mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 21:03:42 -07:00
Merge commit '3187564f5b
' into rando-dev-merge-feb
This commit is contained in:
commit
1d61ba0b86
16 changed files with 181 additions and 48 deletions
6
.github/workflows/generate-builds.yml
vendored
6
.github/workflows/generate-builds.yml
vendored
|
@ -221,6 +221,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y ninja-build
|
sudo apt-get install -y ninja-build
|
||||||
|
sudo apt-get remove -y cmake
|
||||||
|
wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh
|
||||||
|
sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir
|
||||||
- name: Fix dubious ownership error
|
- name: Fix dubious ownership error
|
||||||
if: ${{ vars.LINUX_RUNNER }}
|
if: ${{ vars.LINUX_RUNNER }}
|
||||||
run: git config --global --add safe.directory '*'
|
run: git config --global --add safe.directory '*'
|
||||||
|
@ -264,6 +267,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y ninja-build
|
sudo apt-get install -y ninja-build
|
||||||
|
sudo apt-get remove -y cmake
|
||||||
|
wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh
|
||||||
|
sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 44adc47b4da529e72d968b14cab94aefd8260f22
|
Subproject commit d8f3c4dd4a46fb46c4f69cd387afadfa711606e9
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0833afad66e96d2ec4bbc410186d7247dc243ee2
|
Subproject commit d5a39635a118f814613c0fdd1601f80c809a742d
|
|
@ -2467,6 +2467,10 @@ void Message_DrawText(PlayState* play, Gfx** gfxP);
|
||||||
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH);
|
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH);
|
||||||
void Interface_RandoRestoreSwordless(void);
|
void Interface_RandoRestoreSwordless(void);
|
||||||
|
|
||||||
|
//Pause Warp
|
||||||
|
void PauseWarp_HandleSelection();
|
||||||
|
void PauseWarp_Execute();
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -66,7 +66,7 @@ std::map<int, std::string> cmdMap = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void PerformDisplayListSearch() {
|
void PerformDisplayListSearch() {
|
||||||
auto result = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles("*" + std::string(searchString) + "*DL*");
|
auto result = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles("*" + std::string(searchString) + "*DL*");
|
||||||
|
|
||||||
std::regex dlSearch(".*((DL)|(DL_.*))$");
|
std::regex dlSearch(".*((DL)|(DL_.*))$");
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void DLViewerWindow::DrawElement() {
|
||||||
try {
|
try {
|
||||||
auto res = std::static_pointer_cast<LUS::DisplayList>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList));
|
auto res = std::static_pointer_cast<LUS::DisplayList>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList));
|
||||||
|
|
||||||
if (res->GetInitData()->Type != LUS::ResourceType::DisplayList) {
|
if (res->GetInitData()->Type != static_cast<uint32_t>(LUS::ResourceType::DisplayList)) {
|
||||||
ImGui::Text("Resource type is not a Display List. Please choose another.");
|
ImGui::Text("Resource type is not a Display List. Please choose another.");
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -221,6 +221,7 @@ public:
|
||||||
|
|
||||||
DEFINE_HOOK(OnFileDropped, void(std::string filePath));
|
DEFINE_HOOK(OnFileDropped, void(std::string filePath));
|
||||||
DEFINE_HOOK(OnAssetAltChange, void());
|
DEFINE_HOOK(OnAssetAltChange, void());
|
||||||
|
DEFINE_HOOK(OnKaleidoUpdate, void());
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
static bool IsSaveLoaded();
|
static bool IsSaveLoaded();
|
||||||
|
|
|
@ -187,3 +187,9 @@ void GameInteractor_ExecuteOnSetGameLanguage() {
|
||||||
void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void)) {
|
void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void)) {
|
||||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnAssetAltChange>(fn);
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnAssetAltChange>(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: Pause Menu
|
||||||
|
|
||||||
|
void GameInteractor_ExecuteOnKaleidoUpdate() {
|
||||||
|
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnKaleidoUpdate>();
|
||||||
|
}
|
||||||
|
|
|
@ -60,6 +60,9 @@ void GameInteractor_ExecuteOnSetGameLanguage();
|
||||||
// MARK: - System
|
// MARK: - System
|
||||||
void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void));
|
void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void));
|
||||||
|
|
||||||
|
//Mark: - Pause Menu
|
||||||
|
void GameInteractor_ExecuteOnKaleidoUpdate();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1365,6 +1365,23 @@ void RegisterToTMedallions() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterPauseMenuHooks() {
|
||||||
|
static bool pauseWarpHooksRegistered = false;
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([&]() {
|
||||||
|
if (!GameInteractor::IsSaveLoaded() || !CVarGetInteger("gPauseWarp", 0)) {
|
||||||
|
pauseWarpHooksRegistered = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!pauseWarpHooksRegistered) {
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnKaleidoUpdate>([]() {PauseWarp_HandleSelection();});
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([]() {
|
||||||
|
PauseWarp_Execute();
|
||||||
|
});
|
||||||
|
pauseWarpHooksRegistered = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//from z_player.c
|
//from z_player.c
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ Vec3f pos;
|
/* 0x00 */ Vec3f pos;
|
||||||
|
@ -1657,4 +1674,5 @@ void InitMods() {
|
||||||
NameTag_RegisterHooks();
|
NameTag_RegisterHooks();
|
||||||
RegisterPatchHandHandler();
|
RegisterPatchHandHandler();
|
||||||
RegisterHurtContainerModeHandler();
|
RegisterHurtContainerModeHandler();
|
||||||
|
RegisterPauseMenuHooks();
|
||||||
}
|
}
|
||||||
|
|
92
soh/soh/Enhancements/pausewarp.c
Normal file
92
soh/soh/Enhancements/pausewarp.c
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
#include "custom-message/CustomMessageTypes.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "z64.h"
|
||||||
|
#include "game-interactor/GameInteractor.h"
|
||||||
|
|
||||||
|
static const int songMessageMap[] = {
|
||||||
|
TEXT_WARP_MINUET_OF_FOREST,
|
||||||
|
TEXT_WARP_BOLERO_OF_FIRE,
|
||||||
|
TEXT_WARP_SERENADE_OF_WATER,
|
||||||
|
TEXT_WARP_REQUIEM_OF_SPIRIT,
|
||||||
|
TEXT_WARP_NOCTURNE_OF_SHADOW,
|
||||||
|
TEXT_WARP_PRELUDE_OF_LIGHT
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int ocarinaSongMap[] = {
|
||||||
|
OCARINA_SONG_MINUET,
|
||||||
|
OCARINA_SONG_BOLERO,
|
||||||
|
OCARINA_SONG_SERENADE,
|
||||||
|
OCARINA_SONG_REQUIEM,
|
||||||
|
OCARINA_SONG_NOCTURNE,
|
||||||
|
OCARINA_SONG_PRELUDE
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int entranceIndexMap[] = {
|
||||||
|
ENTR_SACRED_FOREST_MEADOW_2, // Minuet
|
||||||
|
ENTR_DEATH_MOUNTAIN_CRATER_4, // Bolero
|
||||||
|
ENTR_LAKE_HYLIA_8, // Serenade
|
||||||
|
ENTR_DESERT_COLOSSUS_5, // Requiem
|
||||||
|
ENTR_GRAVEYARD_7, // Nocturne
|
||||||
|
ENTR_TEMPLE_OF_TIME_7 // Prelude
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int songAudioMap[] = {
|
||||||
|
NA_BGM_OCA_MINUET,
|
||||||
|
NA_BGM_OCA_BOLERO,
|
||||||
|
NA_BGM_OCA_SERENADE,
|
||||||
|
NA_BGM_OCA_REQUIEM,
|
||||||
|
NA_BGM_OCA_NOCTURNE,
|
||||||
|
NA_BGM_OCA_LIGHT
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool isWarpActive = false;
|
||||||
|
|
||||||
|
void PauseWarp_Execute() {
|
||||||
|
if (!isWarpActive || gPlayState->msgCtx.msgMode != MSGMODE_NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isWarpActive = false;
|
||||||
|
GET_PLAYER(gPlayState)->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
|
||||||
|
if (gPlayState->msgCtx.choiceIndex != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (IS_RANDO) {
|
||||||
|
Entrance_SetWarpSongEntrance();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
|
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
||||||
|
for (int i = 0; i < ARRAY_COUNT(ocarinaSongMap); i++) {
|
||||||
|
if (gPlayState->msgCtx.lastPlayedSong == ocarinaSongMap[i]) {
|
||||||
|
gPlayState->nextEntranceIndex = entranceIndexMap[i];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gPlayState->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActivateWarp(PauseContext* pauseCtx, int song) {
|
||||||
|
Audio_OcaSetInstrument(0);
|
||||||
|
Interface_SetDoAction(gPlayState, DO_ACTION_NONE);
|
||||||
|
pauseCtx->state = 0x12;
|
||||||
|
WREG(2) = -6240;
|
||||||
|
func_800F64E0(0);
|
||||||
|
pauseCtx->unk_1E4 = 0;
|
||||||
|
int idx = song - QUEST_SONG_MINUET;
|
||||||
|
gPlayState->msgCtx.lastPlayedSong = ocarinaSongMap[idx];
|
||||||
|
Audio_SetSoundBanksMute(0x20);
|
||||||
|
Audio_PlayFanfare(songAudioMap[idx]);
|
||||||
|
Message_StartTextbox(gPlayState, songMessageMap[idx], NULL);
|
||||||
|
GET_PLAYER(gPlayState)->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE;
|
||||||
|
isWarpActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PauseWarp_HandleSelection() {
|
||||||
|
if (gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE) {
|
||||||
|
int aButtonPressed = CHECK_BTN_ALL(gPlayState->state.input->press.button, BTN_A);
|
||||||
|
int song = gPlayState->pauseCtx.cursorPoint[PAUSE_QUEST];
|
||||||
|
if (aButtonPressed && CHECK_QUEST_ITEM(song) && song >= QUEST_SONG_MINUET && song <= QUEST_SONG_PRELUDE) {
|
||||||
|
ActivateWarp(&gPlayState->pauseCtx, song);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1037,24 +1037,24 @@ void InitTTSBank() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/scenes" + languageSuffix);
|
auto sceneFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/scenes" + languageSuffix);
|
||||||
if (sceneFile != nullptr) {
|
if (sceneFile != nullptr) {
|
||||||
sceneMap = nlohmann::json::parse(sceneFile->Buffer, nullptr, true, true);
|
sceneMap = nlohmann::json::parse(*sceneFile->Buffer.get(), nullptr, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto miscFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/misc" + languageSuffix);
|
auto miscFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/misc" + languageSuffix);
|
||||||
if (miscFile != nullptr) {
|
if (miscFile != nullptr) {
|
||||||
miscMap = nlohmann::json::parse(miscFile->Buffer, nullptr, true, true);
|
miscMap = nlohmann::json::parse(*miscFile->Buffer.get(), nullptr, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto kaleidoFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/kaleidoscope" + languageSuffix);
|
auto kaleidoFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/kaleidoscope" + languageSuffix);
|
||||||
if (kaleidoFile != nullptr) {
|
if (kaleidoFile != nullptr) {
|
||||||
kaleidoMap = nlohmann::json::parse(kaleidoFile->Buffer, nullptr, true, true);
|
kaleidoMap = nlohmann::json::parse(*kaleidoFile->Buffer.get(), nullptr, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fileChooseFile = LUS::Context::GetInstance()->GetResourceManager()->LoadFile("accessibility/texts/filechoose" + languageSuffix);
|
auto fileChooseFile = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFileRaw("accessibility/texts/filechoose" + languageSuffix);
|
||||||
if (fileChooseFile != nullptr) {
|
if (fileChooseFile != nullptr) {
|
||||||
fileChooseMap = nlohmann::json::parse(fileChooseFile->Buffer, nullptr, true, true);
|
fileChooseMap = nlohmann::json::parse(*fileChooseFile->Buffer.get(), nullptr, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,19 +321,19 @@ OTRGlobals::OTRGlobals() {
|
||||||
|
|
||||||
SPDLOG_INFO("Starting Ship of Harkinian version {}", (char*)gBuildVersion);
|
SPDLOG_INFO("Starting Ship of Harkinian version {}", (char*)gBuildVersion);
|
||||||
|
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Animation, "Animation", std::make_shared<LUS::AnimationFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Animation), std::make_shared<LUS::AnimationFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<LUS::PlayerAnimationFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_PlayerAnimation), std::make_shared<LUS::PlayerAnimationFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Room, "Room", std::make_shared<LUS::SceneFactory>()); // Is room scene? maybe?
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Room), std::make_shared<LUS::SceneFactory>()); // Is room scene? maybe?
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_CollisionHeader, "CollisionHeader", std::make_shared<LUS::CollisionHeaderFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_CollisionHeader), std::make_shared<LUS::CollisionHeaderFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Skeleton, "Skeleton", std::make_shared<LUS::SkeletonFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Skeleton), std::make_shared<LUS::SkeletonFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_SkeletonLimb, "SkeletonLimb", std::make_shared<LUS::SkeletonLimbFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_SkeletonLimb), std::make_shared<LUS::SkeletonLimbFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Path, "Path", std::make_shared<LUS::PathFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Path), std::make_shared<LUS::PathFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Cutscene, "Cutscene", std::make_shared<LUS::CutsceneFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Cutscene), std::make_shared<LUS::CutsceneFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Text, "Text", std::make_shared<LUS::TextFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Text), std::make_shared<LUS::TextFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSample, "AudioSample", std::make_shared<LUS::AudioSampleFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_AudioSample), std::make_shared<LUS::AudioSampleFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSoundFont, "AudioSoundFont", std::make_shared<LUS::AudioSoundFontFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_AudioSoundFont), std::make_shared<LUS::AudioSoundFontFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_AudioSequence, "AudioSequence", std::make_shared<LUS::AudioSequenceFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_AudioSequence), std::make_shared<LUS::AudioSequenceFactory>());
|
||||||
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Background, "Background", std::make_shared<LUS::BackgroundFactory>());
|
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(static_cast<uint32_t>(LUS::ResourceType::SOH_Background), std::make_shared<LUS::BackgroundFactory>());
|
||||||
|
|
||||||
gSaveStateMgr = std::make_shared<SaveStateMgr>();
|
gSaveStateMgr = std::make_shared<SaveStateMgr>();
|
||||||
gRandoContext = Rando::Context::CreateInstance();
|
gRandoContext = Rando::Context::CreateInstance();
|
||||||
|
@ -360,7 +360,7 @@ OTRGlobals::OTRGlobals() {
|
||||||
cameraStrings[i] = dup;
|
cameraStrings[i] = dup;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto versions = context->GetResourceManager()->GetArchive()->GetGameVersions();
|
auto versions = context->GetResourceManager()->GetArchiveManager()->GetGameVersions();
|
||||||
|
|
||||||
for (uint32_t version : versions) {
|
for (uint32_t version : versions) {
|
||||||
if (!ValidHashes.contains(version)) {
|
if (!ValidHashes.contains(version)) {
|
||||||
|
@ -842,7 +842,7 @@ extern "C" RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void OTRExtScanner() {
|
extern "C" void OTRExtScanner() {
|
||||||
auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles("*").get();
|
auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles().get();
|
||||||
|
|
||||||
for (auto& rPath : lst) {
|
for (auto& rPath : lst) {
|
||||||
std::vector<std::string> raw = StringHelper::Split(rPath, ".");
|
std::vector<std::string> raw = StringHelper::Split(rPath, ".");
|
||||||
|
@ -865,11 +865,11 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) {
|
||||||
OTRVersion version = {};
|
OTRVersion version = {};
|
||||||
|
|
||||||
// Use a temporary archive instance to load the otr and read the version file
|
// Use a temporary archive instance to load the otr and read the version file
|
||||||
auto archive = std::make_shared<LUS::Archive>(otrPath, "", std::unordered_set<uint32_t>(), false);
|
auto archive = LUS::OtrArchive(otrPath);
|
||||||
if (archive->IsMainMPQValid()) {
|
if (archive.LoadRaw()) {
|
||||||
auto t = archive->LoadFile("portVersion", false);
|
auto t = archive.LoadFileRaw("portVersion");
|
||||||
if (t != nullptr && t->IsLoaded) {
|
if (t != nullptr && t->IsLoaded) {
|
||||||
auto stream = std::make_shared<LUS::MemoryStream>(t->Buffer.data(), t->Buffer.size());
|
auto stream = std::make_shared<LUS::MemoryStream>(t->Buffer->data(), t->Buffer->size());
|
||||||
auto reader = std::make_shared<LUS::BinaryReader>(stream);
|
auto reader = std::make_shared<LUS::BinaryReader>(stream);
|
||||||
LUS::Endianness endianness = (LUS::Endianness)reader->ReadUByte();
|
LUS::Endianness endianness = (LUS::Endianness)reader->ReadUByte();
|
||||||
reader->SetEndianness(endianness);
|
reader->SetEndianness(endianness);
|
||||||
|
@ -877,10 +877,9 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) {
|
||||||
version.minor = reader->ReadUInt16();
|
version.minor = reader->ReadUInt16();
|
||||||
version.patch = reader->ReadUInt16();
|
version.patch = reader->ReadUInt16();
|
||||||
}
|
}
|
||||||
|
archive.UnloadRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
archive = nullptr;
|
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1418,15 +1417,15 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
|
extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
|
||||||
return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions().size();
|
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
|
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
|
||||||
return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
|
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
|
extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
|
||||||
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
|
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
|
||||||
|
|
||||||
switch (version) {
|
switch (version) {
|
||||||
case OOT_NTSC_US_10:
|
case OOT_NTSC_US_10:
|
||||||
|
@ -1449,7 +1448,7 @@ extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" uint32_t ResourceMgr_GetGameRegion(int index) {
|
extern "C" uint32_t ResourceMgr_GetGameRegion(int index) {
|
||||||
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index];
|
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
|
||||||
|
|
||||||
switch (version) {
|
switch (version) {
|
||||||
case OOT_NTSC_US_10:
|
case OOT_NTSC_US_10:
|
||||||
|
@ -1536,7 +1535,7 @@ extern "C" void ResourceMgr_UnloadResource(const char* resName) {
|
||||||
// OTRTODO: There is probably a more elegant way to go about this...
|
// OTRTODO: There is probably a more elegant way to go about this...
|
||||||
// Kenix: This is definitely leaking memory when it's called.
|
// Kenix: This is definitely leaking memory when it's called.
|
||||||
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
|
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
|
||||||
auto lst = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles(searchMask);
|
auto lst = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask);
|
||||||
char** result = (char**)malloc(lst->size() * sizeof(char*));
|
char** result = (char**)malloc(lst->size() * sizeof(char*));
|
||||||
|
|
||||||
for (size_t i = 0; i < lst->size(); i++) {
|
for (size_t i = 0; i < lst->size(); i++) {
|
||||||
|
@ -1626,7 +1625,7 @@ extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) {
|
||||||
|
|
||||||
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) {
|
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) {
|
||||||
auto res = GetResourceByNameHandlingMQ(texPath);
|
auto res = GetResourceByNameHandlingMQ(texPath);
|
||||||
return res->GetInitData()->Type == LUS::ResourceType::SOH_Background;
|
return res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::SOH_Background);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize)
|
extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize)
|
||||||
|
@ -1674,9 +1673,9 @@ extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
|
||||||
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
||||||
auto res = GetResourceByNameHandlingMQ(filePath);
|
auto res = GetResourceByNameHandlingMQ(filePath);
|
||||||
|
|
||||||
if (res->GetInitData()->Type == LUS::ResourceType::DisplayList)
|
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList))
|
||||||
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
||||||
else if (res->GetInitData()->Type == LUS::ResourceType::Array)
|
else if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::Array))
|
||||||
return (char*)(std::static_pointer_cast<LUS::Array>(res))->Vertices.data();
|
return (char*)(std::static_pointer_cast<LUS::Array>(res))->Vertices.data();
|
||||||
else {
|
else {
|
||||||
return (char*)GetResourceDataByNameHandlingMQ(filePath);
|
return (char*)GetResourceDataByNameHandlingMQ(filePath);
|
||||||
|
@ -1686,7 +1685,7 @@ extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
||||||
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
|
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
|
||||||
auto res = GetResourceByNameHandlingMQ(filePath);
|
auto res = GetResourceByNameHandlingMQ(filePath);
|
||||||
|
|
||||||
if (res->GetInitData()->Type == LUS::ResourceType::DisplayList)
|
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList))
|
||||||
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -112,11 +112,11 @@ namespace SohGui {
|
||||||
void DrawMenuBarIcon() {
|
void DrawMenuBarIcon() {
|
||||||
static bool gameIconLoaded = false;
|
static bool gameIconLoaded = false;
|
||||||
if (!gameIconLoaded) {
|
if (!gameIconLoaded) {
|
||||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTexture("Game_Icon", "textures/icons/gIcon.png");
|
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Game_Icon", "textures/icons/gIcon.png");
|
||||||
gameIconLoaded = true;
|
gameIconLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon")) {
|
if (LUS::Context::GetInstance()->GetWindow()->GetGui()->HasTextureByName("Game_Icon")) {
|
||||||
#ifdef __SWITCH__
|
#ifdef __SWITCH__
|
||||||
ImVec2 iconSize = ImVec2(20.0f, 20.0f);
|
ImVec2 iconSize = ImVec2(20.0f, 20.0f);
|
||||||
float posScale = 1.0f;
|
float posScale = 1.0f;
|
||||||
|
@ -202,8 +202,7 @@ void DrawSettingsMenu() {
|
||||||
|
|
||||||
static std::unordered_map<LUS::AudioBackend, const char*> audioBackendNames = {
|
static std::unordered_map<LUS::AudioBackend, const char*> audioBackendNames = {
|
||||||
{ LUS::AudioBackend::WASAPI, "Windows Audio Session API" },
|
{ LUS::AudioBackend::WASAPI, "Windows Audio Session API" },
|
||||||
{ LUS::AudioBackend::PULSE, "PulseAudio" },
|
{ LUS::AudioBackend::SDL, "SDL" }
|
||||||
{ LUS::AudioBackend::SDL, "SDL" },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ImGui::Text("Audio API (Needs reload)");
|
ImGui::Text("Audio API (Needs reload)");
|
||||||
|
@ -646,6 +645,8 @@ void DrawEnhancementsMenu() {
|
||||||
"- Obtained the Master Sword\n"
|
"- Obtained the Master Sword\n"
|
||||||
"- Not within range of Time Block\n"
|
"- Not within range of Time Block\n"
|
||||||
"- Not within range of Ocarina playing spots");
|
"- Not within range of Ocarina playing spots");
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox("Pause Warp", "gPauseWarp", true, false);
|
||||||
|
UIWidgets::Tooltip("Selection of warp song in pause menu initiates warp. Disables song playback.");
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
|
|
|
@ -109,7 +109,7 @@ std::shared_ptr<ISceneCommand> SceneFactoryV0::ParseSceneCommand(std::shared_ptr
|
||||||
if (commandFactory != nullptr) {
|
if (commandFactory != nullptr) {
|
||||||
auto initData = std::make_shared<ResourceInitData>();
|
auto initData = std::make_shared<ResourceInitData>();
|
||||||
initData->Id = scene->GetInitData()->Id;
|
initData->Id = scene->GetInitData()->Id;
|
||||||
initData->Type = ResourceType::SOH_SceneCommand;
|
initData->Type = static_cast<uint32_t>(ResourceType::SOH_SceneCommand);
|
||||||
initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index);
|
initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index);
|
||||||
initData->ResourceVersion = scene->GetInitData()->ResourceVersion;
|
initData->ResourceVersion = scene->GetInitData()->ResourceVersion;
|
||||||
result = std::static_pointer_cast<ISceneCommand>(commandFactory->ReadResource(initData, reader));
|
result = std::static_pointer_cast<ISceneCommand>(commandFactory->ReadResource(initData, reader));
|
||||||
|
|
|
@ -23,7 +23,7 @@ static void SetMessageEntry(MessageTableEntry& entry, const LUS::MessageEntry& m
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OTRMessage_LoadCustom(const std::string& folderPath, MessageTableEntry*& table, size_t tableSize) {
|
static void OTRMessage_LoadCustom(const std::string& folderPath, MessageTableEntry*& table, size_t tableSize) {
|
||||||
auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->ListFiles(folderPath).get();
|
auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(folderPath).get();
|
||||||
|
|
||||||
for (auto& tPath : lst) {
|
for (auto& tPath : lst) {
|
||||||
auto file = std::static_pointer_cast<LUS::Text>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(tPath));
|
auto file = std::static_pointer_cast<LUS::Text>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(tPath));
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||||
void (*sKaleidoScopeDrawFunc)(PlayState* play);
|
void (*sKaleidoScopeDrawFunc)(PlayState* play);
|
||||||
|
@ -56,6 +57,8 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||||
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
|
|
||||||
|
GameInteractor_ExecuteOnKaleidoUpdate();
|
||||||
|
|
||||||
if (!gSaveContext.sohStats.gameComplete &&
|
if (!gSaveContext.sohStats.gameComplete &&
|
||||||
(!IS_BOSS_RUSH || !gSaveContext.isBossRushPaused)) {
|
(!IS_BOSS_RUSH || !gSaveContext.isBossRushPaused)) {
|
||||||
gSaveContext.sohStats.pauseTimer++;
|
gSaveContext.sohStats.pauseTimer++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue