diff --git a/OTRExporter/OTRExporter/DisplayListExporter.cpp b/OTRExporter/OTRExporter/DisplayListExporter.cpp index 4bc5cd5bc..4ac8586df 100644 --- a/OTRExporter/OTRExporter/DisplayListExporter.cpp +++ b/OTRExporter/OTRExporter/DisplayListExporter.cpp @@ -76,7 +76,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina F3DZEXOpcode opF3D = (F3DZEXOpcode)opcode; if ((int)opF3D == G_DL)// || (int)opF3D == G_BRANCH_Z) - opcode = (uint8_t)G_DL_OTR; + opcode = (uint8_t)G_DL_OTR_HASH; if ((int)opF3D == G_MTX) opcode = (uint8_t)G_MTX_OTR; @@ -85,10 +85,10 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina opcode = (uint8_t)G_BRANCH_Z_OTR; if ((int)opF3D == G_VTX) - opcode = (uint8_t)G_VTX_OTR; + opcode = (uint8_t)G_VTX_OTR_HASH; if ((int)opF3D == G_SETTIMG) - opcode = (uint8_t)G_SETTIMG_OTR; + opcode = (uint8_t)G_SETTIMG_OTR_HASH; word0 += (opcode << 24); @@ -686,7 +686,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina Gfx value = {gsDPSetTextureImage(fmt, siz, www + 1, __)}; word0 = value.words.w0 & 0x00FFFFFF; - word0 += (G_SETTIMG_OTR << 24); + word0 += (G_SETTIMG_OTR_HASH << 24); //word1 = value.words.w1; word1 = 0; @@ -754,7 +754,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina word0 = value.words.w0; word0 &= 0x00FFFFFF; - word0 += (G_VTX_OTR << 24); + word0 += (G_VTX_OTR_HASH << 24); word1 = value.words.w1; writer->Write(word0); diff --git a/OTRExporter/OTRExporter/Main.cpp b/OTRExporter/OTRExporter/Main.cpp index 47a1752aa..3bc9da046 100644 --- a/OTRExporter/OTRExporter/Main.cpp +++ b/OTRExporter/OTRExporter/Main.cpp @@ -154,7 +154,7 @@ static void ExporterProgramEnd() auto fileData = File::ReadAllBytes(item); printf("otrArchive->AddFile(%s)\n", StringHelper::Split(item, "Extract/")[1].c_str()); - otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); + otrArchive->AddFile(StringHelper::Split(item, item.find("Extract/assets/") != std::string::npos ? "Extract/assets/" : "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); } } } diff --git a/OTRExporter/assets/ship_of_harkinian/fonts/Fipps-Regular.otf b/OTRExporter/assets/fonts/Fipps-Regular.otf similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/fonts/Fipps-Regular.otf rename to OTRExporter/assets/fonts/Fipps-Regular.otf diff --git a/OTRExporter/assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf b/OTRExporter/assets/fonts/PressStart2P-Regular.ttf similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf rename to OTRExporter/assets/fonts/PressStart2P-Regular.ttf diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/ABtn.png b/OTRExporter/assets/textures/buttons/ABtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/ABtn.png rename to OTRExporter/assets/textures/buttons/ABtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/BBtn.png b/OTRExporter/assets/textures/buttons/BBtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/BBtn.png rename to OTRExporter/assets/textures/buttons/BBtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/CDown.png b/OTRExporter/assets/textures/buttons/CDown.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/CDown.png rename to OTRExporter/assets/textures/buttons/CDown.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/CLeft.png b/OTRExporter/assets/textures/buttons/CLeft.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/CLeft.png rename to OTRExporter/assets/textures/buttons/CLeft.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/CRight.png b/OTRExporter/assets/textures/buttons/CRight.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/CRight.png rename to OTRExporter/assets/textures/buttons/CRight.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/CUp.png b/OTRExporter/assets/textures/buttons/CUp.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/CUp.png rename to OTRExporter/assets/textures/buttons/CUp.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/LBtn.png b/OTRExporter/assets/textures/buttons/LBtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/LBtn.png rename to OTRExporter/assets/textures/buttons/LBtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/RBtn.png b/OTRExporter/assets/textures/buttons/RBtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/RBtn.png rename to OTRExporter/assets/textures/buttons/RBtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/StartBtn.png b/OTRExporter/assets/textures/buttons/StartBtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/StartBtn.png rename to OTRExporter/assets/textures/buttons/StartBtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/buttons/ZBtn.png b/OTRExporter/assets/textures/buttons/ZBtn.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/buttons/ZBtn.png rename to OTRExporter/assets/textures/buttons/ZBtn.png diff --git a/OTRExporter/assets/ship_of_harkinian/icons/gSohIcon.png b/OTRExporter/assets/textures/icons/gSohIcon.png similarity index 100% rename from OTRExporter/assets/ship_of_harkinian/icons/gSohIcon.png rename to OTRExporter/assets/textures/icons/gSohIcon.png diff --git a/libultraship b/libultraship index 805b15386..5787c1b3d 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 805b153861a3e3588fcc7f2b34d10ca00a6755c7 +Subproject commit 5787c1b3d89ff8d40a52d7405da627d802ca5dce diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index cd4916c7d..3a0aa9cca 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1,4 +1,4 @@ -#include "OTRGlobals.h" +#include "OTRGlobals.h" #include "OTRAudio.h" #include #include @@ -234,19 +234,19 @@ OTRGlobals::OTRGlobals() { }; context = Ship::Window::CreateInstance("Ship of Harkinian", OTRFiles); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Room, std::make_shared()); // Is room scene? maybe? - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_CollisionHeader, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Skeleton, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_SkeletonLimb, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Path, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Cutscene, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Text, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSample, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSoundFont, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSequence, std::make_shared()); - context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Background, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, "Animation", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Room, "Room", std::make_shared()); // Is room scene? maybe? + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Path, "Path", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Text, "Text", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Background, "Background", std::make_shared()); gSaveStateMgr = std::make_shared(); gRandomizer = std::make_shared(); @@ -873,10 +873,6 @@ extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { OTRGlobals::Instance->context->GetResourceManager()->DirtyDirectory(resName); } -extern "C" void ResourceMgr_InvalidateCache() { - OTRGlobals::Instance->context->GetResourceManager()->InvalidateResourceCache(); -} - // OTRTODO: There is probably a more elegant way to go about this... extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { auto lst = OTRGlobals::Instance->context->GetResourceManager()->ListFiles(searchMask);