Skip to content

Commit

Permalink
Linux/GCC related fixes (#1)
Browse files Browse the repository at this point in the history
* linux fixes

Fixes case sensitive path, -1 used in a uint16_t enum, CMD_F and soh include path

* fix type correctness
  • Loading branch information
Random06457 authored Nov 15, 2023
1 parent 673880f commit 17f396a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion OTRExporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/nlohmann-json/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
${CMAKE_CURRENT_SOURCE_DIR}/../../soh/soh
${CMAKE_CURRENT_SOURCE_DIR}/../../mm/2s2h
.
)

Expand Down
4 changes: 2 additions & 2 deletions OTRExporter/CutsceneExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ void OTRExporter_Cutscene::SaveOot(ZCutscene* cs, BinaryWriter* writer) {
}
// MUST be uint16_t for -1
typedef enum : uint16_t{
/* -1 */ CS_TEXT_TYPE_NONE = -1,
/* 0 */ CS_TEXT_TYPE_DEFAULT,
/* -1 */ CS_TEXT_TYPE_NONE = (uint16_t)-1,
/* 0 */ CS_TEXT_TYPE_DEFAULT = 0,
/* 1 */ CS_TEXT_TYPE_1,
/* 2 */ CS_TEXT_OCARINA_ACTION,
/* 3 */ CS_TEXT_TYPE_3,
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter/RoomExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
for (const auto& c : cmdCsCam->cameras) {
writer->Write(c.type);
writer->Write(c.numPoints);
for (size_t i = 0; i < c.numPoints; i++) {
for (int16_t i = 0; i < c.numPoints; i++) {
writer->Write(cmdCsCam->points[((c.baseOffset - arrBase) / 6) + i].scalars[0].scalarData.s16);
writer->Write(cmdCsCam->points[((c.baseOffset - arrBase) / 6) + i].scalars[1].scalarData.s16);
writer->Write(cmdCsCam->points[((c.baseOffset - arrBase) / 6) + i].scalars[2].scalarData.s16);
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter/TextureAnimationExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ZResource.h"
#include "ZTextureAnimation.h"
#include "Exporter.h"
#include <utils/BinaryWriter.h>
#include <Utils/BinaryWriter.h>

class OTRExporter_TextureAnimation : public OTRExporter
{
Expand Down
4 changes: 0 additions & 4 deletions OTRExporter/command_macros_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@

#define CMD_W(a) (a)

#if defined(__GNUC__)
#define CMD_F(a) {.f = (a)}
#else
#define CMD_F(a) {(a)}
#endif

#define CMD_PTR(a) (u32)(a)

Expand Down

0 comments on commit 17f396a

Please sign in to comment.