From 87cc05321f48069ee29c31f3abe19fce0e16d7de Mon Sep 17 00:00:00 2001 From: Random06457 <28494085+Random06457@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:38:39 +0100 Subject: [PATCH 1/2] linux fixes Fixes case sensitive path, -1 used in a uint16_t enum, CMD_F and soh include path --- OTRExporter/CMakeLists.txt | 2 +- OTRExporter/CutsceneExporter.cpp | 4 ++-- OTRExporter/TextureAnimationExporter.h | 2 +- OTRExporter/command_macros_base.h | 4 ---- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/OTRExporter/CMakeLists.txt b/OTRExporter/CMakeLists.txt index 6504d04..b777a4d 100644 --- a/OTRExporter/CMakeLists.txt +++ b/OTRExporter/CMakeLists.txt @@ -172,7 +172,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 . ) diff --git a/OTRExporter/CutsceneExporter.cpp b/OTRExporter/CutsceneExporter.cpp index 048ffab..d6d2c05 100644 --- a/OTRExporter/CutsceneExporter.cpp +++ b/OTRExporter/CutsceneExporter.cpp @@ -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, diff --git a/OTRExporter/TextureAnimationExporter.h b/OTRExporter/TextureAnimationExporter.h index 40b1983..1ac12d3 100644 --- a/OTRExporter/TextureAnimationExporter.h +++ b/OTRExporter/TextureAnimationExporter.h @@ -3,7 +3,7 @@ #include "ZResource.h" #include "ZTextureAnimation.h" #include "Exporter.h" -#include +#include class OTRExporter_TextureAnimation : public OTRExporter { diff --git a/OTRExporter/command_macros_base.h b/OTRExporter/command_macros_base.h index 3067d2c..1506c78 100644 --- a/OTRExporter/command_macros_base.h +++ b/OTRExporter/command_macros_base.h @@ -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) From 41e7762bd075911152114abc67ce0394e9d233bf Mon Sep 17 00:00:00 2001 From: Random06457 <28494085+Random06457@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:44:02 +0100 Subject: [PATCH 2/2] fix type correctness --- OTRExporter/RoomExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OTRExporter/RoomExporter.cpp b/OTRExporter/RoomExporter.cpp index 2818cbf..047fa9a 100644 --- a/OTRExporter/RoomExporter.cpp +++ b/OTRExporter/RoomExporter.cpp @@ -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);