diff --git a/OTRExporter/extract_assets.py b/OTRExporter/extract_assets.py index 404b49ced..0843e21fb 100755 --- a/OTRExporter/extract_assets.py +++ b/OTRExporter/extract_assets.py @@ -48,7 +48,7 @@ def ExtractFunc(fullPath): *pathList, xmlName = fullPath.split(os.sep) objectName = os.path.splitext(xmlName)[0] - outPath = os.path.join("..\\soh\\assets\\", *pathList[4:], objectName) + outPath = os.path.join("..\\soh\\assets\\", *pathList[5:], objectName) os.makedirs(outPath, exist_ok=True) outSourcePath = outPath @@ -90,7 +90,7 @@ def main(): extract_staff_text_path = None xmlFiles = [] - for currentPath, _, files in os.walk(os.path.join("..\\soh\\assets", "xml")): + for currentPath, _, files in os.walk(os.path.join("..\\soh\\assets\\", "xml\\GC_NMQ_PAL_F")): for file in files: fullPath = os.path.join(currentPath, file) if file.endswith(".xml"): diff --git a/OTRExporter/extract_baserom_gc.py b/OTRExporter/extract_baserom_gc.py index cae411f2a..841c92560 100644 --- a/OTRExporter/extract_baserom_gc.py +++ b/OTRExporter/extract_baserom_gc.py @@ -36,8 +36,8 @@ FILE_NAMES = [ 'fra_message_data_static', 'staff_message_data_static', 'map_grand_static', - 'map_i_static', 'map_48x85_static', + 'map_i_static', 'code', 'ovl_title', 'ovl_select', diff --git a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters index 218084e6d..3c46d19fe 100644 --- a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters +++ b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters @@ -12,14 +12,14 @@ {d8c2c1e7-b065-4b0f-86a2-46ab46eedc0b} - + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - + {e047919d-7186-49ca-b115-e48fbb5c8743} - + {3de9dd46-0dfd-4d48-9f20-9f24e5b80fe0} @@ -69,19 +69,19 @@ - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Libraries + Source Files\Libraries - Header Files\Source Files\Utils + Source Files\Utils \ No newline at end of file diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h index 2e6a5a2a0..b3b8d9082 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h @@ -21,7 +21,7 @@ struct TextureCacheKey { uint8_t palette_index; bool operator==(const TextureCacheKey&) const noexcept = default; - + struct Hasher { size_t operator()(const TextureCacheKey& key) const noexcept { uintptr_t addr = (uintptr_t)key.texture_addr; diff --git a/libultraship/libultraship/ResourceMgr.cpp b/libultraship/libultraship/ResourceMgr.cpp index 6c8b1a10c..790b4648a 100644 --- a/libultraship/libultraship/ResourceMgr.cpp +++ b/libultraship/libultraship/ResourceMgr.cpp @@ -86,7 +86,10 @@ namespace Ship { OTR->LoadFile(ToLoad->path, true, ToLoad); //Lock.lock(); - FileCache[ToLoad->path] = ToLoad->bIsLoaded && !ToLoad->bHasLoadError ? ToLoad : nullptr; + + if (!ToLoad->bHasLoadError) + FileCache[ToLoad->path] = ToLoad->bIsLoaded && !ToLoad->bHasLoadError ? ToLoad : nullptr; + //Lock.unlock(); SPDLOG_DEBUG("Loaded File {} on ResourceMgr thread", ToLoad->path); @@ -124,39 +127,47 @@ namespace Ship { } } - auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->File); - - if (UnmanagedRes != nullptr) + if (!ToLoad->File->bHasLoadError) { - UnmanagedRes->resMgr = this; - auto Res = std::shared_ptr(UnmanagedRes); + auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->File); - if (Res != nullptr) { - std::unique_lock Lock(ToLoad->ResourceLoadMutex); + if (UnmanagedRes != nullptr) + { + UnmanagedRes->resMgr = this; + auto Res = std::shared_ptr(UnmanagedRes); - ToLoad->bHasResourceLoaded = true; - ToLoad->Resource = Res; - ResourceCache[Res->file->path] = Res; + if (Res != nullptr) { + std::unique_lock Lock(ToLoad->ResourceLoadMutex); - SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->File->path); + ToLoad->bHasResourceLoaded = true; + ToLoad->Resource = Res; + ResourceCache[Res->file->path] = Res; - // Disabled for now because it can cause random crashes - //FileCache[Res->File->path] = nullptr; - //FileCache.erase(FileCache.find(Res->File->path)); - Res->file = nullptr; + SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->File->path); + + // Disabled for now because it can cause random crashes + //FileCache[Res->File->path] = nullptr; + //FileCache.erase(FileCache.find(Res->File->path)); + Res->file = nullptr; + } + else { + ToLoad->bHasResourceLoaded = false; + ToLoad->Resource = nullptr; + + SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->File->path); + } + + //ResLock.lock(); + //ResLock.unlock(); } - else { - ToLoad->bHasResourceLoaded = false; - ToLoad->Resource = nullptr; - - SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->File->path); - } - - //ResLock.lock(); - //ResLock.unlock(); - - ToLoad->ResourceLoadNotifier.notify_all(); } + else + { + ToLoad->bHasResourceLoaded = false; + ToLoad->Resource = nullptr; + } + + ToLoad->ResourceLoadNotifier.notify_all(); } SPDLOG_INFO("Resource Manager LoadResourceThread ended"); @@ -232,9 +243,16 @@ namespace Ship { std::shared_ptr FileData = LoadFile(FilePath); Promise->File = FileData; - Promise->bHasResourceLoaded = false; - ResourceLoadQueue.push(Promise); - ResourceLoadNotifier.notify_all(); + if (Promise->File->bHasLoadError) + { + Promise->bHasResourceLoaded = true; + } + else + { + Promise->bHasResourceLoaded = false; + ResourceLoadQueue.push(Promise); + ResourceLoadNotifier.notify_all(); + } } else { Promise->bHasResourceLoaded = true; Promise->Resource = resCacheFind->second; diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml index a58e6ae09..a3add03bc 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml @@ -1,14 +1,14 @@ - - - - - - + + + + + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml index 1a21af3bc..f4eff13ae 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml @@ -1,7 +1,7 @@ - - - + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml index f826fec32..537706cd1 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml index c0b4cc789..0f91c80be 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml @@ -1,11 +1,11 @@ - - - - + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml index 23739539f..001ac51d5 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml @@ -1,11 +1,11 @@ - - - - + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml index c2f441e4f..e6e5c9776 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml @@ -1,11 +1,11 @@ - - - - + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml index 871c97b40..e1ea84996 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml @@ -1,29 +1,29 @@ - - + + - + - - + + - + - + - + - + - - + + - + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml index c6b56a384..857a14922 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml index 49cd1b24a..9f0e6e1f4 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml @@ -1,52 +1,52 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml index 73a8ebb3f..dfb01ba07 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml @@ -1,76 +1,76 @@ - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - + - + - + - + - + - + - + - + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml index e65a58ccd..4e08c34f1 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml index 2ac9a9b48..1682fd16a 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml @@ -1,8 +1,8 @@ - + - - - + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg.xml index 82cd468a3..846aaeb07 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg.xml @@ -1,5 +1,5 @@ - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg2.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg2.xml index fb2199424..25c088d61 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg2.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Elf_Msg2.xml @@ -1,5 +1,5 @@ - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml index 483a2fcd4..8a77b7bd3 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml @@ -1,7 +1,7 @@ - - - + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml index cd67b1f48..fee5c6302 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml @@ -1,14 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml index 7d4f8bc78..91a5e31ac 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml @@ -1,19 +1,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml index 6fa7d3643..65673c5ea 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml @@ -1,8 +1,8 @@ - - + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml index ba79dca3c..d7f2859cb 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml @@ -1,38 +1,38 @@ - + - + - + - + - + - + - + - + - + - + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml index 546de14d0..c2f8f7c23 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml @@ -1,8 +1,8 @@ - - + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml index c4293e92b..91321c648 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml @@ -1,9 +1,9 @@ - - + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml index 5467eed62..f12c4ee19 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml @@ -1,5 +1,5 @@ - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml index 0252a1387..d7b6b20cf 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml @@ -1,8 +1,8 @@ - - + + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml index ccc45fb1c..13daffa63 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml @@ -1,15 +1,15 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml index 82dceca25..77c39c63a 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml @@ -1,17 +1,17 @@ - - - - - - - + + + + + + + - + - + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml index 8bebff602..f9aad776d 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml @@ -1,27 +1,27 @@ - - + + - + - + - + - + - + - + - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml index cd8d45592..e6315effd 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml @@ -1,12 +1,12 @@ - - + + - + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml index 389f19aa1..3736e985e 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml @@ -1,5 +1,5 @@ - + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml index a46b4330c..cb043eeb8 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml @@ -1,11 +1,11 @@ - - - - + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml index 52e29f1bc..4ca01b04c 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml @@ -1,10 +1,10 @@ - - - + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml index b42c72a66..051f2177e 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml @@ -1,11 +1,11 @@ - - - - + + + + - - + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml index e0b4cd7b6..a4e410eba 100644 --- a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml @@ -1,11 +1,11 @@ - - - + + + - - - + + + diff --git a/soh/build.c b/soh/build.c index acb8d151d..f3f9bdae6 100644 --- a/soh/build.c +++ b/soh/build.c @@ -1,8 +1,8 @@ -const char gBuildVersion[] = "DECKARD"; +const char gBuildVersion[] = "DECKARD ALFA (1.0.0)"; const char gBuildTeam[] = "github.com/harbourmasters"; #ifdef __TIMESTAMP__ const char gBuildDate[] = __TIMESTAMP__; #else const char gBuildDate[] = __DATE__ " " __TIME__; #endif -const char gBuildMakeOption[] = ""; \ No newline at end of file +const char gBuildMakeOption[] = ""; diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj index 9d5b509f2..aa6dee304 100644 --- a/soh/soh.vcxproj +++ b/soh/soh.vcxproj @@ -144,7 +144,7 @@ false INCLUDE_GAME_PRINTF;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;ENABLE_DX11;%(PreprocessorDefinitions)GLEW_STATIC true - stdcpp17 + stdcpp20 MultiThreadedDebug true diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 6d6c4bb30..c84e37482 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -31,6 +31,16 @@ extern "C" void OTRGameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s std::string scenePath = StringHelper::Sprintf("scenes\\%s\\%s", scene->sceneFile.fileName, scene->sceneFile.fileName); globalCtx->sceneSegment = (Ship::Scene*)OTRGameplay_LoadFile(globalCtx, scenePath.c_str()); + + // Failed to load scene... default to doodongs cavern + if (globalCtx->sceneSegment == nullptr) + { + lusprintf(__FILE__, __LINE__, 2, "Unable to load scene %s... Defaulting to Doodong's Cavern!\n", + scenePath.c_str()); + OTRGameplay_SpawnScene(globalCtx, 0x01, 0); + return; + } + scene->unk_13 = 0; //ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f0880b3da..193b14164 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -1495,26 +1495,6 @@ void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) { OTRGameplay_SpawnScene(globalCtx, sceneNum, spawn); - return; - - SceneTableEntry* scene = &gSceneTable[sceneNum]; - - scene->unk_13 = 0; - globalCtx->loadedScene = scene; - globalCtx->sceneNum = sceneNum; - globalCtx->sceneConfig = scene->config; - - osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); - - globalCtx->sceneSegment = Gameplay_LoadFile(globalCtx, &scene->sceneFile); - scene->unk_13 = 0; - ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); - - gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); - - Gameplay_InitScene(globalCtx, spawn); - - osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(globalCtx, &globalCtx->roomCtx) / 1024.0f); } void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest) { diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 2e8858a94..e730b746a 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -164,9 +164,13 @@ void ElfMsg_Update(Actor* thisx, GlobalContext* globalCtx) { } } +#ifdef ZELDA_DEBUG #include "overlays/ovl_Elf_Msg/ovl_Elf_Msg.h" +#endif -void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) { +void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) +{ +#ifdef ZELDA_DEBUG OPEN_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg.c", 436); if (R_NAVI_MSG_REGION_ALPHA == 0) { @@ -191,4 +195,5 @@ void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) { } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg.c", 457); + #endif } diff --git a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index f23f49e10..73b6785c8 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -148,9 +148,12 @@ void ElfMsg2_Update(Actor* thisx, GlobalContext* globalCtx) { } } +#if ZELDA_DEBUG #include "overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.h" +#endif void ElfMsg2_Draw(Actor* thisx, GlobalContext* globalCtx) { +#if ZELDA_DEBUG OPEN_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg2.c", 355); if (R_NAVI_MSG_REGION_ALPHA == 0) { @@ -165,4 +168,5 @@ void ElfMsg2_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, sCubeDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg2.c", 367); + #endif }