diff --git a/libultraship b/libultraship index aa1091d77..da077e8d6 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit aa1091d77c81af6c894e85f9654270632732bf83 +Subproject commit da077e8d625a5f8a1fd70179b7f9997667d13285 diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 0e5b65f91..859a7b913 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -1037,13 +1037,13 @@ void InitTTSBank() { break; } - // auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/scenes" + languageSuffix); - // if (sceneFile != nullptr) { - // sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true); - // } + auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/scenes" + languageSuffix); + if (sceneFile != nullptr) { + sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true); + } // use binaryreader as base for rawjsonfactory // just pass a shared pointer to initdata in here - sceneMap = LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, initdata); + // sceneMap = LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, initdata); auto miscFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/misc" + languageSuffix); if (miscFile != nullptr) { diff --git a/soh/soh/GbiWrap.cpp b/soh/soh/GbiWrap.cpp index 46f4c877c..5114b6f72 100644 --- a/soh/soh/GbiWrap.cpp +++ b/soh/soh/GbiWrap.cpp @@ -14,8 +14,8 @@ void OTRGetPixelDepthPrepare(float x, float y); uint16_t OTRGetPixelDepth(float x, float y); int32_t OTRGetLastScancode(); void ResourceMgr_LoadDirectory(const char* resName); -void ResourceMgr_LoadFile(const char* resName); -char* ResourceMgr_LoadFileFromDisk(const char* filePath); +// void ResourceMgr_LoadFile(const char* resName); +// char* ResourceMgr_LoadFileFromDisk(const char* filePath); uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); size_t ResourceGetTexSizeByName(const char* name); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 835ca0da6..2e436c01f 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1582,9 +1582,9 @@ extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { } } -extern "C" void ResourceMgr_LoadFile(const char* resName) { - LUS::Context::GetInstance()->GetResourceManager()->LoadResource(resName); -} +// extern "C" void ResourceMgr_LoadFile(const char* resName) { +// LUS::Context::GetInstance()->GetResourceManager()->LoadResource(resName); +// } std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { std::string Path = path; @@ -1607,19 +1607,19 @@ extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { return (char*)res->GetRawPointer(); } -extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) { - FILE* file = fopen(filePath, "r"); - fseek(file, 0, SEEK_END); - int fSize = ftell(file); - fseek(file, 0, SEEK_SET); +// extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) { +// FILE* file = fopen(filePath, "r"); +// fseek(file, 0, SEEK_END); +// int fSize = ftell(file); +// fseek(file, 0, SEEK_SET); - char* data = (char*)malloc(fSize); - fread(data, 1, fSize, file); +// char* data = (char*)malloc(fSize); +// fread(data, 1, fSize, file); - fclose(file); +// fclose(file); - return data; -} +// return data; +// } extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) { auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(texPath)); diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index db42341c2..b87576786 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -95,8 +95,8 @@ uint8_t ResourceMgr_FileExists(const char* resName); uint8_t ResourceMgr_FileAltExists(const char* resName); void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName); char* GetResourceDataByNameHandlingMQ(const char* path); -void ResourceMgr_LoadFile(const char* resName); -char* ResourceMgr_LoadFileFromDisk(const char* filePath); +// void ResourceMgr_LoadFile(const char* resName); +// char* ResourceMgr_LoadFileFromDisk(const char* filePath); uint8_t ResourceMgr_TexIsRaw(const char* texPath); uint8_t ResourceMgr_ResourceIsBackground(char* texPath); char* ResourceMgr_LoadJPEG(char* data, size_t dataSize); diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 3d7889807..8a080f30a 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -39,16 +39,16 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); extern "C" RomFile sNaviMsgFiles[]; s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene); -std::shared_ptr ResourceMgr_LoadFile(const char* path) { - std::string Path = path; - if (IsGameMasterQuest()) { - size_t pos = 0; - if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { - Path.replace(pos, 7, "/mq/"); - } - } - return LUS::Context::GetInstance()->GetResourceManager()->LoadFile(Path.c_str()); -} +// std::shared_ptr ResourceMgr_LoadFile(const char* path) { +// std::string Path = path; +// if (IsGameMasterQuest()) { +// size_t pos = 0; +// if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { +// Path.replace(pos, 7, "/mq/"); +// } +// } +// return LUS::Context::GetInstance()->GetResourceManager()->LoadFile(Path.c_str()); +// } // Forward Declaration of function declared in OTRGlobals.cpp std::shared_ptr GetResourceByNameHandlingMQ(const char* path);