From 552bb2886f79aa602250a947b52b1d56c3b33262 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sun, 28 Apr 2024 21:36:44 -0400 Subject: [PATCH] support lus renamespacing (#4075) --- libultraship | 2 +- .../Enhancements/audio/AudioCollection.cpp | 4 +- soh/soh/Enhancements/audio/AudioEditor.cpp | 30 +- soh/soh/Enhancements/audio/AudioEditor.h | 4 +- soh/soh/Enhancements/controls/InputViewer.cpp | 84 ++--- soh/soh/Enhancements/controls/InputViewer.h | 8 +- .../controls/SohInputEditorWindow.cpp | 322 +++++++++--------- .../controls/SohInputEditorWindow.h | 16 +- .../cosmetics/CosmeticsEditor.cpp | 46 +-- .../Enhancements/cosmetics/CosmeticsEditor.h | 2 +- soh/soh/Enhancements/debugconsole.cpp | 218 ++++++------ soh/soh/Enhancements/debugger/MessageViewer.h | 2 +- soh/soh/Enhancements/debugger/actorViewer.h | 2 +- soh/soh/Enhancements/debugger/colViewer.h | 2 +- .../Enhancements/debugger/debugSaveEditor.cpp | 46 +-- .../Enhancements/debugger/debugSaveEditor.h | 2 +- soh/soh/Enhancements/debugger/dlViewer.cpp | 4 +- soh/soh/Enhancements/debugger/dlViewer.h | 2 +- soh/soh/Enhancements/debugger/valueViewer.h | 2 +- .../GameInteractor_RawAction.cpp | 2 +- .../game-interactor/GameInteractor_Sail.cpp | 4 +- soh/soh/Enhancements/gameplaystatswindow.h | 2 +- soh/soh/Enhancements/mods.cpp | 2 +- soh/soh/Enhancements/presets.cpp | 2 +- .../randomizer/3drando/rando_main.cpp | 2 +- .../randomizer/3drando/spoiler_log.cpp | 6 +- .../Enhancements/randomizer/randomizer.cpp | 16 +- .../randomizer/randomizer_check_tracker.cpp | 2 +- .../randomizer/randomizer_check_tracker.h | 8 +- .../randomizer/randomizer_entrance_tracker.h | 2 +- .../randomizer/randomizer_item_tracker.cpp | 18 +- .../randomizer/randomizer_item_tracker.h | 4 +- .../randomizer/randomizer_settings_window.h | 2 +- .../resolution-editor/ResolutionEditor.cpp | 4 +- .../resolution-editor/ResolutionEditor.h | 4 +- soh/soh/Enhancements/savestates.cpp | 10 +- soh/soh/Enhancements/tts/tts.cpp | 20 +- soh/soh/OTRGlobals.cpp | 140 ++++---- soh/soh/OTRGlobals.h | 2 +- soh/soh/SaveManager.cpp | 14 +- soh/soh/SohGui.cpp | 10 +- soh/soh/SohMenuBar.cpp | 126 +++---- soh/soh/SohMenuBar.h | 4 +- soh/soh/SohModals.h | 4 +- soh/soh/UIWidgets.cpp | 20 +- soh/soh/config/ConfigUpdaters.cpp | 10 +- soh/soh/config/ConfigUpdaters.h | 10 +- .../resource/importer/AnimationFactory.cpp | 4 +- soh/soh/resource/importer/AnimationFactory.h | 4 +- .../resource/importer/AudioSampleFactory.cpp | 6 +- .../resource/importer/AudioSampleFactory.h | 4 +- .../importer/AudioSequenceFactory.cpp | 4 +- .../resource/importer/AudioSequenceFactory.h | 4 +- .../importer/AudioSoundFontFactory.cpp | 14 +- .../resource/importer/AudioSoundFontFactory.h | 4 +- .../resource/importer/BackgroundFactory.cpp | 4 +- soh/soh/resource/importer/BackgroundFactory.h | 4 +- .../importer/CollisionHeaderFactory.cpp | 6 +- .../importer/CollisionHeaderFactory.h | 8 +- soh/soh/resource/importer/CutsceneFactory.cpp | 18 +- soh/soh/resource/importer/CutsceneFactory.h | 4 +- soh/soh/resource/importer/PathFactory.cpp | 4 +- soh/soh/resource/importer/PathFactory.h | 4 +- .../importer/PlayerAnimationFactory.cpp | 4 +- .../importer/PlayerAnimationFactory.h | 4 +- soh/soh/resource/importer/SceneFactory.cpp | 16 +- soh/soh/resource/importer/SceneFactory.h | 12 +- soh/soh/resource/importer/SkeletonFactory.cpp | 10 +- soh/soh/resource/importer/SkeletonFactory.h | 8 +- .../resource/importer/SkeletonLimbFactory.cpp | 6 +- .../resource/importer/SkeletonLimbFactory.h | 8 +- soh/soh/resource/importer/TextFactory.cpp | 6 +- soh/soh/resource/importer/TextFactory.h | 8 +- .../scenecommand/EndMarkerFactory.cpp | 6 +- .../importer/scenecommand/EndMarkerFactory.h | 6 +- .../scenecommand/SceneCommandFactory.cpp | 2 +- .../scenecommand/SceneCommandFactory.h | 6 +- .../scenecommand/SetActorListFactory.cpp | 6 +- .../scenecommand/SetActorListFactory.h | 8 +- .../SetAlternateHeadersFactory.cpp | 10 +- .../scenecommand/SetAlternateHeadersFactory.h | 8 +- .../scenecommand/SetCameraSettingsFactory.cpp | 6 +- .../scenecommand/SetCameraSettingsFactory.h | 8 +- .../SetCollisionHeaderFactory.cpp | 10 +- .../scenecommand/SetCollisionHeaderFactory.h | 8 +- .../scenecommand/SetCsCameraFactory.cpp | 6 +- .../scenecommand/SetCsCameraFactory.h | 8 +- .../scenecommand/SetCutscenesFactory.cpp | 10 +- .../scenecommand/SetCutscenesFactory.h | 8 +- .../scenecommand/SetEchoSettingsFactory.cpp | 6 +- .../scenecommand/SetEchoSettingsFactory.h | 8 +- .../scenecommand/SetEntranceListFactory.cpp | 6 +- .../scenecommand/SetEntranceListFactory.h | 8 +- .../scenecommand/SetExitListFactory.cpp | 6 +- .../scenecommand/SetExitListFactory.h | 8 +- .../scenecommand/SetLightListFactory.cpp | 6 +- .../scenecommand/SetLightListFactory.h | 8 +- .../SetLightingSettingsFactory.cpp | 6 +- .../scenecommand/SetLightingSettingsFactory.h | 8 +- .../importer/scenecommand/SetMeshFactory.cpp | 38 +-- .../importer/scenecommand/SetMeshFactory.h | 8 +- .../scenecommand/SetObjectListFactory.cpp | 6 +- .../scenecommand/SetObjectListFactory.h | 8 +- .../scenecommand/SetPathwaysFactory.cpp | 10 +- .../scenecommand/SetPathwaysFactory.h | 8 +- .../scenecommand/SetRoomBehaviorFactory.cpp | 6 +- .../scenecommand/SetRoomBehaviorFactory.h | 8 +- .../scenecommand/SetRoomListFactory.cpp | 6 +- .../scenecommand/SetRoomListFactory.h | 8 +- .../scenecommand/SetSkyboxModifierFactory.cpp | 6 +- .../scenecommand/SetSkyboxModifierFactory.h | 8 +- .../scenecommand/SetSkyboxSettingsFactory.cpp | 6 +- .../scenecommand/SetSkyboxSettingsFactory.h | 8 +- .../scenecommand/SetSoundSettingsFactory.cpp | 6 +- .../scenecommand/SetSoundSettingsFactory.h | 8 +- .../scenecommand/SetSpecialObjectsFactory.cpp | 6 +- .../scenecommand/SetSpecialObjectsFactory.h | 8 +- .../SetStartPositionListFactory.cpp | 6 +- .../SetStartPositionListFactory.h | 8 +- .../scenecommand/SetTimeSettingsFactory.cpp | 6 +- .../scenecommand/SetTimeSettingsFactory.h | 8 +- .../SetTransitionActorListFactory.cpp | 6 +- .../SetTransitionActorListFactory.h | 8 +- .../scenecommand/SetWindSettingsFactory.cpp | 6 +- .../scenecommand/SetWindSettingsFactory.h | 8 +- .../resource/logging/SceneCommandLoggers.cpp | 50 +-- .../resource/logging/SceneCommandLoggers.h | 50 +-- soh/soh/resource/type/Animation.h | 4 +- soh/soh/resource/type/AudioSample.h | 4 +- soh/soh/resource/type/AudioSequence.h | 4 +- soh/soh/resource/type/AudioSoundFont.h | 4 +- soh/soh/resource/type/Background.h | 4 +- soh/soh/resource/type/CollisionHeader.h | 4 +- soh/soh/resource/type/Cutscene.h | 4 +- soh/soh/resource/type/Path.h | 4 +- soh/soh/resource/type/PlayerAnimation.h | 4 +- soh/soh/resource/type/Scene.h | 4 +- soh/soh/resource/type/Skeleton.cpp | 10 +- soh/soh/resource/type/Skeleton.h | 4 +- soh/soh/resource/type/SkeletonLimb.h | 4 +- soh/soh/resource/type/Text.h | 4 +- .../resource/type/scenecommand/SceneCommand.h | 4 +- soh/soh/z_message_OTR.cpp | 8 +- soh/soh/z_play_otr.cpp | 6 +- soh/soh/z_scene_otr.cpp | 4 +- 145 files changed, 1007 insertions(+), 1007 deletions(-) diff --git a/libultraship b/libultraship index 85f6de497..6f978e0d2 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 85f6de497f6d375390cc3b4ba55eae5ef9c1b153 +Subproject commit 6f978e0d237530f304ba2018bbdc539b175c184a diff --git a/soh/soh/Enhancements/audio/AudioCollection.cpp b/soh/soh/Enhancements/audio/AudioCollection.cpp index d637758a8..8f9c01d0a 100644 --- a/soh/soh/Enhancements/audio/AudioCollection.cpp +++ b/soh/soh/Enhancements/audio/AudioCollection.cpp @@ -388,7 +388,7 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) { excludedSequences.insert(seqInfo); includedSequences.erase(seqInfo); CVarSetInteger(cvarKey.c_str(), 1); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { @@ -396,7 +396,7 @@ void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { includedSequences.insert(seqInfo); excludedSequences.erase(seqInfo); CVarClear(cvarKey.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } void AudioCollection::InitializeShufflePool() { diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index e27de6b56..f33f73b3d 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -203,7 +203,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); ResetGroup(map, type); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { ReplayCurrentBGM(); @@ -214,7 +214,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); RandomizeGroup(type); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { ReplayCurrentBGM(); @@ -225,7 +225,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); LockGroup(map, type); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { ReplayCurrentBGM(); @@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); UnlockGroup(map, type); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { ReplayCurrentBGM(); @@ -281,7 +281,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { if (ImGui::Selectable(seqData.label.c_str())) { CVarSetInteger(cvarKey.c_str(), value); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); UpdateCurrentBGM(defaultValue, type); } @@ -301,7 +301,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { if (ImGui::Button(resetButton.c_str())) { CVarClear(cvarKey.c_str()); CVarClear(cvarLockKey.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); UpdateCurrentBGM(defaultValue, seqData.category); } UIWidgets::Tooltip("Reset to default"); @@ -322,7 +322,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { if (locked) { CVarClear(cvarLockKey.c_str()); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); UpdateCurrentBGM(defaultValue, type); } } @@ -335,7 +335,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { } else { CVarSetInteger(cvarLockKey.c_str(), 1); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } UIWidgets::Tooltip(locked ? "Sound locked" : "Sound unlocked"); } @@ -521,7 +521,7 @@ void AudioEditor::DrawElement() { const std::string resetButton = "Reset##linkVoiceFreqMultiplier"; if (ImGui::Button(resetButton.c_str())) { CVarSetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::NewLine(); @@ -710,14 +710,14 @@ void AudioEditor_RandomizeAll() { RandomizeGroup(type); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ReplayCurrentBGM(); } void AudioEditor_RandomizeGroup(SeqType group) { RandomizeGroup(group); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ReplayCurrentBGM(); } @@ -726,14 +726,14 @@ void AudioEditor_ResetAll() { ResetGroup(AudioCollection::Instance->GetAllSequences(), type); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ReplayCurrentBGM(); } void AudioEditor_ResetGroup(SeqType group) { ResetGroup(AudioCollection::Instance->GetAllSequences(), group); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ReplayCurrentBGM(); } @@ -742,7 +742,7 @@ void AudioEditor_LockAll() { LockGroup(AudioCollection::Instance->GetAllSequences(), type); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } void AudioEditor_UnlockAll() { @@ -750,5 +750,5 @@ void AudioEditor_UnlockAll() { UnlockGroup(AudioCollection::Instance->GetAllSequences(), type); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } diff --git a/soh/soh/Enhancements/audio/AudioEditor.h b/soh/soh/Enhancements/audio/AudioEditor.h index 38a681539..45c2654e5 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.h +++ b/soh/soh/Enhancements/audio/AudioEditor.h @@ -10,9 +10,9 @@ #include #include "AudioCollection.h" -class AudioEditor : public LUS::GuiWindow { +class AudioEditor : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; void DrawElement() override; void InitElement() override; diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp index fb476e9aa..52b3527cc 100644 --- a/soh/soh/Enhancements/controls/InputViewer.cpp +++ b/soh/soh/Enhancements/controls/InputViewer.cpp @@ -47,14 +47,14 @@ void InputViewer::RenderButton(std::string btnTexture, std::string btnOutlineTex // Render Outline based on settings if (outlineMode == BUTTON_OUTLINE_ALWAYS_SHOWN || (outlineMode == BUTTON_OUTLINE_NOT_PRESSED && !state) || (outlineMode == BUTTON_OUTLINE_PRESSED && state)) { - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size, + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } // Render button if pressed if (state) { ImGui::SetCursorPos(pos); ImGui::SetNextItemAllowOverlap(); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size, + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } } @@ -63,61 +63,61 @@ void InputViewer::DrawElement() { if (CVarGetInteger(CVAR_WINDOW("InputViewer"), 0)) { static bool sButtonTexturesLoaded = false; if (!sButtonTexturesLoaded) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage( + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage( "Input-Viewer-Background", "textures/buttons/InputViewerBackground.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn", "textures/buttons/ABtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn", "textures/buttons/BBtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn", "textures/buttons/LBtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn", "textures/buttons/RBtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn", "textures/buttons/ZBtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn", "textures/buttons/ABtn.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn", "textures/buttons/BBtn.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn", "textures/buttons/LBtn.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn", "textures/buttons/RBtn.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn", "textures/buttons/ZBtn.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn", "textures/buttons/StartBtn.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left", "textures/buttons/CLeft.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right", "textures/buttons/CRight.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up", "textures/buttons/CUp.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down", "textures/buttons/CDown.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left", "textures/buttons/CLeft.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right", "textures/buttons/CRight.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up", "textures/buttons/CUp.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down", "textures/buttons/CDown.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick", "textures/buttons/AnalogStick.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left", "textures/buttons/DPadLeft.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right", "textures/buttons/DPadRight.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up", "textures/buttons/DPadUp.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up", "textures/buttons/DPadUp.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down", "textures/buttons/DPadDown.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick", "textures/buttons/RightStick.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn Outline", "textures/buttons/ABtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn Outline", "textures/buttons/BBtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn Outline", "textures/buttons/LBtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn Outline", "textures/buttons/RBtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn Outline", "textures/buttons/ZBtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn Outline", "textures/buttons/StartBtnOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left Outline", "textures/buttons/CLeftOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right Outline", "textures/buttons/CRightOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up Outline", "textures/buttons/CUpOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down Outline", "textures/buttons/CDownOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick Outline", "textures/buttons/AnalogStickOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left Outline", "textures/buttons/DPadLeftOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right Outline", "textures/buttons/DPadRightOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up Outline", "textures/buttons/DPadUpOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down Outline", "textures/buttons/DPadDownOutline.png"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick Outline", + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick Outline", "textures/buttons/RightStickOutline.png"); sButtonTexturesLoaded = true; } @@ -133,7 +133,7 @@ void InputViewer::DrawElement() { const int showAnalogAngles = CVarGetInteger("gInputViewer.AnalogAngles.Enabled", 0); const int buttonOutlineMode = CVarGetInteger("gInputViewer.ButtonOutlineMode", BUTTON_OUTLINE_NOT_PRESSED); - ImVec2 bgSize = LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureSize("Input-Viewer-Background"); + ImVec2 bgSize = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureSize("Input-Viewer-Background"); ImVec2 scaledBGSize = ImVec2(bgSize.x * scale, bgSize.y * scale); ImGui::SetNextWindowSize(ImVec2( @@ -150,7 +150,7 @@ void InputViewer::DrawElement() { ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f)); - OSContPad* pads = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); + OSContPad* pads = Ship::Context::GetInstance()->GetControlDeck()->GetPads(); ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground | @@ -168,7 +168,7 @@ void InputViewer::DrawElement() { ImGui::SetNextItemAllowOverlap(); // Background ImGui::Image( - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"), + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"), scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } @@ -263,7 +263,7 @@ void InputViewer::DrawElement() { ImGui::SetNextItemAllowOverlap(); ImGui::SetCursorPos(aPos); ImGui::Image( - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"), + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"), scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } const int analogStickMode = @@ -274,7 +274,7 @@ void InputViewer::DrawElement() { ImGui::SetCursorPos( ImVec2(aPos.x + maxStickDistance * ((float)(pads[0].stick_x) / MAX_AXIS_RANGE) * scale, aPos.y - maxStickDistance * ((float)(pads[0].stick_y) / MAX_AXIS_RANGE) * scale)); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"), scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } @@ -287,7 +287,7 @@ void InputViewer::DrawElement() { ImGui::SetNextItemAllowOverlap(); ImGui::SetCursorPos(aPos); ImGui::Image( - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"), + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"), scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } const int rightStickMode = @@ -298,7 +298,7 @@ void InputViewer::DrawElement() { ImGui::SetCursorPos( ImVec2(aPos.x + maxRightStickDistance * ((float)(pads[0].right_stick_x) / MAX_AXIS_RANGE) * scale, aPos.y - maxRightStickDistance * ((float)(pads[0].right_stick_y) / MAX_AXIS_RANGE) * scale)); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"), scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); } diff --git a/soh/soh/Enhancements/controls/InputViewer.h b/soh/soh/Enhancements/controls/InputViewer.h index 6f2e2c587..4d528ead4 100644 --- a/soh/soh/Enhancements/controls/InputViewer.h +++ b/soh/soh/Enhancements/controls/InputViewer.h @@ -15,9 +15,9 @@ typedef enum { STICK_MODE_ALWAYS_HIDDEN, } StickMode; -class InputViewer : public LUS::GuiWindow { +class InputViewer : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; void InitElement() override {}; void DrawElement() override; @@ -32,9 +32,9 @@ public: void RenderButton(std::string btn, std::string btnOutline, int state, ImVec2 size, int outlineMode); }; -class InputViewerSettingsWindow : public LUS::GuiWindow { +class InputViewerSettingsWindow : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; void InitElement() override {}; void DrawElement() override; diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 02781bf04..be71c7de1 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -57,7 +57,7 @@ void SohInputEditorWindow::UpdateElement() { } if (mInputEditorPopupOpen && ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopupId)) { - LUS::Context::GetInstance()->GetControlDeck()->BlockGameInput(INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID); + Ship::Context::GetInstance()->GetControlDeck()->BlockGameInput(INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID); // continue to block input for a third of a second after getting the mapping mGameInputBlockTimer = ImGui::GetIO().Framerate / 3; @@ -69,24 +69,24 @@ void SohInputEditorWindow::UpdateElement() { } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->BlockImGuiGamepadNavigation(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->BlockImGuiGamepadNavigation(); } else { if (mGameInputBlockTimer != INT32_MAX) { mGameInputBlockTimer--; if (mGameInputBlockTimer <= 0) { - LUS::Context::GetInstance()->GetControlDeck()->UnblockGameInput( + Ship::Context::GetInstance()->GetControlDeck()->UnblockGameInput( INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID); mGameInputBlockTimer = INT32_MAX; } } - if (LUS::Context::GetInstance()->GetWindow()->GetGui()->ImGuiGamepadNavigationEnabled()) { + if (Ship::Context::GetInstance()->GetWindow()->GetGui()->ImGuiGamepadNavigationEnabled()) { mMappingInputBlockTimer = ImGui::GetIO().Framerate / 3; } else { mMappingInputBlockTimer = INT32_MAX; } - LUS::Context::GetInstance()->GetWindow()->GetGui()->UnblockImGuiGamepadNavigation(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->UnblockImGuiGamepadNavigation(); } } @@ -176,26 +176,26 @@ void SohInputEditorWindow::DrawAnalogPreview(const char* label, ImVec2 stick, fl #define BUTTON_COLOR_GAMEPAD_PURPLE ImVec4(0.431f, 0.369f, 0.706f, 0.5f) #define BUTTON_COLOR_GAMEPAD_PURPLE_HOVERED ImVec4(0.431f, 0.369f, 0.706f, 1.0f) -void SohInputEditorWindow::GetButtonColorsForLUSDeviceIndex(LUS::LUSDeviceIndex lusIndex, ImVec4& buttonColor, +void SohInputEditorWindow::GetButtonColorsForLUSDeviceIndex(Ship::ShipDeviceIndex lusIndex, ImVec4& buttonColor, ImVec4& buttonHoveredColor) { switch (lusIndex) { - case LUS::LUSDeviceIndex::Keyboard: + case Ship::ShipDeviceIndex::Keyboard: buttonColor = BUTTON_COLOR_KEYBOARD_BEIGE; buttonHoveredColor = BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED; break; - case LUS::LUSDeviceIndex::Blue: + case Ship::ShipDeviceIndex::Blue: buttonColor = BUTTON_COLOR_GAMEPAD_BLUE; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_BLUE_HOVERED; break; - case LUS::LUSDeviceIndex::Red: + case Ship::ShipDeviceIndex::Red: buttonColor = BUTTON_COLOR_GAMEPAD_RED; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_RED_HOVERED; break; - case LUS::LUSDeviceIndex::Orange: + case Ship::ShipDeviceIndex::Orange: buttonColor = BUTTON_COLOR_GAMEPAD_ORANGE; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_ORANGE_HOVERED; break; - case LUS::LUSDeviceIndex::Green: + case Ship::ShipDeviceIndex::Green: buttonColor = BUTTON_COLOR_GAMEPAD_GREEN; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_GREEN_HOVERED; break; @@ -230,7 +230,7 @@ void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t ImGui::CloseCurrentPopup(); } // todo: figure out why optional params (using id = "" in the definition) wasn't working - if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() + if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetButton(bitmask) @@ -243,7 +243,7 @@ void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t } void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id) { - auto mapping = LUS::Context::GetInstance() + auto mapping = Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetButton(bitmask) @@ -269,7 +269,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_ auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto physicalInputDisplayName = StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str()); - GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); + GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); auto popupId = StringHelper::Sprintf("editButtonMappingPopup##%s", id.c_str()); @@ -292,7 +292,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_ mInputEditorPopupOpen = false; ImGui::CloseCurrentPopup(); } - if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() + if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetButton(bitmask) @@ -307,18 +307,18 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_ ImGui::SameLine(0, 0); #ifndef __WIIU__ - auto sdlAxisDirectionToButtonMapping = std::dynamic_pointer_cast(mapping); - auto indexMapping = LUS::Context::GetInstance() + auto sdlAxisDirectionToButtonMapping = std::dynamic_pointer_cast(mapping); + auto indexMapping = Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() - ->GetDeviceIndexMappingFromLUSDeviceIndex(mapping->GetLUSDeviceIndex()); - auto sdlIndexMapping = std::dynamic_pointer_cast(indexMapping); + ->GetDeviceIndexMappingFromShipDeviceIndex(mapping->GetShipDeviceIndex()); + auto sdlIndexMapping = std::dynamic_pointer_cast(indexMapping); if (sdlIndexMapping != nullptr && sdlAxisDirectionToButtonMapping != nullptr) { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f)); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); - GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); + GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); @@ -433,7 +433,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_ ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); if (ImGui::Button(StringHelper::Sprintf("%s###removeButtonMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(), ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) { - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetButton(bitmask) @@ -459,7 +459,7 @@ void SohInputEditorWindow::DrawButtonLine(const char* buttonName, uint8_t port, } void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, - LUS::Direction direction) { + Ship::Direction direction) { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); auto popupId = StringHelper::Sprintf("addStickDirectionMappingPopup##%d-%d-%d", port, stick, direction); if (ImGui::Button( @@ -477,9 +477,9 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, mInputEditorPopupOpen = false; ImGui::CloseCurrentPopup(); } - if (stick == LUS::LEFT) { + if (stick == Ship::LEFT) { if (mMappingInputBlockTimer == INT32_MAX && - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetLeftStick() @@ -489,7 +489,7 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, } } else { if (mMappingInputBlockTimer == INT32_MAX && - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRightStick() @@ -502,16 +502,16 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, } void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, - LUS::Direction direction, std::string id) { - std::shared_ptr mapping = nullptr; - if (stick == LUS::LEFT) { - mapping = LUS::Context::GetInstance() + Ship::Direction direction, std::string id) { + std::shared_ptr mapping = nullptr; + if (stick == Ship::LEFT) { + mapping = Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetLeftStick() ->GetAxisDirectionMappingById(direction, id); } else { - mapping = LUS::Context::GetInstance() + mapping = Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRightStick() @@ -539,7 +539,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto physicalInputDisplayName = StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str()); - GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); + GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); auto popupId = StringHelper::Sprintf("editStickDirectionMappingPopup##%s", id.c_str()); @@ -564,9 +564,9 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, ImGui::CloseCurrentPopup(); } - if (stick == LUS::LEFT) { + if (stick == Ship::LEFT) { if (mMappingInputBlockTimer == INT32_MAX && - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetLeftStick() @@ -576,7 +576,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, } } else { if (mMappingInputBlockTimer == INT32_MAX && - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRightStick() @@ -595,14 +595,14 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, if (ImGui::Button( StringHelper::Sprintf("%s###removeStickDirectionMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(), ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) { - if (stick == LUS::LEFT) { - LUS::Context::GetInstance() + if (stick == Ship::LEFT) { + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetLeftStick() ->ClearAxisDirectionMapping(direction, id); } else { - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRightStick() @@ -616,7 +616,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, } void SohInputEditorWindow::DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, - LUS::Direction direction, ImVec4 color = CHIP_COLOR_N64_GREY) { + Ship::Direction direction, ImVec4 color = CHIP_COLOR_N64_GREY) { ImGui::NewLine(); ImGui::SameLine(); ImGui::BeginDisabled(); @@ -634,21 +634,21 @@ void SohInputEditorWindow::DrawStickDirectionLine(const char* axisDirectionName, void SohInputEditorWindow::DrawStickSection(uint8_t port, uint8_t stick, int32_t id, ImVec4 color = CHIP_COLOR_N64_GREY) { static int8_t sX, sY; - std::shared_ptr controllerStick = nullptr; - if (stick == LUS::LEFT) { - controllerStick = LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick(); + std::shared_ptr controllerStick = nullptr; + if (stick == Ship::LEFT) { + controllerStick = Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick(); } else { - controllerStick = LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick(); + controllerStick = Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick(); } controllerStick->Process(sX, sY); DrawAnalogPreview(StringHelper::Sprintf("##AnalogPreview%d", id).c_str(), ImVec2(sX, sY)); ImGui::SameLine(); ImGui::BeginGroup(); - DrawStickDirectionLine(ICON_FA_ARROW_UP, port, stick, LUS::UP, color); - DrawStickDirectionLine(ICON_FA_ARROW_DOWN, port, stick, LUS::DOWN, color); - DrawStickDirectionLine(ICON_FA_ARROW_LEFT, port, stick, LUS::LEFT, color); - DrawStickDirectionLine(ICON_FA_ARROW_RIGHT, port, stick, LUS::RIGHT, color); + DrawStickDirectionLine(ICON_FA_ARROW_UP, port, stick, Ship::UP, color); + DrawStickDirectionLine(ICON_FA_ARROW_DOWN, port, stick, Ship::DOWN, color); + DrawStickDirectionLine(ICON_FA_ARROW_LEFT, port, stick, Ship::LEFT, color); + DrawStickDirectionLine(ICON_FA_ARROW_RIGHT, port, stick, Ship::RIGHT, color); ImGui::EndGroup(); ImGui::SetNextItemOpen(true, ImGuiCond_Once); if (ImGui::TreeNode(StringHelper::Sprintf("Analog Stick Options##%d", id).c_str())) { @@ -776,7 +776,7 @@ void SohInputEditorWindow::UpdateBitmaskToMappingIds(uint8_t port) { // todo: do we need this now that ControllerButton exists? for (auto [bitmask, button] : - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetAllButtons()) { + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetAllButtons()) { for (auto [id, mapping] : button->GetAllButtonMappings()) { // using a vector here instead of a set because i want newly added mappings // to go to the end of the list instead of autosorting @@ -791,12 +791,12 @@ void SohInputEditorWindow::UpdateBitmaskToMappingIds(uint8_t port) { void SohInputEditorWindow::UpdateStickDirectionToMappingIds(uint8_t port) { // todo: do we need this? for (auto stick : - { std::make_pair>( - LUS::LEFT, LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick()), - std::make_pair>( - LUS::RIGHT, - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick()) }) { - for (auto direction : { LUS::LEFT, LUS::RIGHT, LUS::UP, LUS::DOWN }) { + { std::make_pair>( + Ship::LEFT, Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick()), + std::make_pair>( + Ship::RIGHT, + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick()) }) { + for (auto direction : { Ship::LEFT, Ship::RIGHT, Ship::UP, Ship::DOWN }) { for (auto [id, mapping] : stick.second->GetAllAxisDirectionMappingByDirection(direction)) { // using a vector here instead of a set because i want newly added mappings // to go to the end of the list instead of autosorting @@ -815,7 +815,7 @@ void SohInputEditorWindow::DrawRemoveRumbleMappingButton(uint8_t port, std::stri ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); if (ImGui::Button(StringHelper::Sprintf("%s###removeRumbleMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRumble()->ClearRumbleMapping(id); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRumble()->ClearRumbleMapping(id); } ImGui::PopStyleVar(); } @@ -838,7 +838,7 @@ void SohInputEditorWindow::DrawAddRumbleMappingButton(uint8_t port) { ImGui::CloseCurrentPopup(); } - if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() + if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRumble() @@ -855,7 +855,7 @@ bool SohInputEditorWindow::TestingRumble() { } void SohInputEditorWindow::DrawRumbleSection(uint8_t port) { - for (auto [id, mapping] : LUS::Context::GetInstance() + for (auto [id, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetRumble() @@ -864,7 +864,7 @@ void SohInputEditorWindow::DrawRumbleSection(uint8_t port) { ImGui::SetNextItemOpen(true, ImGuiCond_Once); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); - GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); + GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor); // begin hackaround https://github.com/ocornut/imgui/issues/282#issuecomment-123763192 // spaces to have background color for text in a tree node std::string spaces = ""; @@ -998,7 +998,7 @@ void SohInputEditorWindow::DrawRemoveLEDMappingButton(uint8_t port, std::string ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); if (ImGui::Button(StringHelper::Sprintf("%s###removeLEDMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->ClearLEDMapping(id); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->ClearLEDMapping(id); } ImGui::PopStyleVar(); } @@ -1021,7 +1021,7 @@ void SohInputEditorWindow::DrawAddLEDMappingButton(uint8_t port) { ImGui::CloseCurrentPopup(); } - if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() + if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetLED() @@ -1035,7 +1035,7 @@ void SohInputEditorWindow::DrawAddLEDMappingButton(uint8_t port) { void SohInputEditorWindow::DrawLEDSection(uint8_t port) { for (auto [id, mapping] : - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->GetAllLEDMappings()) { + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->GetAllLEDMappings()) { ImGui::AlignTextToFramePadding(); ImGui::SetNextItemOpen(true, ImGuiCond_Once); auto open = ImGui::TreeNode( @@ -1088,7 +1088,7 @@ void SohInputEditorWindow::DrawLEDSection(uint8_t port) { color.b = colorVec.z * 255.0; CVarSetColor24("gLedPort1Color", color); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); ImGui::Text("Custom Color"); @@ -1116,7 +1116,7 @@ void SohInputEditorWindow::DrawRemoveGyroMappingButton(uint8_t port, std::string ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); if (ImGui::Button(StringHelper::Sprintf("%s###removeGyroMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->ClearGyroMapping(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->ClearGyroMapping(); } ImGui::PopStyleVar(); } @@ -1139,7 +1139,7 @@ void SohInputEditorWindow::DrawAddGyroMappingButton(uint8_t port) { ImGui::CloseCurrentPopup(); } - if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() + if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(port) ->GetGyro() @@ -1153,7 +1153,7 @@ void SohInputEditorWindow::DrawAddGyroMappingButton(uint8_t port) { void SohInputEditorWindow::DrawGyroSection(uint8_t port) { auto mapping = - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->GetGyroMapping(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->GetGyroMapping(); if (mapping != nullptr) { auto id = mapping->GetGyroMappingId(); ImGui::AlignTextToFramePadding(); @@ -1236,28 +1236,28 @@ void SohInputEditorWindow::DrawGyroSection(uint8_t port) { } void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set bitmasks) { - std::set allLusDeviceIndices; - allLusDeviceIndices.insert(LUS::LUSDeviceIndex::Keyboard); - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::set allLusDeviceIndices; + allLusDeviceIndices.insert(Ship::ShipDeviceIndex::Keyboard); + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { allLusDeviceIndices.insert(lusIndex); } - std::vector> lusDeviceIndiciesWithMappings; + std::vector> lusDeviceIndiciesWithMappings; for (auto lusIndex : allLusDeviceIndices) { for (auto [bitmask, button] : - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetAllButtons()) { + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetAllButtons()) { if (!bitmasks.contains(bitmask)) { continue; } - if (button->HasMappingsForLUSDeviceIndex(lusIndex)) { + if (button->HasMappingsForShipDeviceIndex(lusIndex)) { for (auto [id, mapping] : button->GetAllButtonMappings()) { - if (mapping->GetLUSDeviceIndex() == lusIndex) { + if (mapping->GetShipDeviceIndex() == lusIndex) { lusDeviceIndiciesWithMappings.push_back( - std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); + std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); break; } } @@ -1273,7 +1273,7 @@ void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set allLusDeviceIndices; - allLusDeviceIndices.insert(LUS::LUSDeviceIndex::Keyboard); - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() +void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick) { + std::set allLusDeviceIndices; + allLusDeviceIndices.insert(Ship::ShipDeviceIndex::Keyboard); + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { allLusDeviceIndices.insert(lusIndex); } - std::vector> lusDeviceIndiciesWithMappings; + std::vector> lusDeviceIndiciesWithMappings; for (auto lusIndex : allLusDeviceIndices) { auto controllerStick = - stick == LUS::Stick::LEFT_STICK - ? LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetLeftStick() - : LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetRightStick(); - if (controllerStick->HasMappingsForLUSDeviceIndex(lusIndex)) { + stick == Ship::Stick::LEFT_STICK + ? Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetLeftStick() + : Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetRightStick(); + if (controllerStick->HasMappingsForShipDeviceIndex(lusIndex)) { for (auto [direction, mappings] : controllerStick->GetAllAxisDirectionMappings()) { bool foundMapping = false; for (auto [id, mapping] : mappings) { - if (mapping->GetLUSDeviceIndex() == lusIndex) { + if (mapping->GetShipDeviceIndex() == lusIndex) { foundMapping = true; lusDeviceIndiciesWithMappings.push_back( - std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); + std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); break; } } @@ -1324,7 +1324,7 @@ void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::St ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::SameLine(); - if (lusIndex == LUS::LUSDeviceIndex::Keyboard) { + if (lusIndex == Ship::ShipDeviceIndex::Keyboard) { ImGui::SmallButton(ICON_FA_KEYBOARD_O); } else { ImGui::SmallButton(connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN); @@ -1335,29 +1335,29 @@ void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::St } void SohInputEditorWindow::DrawRumbleDeviceIcons(uint8_t portIndex) { - std::set allLusDeviceIndices; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::set allLusDeviceIndices; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { allLusDeviceIndices.insert(lusIndex); } - std::vector> lusDeviceIndiciesWithMappings; + std::vector> lusDeviceIndiciesWithMappings; for (auto lusIndex : allLusDeviceIndices) { - if (LUS::Context::GetInstance() + if (Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->GetRumble() - ->HasMappingsForLUSDeviceIndex(lusIndex)) { - for (auto [id, mapping] : LUS::Context::GetInstance() + ->HasMappingsForShipDeviceIndex(lusIndex)) { + for (auto [id, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->GetRumble() ->GetAllRumbleMappings()) { - if (mapping->GetLUSDeviceIndex() == lusIndex) { + if (mapping->GetShipDeviceIndex() == lusIndex) { lusDeviceIndiciesWithMappings.push_back( - std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); + std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); break; } } @@ -1379,14 +1379,14 @@ void SohInputEditorWindow::DrawRumbleDeviceIcons(uint8_t portIndex) { void SohInputEditorWindow::DrawGyroDeviceIcons(uint8_t portIndex) { auto mapping = - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetGyro()->GetGyroMapping(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetGyro()->GetGyroMapping(); if (mapping == nullptr) { return; } auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); - GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); + GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::SameLine(); @@ -1396,29 +1396,29 @@ void SohInputEditorWindow::DrawGyroDeviceIcons(uint8_t portIndex) { } void SohInputEditorWindow::DrawLEDDeviceIcons(uint8_t portIndex) { - std::set allLusDeviceIndices; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::set allLusDeviceIndices; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { allLusDeviceIndices.insert(lusIndex); } - std::vector> lusDeviceIndiciesWithMappings; + std::vector> lusDeviceIndiciesWithMappings; for (auto lusIndex : allLusDeviceIndices) { - if (LUS::Context::GetInstance() + if (Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->GetRumble() - ->HasMappingsForLUSDeviceIndex(lusIndex)) { - for (auto [id, mapping] : LUS::Context::GetInstance() + ->HasMappingsForShipDeviceIndex(lusIndex)) { + for (auto [id, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->GetLED() ->GetAllLEDMappings()) { - if (mapping->GetLUSDeviceIndex() == lusIndex) { + if (mapping->GetShipDeviceIndex() == lusIndex) { lusDeviceIndiciesWithMappings.push_back( - std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); + std::pair(lusIndex, mapping->PhysicalDeviceIsConnected())); break; } } @@ -1516,7 +1516,7 @@ void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidt } if (ImGui::Selectable(i->second, i->first == currentButton)) { CVarSetInteger(mapping.cVarName, i->first); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } ImGui::EndCombo(); @@ -1548,7 +1548,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS); TableHelper::InitHeader(false); - LUS::GuiWindow::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); labelWidth = ImGui::CalcTextSize("D5").x + 10; DrawMapping(ocarinaD5, labelWidth, disableMask); DrawMapping(ocarinaB4, labelWidth, disableMask); @@ -1557,16 +1557,16 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { DrawMapping(ocarinaD4, labelWidth, disableMask); ImGui::Dummy(ImVec2(0, 5)); float cursorY = ImGui::GetCursorPosY(); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); TableHelper::NextCol(); - LUS::GuiWindow::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10; DrawMapping(ocarinaSongDisable, labelWidth, disableMask); DrawMapping(ocarinaSharp, labelWidth, disableMask); DrawMapping(ocarinaFlat, labelWidth, disableMask); - LUS::GuiWindow::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); + Ship::GuiWindow::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); ImGui::EndTable(); } @@ -1577,7 +1577,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { UIWidgets::Spacer(0); } - LUS::GuiWindow::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) { ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS); @@ -1589,7 +1589,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { UIWidgets::Spacer(0); ImGui::EndTable(); } - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); ImGui::EndTable(); } @@ -1597,7 +1597,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { void SohInputEditorWindow::DrawCameraControlPanel() { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - LUS::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming"); UIWidgets::Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"); if (CVarGetInteger("gRightStickAiming", 0)) { @@ -1629,12 +1629,12 @@ void SohInputEditorWindow::DrawCameraControlPanel() { "gFirstPersonCameraSensitivityY", 0.01f, 5.0f, "", 1.0f, true); } UIWidgets::Spacer(0); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); UIWidgets::Spacer(0); cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - LUS::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera"); UIWidgets::Tooltip("Enables free camera control\nNote: You must remap C buttons off of the right stick in the " @@ -1652,13 +1652,13 @@ void SohInputEditorWindow::DrawCameraControlPanel() { "gFreeCameraDistMax", 100, 900, "", 185, true, false, true); UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed", "gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); } void SohInputEditorWindow::DrawDpadControlPanel() { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - LUS::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause"); UIWidgets::Tooltip("Navigate Pause with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate\n" "To make the cursor only move a single space no matter how long a direction is held, manually set gDpadHoldChange to 0"); @@ -1667,13 +1667,13 @@ void SohInputEditorWindow::DrawDpadControlPanel() { "To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gDpadHoldChange to 0"); UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips"); UIWidgets::Tooltip("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate"); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); } void SohInputEditorWindow::DrawMiscControlPanel() { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - LUS::GuiWindow::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); UIWidgets::PaddedText("Allow the cursor to be on any slot"); static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" }; UIWidgets::EnhancementCombobox("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY); @@ -1685,24 +1685,24 @@ void SohInputEditorWindow::DrawMiscControlPanel() { UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed"); if (CVarGetInteger("gEnableWalkModify", 0)) { UIWidgets::Spacer(5); - LUS::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false); - LUS::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity", "gWalkModifierDoesntChangeJump", true, false); UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); - LUS::GuiWindow::EndGroupPanel(0); - LUS::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail()); + Ship::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1", "gSwimModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2", "gSwimModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); - LUS::GuiWindow::EndGroupPanel(0); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); } ImGui::EndDisabled(); UIWidgets::Spacer(0); UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL"); UIWidgets::Tooltip("Speak to Navi with L but enter first-person camera with C-Up"); - LUS::GuiWindow::EndGroupPanel(0); + Ship::GuiWindow::EndGroupPanel(0); } void SohInputEditorWindow::DrawLinkTab() { @@ -1749,17 +1749,17 @@ void SohInputEditorWindow::DrawLinkTab() { } if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); - DrawStickSection(portIndex, LUS::LEFT, 0); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); + DrawStickSection(portIndex, Ship::LEFT, 0); } else { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); } if (ImGui::CollapsingHeader("Additional (\"Right\") Stick")) { - DrawAnalogStickDeviceIcons(portIndex, LUS::RIGHT_STICK); - DrawStickSection(portIndex, LUS::RIGHT, 1, CHIP_COLOR_N64_YELLOW); + DrawAnalogStickDeviceIcons(portIndex, Ship::RIGHT_STICK); + DrawStickSection(portIndex, Ship::RIGHT, 1, CHIP_COLOR_N64_YELLOW); } else { - DrawAnalogStickDeviceIcons(portIndex, LUS::RIGHT_STICK); + DrawAnalogStickDeviceIcons(portIndex, Ship::RIGHT_STICK); } if (ImGui::CollapsingHeader("Rumble")) { @@ -1884,10 +1884,10 @@ void SohInputEditorWindow::DrawIvanTab() { } if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); - DrawStickSection(portIndex, LUS::LEFT, 0); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); + DrawStickSection(portIndex, Ship::LEFT, 0); } else { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); } ImGui::PopStyleColor(); @@ -1942,10 +1942,10 @@ void SohInputEditorWindow::DrawDebugPortTab(uint8_t portIndex, std::string custo } if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); - DrawStickSection(portIndex, LUS::LEFT, 0); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); + DrawStickSection(portIndex, Ship::LEFT, 0); } else { - DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); + DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK); } ImGui::PopStyleColor(); @@ -1965,7 +1965,7 @@ void SohInputEditorWindow::DrawClearAllButton(uint8_t portIndex) { ImGui::CloseCurrentPopup(); } if (ImGui::Button("Clear All")) { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->ClearAllMappings(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->ClearAllMappings(); ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); @@ -1983,12 +1983,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { ImGui::PopStyleVar(); if (ImGui::BeginPopup(popupId.c_str())) { - std::map> indexMappings; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::map> indexMappings; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto wiiuIndexMapping = std::static_pointer_cast(mapping); + auto wiiuIndexMapping = std::static_pointer_cast(mapping); if (wiiuIndexMapping == nullptr) { continue; } @@ -2025,11 +2025,11 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { ImGui::CloseCurrentPopup(); } if (ImGui::Button("Set defaults")) { - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->ClearAllMappingsForDevice(lusIndex); - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( lusIndex); shouldClose = true; ImGui::CloseCurrentPopup(); @@ -2048,12 +2048,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { void SohInputEditorWindow::DrawDevicesTab() { if (ImGui::BeginTabItem("Devices")) { - std::map> indexMappings; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::map> indexMappings; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { - auto wiiuIndexMapping = std::static_pointer_cast(mapping); + auto wiiuIndexMapping = std::static_pointer_cast(mapping); if (wiiuIndexMapping == nullptr) { continue; } @@ -2061,11 +2061,11 @@ void SohInputEditorWindow::DrawDevicesTab() { indexMappings[lusIndex] = { wiiuIndexMapping->GetWiiUControllerName(), -1 }; } - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto wiiuIndexMapping = std::static_pointer_cast(mapping); + auto wiiuIndexMapping = std::static_pointer_cast(mapping); if (wiiuIndexMapping == nullptr) { continue; } @@ -2108,12 +2108,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { } if (ImGui::BeginPopup(popupId.c_str())) { - std::map> indexMappings; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::map> indexMappings; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); + auto sdlIndexMapping = std::static_pointer_cast(mapping); if (sdlIndexMapping == nullptr) { continue; } @@ -2136,12 +2136,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { ImGui::CloseCurrentPopup(); } if (ImGui::Button("Set defaults")) { - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) - ->ClearAllMappingsForDevice(LUS::LUSDeviceIndex::Keyboard); - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( - LUS::LUSDeviceIndex::Keyboard); + ->ClearAllMappingsForDevice(Ship::ShipDeviceIndex::Keyboard); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( + Ship::ShipDeviceIndex::Keyboard); shouldClose = true; ImGui::CloseCurrentPopup(); } @@ -2171,11 +2171,11 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { ImGui::CloseCurrentPopup(); } if (ImGui::Button("Set defaults")) { - LUS::Context::GetInstance() + Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(portIndex) ->ClearAllMappingsForDevice(lusIndex); - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( lusIndex); shouldClose = true; ImGui::CloseCurrentPopup(); @@ -2194,12 +2194,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { void SohInputEditorWindow::DrawDevicesTab() { if (ImGui::BeginTabItem("Devices")) { - std::map> indexMappings; - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + std::map> indexMappings; + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); + auto sdlIndexMapping = std::static_pointer_cast(mapping); if (sdlIndexMapping == nullptr) { continue; } @@ -2207,11 +2207,11 @@ void SohInputEditorWindow::DrawDevicesTab() { indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), -1 }; } - for (auto [lusIndex, mapping] : LUS::Context::GetInstance() + for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); + auto sdlIndexMapping = std::static_pointer_cast(mapping); if (sdlIndexMapping == nullptr) { continue; } diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.h b/soh/soh/Enhancements/controls/SohInputEditorWindow.h index e96b5b09a..079aa805b 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.h +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.h @@ -20,7 +20,7 @@ typedef struct { N64ButtonMask defaultBtn; } CustomButtonMap; -class SohInputEditorWindow : public LUS::GuiWindow { +class SohInputEditorWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; ~SohInputEditorWindow(); @@ -38,14 +38,14 @@ class SohInputEditorWindow : public LUS::GuiWindow { void UpdateElement() override; private: - void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, LUS::Direction direction, + void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, Ship::Direction direction, ImVec4 color); void DrawButtonLine(const char* buttonName, uint8_t port, uint16_t bitmask, ImVec4 color); void DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id); void DrawButtonLineAddMappingButton(uint8_t port, uint16_t bitmask); - void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, LUS::Direction direction, std::string id); - void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, LUS::Direction direction); + void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction, std::string id); + void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction); void DrawStickSection(uint8_t port, uint8_t stick, int32_t id, ImVec4 color); void DrawRumbleSection(uint8_t port); @@ -74,20 +74,20 @@ class SohInputEditorWindow : public LUS::GuiWindow { int32_t mGameInputBlockTimer; int32_t mMappingInputBlockTimer; int32_t mRumbleTimer; - std::shared_ptr mRumbleMappingToTest; + std::shared_ptr mRumbleMappingToTest; // mBitmaskToMappingIds[port][bitmask] = { id0, id1, ... } std::unordered_map>> mBitmaskToMappingIds; // mStickDirectionToMappingIds[port][stick][direction] = { id0, id1, ... } std::unordered_map>>> + std::unordered_map>>> mStickDirectionToMappingIds; void UpdateBitmaskToMappingIds(uint8_t port); void UpdateStickDirectionToMappingIds(uint8_t port); - void GetButtonColorsForLUSDeviceIndex(LUS::LUSDeviceIndex lusIndex, ImVec4& buttonColor, + void GetButtonColorsForLUSDeviceIndex(Ship::ShipDeviceIndex lusIndex, ImVec4& buttonColor, ImVec4& buttonHoveredColor); void DrawLinkTab(); void DrawIvanTab(); @@ -97,7 +97,7 @@ class SohInputEditorWindow : public LUS::GuiWindow { std::set mDpadBitmasks; std::set mModifierButtonsBitmasks; void DrawButtonDeviceIcons(uint8_t portIndex, std::set bitmasks); - void DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::Stick stick); + void DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick); void DrawRumbleDeviceIcons(uint8_t portIndex); void DrawGyroDeviceIcons(uint8_t portIndex); void DrawLEDDeviceIcons(uint8_t portIndex); diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 65659a80f..51eabd08d 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -1322,7 +1322,7 @@ void Draw_Placements(){ if (ImGui::Button("Reset##EnemyHealthBarWidth")) { CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Value")); CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Changed")); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::NewLine(); ImGui::EndTable(); @@ -1333,7 +1333,7 @@ void Reset_Option_Single(const char* Button_Title, const char* name) { ImGui::SameLine(); if (ImGui::Button(Button_Title)) { CVarClear(name); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } void Reset_Option_Double(const char* Button_Title, const char* name) { @@ -1341,14 +1341,14 @@ void Reset_Option_Double(const char* Button_Title, const char* name) { if (ImGui::Button(Button_Title)) { CVarClear((std::string(name) + ".Value").c_str()); CVarClear((std::string(name) + ".Changed").c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } void DrawSillyTab() { ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0)); if (CVarGetInteger("gLetItSnow", 0)) { if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %.3fx", "##Link_BodyScale", CVAR_COSMETIC("Link.BodyScale.Value"), 0.001f, 0.025f, "", 0.01f, true)) { @@ -1358,7 +1358,7 @@ void DrawSillyTab() { if (ImGui::Button("Reset##Link_BodyScale")) { CVarClear(CVAR_COSMETIC("Link.BodyScale.Value")); CVarClear(CVAR_COSMETIC("Link.BodyScale.Changed")); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); if (gPlayState != nullptr) { static Player* player = GET_PLAYER(gPlayState); player->actor.scale.x = 0.01f; @@ -1612,7 +1612,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { CVarSetInteger((cosmeticOption.changedCvar), 1); ApplySideEffects(cosmeticOption); ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); ImGui::Text("%s", cosmeticOption.label.c_str()); @@ -1620,7 +1620,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) { RandomizeColor(cosmeticOption); ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (cosmeticOption.supportsRainbow) { ImGui::SameLine(); @@ -1630,21 +1630,21 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { CVarSetInteger((cosmeticOption.changedCvar), 1); ApplySideEffects(cosmeticOption); ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } ImGui::SameLine(); bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0); if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) { CVarSetInteger((cosmeticOption.lockedCvar), isLocked); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (CVarGetInteger((cosmeticOption.changedCvar), 0)) { ImGui::SameLine(); if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) { ResetColor(cosmeticOption); ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } } @@ -1660,7 +1660,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { } } ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); if (ImGui::Button(("Reset##" + label).c_str())) { @@ -1670,7 +1670,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { } } ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } for (auto& [id, cosmeticOption] : cosmeticOptions) { if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) { @@ -1706,7 +1706,7 @@ void CosmeticsEditorWindow::DrawElement() { CVarSetInteger(cosmeticOption.lockedCvar, 1); } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { @@ -1715,7 +1715,7 @@ void CosmeticsEditorWindow::DrawElement() { CVarSetInteger(cosmeticOption.lockedCvar, 0); } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } UIWidgets::EnhancementCheckbox("Sync Rainbow colors", CVAR_COSMETIC("RainbowSync")); @@ -1734,7 +1734,7 @@ void CosmeticsEditorWindow::DrawElement() { } } ApplyOrResetCustomGfxPatches(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { @@ -1743,7 +1743,7 @@ void CosmeticsEditorWindow::DrawElement() { CVarSetInteger(cosmeticOption.lockedCvar, 1); } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { @@ -1752,7 +1752,7 @@ void CosmeticsEditorWindow::DrawElement() { CVarSetInteger(cosmeticOption.lockedCvar, 0); } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { @@ -1777,7 +1777,7 @@ void CosmeticsEditorWindow::DrawElement() { if (ImGui::Button("Reset##Trails_Duration")) { CVarClear(CVAR_COSMETIC("Trails.Duration.Value")); CVarClear(CVAR_COSMETIC("Trails.Duration.Changed")); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::EndTabItem(); } @@ -1843,7 +1843,7 @@ void CosmeticsEditorWindow::InitElement() { cosmeticOption.currentColor.z = cvarColor.b / 255.0; cosmeticOption.currentColor.w = cvarColor.a / 255.0; } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); ApplyAuthenticGfxPatches(); @@ -1860,7 +1860,7 @@ void CosmeticsEditor_RandomizeAll() { } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); } @@ -1873,7 +1873,7 @@ void CosmeticsEditor_RandomizeGroup(CosmeticGroup group) { } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); } @@ -1884,7 +1884,7 @@ void CosmeticsEditor_ResetAll() { } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); } @@ -1895,6 +1895,6 @@ void CosmeticsEditor_ResetGroup(CosmeticGroup group) { } } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); } diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h index 9599a521f..88f60c76c 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h @@ -54,7 +54,7 @@ void CosmeticsEditor_ResetAll(); void CosmeticsEditor_ResetGroup(CosmeticGroup group); void ApplyOrResetCustomGfxPatches(bool manualChange = true); -class CosmeticsEditorWindow : public LUS::GuiWindow { +class CosmeticsEditorWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index e75450c7c..7c73ea61e 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -36,12 +36,12 @@ extern PlayState* gPlayState; #include #include -#define CMD_REGISTER LUS::Context::GetInstance()->GetConsole()->AddCommand +#define CMD_REGISTER Ship::Context::GetInstance()->GetConsole()->AddCommand // TODO: Commands should be using the output passed in. -#define ERROR_MESSAGE std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendErrorMessage -#define INFO_MESSAGE std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendInfoMessage +#define ERROR_MESSAGE std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendErrorMessage +#define INFO_MESSAGE std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendInfoMessage -static bool ActorSpawnHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool ActorSpawnHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if ((args.size() != 9) && (args.size() != 3) && (args.size() != 6)) { ERROR_MESSAGE("Not enough arguments passed to actorspawn"); return 1; @@ -101,7 +101,7 @@ static bool ActorSpawnHandler(std::shared_ptr Console, const std:: return 0; } -static bool KillPlayerHandler(std::shared_ptr Console, const std::vector&, std::string* output) { +static bool KillPlayerHandler(std::shared_ptr Console, const std::vector&, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::SetPlayerHealth(); dynamic_cast(effect)->parameters[0] = 0; GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -114,7 +114,7 @@ static bool KillPlayerHandler(std::shared_ptr Console, const std:: } } -static bool SetPlayerHealthHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool SetPlayerHealthHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -145,7 +145,7 @@ static bool SetPlayerHealthHandler(std::shared_ptr Console, const } } -static bool LoadSceneHandler(std::shared_ptr Console, const std::vector&, std::string* output) { +static bool LoadSceneHandler(std::shared_ptr Console, const std::vector&, std::string* output) { gSaveContext.respawnFlag = 0; gSaveContext.seqId = 0xFF; gSaveContext.gameMode = 0; @@ -153,7 +153,7 @@ static bool LoadSceneHandler(std::shared_ptr Console, const std::v return 0; } -static bool RupeeHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool RupeeHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { return 1; } @@ -178,7 +178,7 @@ static bool RupeeHandler(std::shared_ptr Console, const std::vecto return 0; } -static bool SetPosHandler(std::shared_ptr Console, const std::vector args, std::string* output) { +static bool SetPosHandler(std::shared_ptr Console, const std::vector args, std::string* output) { if (gPlayState == nullptr) { ERROR_MESSAGE("PlayState == nullptr"); return 1; @@ -205,7 +205,7 @@ static bool SetPosHandler(std::shared_ptr Console, const std::vect return 0; } -static bool ResetHandler(std::shared_ptr Console, std::vector args, std::string* output) { +static bool ResetHandler(std::shared_ptr Console, std::vector args, std::string* output) { if (gPlayState == nullptr) { ERROR_MESSAGE("PlayState == nullptr"); return 1; @@ -225,7 +225,7 @@ const static std::map ammoItems{ { "beans", ITEM_BEAN } }; -static bool AddAmmoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool AddAmmoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 3) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -264,7 +264,7 @@ static bool AddAmmoHandler(std::shared_ptr Console, const std::vec } } -static bool TakeAmmoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool TakeAmmoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 3) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -311,7 +311,7 @@ const static std::map bottleItems{ { "big_poe", ITEM_BIG_POE }, { "blue_fire", ITEM_BLUE_FIRE }, { "rutos_letter", ITEM_LETTER_RUTO }, }; -static bool BottleHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool BottleHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 3) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -343,7 +343,7 @@ static bool BottleHandler(std::shared_ptr Console, const std::vect return 0; } -static bool BHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool BHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -353,7 +353,7 @@ static bool BHandler(std::shared_ptr Console, const std::vector Console, const std::vector& args, std::string* output) { +static bool ItemHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 3) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -364,7 +364,7 @@ static bool ItemHandler(std::shared_ptr Console, const std::vector return 0; } -static bool GiveItemHandler(std::shared_ptr Console, const std::vector args, std::string* output) { +static bool GiveItemHandler(std::shared_ptr Console, const std::vector args, std::string* output) { if (args.size() < 3) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -385,7 +385,7 @@ static bool GiveItemHandler(std::shared_ptr Console, const std::ve return 0; } -static bool EntranceHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool EntranceHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -406,7 +406,7 @@ static bool EntranceHandler(std::shared_ptr Console, const std::ve gSaveContext.nextTransitionType = TRANS_TYPE_INSTANT; } -static bool VoidHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool VoidHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (gPlayState != nullptr) { gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = gPlayState->actorCtx.flags.tempSwch; gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = gPlayState->actorCtx.flags.tempCollect; @@ -422,7 +422,7 @@ static bool VoidHandler(std::shared_ptr Console, const std::vector return 0; } -static bool ReloadHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool ReloadHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (gPlayState != nullptr) { gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; gPlayState->transitionTrigger = TRANS_TRIGGER_START; @@ -439,7 +439,7 @@ const static std::map fw_options { { "clear", 0}, {"warp", 1}, {"backup", 2} }; -static bool FWHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool FWHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -491,7 +491,7 @@ static bool FWHandler(std::shared_ptr Console, const std::vector Console, const std::vector& args, std::string* output) { +static bool FileSelectHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (gPlayState != nullptr) { SET_NEXT_GAMESTATE(&gPlayState->state, FileChoose_Init, FileChooseContext); gPlayState->state.running = 0; @@ -502,12 +502,12 @@ static bool FileSelectHandler(std::shared_ptr Console, const std:: return 0; } -static bool QuitHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { - LUS::Context::GetInstance()->GetWindow()->Close(); +static bool QuitHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { + Ship::Context::GetInstance()->GetWindow()->Close(); return 0; } -static bool SaveStateHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool SaveStateHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE }); @@ -521,7 +521,7 @@ static bool SaveStateHandler(std::shared_ptr Console, const std::v } } -static bool LoadStateHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool LoadStateHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD }); @@ -542,7 +542,7 @@ static bool LoadStateHandler(std::shared_ptr Console, const std::v } -static bool StateSlotSelectHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool StateSlotSelectHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -567,7 +567,7 @@ static bool StateSlotSelectHandler(std::shared_ptr Console, const return 0; } -static bool InvisibleHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool InvisibleHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -594,7 +594,7 @@ static bool InvisibleHandler(std::shared_ptr Console, const std::v } } -static bool GiantLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool GiantLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -622,7 +622,7 @@ static bool GiantLinkHandler(std::shared_ptr Console, const std::v } } -static bool MinishLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool MinishLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -650,7 +650,7 @@ static bool MinishLinkHandler(std::shared_ptr Console, const std:: } } -static bool AddHeartContainerHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool AddHeartContainerHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -681,7 +681,7 @@ static bool AddHeartContainerHandler(std::shared_ptr Console, cons } } -static bool RemoveHeartContainerHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool RemoveHeartContainerHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -712,7 +712,7 @@ static bool RemoveHeartContainerHandler(std::shared_ptr Console, c } } -static bool GravityHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool GravityHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -721,7 +721,7 @@ static bool GravityHandler(std::shared_ptr Console, const std::vec GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyGravity(); try { - dynamic_cast(effect)->parameters[0] = LUS::Math::clamp(std::stoi(args[1], nullptr, 10), GI_GRAVITY_LEVEL_LIGHT, GI_GRAVITY_LEVEL_HEAVY); + dynamic_cast(effect)->parameters[0] = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), GI_GRAVITY_LEVEL_LIGHT, GI_GRAVITY_LEVEL_HEAVY); } catch (std::invalid_argument const& ex) { ERROR_MESSAGE("[SOH] Gravity value must be a number."); return 1; @@ -737,7 +737,7 @@ static bool GravityHandler(std::shared_ptr Console, const std::vec } } -static bool NoUIHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool NoUIHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -765,7 +765,7 @@ static bool NoUIHandler(std::shared_ptr Console, const std::vector } } -static bool FreezeHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool FreezeHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::FreezePlayer(); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -778,7 +778,7 @@ static bool FreezeHandler(std::shared_ptr Console, const std::vect } } -static bool DefenseModifierHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool DefenseModifierHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -802,7 +802,7 @@ static bool DefenseModifierHandler(std::shared_ptr Console, const } } -static bool DamageHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool DamageHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -832,7 +832,7 @@ static bool DamageHandler(std::shared_ptr Console, const std::vect } } -static bool HealHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool HealHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -862,7 +862,7 @@ static bool HealHandler(std::shared_ptr Console, const std::vector } } -static bool FillMagicHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool FillMagicHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::FillMagic(); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -875,7 +875,7 @@ static bool FillMagicHandler(std::shared_ptr Console, const std::v } } -static bool EmptyMagicHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool EmptyMagicHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::EmptyMagic(); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -888,7 +888,7 @@ static bool EmptyMagicHandler(std::shared_ptr Console, const std:: } } -static bool NoZHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool NoZHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -916,7 +916,7 @@ static bool NoZHandler(std::shared_ptr Console, const std::vector< } } -static bool OneHitKOHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool OneHitKOHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -944,7 +944,7 @@ static bool OneHitKOHandler(std::shared_ptr Console, const std::ve } } -static bool PacifistHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool PacifistHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -972,7 +972,7 @@ static bool PacifistHandler(std::shared_ptr Console, const std::ve } } -static bool PaperLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool PaperLinkHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1001,7 +1001,7 @@ static bool PaperLinkHandler(std::shared_ptr Console, const std::v } } -static bool RainstormHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool RainstormHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1029,7 +1029,7 @@ static bool RainstormHandler(std::shared_ptr Console, const std::v } } -static bool ReverseControlsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool ReverseControlsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1058,7 +1058,7 @@ static bool ReverseControlsHandler(std::shared_ptr Console, const } } -static bool UpdateRupeesHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool UpdateRupeesHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1082,7 +1082,7 @@ static bool UpdateRupeesHandler(std::shared_ptr Console, const std } } -static bool SpeedModifierHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool SpeedModifierHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1112,7 +1112,7 @@ const static std::map boots { { "hover", EQUIP_VALUE_BOOTS_HOVER }, }; -static bool BootsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool BootsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1143,7 +1143,7 @@ const static std::map shields { { "mirror", ITEM_SHIELD_MIRROR }, }; -static bool GiveShieldHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool GiveShieldHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1168,7 +1168,7 @@ static bool GiveShieldHandler(std::shared_ptr Console, const std:: } } -static bool TakeShieldHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool TakeShieldHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1193,7 +1193,7 @@ static bool TakeShieldHandler(std::shared_ptr Console, const std:: } } -static bool KnockbackHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool KnockbackHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1223,7 +1223,7 @@ static bool KnockbackHandler(std::shared_ptr Console, const std::v } } -static bool ElectrocuteHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool ElectrocuteHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::ElectrocutePlayer(); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -1236,7 +1236,7 @@ static bool ElectrocuteHandler(std::shared_ptr Console, const std: } } -static bool BurnHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool BurnHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectBase* effect = new GameInteractionEffect::BurnPlayer(); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); @@ -1249,7 +1249,7 @@ static bool BurnHandler(std::shared_ptr Console, const std::vector } } -static bool CuccoStormHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool CuccoStormHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { GameInteractionEffectQueryResult result = GameInteractor::RawAction::SpawnActor(ACTOR_EN_NIW, 0); if (result == GameInteractionEffectQueryResult::Possible) { @@ -1261,7 +1261,7 @@ static bool CuccoStormHandler(std::shared_ptr Console, const std:: } } -static bool GenerateRandoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool GenerateRandoHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() == 1) { if (GenerateRandomizer()) { return 0; @@ -1309,7 +1309,7 @@ static constexpr std::array, COSMETICS_GRO {"ivan", COSMETICS_GROUP_IVAN}, }}; -static bool CosmeticsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool CosmeticsHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1361,7 +1361,7 @@ static std::map sfx_groups = { {"custom", SEQ_BGM_CUSTOM}, }; -static bool SfxHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { +static bool SfxHandler(std::shared_ptr Console, const std::vector& args, std::string* output) { if (args.size() < 2) { ERROR_MESSAGE("[SOH] Unexpected arguments passed"); return 1; @@ -1411,17 +1411,17 @@ void DebugConsole_Init(void) { CMD_REGISTER("save_state", {SaveStateHandler, "Save a state."}); CMD_REGISTER("load_state", {LoadStateHandler, "Load a state."}); CMD_REGISTER("set_slot", {StateSlotSelectHandler, "Selects a SaveState slot", { - {"Slot number", LUS::ArgumentType::NUMBER,} + {"Slot number", Ship::ArgumentType::NUMBER,} }}); // Map & Location CMD_REGISTER("void", {VoidHandler, "Voids out of the current map."}); CMD_REGISTER("reload", {ReloadHandler, "Reloads the current map."}); CMD_REGISTER("fw", {FWHandler, "Spawns the player where Farore's Wind is set.", { - {"clear|warp|backup", LUS::ArgumentType::TEXT} + {"clear|warp|backup", Ship::ArgumentType::TEXT} }}); CMD_REGISTER("entrance", {EntranceHandler, "Sends player to the entered entrance (hex)", { - {"entrance", LUS::ArgumentType::NUMBER} + {"entrance", Ship::ArgumentType::NUMBER} }}); // Gameplay @@ -1430,64 +1430,64 @@ void DebugConsole_Init(void) { CMD_REGISTER("map", {LoadSceneHandler, "Load up kak?"}); CMD_REGISTER("rupee", {RupeeHandler, "Set your rupee counter.", { - {"amount", LUS::ArgumentType::NUMBER} + {"amount", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("bItem", {BHandler, "Set an item to the B button.", { - {"Item ID", LUS::ArgumentType::NUMBER} + {"Item ID", Ship::ArgumentType::NUMBER} }}); - CMD_REGISTER("spawn", { ActorSpawnHandler, "Spawn an actor.", { { "actor name/id", LUS::ArgumentType::NUMBER }, // TODO there should be an actor_id arg type - {"data", LUS::ArgumentType::NUMBER}, - {"x", LUS::ArgumentType::NUMBER, true}, - {"y", LUS::ArgumentType::NUMBER, true}, - {"z", LUS::ArgumentType::NUMBER, true}, - {"rx", LUS::ArgumentType::NUMBER, true}, - {"ry", LUS::ArgumentType::NUMBER, true}, - {"rz", LUS::ArgumentType::NUMBER, true} + CMD_REGISTER("spawn", { ActorSpawnHandler, "Spawn an actor.", { { "actor name/id", Ship::ArgumentType::NUMBER }, // TODO there should be an actor_id arg type + {"data", Ship::ArgumentType::NUMBER}, + {"x", Ship::ArgumentType::NUMBER, true}, + {"y", Ship::ArgumentType::NUMBER, true}, + {"z", Ship::ArgumentType::NUMBER, true}, + {"rx", Ship::ArgumentType::NUMBER, true}, + {"ry", Ship::ArgumentType::NUMBER, true}, + {"rz", Ship::ArgumentType::NUMBER, true} }}); CMD_REGISTER("pos", {SetPosHandler, "Sets the position of the player.", { - {"x", LUS::ArgumentType::NUMBER, true}, - {"y", LUS::ArgumentType::NUMBER, true}, - {"z", LUS::ArgumentType::NUMBER, true} + {"x", Ship::ArgumentType::NUMBER, true}, + {"y", Ship::ArgumentType::NUMBER, true}, + {"z", Ship::ArgumentType::NUMBER, true} }}); CMD_REGISTER("addammo", {AddAmmoHandler, "Adds ammo of an item.", { - {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", LUS::ArgumentType::TEXT}, - {"count", LUS::ArgumentType::NUMBER} + {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", Ship::ArgumentType::TEXT}, + {"count", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("takeammo", {TakeAmmoHandler, "Removes ammo of an item.", { - {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", LUS::ArgumentType::TEXT}, - {"count", LUS::ArgumentType::NUMBER} + {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", Ship::ArgumentType::TEXT}, + {"count", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("bottle", {BottleHandler, "Changes item in a bottle slot.", { - {"item", LUS::ArgumentType::TEXT}, - {"slot", LUS::ArgumentType::NUMBER} + {"item", Ship::ArgumentType::TEXT}, + {"slot", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("give_item", {GiveItemHandler, "Gives an item to the player as if it was given from an actor", { - {"vanilla|randomizer", LUS::ArgumentType::TEXT}, - {"giveItemID", LUS::ArgumentType::NUMBER} + {"vanilla|randomizer", Ship::ArgumentType::TEXT}, + {"giveItemID", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("item", {ItemHandler, "Sets item ID in arg 1 into slot arg 2. No boundary checks. Use with caution.", { - {"slot", LUS::ArgumentType::NUMBER}, - {"item id", LUS::ArgumentType::NUMBER} + {"slot", Ship::ArgumentType::NUMBER}, + {"item id", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("invisible", {InvisibleHandler, "Activate Link's Elvish cloak, making him appear invisible.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("giant_link", {GiantLinkHandler, "Turn Link into a giant Lonky boi.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("minish_link", {MinishLinkHandler, "Turn Link into a minish boi.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("add_heart_container", @@ -1497,25 +1497,25 @@ void DebugConsole_Init(void) { {RemoveHeartContainerHandler, "Remove a heart from Link. The minimal amount of hearts is 3."}); CMD_REGISTER("gravity", {GravityHandler, "Set gravity level.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("no_ui", {NoUIHandler, "Disables the UI.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("freeze", {FreezeHandler, "Freezes Link in place"}); CMD_REGISTER("defense_modifier", {DefenseModifierHandler, "Sets the defense modifier.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("damage", {DamageHandler, "Deal damage to Link.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("heal", {HealHandler, "Heals Link.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("fill_magic", {FillMagicHandler, "Fills magic."}); @@ -1523,50 +1523,50 @@ void DebugConsole_Init(void) { CMD_REGISTER("empty_magic", {EmptyMagicHandler, "Empties magic."}); CMD_REGISTER("no_z", {NoZHandler, "Disables Z-button presses.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("ohko", {OneHitKOHandler, "Activates one hit KO. Any damage kills Link and he cannot gain health in this mode.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("pacifist", {PacifistHandler, "Activates pacifist mode. Prevents Link from using his weapon.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("paper_link", {PaperLinkHandler, "Link but made out of paper.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("rainstorm", {RainstormHandler, "Activates rainstorm."}); CMD_REGISTER("reverse_controls", {ReverseControlsHandler, "Reverses the controls.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("update_rupees", {UpdateRupeesHandler, "Adds rupees.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("speed_modifier", {SpeedModifierHandler, "Sets the speed modifier.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("boots", {BootsHandler, "Activates boots.", { - {"kokiri|iron|hover", LUS::ArgumentType::TEXT}, + {"kokiri|iron|hover", Ship::ArgumentType::TEXT}, }}); CMD_REGISTER("giveshield", {GiveShieldHandler, "Gives a shield and equips it when Link is the right age for it.", { - {"deku|hylian|mirror", LUS::ArgumentType::TEXT}, + {"deku|hylian|mirror", Ship::ArgumentType::TEXT}, }}); CMD_REGISTER("takeshield", {TakeShieldHandler, "Takes a shield and unequips it if Link is wearing it.", { - {"deku|hylian|mirror", LUS::ArgumentType::TEXT}, + {"deku|hylian|mirror", Ship::ArgumentType::TEXT}, }}); CMD_REGISTER("knockback", {KnockbackHandler, "Knocks Link back.", { - {"value", LUS::ArgumentType::NUMBER} + {"value", Ship::ArgumentType::NUMBER} }}); CMD_REGISTER("electrocute", {ElectrocuteHandler, "Electrocutes Link."}); @@ -1576,18 +1576,18 @@ void DebugConsole_Init(void) { CMD_REGISTER("cucco_storm", {CuccoStormHandler, "Cucco Storm"}); CMD_REGISTER("gen_rando", {GenerateRandoHandler, "Generate a randomizer seed", { - {"seed|count", LUS::ArgumentType::NUMBER, true}, - {"testing", LUS::ArgumentType::NUMBER, true}, + {"seed|count", Ship::ArgumentType::NUMBER, true}, + {"testing", Ship::ArgumentType::NUMBER, true}, }}); CMD_REGISTER("cosmetics", {CosmeticsHandler, "Change cosmetics.", { - {"reset|randomize", LUS::ArgumentType::TEXT}, - {"group name", LUS::ArgumentType::TEXT, true}, + {"reset|randomize", Ship::ArgumentType::TEXT}, + {"group name", Ship::ArgumentType::TEXT, true}, }}); CMD_REGISTER("sfx", {SfxHandler, "Change SFX.", { - {"reset|randomize", LUS::ArgumentType::TEXT}, - {"group_name", LUS::ArgumentType::TEXT, true}, + {"reset|randomize", Ship::ArgumentType::TEXT}, + {"group_name", Ship::ArgumentType::TEXT, true}, }}); CVarSave(); diff --git a/soh/soh/Enhancements/debugger/MessageViewer.h b/soh/soh/Enhancements/debugger/MessageViewer.h index 702693793..43ae55aa7 100644 --- a/soh/soh/Enhancements/debugger/MessageViewer.h +++ b/soh/soh/Enhancements/debugger/MessageViewer.h @@ -26,7 +26,7 @@ void MessageDebug_DisplayCustomMessage(const char* customMessage); } -class MessageViewer : public LUS::GuiWindow { +class MessageViewer : public Ship::GuiWindow { public: static inline const char* TABLE_ID = "MessageViewer"; using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugger/actorViewer.h b/soh/soh/Enhancements/debugger/actorViewer.h index 6eceaa92d..2f4ca680a 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.h +++ b/soh/soh/Enhancements/debugger/actorViewer.h @@ -2,7 +2,7 @@ #include -class ActorViewerWindow : public LUS::GuiWindow { +class ActorViewerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugger/colViewer.h b/soh/soh/Enhancements/debugger/colViewer.h index 98f0b6f0a..5252bc950 100644 --- a/soh/soh/Enhancements/debugger/colViewer.h +++ b/soh/soh/Enhancements/debugger/colViewer.h @@ -14,7 +14,7 @@ typedef enum { } ColViewerRenderSetting; #ifdef __cplusplus -class ColViewerWindow : public LUS::GuiWindow { +class ColViewerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index f90ab739c..f7b85251c 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -614,7 +614,7 @@ void DrawInfoTab() { void DrawBGSItemFlag(uint8_t itemID) { const ItemMapEntry& slotEntry = itemMapping[itemID]; - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); ImGui::SameLine(); int tradeIndex = itemID - ITEM_POCKET_EGG; bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0; @@ -656,7 +656,7 @@ void DrawInventoryTab() { uint8_t item = gSaveContext.inventory.items[index]; if (item != ITEM_NONE) { const ItemMapEntry& slotEntry = itemMapping.find(item)->second; - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { selectedIndex = index; ImGui::OpenPopup(itemPopupPicker); @@ -704,7 +704,7 @@ void DrawInventoryTab() { ImGui::SameLine(); } const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { gSaveContext.inventory.items[selectedIndex] = slotEntry.id; // Set adult trade item flag if you're playing adult trade shuffle in rando @@ -742,7 +742,7 @@ void DrawInventoryTab() { ImGui::PushItemWidth(32.0f); ImGui::BeginGroup(); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item)); ImGui::EndGroup(); @@ -1157,7 +1157,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const uint8_t item = items[CUR_UPG_VALUE(categoryId)]; if (item != ITEM_NONE) { const ItemMapEntry& slotEntry = itemMapping[item]; - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImGui::OpenPopup(upgradePopupPicker); } @@ -1185,7 +1185,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const UIWidgets::SetLastItemHoverText("None"); } else { const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]]; - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { Inventory_ChangeUpgrade(categoryId, pickerIndex); ImGui::CloseCurrentPopup(); @@ -1222,7 +1222,7 @@ void DrawEquipmentTab() { bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasEquip) { gSaveContext.inventory.equipment &= ~bitMask; @@ -1321,7 +1321,7 @@ void DrawQuestItemButton(uint32_t item) { uint32_t bitMask = 1 << entry.id; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasQuestItem) { gSaveContext.inventory.questItems &= ~bitMask; @@ -1339,7 +1339,7 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) { uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasItem) { gSaveContext.inventory.dungeonItems[scene] &= ~bitMask; @@ -1386,7 +1386,7 @@ void DrawQuestStatusTab() { uint32_t bitMask = 1 << entry.id; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasQuestItem) { gSaveContext.inventory.questItems &= ~bitMask; @@ -1449,7 +1449,7 @@ void DrawQuestStatusTab() { if (dungeonItemsScene != SCENE_JABU_JABU_BOSS) { float lineHeight = ImGui::GetTextLineHeightWithSpacing(); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); ImGui::SameLine(); if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) { gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene]; @@ -1793,34 +1793,34 @@ void SaveEditorWindow::DrawElement() { void SaveEditorWindow::InitElement() { // Load item icons into ImGui for (const auto& entry : itemMapping) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } for (const auto& entry : gregMapping) { ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f); ImVec4 gregFadedGreen = gregGreen; gregFadedGreen.w = 0.3f; - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); } for (const auto& entry : triforcePieceMapping) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } for (const auto& entry : questMapping) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } for (const auto& entry : songMapping) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); ImVec4 fadedCol = entry.color; fadedCol.w = 0.3f; - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); } for (const auto& entry : vanillaSongMapping) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); ImVec4 fadedCol = entry.color; fadedCol.w = 0.3f; - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); } } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.h b/soh/soh/Enhancements/debugger/debugSaveEditor.h index 01557efef..1de852e35 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.h +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.h @@ -590,7 +590,7 @@ const std::vector state3 = { "Travelling to Hook Target" }; -class SaveEditorWindow : public LUS::GuiWindow { +class SaveEditorWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugger/dlViewer.cpp b/soh/soh/Enhancements/debugger/dlViewer.cpp index 028234fc1..790f426df 100644 --- a/soh/soh/Enhancements/debugger/dlViewer.cpp +++ b/soh/soh/Enhancements/debugger/dlViewer.cpp @@ -65,7 +65,7 @@ std::map cmdMap = { }; void PerformDisplayListSearch() { - auto result = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles("*" + std::string(searchString) + "*DL*"); + auto result = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles("*" + std::string(searchString) + "*DL*"); displayListSearchResults.clear(); @@ -127,7 +127,7 @@ void DLViewerWindow::DrawElement() { } try { - auto res = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList)); + auto res = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList)); if (res->GetInitData()->Type != static_cast(LUS::ResourceType::DisplayList)) { ImGui::Text("Resource type is not a Display List. Please choose another."); diff --git a/soh/soh/Enhancements/debugger/dlViewer.h b/soh/soh/Enhancements/debugger/dlViewer.h index 348372a49..9d2785456 100644 --- a/soh/soh/Enhancements/debugger/dlViewer.h +++ b/soh/soh/Enhancements/debugger/dlViewer.h @@ -2,7 +2,7 @@ #include -class DLViewerWindow : public LUS::GuiWindow { +class DLViewerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/debugger/valueViewer.h b/soh/soh/Enhancements/debugger/valueViewer.h index 7631b8c3f..747d39018 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.h +++ b/soh/soh/Enhancements/debugger/valueViewer.h @@ -33,7 +33,7 @@ typedef struct { uint32_t y; } ValueTableElement; -class ValueViewerWindow : public LUS::GuiWindow { +class ValueViewerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 229f76cbb..cf098bda3 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -459,7 +459,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint break; } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ApplyOrResetCustomGfxPatches(); } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Sail.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Sail.cpp index a209d8c50..77d48dc80 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Sail.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Sail.cpp @@ -66,7 +66,7 @@ void GameInteractorSail::HandleRemoteJson(nlohmann::json payload) { } std::string command = payload["command"].get(); - std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); + std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); responsePayload["status"] = "success"; GameInteractor::Instance->TransmitJsonToRemote(responsePayload); return; @@ -88,7 +88,7 @@ void GameInteractorSail::HandleRemoteJson(nlohmann::json payload) { } std::string command = payload["effect"]["command"].get(); - std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); + std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); responsePayload["status"] = "success"; GameInteractor::Instance->TransmitJsonToRemote(responsePayload); return; diff --git a/soh/soh/Enhancements/gameplaystatswindow.h b/soh/soh/Enhancements/gameplaystatswindow.h index 2a3786415..453b24559 100644 --- a/soh/soh/Enhancements/gameplaystatswindow.h +++ b/soh/soh/Enhancements/gameplaystatswindow.h @@ -1,7 +1,7 @@ #include #include "gameplaystats.h" -class GameplayStatsWindow : public LUS::GuiWindow { +class GameplayStatsWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index a10dd559b..8f9819f08 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -462,7 +462,7 @@ void RegisterDeleteFileOnDeath() { if (gPlayState->gameOverCtx.state == GAMEOVER_DEATH_MENU && gPlayState->pauseCtx.state == 9) { SaveManager::Instance->DeleteZeldaFile(gSaveContext.fileNum); hasAffectedHealth = false; - std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); + std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); } }); } diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index 726863e05..ea51502e3 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -70,7 +70,7 @@ void DrawPresetSelector(PresetType presetTypeId) { if (selectedPresetId != 0) { applyPreset(selectedPresetDef.entries); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::PopStyleVar(1); } diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index 167e12667..e53caeef2 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -18,7 +18,7 @@ void RandoMain::GenerateRando(std::unordered_map cvarS // std::string settingsFileName = "./randomizer/latest_settings.json"; // CVarSetString("gLoadedPreset", settingsFileName.c_str()); - std::string fileName = LUS::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, enabledTricks, seedString).c_str()); + std::string fileName = Ship::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, enabledTricks, seedString).c_str()); CVarSetString("gSpoilerLog", fileName.c_str()); CVarSave(); diff --git a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp index ce885aec5..235996273 100644 --- a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp @@ -895,8 +895,8 @@ const char* SpoilerLog_Write(int language) { WriteAllLocations(language); //WriteHintData(language); - if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"))) { - std::filesystem::create_directory(LUS::Context::GetPathRelativeToAppDirectory("Randomizer")); + if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"))) { + std::filesystem::create_directory(Ship::Context::GetPathRelativeToAppDirectory("Randomizer")); } std::string jsonString = jsonData.dump(4); @@ -911,7 +911,7 @@ const char* SpoilerLog_Write(int language) { fileNameStream << std::to_string(Settings::hashIconIndexes[i]); } std::string fileName = fileNameStream.str(); - std::ofstream jsonFile(LUS::Context::GetPathRelativeToAppDirectory( + std::ofstream jsonFile(Ship::Context::GetPathRelativeToAppDirectory( (std::string("Randomizer/") + fileName + std::string(".json")).c_str())); jsonFile << std::setw(4) << jsonString << std::endl; jsonFile.close(); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 40b3daaf3..0c7f30e0f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4683,7 +4683,7 @@ void RandomizerSettingsWindow::DrawElement() { excludedLocationString += ","; } CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); ImGui::Text("%s", rcObject->rcShortName.c_str()); @@ -4728,7 +4728,7 @@ void RandomizerSettingsWindow::DrawElement() { } else { CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str()); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); ImGui::Text("%s", rcObject->rcShortName.c_str()); @@ -4914,7 +4914,7 @@ void RandomizerSettingsWindow::DrawElement() { enabledTrickString += ","; } CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks")); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Enable All")) { @@ -4931,7 +4931,7 @@ void RandomizerSettingsWindow::DrawElement() { enabledTrickString += ","; } CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } if (ImGui::BeginTable("trickTags", showTag.size(), ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_Borders)) { @@ -5008,7 +5008,7 @@ void RandomizerSettingsWindow::DrawElement() { enabledTrickString += ","; } CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::BeginChild("ChildTricksDisabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar); @@ -5044,7 +5044,7 @@ void RandomizerSettingsWindow::DrawElement() { enabledTrickString += ","; } CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } DrawTagChips(*rtObject.rtTags); ImGui::SameLine(); @@ -5118,7 +5118,7 @@ void RandomizerSettingsWindow::DrawElement() { enabledTrickString += ","; } CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks")); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::BeginChild("ChildTricksEnabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar); @@ -5160,7 +5160,7 @@ void RandomizerSettingsWindow::DrawElement() { } else { CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } DrawTagChips(*rtObject.rtTags); ImGui::SameLine(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 1123cba72..20b5c333d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -877,7 +877,7 @@ void CheckTrackerWindow::DrawElement() { if (CVarGetInteger(CVAR_TRACKER_CHECK("DisplayType"), TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_COMBO_BUTTON) { int comboButton1Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton1"), TRACKER_COMBO_BUTTON_L)]; int comboButton2Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton2"), TRACKER_COMBO_BUTTON_R)]; - OSContPad* trackerButtonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); + OSContPad* trackerButtonsPressed = Ship::Context::GetInstance()->GetControlDeck()->GetPads(); bool comboButtonsHeld = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & comboButton1Mask && trackerButtonsPressed[0].button & comboButton2Mask; diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.h index 85a4f1d9e..216da367f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.h @@ -7,9 +7,9 @@ namespace CheckTracker { -class CheckTrackerSettingsWindow : public LUS::GuiWindow { +class CheckTrackerSettingsWindow : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; ~CheckTrackerSettingsWindow() {}; protected: @@ -18,9 +18,9 @@ class CheckTrackerSettingsWindow : public LUS::GuiWindow { void UpdateElement() override {}; }; -class CheckTrackerWindow : public LUS::GuiWindow { +class CheckTrackerWindow : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; ~CheckTrackerWindow() {}; protected: diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h index fc5346aa3..87d736058 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h @@ -85,7 +85,7 @@ s16 GetLastEntranceOverride(); s16 GetCurrentGrottoId(); const EntranceData* GetEntranceData(s16); -class EntranceTrackerWindow : public LUS::GuiWindow { +class EntranceTrackerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 5ae80b5e7..5fd158d8f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -560,7 +560,7 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) { void DrawEquip(ItemTrackerItem item) { bool hasEquip = HasEquipment(item); int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); @@ -570,7 +570,7 @@ void DrawQuest(ItemTrackerItem item) { bool hasQuestItem = HasQuestItem(item); int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); ImGui::BeginGroup(); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); if (item.id == QUEST_SKULL_TOKEN) { @@ -640,7 +640,7 @@ void DrawItem(ItemTrackerItem item) { ImGui::BeginGroup(); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); DrawItemCount(item, false); @@ -662,7 +662,7 @@ void DrawBottle(ItemTrackerItem item) { } int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); @@ -677,11 +677,11 @@ void DrawDungeonItem(ItemTrackerItem item) { bool hasSmallKey = GameInteractor::IsSaveLoaded() ? ((gSaveContext.inventory.dungeonKeys[item.data]) >= 0) : false; ImGui::BeginGroup(); if (itemId == ITEM_KEY_SMALL) { - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } else { - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } @@ -722,7 +722,7 @@ void DrawSong(ItemTrackerItem item) { ImVec2 p = ImGui::GetCursorScreenPos(); bool hasSong = HasSong(item); ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); } @@ -1013,7 +1013,7 @@ void ItemTrackerWindow::DrawElement() { int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12); int comboButton1Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton1"), TRACKER_COMBO_BUTTON_L)]; int comboButton2Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton2"), TRACKER_COMBO_BUTTON_R)]; - OSContPad* buttonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); + OSContPad* buttonsPressed = Ship::Context::GetInstance()->GetControlDeck()->GetPads(); bool comboButtonsHeld = buttonsPressed != nullptr && buttonsPressed[0].button & comboButton1Mask && buttonsPressed[0].button & comboButton2Mask; bool isPaused = CVarGetInteger(CVAR_TRACKER_ITEM("ShowOnlyPaused"), 0) == 0 || gPlayState != nullptr && gPlayState->pauseCtx.state > 0; @@ -1144,7 +1144,7 @@ void ItemTrackerSettingsWindow::DrawElement() { CVarSetFloat(CVAR_TRACKER_ITEM("BgColorG"), ChromaKeyBackground.y); CVarSetFloat(CVAR_TRACKER_ITEM("BgColorB"), ChromaKeyBackground.z); CVarSetFloat(CVAR_TRACKER_ITEM("BgColorA"), ChromaKeyBackground.w); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::PopItemWidth(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h index 1fb4e1063..cae869c54 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h @@ -29,7 +29,7 @@ typedef struct ItemTrackerDungeon { std::vector items; } ItemTrackerDungeon; -class ItemTrackerSettingsWindow : public LUS::GuiWindow { +class ItemTrackerSettingsWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; @@ -39,7 +39,7 @@ class ItemTrackerSettingsWindow : public LUS::GuiWindow { void UpdateElement() override {}; }; -class ItemTrackerWindow : public LUS::GuiWindow { +class ItemTrackerWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/randomizer/randomizer_settings_window.h b/soh/soh/Enhancements/randomizer/randomizer_settings_window.h index bbb55ca3c..566baeaa3 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_settings_window.h +++ b/soh/soh/Enhancements/randomizer/randomizer_settings_window.h @@ -1,6 +1,6 @@ #include -class RandomizerSettingsWindow : public LUS::GuiWindow { +class RandomizerSettingsWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp index 892b5798a..69dec46bc 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp @@ -117,7 +117,7 @@ void AdvancedResolutionSettingsWindow::DrawElement() { CVarGetInteger("gLowResMode", 0); if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f%%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) { - LUS::Context::GetInstance()->GetWindow()->SetResolutionMultiplier( + Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier( CVarGetFloat("gInternalResolution", 1)); } UIWidgets::Tooltip("Multiplies your output resolution by the value entered."); @@ -126,7 +126,7 @@ void AdvancedResolutionSettingsWindow::DrawElement() { #ifndef __WIIU__ if (UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false)) { - LUS::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); + Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); }; UIWidgets::Tooltip( "Activates multi-sample anti-aliasing when above 1x, up to 8x for 8 samples for every pixel.\n\n" diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.h b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.h index 68680c824..f75931451 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.h +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.h @@ -2,12 +2,12 @@ #include namespace AdvancedResolutionSettings { -class AdvancedResolutionSettingsWindow : public LUS::GuiWindow { +class AdvancedResolutionSettingsWindow : public Ship::GuiWindow { private: bool IsDroppingFrames(); public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; void InitElement() override; void DrawElement() override; diff --git a/soh/soh/Enhancements/savestates.cpp b/soh/soh/Enhancements/savestates.cpp index 54dd56860..4d051911e 100644 --- a/soh/soh/Enhancements/savestates.cpp +++ b/soh/soh/Enhancements/savestates.cpp @@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) { } void SaveStateMgr::SetCurrentSlot(unsigned int slot) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); this->currentSlot = slot; } @@ -855,12 +855,12 @@ void SaveStateMgr::ProcessSaveStateRequests(void) { this->states[request.slot] = std::make_shared(OTRGlobals::Instance->gSaveStateMgr, request.slot); } this->states[request.slot]->Save(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); break; case RequestType::LOAD: if (this->states.contains(request.slot)) { this->states[request.slot]->Load(); - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); } else { SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); } @@ -876,7 +876,7 @@ void SaveStateMgr::ProcessSaveStateRequests(void) { SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { if (gPlayState == nullptr) { SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\""); - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); return SaveStateReturn::FAIL_WRONG_GAMESTATE; } @@ -890,7 +890,7 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { return SaveStateReturn::SUCCESS; } else { SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); return SaveStateReturn::FAIL_INVALID_SLOT; } [[unlikely]] default: diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 3a375230f..abdcda0ee 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -1039,22 +1039,22 @@ void InitTTSBank() { break; } - auto initData = std::make_shared(); + auto initData = std::make_shared(); initData->Format = RESOURCE_FORMAT_BINARY; - initData->Type = static_cast(LUS::ResourceType::Json); + initData->Type = static_cast(Ship::ResourceType::Json); initData->ResourceVersion = 0; - sceneMap = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, true, initData))->Data; + sceneMap = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, true, initData))->Data; - miscMap = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/misc" + languageSuffix, true, initData))->Data; + miscMap = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/misc" + languageSuffix, true, initData))->Data; - kaleidoMap = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/kaleidoscope" + languageSuffix, true, initData))->Data; + kaleidoMap = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/kaleidoscope" + languageSuffix, true, initData))->Data; - fileChooseMap = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/filechoose" + languageSuffix, true, initData))->Data; + fileChooseMap = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/filechoose" + languageSuffix, true, initData))->Data; } void RegisterOnSetGameLanguageHook() { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b79b1f9f3..e796d9f96 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -248,19 +248,19 @@ const char* constCameraStrings[] = { OTRGlobals::OTRGlobals() { std::vector OTRFiles; - std::string mqPath = LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName); + std::string mqPath = Ship::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName); if (std::filesystem::exists(mqPath)) { OTRFiles.push_back(mqPath); } - std::string ootPath = LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName); + std::string ootPath = Ship::Context::LocateFileAcrossAppDirs("oot.otr", appShortName); if (std::filesystem::exists(ootPath)) { OTRFiles.push_back(ootPath); } - std::string sohOtrPath = LUS::Context::GetPathRelativeToAppBundle("soh.otr"); + std::string sohOtrPath = Ship::Context::GetPathRelativeToAppBundle("soh.otr"); if (std::filesystem::exists(sohOtrPath)) { OTRFiles.push_back(sohOtrPath); } - std::string patchesPath = LUS::Context::LocateFileAcrossAppDirs("mods", appShortName); + std::string patchesPath = Ship::Context::LocateFileAcrossAppDirs("mods", appShortName); std::vector patchOTRs = {}; if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { if (std::filesystem::is_directory(patchesPath)) { @@ -302,7 +302,7 @@ OTRGlobals::OTRGlobals() { OOT_PAL_GC_DBG2 }; - context = LUS::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json"); + context = Ship::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json"); context->InitLogging(); context->InitGfxDebugger(); @@ -378,7 +378,7 @@ OTRGlobals::OTRGlobals() { #if defined(__SWITCH__) SPDLOG_ERROR("Invalid OTR File!"); #elif defined(__WIIU__) - LUS::WiiU::ThrowInvalidOTR(); + Ship::WiiU::ThrowInvalidOTR(); #else SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File", "Attempted to load an invalid OTR file. Try regenerating.", nullptr); @@ -450,15 +450,15 @@ bool OTRGlobals::HasOriginal() { } uint32_t OTRGlobals::GetInterpolationFPS() { - if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) { return CVarGetInteger("gInterpolationFPS", 20); } if (CVarGetInteger("gMatchRefreshRate", 0)) { - return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); } - return std::min(LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20)); + return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20)); } struct ExtensionEntry { @@ -853,7 +853,7 @@ extern "C" RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID) { } extern "C" void OTRExtScanner() { - auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles().get(); + auto lst = *Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles().get(); for (auto& rPath : lst) { std::vector raw = StringHelper::Split(rPath, "."); @@ -876,13 +876,13 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) { OTRVersion version = {}; // Use a temporary archive instance to load the otr and read the version file - auto archive = LUS::OtrArchive(otrPath); + auto archive = Ship::OtrArchive(otrPath); if (archive.Open()) { - auto t = archive.LoadFile("portVersion", std::make_shared()); + auto t = archive.LoadFile("portVersion", std::make_shared()); if (t != nullptr && t->IsLoaded) { - auto stream = std::make_shared(t->Buffer->data(), t->Buffer->size()); - auto reader = std::make_shared(stream); - LUS::Endianness endianness = (LUS::Endianness)reader->ReadUByte(); + auto stream = std::make_shared(t->Buffer->data(), t->Buffer->size()); + auto reader = std::make_shared(stream); + Ship::Endianness endianness = (Ship::Endianness)reader->ReadUByte(); reader->SetEndianness(endianness); version.major = reader->ReadUInt16(); version.minor = reader->ReadUInt16(); @@ -913,7 +913,7 @@ void CheckSoHOTRVersion(std::string otrPath) { Extractor::ShowErrorBox("soh.otr file is missing", msg.c_str()); exit(1); #elif defined(__SWITCH__) - LUS::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou are missing the soh.otr file." + msg).c_str()); + Ship::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou are missing the soh.otr file." + msg).c_str()); #elif defined(__WIIU__) OSFatal(("You are missing the soh.otr file\n\n" + msg).c_str()); #endif @@ -926,7 +926,7 @@ void CheckSoHOTRVersion(std::string otrPath) { Extractor::ShowErrorBox("soh.otr file version does not match", msg.c_str()); exit(1); #elif defined(__SWITCH__) - LUS::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou have an old soh.otr file." + msg).c_str()); + Ship::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou have an old soh.otr file." + msg).c_str()); #elif defined(__WIIU__) OSFatal(("You have an old soh.otr file\n\n" + msg).c_str()); #endif @@ -937,7 +937,7 @@ void CheckSoHOTRVersion(std::string otrPath) { // For Windows/Mac/Linux if the version doesn't match, offer to void DetectOTRVersion(std::string fileName, bool isMQ) { bool isOtrOld = false; - std::string otrPath = LUS::Context::LocateFileAcrossAppDirs(fileName, appShortName); + std::string otrPath = Ship::Context::LocateFileAcrossAppDirs(fileName, appShortName); // Doesn't exist so nothing to do here if (!std::filesystem::exists(otrPath)) { @@ -967,7 +967,7 @@ void DetectOTRVersion(std::string fileName, bool isMQ) { fileName.c_str(), version); if (Extractor::ShowYesNoBox("Old OTR File Found", msgBuf) == IDYES) { - std::string installPath = LUS::Context::GetAppBundlePath(); + std::string installPath = Ship::Context::GetAppBundlePath(); if (!std::filesystem::exists(installPath + "/assets/extractor")) { Extractor::ShowErrorBox("Extractor assets not found", "Unable to regenerate. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); @@ -975,17 +975,17 @@ void DetectOTRVersion(std::string fileName, bool isMQ) { } Extractor extract; - if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName), isMQ ? RomSearchMode::MQ : RomSearchMode::Vanilla)) { + if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName), isMQ ? RomSearchMode::MQ : RomSearchMode::Vanilla)) { Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting..."); exit(1); } - extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); + extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName)); } else { exit(1); } #elif defined(__SWITCH__) - LUS::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship with an old game OTR file." + Ship::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship with an old game OTR file." "\x1b[4;2HPlease regenerate a new game OTR and relaunch." "\x1b[6;2HPress the Home button to exit..."); #elif defined(__WIIU__) @@ -1013,9 +1013,9 @@ bool PathTestCleanup(FILE* tfile) { extern "C" void InitOTR() { #ifdef __SWITCH__ - LUS::Switch::Init(LUS::PreInitPhase); + Ship::Switch::Init(Ship::PreInitPhase); #elif defined(__WIIU__) - LUS::WiiU::Init(appShortName); + Ship::WiiU::Init(appShortName); #endif #ifdef _WIN32 @@ -1055,13 +1055,13 @@ extern "C" void InitOTR() { } #endif - CheckSoHOTRVersion(LUS::Context::GetPathRelativeToAppBundle("soh.otr")); + CheckSoHOTRVersion(Ship::Context::GetPathRelativeToAppBundle("soh.otr")); - if (!std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName)) && - !std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName))){ + if (!std::filesystem::exists(Ship::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName)) && + !std::filesystem::exists(Ship::Context::LocateFileAcrossAppDirs("oot.otr", appShortName))){ #if not defined(__SWITCH__) && not defined(__WIIU__) - std::string installPath = LUS::Context::GetAppBundlePath(); + std::string installPath = Ship::Context::GetAppBundlePath(); if (!std::filesystem::exists(installPath + "/assets/extractor")) { Extractor::ShowErrorBox("Extractor assets not found", "No OTR files found. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); @@ -1071,26 +1071,26 @@ extern "C" void InitOTR() { bool generatedOtrIsMQ = false; if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) { Extractor extract; - if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName))) { + if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName))) { Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting..."); exit(1); } - extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); + extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName)); generatedOtrIsMQ = extract.IsMasterQuest(); } else { exit(1); } if (Extractor::ShowYesNoBox("Extraction Complete", "ROM Extracted. Extract another?") == IDYES) { Extractor extract; - if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName), generatedOtrIsMQ ? RomSearchMode::Vanilla : RomSearchMode::MQ)) { + if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName), generatedOtrIsMQ ? RomSearchMode::Vanilla : RomSearchMode::MQ)) { Extractor::ShowErrorBox("Error", "An error occured, an OTR file may have been generated by a different step.\n\nContinuing..."); } else { - extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); + extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName)); } } #elif defined(__SWITCH__) - LUS::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship without a game OTR file." + Ship::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship without a game OTR file." "\x1b[4;2HPlease generate a game OTR and relaunch." "\x1b[6;2HPress the Home button to exit..."); #elif defined(__WIIU__) @@ -1165,9 +1165,9 @@ extern "C" void InitOTR() { } #endif - std::shared_ptr conf = OTRGlobals::Instance->context->GetConfig(); - conf->RegisterConfigVersionUpdater(std::make_shared()); - conf->RegisterConfigVersionUpdater(std::make_shared()); + std::shared_ptr conf = OTRGlobals::Instance->context->GetConfig(); + conf->RegisterConfigVersionUpdater(std::make_shared()); + conf->RegisterConfigVersionUpdater(std::make_shared()); conf->RunVersionUpdates(); } @@ -1245,14 +1245,14 @@ extern bool ToggleAltAssetsAtEndOfFrame; extern "C" void Graph_StartFrame() { #ifndef __WIIU__ - using LUS::KbScancode; + using Ship::KbScancode; int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode(); OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1); switch (dwScancode) { case KbScancode::LUS_KB_F5: { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); return; } @@ -1274,7 +1274,7 @@ extern "C" void Graph_StartFrame() { } case KbScancode::LUS_KB_F6: { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); return; } @@ -1289,7 +1289,7 @@ extern "C" void Graph_StartFrame() { } case KbScancode::LUS_KB_F7: { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); return; } @@ -1431,15 +1431,15 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) { } extern "C" uint32_t ResourceMgr_GetNumGameVersions() { - return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); } extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { - return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; } extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { - uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; switch (version) { case OOT_NTSC_US_10: @@ -1462,7 +1462,7 @@ extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { } extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { - uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; switch (version) { case OOT_NTSC_US_10: @@ -1531,10 +1531,10 @@ extern "C" uint32_t ResourceMgr_IsGameMasterQuest() { } extern "C" void ResourceMgr_LoadDirectory(const char* resName) { - LUS::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); + Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); } extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { - LUS::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); + Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); } extern "C" void ResourceMgr_UnloadResource(const char* resName) { @@ -1542,13 +1542,13 @@ extern "C" void ResourceMgr_UnloadResource(const char* resName) { if (path.substr(0, 7) == "__OTR__") { path = path.substr(7); } - auto res = LUS::Context::GetInstance()->GetResourceManager()->UnloadResource(path); + auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path); } // OTRTODO: There is probably a more elegant way to go about this... // Kenix: This is definitely leaking memory when it's called. extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { - auto lst = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); + auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); char** result = (char**)malloc(lst->size() * sizeof(char*)); for (size_t i = 0; i < lst->size(); i++) { @@ -1592,7 +1592,7 @@ extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { } } -std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { +std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { std::string Path = path; if (ResourceMgr_IsGameMasterQuest()) { size_t pos = 0; @@ -1600,7 +1600,7 @@ std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { Path.replace(pos, 7, "/mq/"); } } - return LUS::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); + return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); } extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { @@ -1728,7 +1728,7 @@ std::unordered_map> origi // instead (When that is available). Index can be found using the commented out section below. extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { auto res = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); // Leaving this here for people attempting to find the correct Dlist index to patch /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { @@ -1767,7 +1767,7 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { auto res = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); // Do not patch custom assets as they most likely do not have the same instructions as authentic assets if (res->GetInitData()->IsCustom) { @@ -1790,7 +1790,7 @@ extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const ch extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { auto res = std::static_pointer_cast( - LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; *gfx = originalGfx[path][patchName].instruction; @@ -1850,7 +1850,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) { ExtensionEntry entry = ExtensionCache[path]; - auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); + auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint8_t* strem2 = (uint8_t*)strem; @@ -1941,7 +1941,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel bool isAlt = CVarGetInteger("gAltAssets", 0); if (isAlt) { - pathStr = LUS::IResource::gAltAssetPrefix + pathStr; + pathStr = Ship::IResource::gAltAssetPrefix + pathStr; } SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); @@ -1975,8 +1975,8 @@ extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { return (s32*)GetResourceDataByNameHandlingMQ(path); } -std::filesystem::path GetSaveFile(std::shared_ptr Conf) { - const std::string fileName = Conf->GetString("Game.SaveName", LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav")); +std::filesystem::path GetSaveFile(std::shared_ptr Conf) { + const std::string fileName = Conf->GetString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav")); std::filesystem::path saveFile = std::filesystem::absolute(fileName); if (!exists(saveFile.parent_path())) { @@ -1987,13 +1987,13 @@ std::filesystem::path GetSaveFile(std::shared_ptr Conf) { } std::filesystem::path GetSaveFile() { - const std::shared_ptr pConf = OTRGlobals::Instance->context->GetConfig(); + const std::shared_ptr pConf = OTRGlobals::Instance->context->GetConfig(); return GetSaveFile(pConf); } void OTRGlobals::CheckSaveFile(size_t sramSize) const { - const std::shared_ptr pConf = Instance->context->GetConfig(); + const std::shared_ptr pConf = Instance->context->GetConfig(); std::filesystem::path savePath = GetSaveFile(pConf); std::fstream saveFile(savePath, std::fstream::in | std::fstream::out | std::fstream::binary); @@ -2210,19 +2210,19 @@ Color_RGB8 GetColorForControllerLED() { extern "C" void OTRControllerCallback(uint8_t rumble) { // We call this every tick, SDL accounts for this use and prevents driver spam // https://github.com/libsdl-org/SDL/blob/f17058b562c8a1090c0c996b42982721ace90903/src/joystick/SDL_joystick.c#L1114-L1144 - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetLED()->SetLEDColor(GetColorForControllerLED()); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetLED()->SetLEDColor(GetColorForControllerLED()); static std::shared_ptr controllerConfigWindow = nullptr; if (controllerConfigWindow == nullptr) { - controllerConfigWindow = std::dynamic_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Input Editor")); + controllerConfigWindow = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Input Editor")); } else if (controllerConfigWindow->TestingRumble()) { return; } if (rumble) { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StartRumble(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StartRumble(); } else { - LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StopRumble(); + Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StopRumble(); } } @@ -2262,7 +2262,7 @@ extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) { } extern "C" int Controller_ShouldRumble(size_t slot) { - for (auto [id, mapping] : LUS::Context::GetInstance() + for (auto [id, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetControllerByPort(static_cast(slot)) ->GetRumble() @@ -2650,12 +2650,12 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { } extern "C" void Overlay_DisplayText(float duration, const char* text) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); } extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) { float duration = seconds * OTRGlobals::Instance->GetInterpolationFPS() * 0.05; - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); } extern "C" void Entrance_ClearEntranceTrackingData(void) { @@ -2741,14 +2741,14 @@ void SoH_ProcessDroppedFiles(std::string filePath) { } } - auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); + auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui(); gui->GetGuiWindow("Console")->Hide(); gui->GetGuiWindow("Actor Viewer")->Hide(); gui->GetGuiWindow("Collision Viewer")->Hide(); gui->GetGuiWindow("Save Editor")->Hide(); gui->GetGuiWindow("Display List Viewer")->Hide(); gui->GetGuiWindow("Stats")->Hide(); - std::dynamic_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->ClearBindings(); + std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->ClearBindings(); gui->SaveConsoleVariablesOnNextTick(); @@ -2756,12 +2756,12 @@ void SoH_ProcessDroppedFiles(std::string filePath) { gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Configuration Loaded. Hash: %d", finalHash); } catch (std::exception& e) { SPDLOG_ERROR("Failed to load config file: {}", e.what()); - auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); + auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui(); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file"); return; } catch (...) { SPDLOG_ERROR("Failed to load config file"); - auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); + auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui(); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file"); return; } diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 49b41ce86..3a1b3e1f6 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -37,7 +37,7 @@ class OTRGlobals public: static OTRGlobals* Instance; - std::shared_ptr context; + std::shared_ptr context; std::shared_ptr gSaveStateMgr; std::shared_ptr gRandomizer; diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index eadfb75de..484a9e1b1 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -44,12 +44,12 @@ void SaveManager::ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, v } std::filesystem::path SaveManager::GetFileName(int fileNum) { - const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); + const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav"); } std::filesystem::path SaveManager::GetFileTempName(int fileNum) { - const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); + const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".temp"); } @@ -371,10 +371,10 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool f void SaveManager::Init() { // Wait on saves that snuck through the Wait in OnExitGame ThreadPoolWait(); - const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); + const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); - auto sOldSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav"); - auto sOldBackupSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.bak"); + auto sOldSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav"); + auto sOldBackupSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.bak"); // If the save directory does not exist, create it if (!std::filesystem::exists(sSavePath)) { @@ -1017,7 +1017,7 @@ void SaveManager::SaveGlobal() { globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting; globalBlock["language"] = gSaveContext.language; - const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); + const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); std::ofstream output(sGlobalPath); @@ -1076,7 +1076,7 @@ void SaveManager::LoadFile(int fileNum) { GameInteractor::Instance->ExecuteHooks(fileNum); } catch (const std::exception& e) { input.close(); - std::filesystem::path newFile(LUS::Context::GetPathRelativeToAppDirectory("Save") + ("/file" + std::to_string(fileNum + 1) + "-" + std::to_string(GetUnixTimestamp()) + ".bak")); + std::filesystem::path newFile(Ship::Context::GetPathRelativeToAppDirectory("Save") + ("/file" + std::to_string(fileNum + 1) + "-" + std::to_string(GetUnixTimestamp()) + ".bak")); #if defined(__SWITCH__) || defined(__WIIU__) copy_file(fileName.c_str(), newFile.c_str()); #else diff --git a/soh/soh/SohGui.cpp b/soh/soh/SohGui.cpp index 28366a668..9055087bd 100644 --- a/soh/soh/SohGui.cpp +++ b/soh/soh/SohGui.cpp @@ -112,9 +112,9 @@ namespace SohGui { std::shared_ptr mSohMenuBar; - std::shared_ptr mConsoleWindow; - std::shared_ptr mStatsWindow; - std::shared_ptr mInputEditorWindow; + std::shared_ptr mConsoleWindow; + std::shared_ptr mStatsWindow; + std::shared_ptr mInputEditorWindow; std::shared_ptr mAudioEditorWindow; std::shared_ptr mInputViewer; @@ -137,10 +137,10 @@ namespace SohGui { std::shared_ptr mModalWindow; void SetupGuiElements() { - auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); + auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui(); mSohMenuBar = std::make_shared("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0)); - gui->SetMenuBar(std::reinterpret_pointer_cast(mSohMenuBar)); + gui->SetMenuBar(std::reinterpret_pointer_cast(mSohMenuBar)); if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) { #if defined(__SWITCH__) || defined(__WIIU__) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 20bcc43b8..e7a99b39f 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -106,11 +106,11 @@ namespace SohGui { void DrawMenuBarIcon() { static bool gameIconLoaded = false; if (!gameIconLoaded) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Game_Icon", "textures/icons/gIcon.png"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Game_Icon", "textures/icons/gIcon.png"); gameIconLoaded = true; } - if (LUS::Context::GetInstance()->GetWindow()->GetGui()->HasTextureByName("Game_Icon")) { + if (Ship::Context::GetInstance()->GetWindow()->GetGui()->HasTextureByName("Game_Icon")) { #ifdef __SWITCH__ ImVec2 iconSize = ImVec2(20.0f, 20.0f); float posScale = 1.0f; @@ -122,7 +122,7 @@ void DrawMenuBarIcon() { float posScale = 1.0f; #endif ImGui::SetCursorPos(ImVec2(5, 2.5f) * posScale); - ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon"), iconSize); + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon"), iconSize); ImGui::SameLine(); ImGui::SetCursorPos(ImVec2(25, 0) * posScale); } @@ -137,12 +137,12 @@ void DrawShipMenu() { "[-]" #endif )) { - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetMenuBar()->ToggleVisibility(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuBar()->ToggleVisibility(); } UIWidgets::Spacer(0); #if !defined(__SWITCH__) && !defined(__WIIU__) if (ImGui::MenuItem("Toggle Fullscreen", "F11")) { - LUS::Context::GetInstance()->GetWindow()->ToggleFullscreen(); + Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); } UIWidgets::Spacer(0); #endif @@ -155,25 +155,25 @@ void DrawShipMenu() { "" #endif )) { - std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); + std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); } #if !defined(__SWITCH__) && !defined(__WIIU__) UIWidgets::Spacer(0); if (ImGui::MenuItem("Open App Files Folder")) { - std::string filesPath = LUS::Context::GetInstance()->GetAppDirectoryPath(); + std::string filesPath = Ship::Context::GetInstance()->GetAppDirectoryPath(); SDL_OpenURL(std::string("file:///" + std::filesystem::absolute(filesPath).string()).c_str()); } UIWidgets::Spacer(0); if (ImGui::MenuItem("Quit")) { - LUS::Context::GetInstance()->GetWindow()->Close(); + Ship::Context::GetInstance()->GetWindow()->Close(); } #endif ImGui::EndMenu(); } } -extern std::shared_ptr mInputEditorWindow; +extern std::shared_ptr mInputEditorWindow; extern std::shared_ptr mInputViewer; extern std::shared_ptr mInputViewerSettings; extern std::shared_ptr mAdvancedResolutionSettingsWindow; @@ -196,27 +196,27 @@ void DrawSettingsMenu() { Audio_SetGameVolume(SEQ_PLAYER_FANFARE, CVarGetFloat("gFanfareVolume", 1.0f)); } - static std::unordered_map audioBackendNames = { - { LUS::AudioBackend::WASAPI, "Windows Audio Session API" }, - { LUS::AudioBackend::SDL, "SDL" } + static std::unordered_map audioBackendNames = { + { Ship::AudioBackend::WASAPI, "Windows Audio Session API" }, + { Ship::AudioBackend::SDL, "SDL" } }; ImGui::Text("Audio API (Needs reload)"); - auto currentAudioBackend = LUS::Context::GetInstance()->GetAudio()->GetAudioBackend(); + auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetAudioBackend(); - if (LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { + if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); } if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) { - for (uint8_t i = 0; i < LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { - auto backend = LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; + for (uint8_t i = 0; i < Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { + auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) { - LUS::Context::GetInstance()->GetAudio()->SetAudioBackend(backend); + Ship::Context::GetInstance()->GetAudio()->SetAudioBackend(backend); } } ImGui::EndCombo(); } - if (LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { + if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { UIWidgets::ReEnableComponent(""); } @@ -274,7 +274,7 @@ void DrawSettingsMenu() { CVarGetInteger("gAdvancedResolution.Enabled", 0); if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) { - LUS::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); + Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); } UIWidgets::Tooltip("Resolution scale. Multiplies output resolution by this value, on each axis relative to window size.\n" "Lower values may improve performance.\n" @@ -307,7 +307,7 @@ void DrawSettingsMenu() { if (UIWidgets::PaddedEnhancementSliderInt( (CVarGetInteger("gMSAAValue", 1) == 1) ? "Anti-aliasing (MSAA): Off" : "Anti-aliasing (MSAA): %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false)) { - LUS::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); + Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); } UIWidgets::Tooltip("Activates MSAA (multi-sample anti-aliasing) from 2x up to 8x, to smooth the edges of rendered geometry.\n" "Higher sample count will result in smoother edges on models, but may reduce performance.\n\n" @@ -318,10 +318,10 @@ void DrawSettingsMenu() { { // FPS Slider const int minFps = 20; static int maxFps; - if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) { maxFps = 360; } else { - maxFps = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); } int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps); #ifdef __WIIU__ @@ -383,15 +383,15 @@ void DrawSettingsMenu() { currentFps = 60; } CVarSetInteger("gInterpolationFPS", currentFps); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); #else bool matchingRefreshRate = - CVarGetInteger("gMatchRefreshRate", 0) && LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() != LUS::WindowBackend::DX11; + CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::DX11; UIWidgets::PaddedEnhancementSliderInt( (currentFps == 20) ? "Frame Rate: Original (20 fps)" : "Frame Rate: %d fps", "##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate); #endif - if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) { UIWidgets::Tooltip( "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics.\n" "This is purely visual and does not impact game logic, execution of glitches etc.\n" @@ -406,13 +406,13 @@ void DrawSettingsMenu() { } } // END FPS Slider - if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) { UIWidgets::Spacer(0); if (ImGui::Button("Match Frame Rate to Refresh Rate")) { - int hz = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); if (hz >= 20 && hz <= 360) { CVarSetInteger("gInterpolationFPS", hz); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } } else { @@ -420,7 +420,7 @@ void DrawSettingsMenu() { } UIWidgets::Tooltip("Matches interpolation value to the game window's current refresh rate."); - if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) { UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); UIWidgets::Tooltip( @@ -442,52 +442,52 @@ void DrawSettingsMenu() { UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); - static std::unordered_map windowBackendNames = { - { LUS::WindowBackend::DX11, "DirectX" }, - { LUS::WindowBackend::SDL_OPENGL, "OpenGL"}, - { LUS::WindowBackend::SDL_METAL, "Metal" }, - { LUS::WindowBackend::GX2, "GX2"} + static std::unordered_map windowBackendNames = { + { Ship::WindowBackend::DX11, "DirectX" }, + { Ship::WindowBackend::SDL_OPENGL, "OpenGL"}, + { Ship::WindowBackend::SDL_METAL, "Metal" }, + { Ship::WindowBackend::GX2, "GX2"} }; ImGui::Text("Renderer API (Needs reload)"); - LUS::WindowBackend runningWindowBackend = LUS::Context::GetInstance()->GetWindow()->GetWindowBackend(); - LUS::WindowBackend configWindowBackend; - int configWindowBackendId = LUS::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); - if (configWindowBackendId != -1 && configWindowBackendId < static_cast(LUS::WindowBackend::BACKEND_COUNT)) { - configWindowBackend = static_cast(configWindowBackendId); + Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend(); + Ship::WindowBackend configWindowBackend; + int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); + if (configWindowBackendId != -1 && configWindowBackendId < static_cast(Ship::WindowBackend::BACKEND_COUNT)) { + configWindowBackend = static_cast(configWindowBackendId); } else { configWindowBackend = runningWindowBackend; } - if (LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { + if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); } if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) { - for (size_t i = 0; i < LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) { - auto backend = LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; + for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) { + auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) { - LUS::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast(backend)); - LUS::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", + Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast(backend)); + Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", windowBackendNames[backend]); - LUS::Context::GetInstance()->GetConfig()->Save(); + Ship::Context::GetInstance()->GetConfig()->Save(); } } ImGui::EndCombo(); } - if (LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { + if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { UIWidgets::ReEnableComponent(""); } - if (LUS::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { + if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); UIWidgets::Tooltip("Activate vertical sync, to prevent screen tearing."); } - if (LUS::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { + if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); } - if (LUS::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { + if (Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows (Needs reload)", "gEnableMultiViewports", true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect."); } @@ -503,7 +503,7 @@ void DrawSettingsMenu() { UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); // Draw LUS settings menu (such as Overlays Text Font) - LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings(); ImGui::EndMenu(); } @@ -1417,9 +1417,9 @@ void DrawEnhancementsMenu() { #ifdef __SWITCH__ UIWidgets::Spacer(0); ImGui::Text("Switch performance mode"); - if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwitchPerfMode"), SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) { - SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger(CVAR_ENHANCEMENT("SwitchPerfMode"), (int)LUS::SwitchProfiles::STOCK)]); - LUS::Switch::ApplyOverclock(); + if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwitchPerfMode"), SWITCH_CPU_PROFILES, (int)Ship::SwitchProfiles::STOCK)) { + SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger(CVAR_ENHANCEMENT("SwitchPerfMode"), (int)Ship::SwitchProfiles::STOCK)]); + Ship::Switch::ApplyOverclock(); } #endif @@ -1504,7 +1504,7 @@ void DrawCheatsMenu() { if (UIWidgets::PaddedEnhancementCheckbox("I promise I have read the warning", CVAR_CHEAT("SaveStatePromise"), true, false)) { CVarSetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (CVarGetInteger(CVAR_CHEAT("SaveStatePromise"), 0) == 1) { UIWidgets::PaddedEnhancementCheckbox("I understand, enable save states", CVAR_CHEAT("SaveStatesEnabled"), true, @@ -1598,8 +1598,8 @@ void DrawCheatsMenu() { CVarSetInteger(CVAR_CHEAT("EnableBetaQuest"), betaQuestEnabled); CVarSetInteger(CVAR_CHEAT("BetaQuestWorld"), betaQuestWorld); - std::reinterpret_pointer_cast(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (!isBetaQuestEnabled) { @@ -1613,8 +1613,8 @@ void DrawCheatsMenu() { } } -extern std::shared_ptr mStatsWindow; -extern std::shared_ptr mConsoleWindow; +extern std::shared_ptr mStatsWindow; +extern std::shared_ptr mConsoleWindow; extern std::shared_ptr mSaveEditorWindow; extern std::shared_ptr mColViewerWindow; extern std::shared_ptr mActorViewerWindow; @@ -1772,7 +1772,7 @@ void DrawRemoteControlMenu() { port = 43384; break; } - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { case GI_SCHEME_SAIL: @@ -1808,14 +1808,14 @@ void DrawRemoteControlMenu() { ImGui::Text("Remote IP & Port"); if (ImGui::InputText("##gRemote.IP", (char*)ip.c_str(), ip.capacity() + 1)) { CVarSetString(CVAR_REMOTE("IP"), ip.c_str()); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); ImGui::PushItemWidth(ImGui::GetFontSize() * 5); if (ImGui::InputScalar("##gRemote.Port", ImGuiDataType_U16, &port)) { CVarSetInteger(CVAR_REMOTE("Port"), port); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::PopItemWidth(); @@ -1828,7 +1828,7 @@ void DrawRemoteControlMenu() { if (ImGui::Button(buttonLabel, ImVec2(-1.0f, 0.0f))) { if (GameInteractor::Instance->isRemoteInteractorEnabled) { CVarSetInteger(CVAR_REMOTE("Enabled"), 0); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { case GI_SCHEME_SAIL: GameInteractorSail::Instance->Disable(); @@ -1839,7 +1839,7 @@ void DrawRemoteControlMenu() { } } else { CVarSetInteger(CVAR_REMOTE("Enabled"), 1); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { case GI_SCHEME_SAIL: GameInteractorSail::Instance->Enable(); diff --git a/soh/soh/SohMenuBar.h b/soh/soh/SohMenuBar.h index ce62344ad..99fb8a0ae 100644 --- a/soh/soh/SohMenuBar.h +++ b/soh/soh/SohMenuBar.h @@ -5,9 +5,9 @@ #include "window/gui/GuiElement.h" namespace SohGui { -class SohMenuBar : public LUS::GuiMenuBar { +class SohMenuBar : public Ship::GuiMenuBar { public: - using LUS::GuiMenuBar::GuiMenuBar; + using Ship::GuiMenuBar::GuiMenuBar; protected: void DrawElement() override; void InitElement() override {}; diff --git a/soh/soh/SohModals.h b/soh/soh/SohModals.h index 6f5acb2c0..b64e180b6 100644 --- a/soh/soh/SohModals.h +++ b/soh/soh/SohModals.h @@ -4,9 +4,9 @@ #include "window/gui/GuiMenuBar.h" #include "window/gui/GuiElement.h" -class SohModalWindow : public LUS::GuiWindow { +class SohModalWindow : public Ship::GuiWindow { public: - using LUS::GuiWindow::GuiWindow; + using GuiWindow::GuiWindow; void InitElement() override {}; void DrawElement() override; diff --git a/soh/soh/UIWidgets.cpp b/soh/soh/UIWidgets.cpp index 4817e85fc..5bf2e7b73 100644 --- a/soh/soh/UIWidgets.cpp +++ b/soh/soh/UIWidgets.cpp @@ -208,7 +208,7 @@ namespace UIWidgets { bool val = (bool)CVarGetInteger(cvarName, defaultValue); if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { CVarSetInteger(cvarName, val); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); changed = true; } @@ -248,7 +248,7 @@ namespace UIWidgets { CVarSetInteger(cvarName, i); selected = i; changed = true; - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } } @@ -261,7 +261,7 @@ namespace UIWidgets { if (disabledValue >= 0 && selected != disabledValue) { CVarSetInteger(cvarName, disabledValue); changed = true; - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } } @@ -351,7 +351,7 @@ namespace UIWidgets { if (changed && (oldVal != val)) { CVarSetInteger(cvarName, val); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } else { changed = false; } @@ -452,7 +452,7 @@ namespace UIWidgets { ss << std::setprecision(ticks + 1) << std::setiosflags(std::ios_base::fixed) << val; val = std::stof(ss.str()); CVarSetFloat(cvarName, val); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } else { changed = false; } @@ -501,7 +501,7 @@ namespace UIWidgets { int val = CVarGetInteger(cvarName, 0); if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { CVarSetInteger(cvarName, id); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); ret = true; } ImGui::SameLine(); @@ -528,7 +528,7 @@ namespace UIWidgets { CVarSetColor(cvarName, colorsRGBA); CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); changed = true; } Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); @@ -553,7 +553,7 @@ namespace UIWidgets { NewColors.b = fmin(fmax(colors->z * 255, 0), 255); CVarSetColor(cvarName, NewColors); CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); changed = true; } Tooltip("Chooses a random color\nOverwrites previously chosen color"); @@ -614,7 +614,7 @@ namespace UIWidgets { colors.a = 255.0; CVarSetColor(cvarName, colors); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); changed = true; } } @@ -630,7 +630,7 @@ namespace UIWidgets { colors.a = ColorRGBA.w * 255.0; CVarSetColor(cvarName, colors); - LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); changed = true; } } diff --git a/soh/soh/config/ConfigUpdaters.cpp b/soh/soh/config/ConfigUpdaters.cpp index 1951e78e1..994505dd6 100644 --- a/soh/soh/config/ConfigUpdaters.cpp +++ b/soh/soh/config/ConfigUpdaters.cpp @@ -1,11 +1,11 @@ #include "ConfigUpdaters.h" #include "soh/Enhancements/audio/AudioCollection.h" -namespace LUS { +namespace SOH { ConfigVersion1Updater::ConfigVersion1Updater() : ConfigVersionUpdater(1) {} ConfigVersion2Updater::ConfigVersion2Updater() : ConfigVersionUpdater(2) {} - void ConfigVersion1Updater::Update(Config* conf) { + void ConfigVersion1Updater::Update(Ship::Config* conf) { if (conf->GetInt("Window.Width", 640) == 640) { conf->Erase("Window.Width"); } @@ -36,10 +36,10 @@ namespace LUS { if (conf->GetInt("Window.Fullscreen.Height", 1080) == 1080) { conf->Erase("Window.Fullscreen.Height"); } - if (conf->GetInt("Shortcuts.Fullscreen", KbScancode::LUS_KB_F11) == KbScancode::LUS_KB_F10) { + if (conf->GetInt("Shortcuts.Fullscreen", Ship::KbScancode::LUS_KB_F11) == Ship::KbScancode::LUS_KB_F10) { conf->Erase("Shortcuts.Fullscreen"); } - if (conf->GetInt("Shortcuts.Console", KbScancode::LUS_KB_OEM_3) == KbScancode::LUS_KB_OEM_3) { + if (conf->GetInt("Shortcuts.Console", Ship::KbScancode::LUS_KB_OEM_3) == Ship::KbScancode::LUS_KB_OEM_3) { conf->Erase("Shortcuts.Console"); } if (conf->GetString("Game.SaveName", "") == "") { @@ -63,7 +63,7 @@ namespace LUS { CVarClear("gSeededRandomizedEnemies"); } - void ConfigVersion2Updater::Update(Config* conf) { + void ConfigVersion2Updater::Update(Ship::Config* conf) { for (auto seq : AudioCollection::Instance->GetAllSequences()) { CVarClear(std::string("gAudioEditor.ReplacedSequences." + seq.second.sfxKey).c_str()); } diff --git a/soh/soh/config/ConfigUpdaters.h b/soh/soh/config/ConfigUpdaters.h index cc8f6109a..4c9234476 100644 --- a/soh/soh/config/ConfigUpdaters.h +++ b/soh/soh/config/ConfigUpdaters.h @@ -1,15 +1,15 @@ #include "libultraship/libultraship.h" -namespace LUS { - class ConfigVersion1Updater : public ConfigVersionUpdater { +namespace SOH { + class ConfigVersion1Updater : public Ship::ConfigVersionUpdater { public: ConfigVersion1Updater(); - void Update(Config* conf); + void Update(Ship::Config* conf); }; - class ConfigVersion2Updater : public ConfigVersionUpdater { + class ConfigVersion2Updater : public Ship::ConfigVersionUpdater { public: ConfigVersion2Updater(); - void Update(Config* conf); + void Update(Ship::Config* conf); }; } \ No newline at end of file diff --git a/soh/soh/resource/importer/AnimationFactory.cpp b/soh/soh/resource/importer/AnimationFactory.cpp index 8e1aca9b7..13aa71c86 100644 --- a/soh/soh/resource/importer/AnimationFactory.cpp +++ b/soh/soh/resource/importer/AnimationFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto animation = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); AnimationType animType = (AnimationType)reader->ReadUInt32(); animation->type = animType; diff --git a/soh/soh/resource/importer/AnimationFactory.h b/soh/soh/resource/importer/AnimationFactory.h index 36dfceaae..ae27832b6 100644 --- a/soh/soh/resource/importer/AnimationFactory.h +++ b/soh/soh/resource/importer/AnimationFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryAnimationV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryAnimationV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp index b45e698e5..0ec3f5260 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.cpp +++ b/soh/soh/resource/importer/AudioSampleFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto audioSample = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); audioSample->sample.codec = reader->ReadUByte(); audioSample->sample.medium = reader->ReadUByte(); @@ -71,7 +71,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) { ExtensionEntry entry = ExtensionCache[path]; - auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); + auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint8_t* strem2 = (uint8_t*)strem; diff --git a/soh/soh/resource/importer/AudioSampleFactory.h b/soh/soh/resource/importer/AudioSampleFactory.h index 2680ccdc2..372e8a310 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.h +++ b/soh/soh/resource/importer/AudioSampleFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryAudioSampleV2 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryAudioSampleV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp index ba2a36697..35da7f798 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.cpp +++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto audioSequence = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); audioSequence->sequence.seqDataSize = reader->ReadInt32(); audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize); diff --git a/soh/soh/resource/importer/AudioSequenceFactory.h b/soh/soh/resource/importer/AudioSequenceFactory.h index fb4391d61..35fd1ebef 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.h +++ b/soh/soh/resource/importer/AudioSequenceFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryAudioSequenceV2 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryAudioSequenceV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp index 6d7efc58c..534a7914c 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.cpp +++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp @@ -4,13 +4,13 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto audioSoundFont = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); audioSoundFont->soundFont.fntIndex = reader->ReadInt32(); audioSoundFont->medium = reader->ReadInt8(); @@ -67,7 +67,7 @@ std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResou if (sampleFileName.empty()) { drum.sound.sample = nullptr; } else { - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); drum.sound.sample = static_cast(res ? res->GetRawPointer() : nullptr); } @@ -111,7 +111,7 @@ std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResou bool hasSampleRef = reader->ReadInt8(); std::string sampleFileName = reader->ReadString(); instrument.lowNotesSound.tuning = reader->ReadFloat(); - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); instrument.lowNotesSound.sample = static_cast(res ? res->GetRawPointer() : nullptr); } else { instrument.lowNotesSound.sample = nullptr; @@ -123,7 +123,7 @@ std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResou bool hasSampleRef = reader->ReadInt8(); std::string sampleFileName = reader->ReadString(); instrument.normalNotesSound.tuning = reader->ReadFloat(); - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); instrument.normalNotesSound.sample = static_cast(res ? res->GetRawPointer() : nullptr); } else { instrument.normalNotesSound.sample = nullptr; @@ -135,7 +135,7 @@ std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResou bool hasSampleRef = reader->ReadInt8(); std::string sampleFileName = reader->ReadString(); instrument.highNotesSound.tuning = reader->ReadFloat(); - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); instrument.highNotesSound.sample = static_cast(res ? res->GetRawPointer() : nullptr); } else { instrument.highNotesSound.sample = nullptr; @@ -160,7 +160,7 @@ std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResou bool hasSampleRef = reader->ReadInt8(); std::string sampleFileName = reader->ReadString(); soundEffect.tuning = reader->ReadFloat(); - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); soundEffect.sample = static_cast(res ? res->GetRawPointer() : nullptr); } diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.h b/soh/soh/resource/importer/AudioSoundFontFactory.h index a63533db9..a80b8fe97 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.h +++ b/soh/soh/resource/importer/AudioSoundFontFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryAudioSoundFontV2 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryAudioSoundFontV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/BackgroundFactory.cpp b/soh/soh/resource/importer/BackgroundFactory.cpp index 07c47cbe9..6be484698 100644 --- a/soh/soh/resource/importer/BackgroundFactory.cpp +++ b/soh/soh/resource/importer/BackgroundFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto background = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); uint32_t dataSize = reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/BackgroundFactory.h b/soh/soh/resource/importer/BackgroundFactory.h index 787ee509c..e74e897e9 100644 --- a/soh/soh/resource/importer/BackgroundFactory.h +++ b/soh/soh/resource/importer/BackgroundFactory.h @@ -4,8 +4,8 @@ #include "resource/ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryBackgroundV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryBackgroundV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp index c5372f249..4636d80c7 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto collisionHeader = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16(); collisionHeader->collisionHeaderData.minBounds.y = reader->ReadInt16(); @@ -123,7 +123,7 @@ std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadReso return collisionHeader; } -std::shared_ptr ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.h b/soh/soh/resource/importer/CollisionHeaderFactory.h index abd878909..dd438f9c3 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.h +++ b/soh/soh/resource/importer/CollisionHeaderFactory.h @@ -5,13 +5,13 @@ #include "ResourceFactoryXML.h" namespace SOH { -class ResourceFactoryBinaryCollisionHeaderV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryCollisionHeaderV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; -class ResourceFactoryXMLCollisionHeaderV0 : public LUS::ResourceFactoryXML { +class ResourceFactoryXMLCollisionHeaderV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/CutsceneFactory.cpp b/soh/soh/resource/importer/CutsceneFactory.cpp index 28f5e642b..49e44680c 100644 --- a/soh/soh/resource/importer/CutsceneFactory.cpp +++ b/soh/soh/resource/importer/CutsceneFactory.cpp @@ -2,19 +2,19 @@ #include "soh/resource/type/Cutscene.h" #include "spdlog/spdlog.h" -static inline uint32_t read_CMD_BBBB(std::shared_ptr reader) { +static inline uint32_t read_CMD_BBBB(std::shared_ptr reader) { uint32_t v; reader->Read((char*)&v, sizeof(uint32_t)); return v; } -static inline uint32_t read_CMD_BBH(std::shared_ptr reader) { +static inline uint32_t read_CMD_BBH(std::shared_ptr reader) { uint32_t v; reader->Read((char*)&v, sizeof(uint32_t)); // swap the half word to match endianness - if (reader->GetEndianness() != LUS::Endianness::Native) { + if (reader->GetEndianness() != Ship::Endianness::Native) { uint8_t* b = (uint8_t*)&v; uint8_t tmp = b[2]; b[2] = b[3]; @@ -24,12 +24,12 @@ static inline uint32_t read_CMD_BBH(std::shared_ptr reader) { return v; } -static inline uint32_t read_CMD_HBB(std::shared_ptr reader) { +static inline uint32_t read_CMD_HBB(std::shared_ptr reader) { uint32_t v; reader->Read((char*)&v, sizeof(uint32_t)); // swap the half word to match endianness - if (reader->GetEndianness() != LUS::Endianness::Native) { + if (reader->GetEndianness() != Ship::Endianness::Native) { uint8_t* b = (uint8_t*)&v; uint8_t tmp = b[0]; b[0] = b[1]; @@ -39,12 +39,12 @@ static inline uint32_t read_CMD_HBB(std::shared_ptr reader) { return v; } -static inline uint32_t read_CMD_HH(std::shared_ptr reader) { +static inline uint32_t read_CMD_HH(std::shared_ptr reader) { uint32_t v; reader->Read((char*)&v, sizeof(uint32_t)); // swap the half words to match endianness - if (reader->GetEndianness() != LUS::Endianness::Native) { + if (reader->GetEndianness() != Ship::Endianness::Native) { uint8_t* b = (uint8_t*)&v; uint8_t tmp = b[0]; b[0] = b[1]; @@ -58,13 +58,13 @@ static inline uint32_t read_CMD_HH(std::shared_ptr reader) { } namespace SOH { -std::shared_ptr ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto cutscene = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); uint32_t numEntries = reader->ReadUInt32(); cutscene->commands.reserve(numEntries); diff --git a/soh/soh/resource/importer/CutsceneFactory.h b/soh/soh/resource/importer/CutsceneFactory.h index 8194615af..8afe98bb8 100644 --- a/soh/soh/resource/importer/CutsceneFactory.h +++ b/soh/soh/resource/importer/CutsceneFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryCutsceneV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryCutsceneV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/PathFactory.cpp b/soh/soh/resource/importer/PathFactory.cpp index 07fc86f40..00807b75a 100644 --- a/soh/soh/resource/importer/PathFactory.cpp +++ b/soh/soh/resource/importer/PathFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto path = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); path->numPaths = reader->ReadUInt32(); path->paths.reserve(path->numPaths); diff --git a/soh/soh/resource/importer/PathFactory.h b/soh/soh/resource/importer/PathFactory.h index aa8ae747c..ddbee772d 100644 --- a/soh/soh/resource/importer/PathFactory.h +++ b/soh/soh/resource/importer/PathFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryPathV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryPathV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.cpp b/soh/soh/resource/importer/PlayerAnimationFactory.cpp index 4c25d5e80..59610da46 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.cpp +++ b/soh/soh/resource/importer/PlayerAnimationFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto playerAnimation = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); uint32_t numEntries = reader->ReadUInt32(); playerAnimation->limbRotData.reserve(numEntries); diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.h b/soh/soh/resource/importer/PlayerAnimationFactory.h index 8b459a38b..3ee8b1d3a 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.h +++ b/soh/soh/resource/importer/PlayerAnimationFactory.h @@ -4,8 +4,8 @@ #include "ResourceFactoryBinary.h" namespace SOH { -class ResourceFactoryBinaryPlayerAnimationV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryPlayerAnimationV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp index c537cb312..1bcf92e1c 100644 --- a/soh/soh/resource/importer/SceneFactory.cpp +++ b/soh/soh/resource/importer/SceneFactory.cpp @@ -58,7 +58,7 @@ ResourceFactoryBinarySceneV0::ResourceFactoryBinarySceneV0() { sceneCommandFactories[SceneCommandID::SetMesh] = std::make_shared(); } -void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader) { +void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader) { uint32_t commandCount = reader->ReadUInt32(); scene->commands.reserve(commandCount); @@ -68,16 +68,16 @@ void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr sce } std::shared_ptr ResourceFactoryBinarySceneV0::ParseSceneCommand(std::shared_ptr scene, - std::shared_ptr reader, uint32_t index) { + std::shared_ptr reader, uint32_t index) { SceneCommandID cmdID = (SceneCommandID)reader->ReadInt32(); - reader->Seek(-sizeof(int32_t), LUS::SeekOffsetType::Current); + reader->Seek(-sizeof(int32_t), Ship::SeekOffsetType::Current); std::shared_ptr result = nullptr; auto commandFactory = ResourceFactoryBinarySceneV0::sceneCommandFactories[cmdID]; if (commandFactory != nullptr) { - auto initData = std::make_shared(); + auto initData = std::make_shared(); initData->Id = scene->GetInitData()->Id; initData->Type = static_cast(SOH::ResourceType::SOH_SceneCommand); initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index); @@ -93,13 +93,13 @@ std::shared_ptr ResourceFactoryBinarySceneV0::ParseSceneCommand(s return result; } -std::shared_ptr ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto scene = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); ParseSceneCommands(scene, reader); @@ -200,7 +200,7 @@ std::shared_ptr ResourceFactoryXMLSceneV0::ParseSceneCommand(std: auto commandFactory = ResourceFactoryXMLSceneV0::sceneCommandFactories[cmdID]; if (commandFactory != nullptr) { - auto initData = std::make_shared(); + auto initData = std::make_shared(); initData->Id = scene->GetInitData()->Id; initData->Type = static_cast(ResourceType::SOH_SceneCommand); initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index); @@ -216,7 +216,7 @@ std::shared_ptr ResourceFactoryXMLSceneV0::ParseSceneCommand(std: return result; } -std::shared_ptr ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } diff --git a/soh/soh/resource/importer/SceneFactory.h b/soh/soh/resource/importer/SceneFactory.h index a1b345f7d..115c3f3f5 100644 --- a/soh/soh/resource/importer/SceneFactory.h +++ b/soh/soh/resource/importer/SceneFactory.h @@ -8,12 +8,12 @@ #include "ResourceFactoryXML.h" namespace SOH { -class ResourceFactoryBinarySceneV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary { public: ResourceFactoryBinarySceneV0(); - std::shared_ptr ReadResource(std::shared_ptr file) override; - void ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader); + std::shared_ptr ReadResource(std::shared_ptr file) override; + void ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader); // Doing something very similar to what we do on the ResourceLoader. // Eventually, scene commands should be moved up to the ResourceLoader as well. @@ -21,14 +21,14 @@ class ResourceFactoryBinarySceneV0 : public LUS::ResourceFactoryBinary { // and the exporter does not export the commands with a proper OTR header. static inline std::unordered_map> sceneCommandFactories; protected: - std::shared_ptr ParseSceneCommand(std::shared_ptr scene, std::shared_ptr reader, uint32_t index); + std::shared_ptr ParseSceneCommand(std::shared_ptr scene, std::shared_ptr reader, uint32_t index); }; -class ResourceFactoryXMLSceneV0 : public LUS::ResourceFactoryXML { +class ResourceFactoryXMLSceneV0 : public Ship::ResourceFactoryXML { public: ResourceFactoryXMLSceneV0(); - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; void ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader); // Doing something very similar to what we do on the ResourceLoader. diff --git a/soh/soh/resource/importer/SkeletonFactory.cpp b/soh/soh/resource/importer/SkeletonFactory.cpp index fedfda400..d4cb965bf 100644 --- a/soh/soh/resource/importer/SkeletonFactory.cpp +++ b/soh/soh/resource/importer/SkeletonFactory.cpp @@ -4,13 +4,13 @@ #include namespace SOH { -std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto skeleton = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); skeleton->type = (SkeletonType)reader->ReadInt8(); skeleton->limbType = (LimbType)reader->ReadInt8(); @@ -43,7 +43,7 @@ std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(st for (size_t i = 0; i < skeleton->limbTable.size(); i++) { std::string limbStr = skeleton->limbTable[i]; - auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str()); + auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str()); skeleton->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr); } @@ -62,7 +62,7 @@ std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(st return skeleton; } -std::shared_ptr ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } @@ -112,7 +112,7 @@ std::shared_ptr ResourceFactoryXMLSkeletonV0::ReadResource(std:: std::string limbName = child->Attribute("Path"); skel->limbTable.push_back(limbName); - auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str()); + auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str()); skel->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr); } diff --git a/soh/soh/resource/importer/SkeletonFactory.h b/soh/soh/resource/importer/SkeletonFactory.h index 5de02175f..24f92720a 100644 --- a/soh/soh/resource/importer/SkeletonFactory.h +++ b/soh/soh/resource/importer/SkeletonFactory.h @@ -5,13 +5,13 @@ #include "ResourceFactoryXML.h" namespace SOH { -class ResourceFactoryBinarySkeletonV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinarySkeletonV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; -class ResourceFactoryXMLSkeletonV0 : public LUS::ResourceFactoryXML { +class ResourceFactoryXMLSkeletonV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.cpp b/soh/soh/resource/importer/SkeletonLimbFactory.cpp index 15ba92281..3f780e6d4 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.cpp +++ b/soh/soh/resource/importer/SkeletonLimbFactory.cpp @@ -4,13 +4,13 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto skeletonLimb = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); skeletonLimb->limbType = (LimbType)reader->ReadInt8(); skeletonLimb->skinSegmentType = (ZLimbSkinType)reader->ReadInt8(); @@ -184,7 +184,7 @@ std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResourc return skeletonLimb; } -std::shared_ptr ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.h b/soh/soh/resource/importer/SkeletonLimbFactory.h index 125dde2b8..222cefa2c 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.h +++ b/soh/soh/resource/importer/SkeletonLimbFactory.h @@ -5,13 +5,13 @@ #include "ResourceFactoryXML.h" namespace SOH { -class ResourceFactoryBinarySkeletonLimbV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinarySkeletonLimbV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; -class ResourceFactoryXMLSkeletonLimbV0 : public LUS::ResourceFactoryXML { +class ResourceFactoryXMLSkeletonLimbV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/TextFactory.cpp b/soh/soh/resource/importer/TextFactory.cpp index 89d229f80..1da1d50db 100644 --- a/soh/soh/resource/importer/TextFactory.cpp +++ b/soh/soh/resource/importer/TextFactory.cpp @@ -3,13 +3,13 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } auto text = std::make_shared(file->InitData); - auto reader = std::get>(file->Reader); + auto reader = std::get>(file->Reader); uint32_t msgCount = reader->ReadUInt32(); text->messages.reserve(msgCount); @@ -27,7 +27,7 @@ std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std::s return text; } -std::shared_ptr ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr file) { +std::shared_ptr ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } diff --git a/soh/soh/resource/importer/TextFactory.h b/soh/soh/resource/importer/TextFactory.h index cb466204b..55a569366 100644 --- a/soh/soh/resource/importer/TextFactory.h +++ b/soh/soh/resource/importer/TextFactory.h @@ -5,13 +5,13 @@ #include "ResourceFactoryXML.h" namespace SOH { -class ResourceFactoryBinaryTextV0 : public LUS::ResourceFactoryBinary { +class ResourceFactoryBinaryTextV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; -class ResourceFactoryXMLTextV0 : public LUS::ResourceFactoryXML { +class ResourceFactoryXMLTextV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp index debcf7ab1..6932117f1 100644 --- a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -EndMarkerFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +EndMarkerFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto endMarker = std::make_shared(initData); ReadCommandId(endMarker, reader); @@ -17,7 +17,7 @@ EndMarkerFactory::ReadResource(std::shared_ptr initData, return endMarker; } -std::shared_ptr EndMarkerFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr EndMarkerFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto endMarker = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h index 8e3875ef2..62dfcd7c4 100644 --- a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h @@ -5,12 +5,12 @@ namespace SOH { class EndMarkerFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class EndMarkerFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp index 9ab5d1611..8d7de5021 100644 --- a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace SOH { -void SceneCommandFactoryBinaryV0::ReadCommandId(std::shared_ptr command, std::shared_ptr reader) { +void SceneCommandFactoryBinaryV0::ReadCommandId(std::shared_ptr command, std::shared_ptr reader) { command->cmdId = (SceneCommandID)reader->ReadInt32(); } } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h index 73e5a2e06..601996ea4 100644 --- a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h +++ b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h @@ -9,15 +9,15 @@ namespace SOH { class SceneCommandFactoryBinaryV0 { public: - virtual std::shared_ptr ReadResource(std::shared_ptr initData, std::shared_ptr reader) = 0; + virtual std::shared_ptr ReadResource(std::shared_ptr initData, std::shared_ptr reader) = 0; protected: - void ReadCommandId(std::shared_ptr command, std::shared_ptr reader); + void ReadCommandId(std::shared_ptr command, std::shared_ptr reader); }; class SceneCommandFactoryXMLV0 { public: - virtual std::shared_ptr ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) = 0; + virtual std::shared_ptr ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) = 0; protected: void ReadCommandId(std::shared_ptr command, tinyxml2::XMLElement* reader); diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp index cf397fcd3..6c262e7af 100644 --- a/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetActorListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetActorListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setActorList = std::make_shared(initData); ReadCommandId(setActorList, reader); @@ -34,7 +34,7 @@ SetActorListFactory::ReadResource(std::shared_ptr initDat return setActorList; } -std::shared_ptr SetActorListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetActorListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setActorList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h index 5dd872f8a..703181c9a 100644 --- a/soh/soh/resource/importer/scenecommand/SetActorListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetActorListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetActorListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp index 40e31f0f2..c04f717c3 100644 --- a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp @@ -5,8 +5,8 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setAlternateHeaders = std::make_shared(initData); ReadCommandId(setAlternateHeaders, reader); @@ -16,7 +16,7 @@ std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::sh for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { auto headerName = reader->ReadString(); if (!headerName.empty()) { - setAlternateHeaders->headers.push_back(std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); + setAlternateHeaders->headers.push_back(std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); } else { setAlternateHeaders->headers.push_back(nullptr); } @@ -29,7 +29,7 @@ std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::sh return setAlternateHeaders; } -std::shared_ptr SetAlternateHeadersFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetAlternateHeadersFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setAlternateHeaders = std::make_shared(initData); @@ -43,7 +43,7 @@ std::shared_ptr SetAlternateHeadersFactoryXML::ReadResource(std: for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { auto headerName = std::string(child->Attribute("HeaderName")); if (!headerName.empty()) { - setAlternateHeaders->headers.push_back(std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); + setAlternateHeaders->headers.push_back(std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); } else { setAlternateHeaders->headers.push_back(nullptr); } diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h index 84e730905..7b1324a60 100644 --- a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetAlternateHeadersFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetAlternateHeadersFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp index 521586262..58c6ab4e3 100644 --- a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetCameraSettingsFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetCameraSettingsFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setCameraSettings = std::make_shared(initData); ReadCommandId(setCameraSettings, reader); @@ -20,7 +20,7 @@ std::shared_ptr SetCameraSettingsFactory::ReadResource(std::shar return setCameraSettings; } -std::shared_ptr SetCameraSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetCameraSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setCameraSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h index a03287b35..a8c21f776 100644 --- a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetCameraSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetCameraSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp index f50ee3790..a67778f63 100644 --- a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp @@ -5,14 +5,14 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetCollisionHeaderFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetCollisionHeaderFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setCollisionHeader = std::make_shared(initData); ReadCommandId(setCollisionHeader, reader); setCollisionHeader->fileName = reader->ReadString(); - setCollisionHeader->collisionHeader = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); + setCollisionHeader->collisionHeader = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) { LogSetCollisionHeaderAsXML(setCollisionHeader); @@ -21,14 +21,14 @@ std::shared_ptr SetCollisionHeaderFactory::ReadResource(std::sha return setCollisionHeader; } -std::shared_ptr SetCollisionHeaderFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetCollisionHeaderFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setCollisionHeader = std::make_shared(initData); setCollisionHeader->cmdId = SceneCommandID::SetCollisionHeader; setCollisionHeader->fileName = reader->Attribute("FileName"); - setCollisionHeader->collisionHeader = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); + setCollisionHeader->collisionHeader = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); return setCollisionHeader; } diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h index 12b872f3c..35902e7cb 100644 --- a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetCollisionHeaderFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetCollisionHeaderFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp index 569b8b1d9..7ae8237bf 100644 --- a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetCsCameraFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetCsCameraFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setCsCamera = std::make_shared(initData); ReadCommandId(setCsCamera, reader); @@ -22,7 +22,7 @@ SetCsCameraFactory::ReadResource(std::shared_ptr initData return setCsCamera; } -std::shared_ptr SetCsCameraFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetCsCameraFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setCsCamera = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h index 89c92a699..ad232a11d 100644 --- a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetCsCameraFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetCsCameraFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp index 7aea7c70d..7ca657403 100644 --- a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp @@ -5,14 +5,14 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetCutscenesFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetCutscenesFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setCutscenes = std::make_shared(initData); ReadCommandId(setCutscenes, reader); setCutscenes->fileName = reader->ReadString(); - setCutscenes->cutscene = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); + setCutscenes->cutscene = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) { LogCutscenesAsXML(setCutscenes); @@ -21,14 +21,14 @@ SetCutscenesFactory::ReadResource(std::shared_ptr initDat return setCutscenes; } -std::shared_ptr SetCutscenesFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetCutscenesFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setCutscenes = std::make_shared(initData); setCutscenes->cmdId = SceneCommandID::SetCutscenes; setCutscenes->fileName = reader->Attribute("FileName"); - setCutscenes->cutscene = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); + setCutscenes->cutscene = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); return setCutscenes; } diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h index c78bf621c..4bd76b563 100644 --- a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetCutscenesFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetCutscenesFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp index d4c6e9a50..4038ea825 100644 --- a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetEchoSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetEchoSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setEchoSettings = std::make_shared(initData); ReadCommandId(setEchoSettings, reader); @@ -19,7 +19,7 @@ SetEchoSettingsFactory::ReadResource(std::shared_ptr init return setEchoSettings; } -std::shared_ptr SetEchoSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetEchoSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setEchoSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h index 4be1fe399..c76885cf9 100644 --- a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetEchoSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetEchoSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp index f3817c39c..0590bfeb7 100644 --- a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetEntranceListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetEntranceListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setEntranceList = std::make_shared(initData); ReadCommandId(setEntranceList, reader); @@ -28,7 +28,7 @@ SetEntranceListFactory::ReadResource(std::shared_ptr init return setEntranceList; } -std::shared_ptr SetEntranceListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetEntranceListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setEntranceList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h index a5349cf83..207e9f050 100644 --- a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetEntranceListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetEntranceListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp index b6078199b..328b41d8a 100644 --- a/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetExitListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetExitListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setExitList = std::make_shared( initData); ReadCommandId(setExitList, reader); @@ -23,7 +23,7 @@ SetExitListFactory::ReadResource(std::shared_ptr initData return setExitList; } -std::shared_ptr SetExitListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetExitListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setExitList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.h b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h index fc47b88d0..4b050f46f 100644 --- a/soh/soh/resource/importer/scenecommand/SetExitListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetExitListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetExitListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp index af7f1bb3c..e1cbd2122 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetLightListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetLightListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setLightList = std::make_shared(initData); ReadCommandId(setLightList, reader); @@ -38,7 +38,7 @@ SetLightListFactory::ReadResource(std::shared_ptr initDat return setLightList; } -std::shared_ptr SetLightListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetLightListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setLightList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.h b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h index aae5c8e4a..0af868d17 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetLightListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetLightListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp index 573998cfa..7e35a7ac0 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetLightingSettingsFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetLightingSettingsFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setLightingSettings = std::make_shared(initData); ReadCommandId(setLightingSettings, reader); @@ -51,7 +51,7 @@ std::shared_ptr SetLightingSettingsFactory::ReadResource(std::sh return setLightingSettings; } -std::shared_ptr SetLightingSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetLightingSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setLightingSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h index 39ae6934d..d5b3be279 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetLightingSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetLightingSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp index 8c4109c5a..bdc5a0106 100644 --- a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp @@ -5,8 +5,8 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr -SetMeshFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetMeshFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setMesh = std::make_shared(initData); ReadCommandId(setMesh, reader); @@ -41,8 +41,8 @@ SetMeshFactory::ReadResource(std::shared_ptr initData, st std::string meshOpa = reader->ReadString(); std::string meshXlu = reader->ReadString(); - auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); - auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); + auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); + auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -56,8 +56,8 @@ SetMeshFactory::ReadResource(std::shared_ptr initData, st std::string imgOpa = reader->ReadString(); std::string imgXlu = reader->ReadString(); - auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); - auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); + auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); + auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -104,8 +104,8 @@ SetMeshFactory::ReadResource(std::shared_ptr initData, st std::string meshOpa = reader->ReadString(); std::string meshXlu = reader->ReadString(); - opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); - xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); + opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); + xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -124,8 +124,8 @@ SetMeshFactory::ReadResource(std::shared_ptr initData, st std::string meshOpa = reader->ReadString(); std::string meshXlu = reader->ReadString(); - auto opaRes = meshOpa != "" ? LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()) : nullptr; - auto xluRes = meshXlu != "" ? LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()) : nullptr; + auto opaRes = meshOpa != "" ? Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()) : nullptr; + auto xluRes = meshXlu != "" ? Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()) : nullptr; dlist.opa = (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr); dlist.xlu = (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr); @@ -155,7 +155,7 @@ SetMeshFactory::ReadResource(std::shared_ptr initData, st return setMesh; } -std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setMesh = std::make_shared(initData); @@ -199,8 +199,8 @@ std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr< std::string meshOpa = child->Attribute("MeshOpa"); std::string meshXlu = child->Attribute("MeshXlu"); - auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); - auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); + auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); + auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -214,8 +214,8 @@ std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr< std::string imgOpa = child->Attribute("ImgOpa"); std::string imgXlu = child->Attribute("ImgXlu"); - auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); - auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); + auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); + auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -271,8 +271,8 @@ std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr< std::string meshOpa = child->Attribute("MeshOpa"); std::string meshXlu = child->Attribute("MeshXlu"); - opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); - xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); + opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); + xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; @@ -291,8 +291,8 @@ std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr< std::string meshOpa = child->Attribute("MeshOpa"); std::string meshXlu = child->Attribute("MeshXlu"); - auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); - auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); + auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); + auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.h b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h index f64b55d72..c87123174 100644 --- a/soh/soh/resource/importer/scenecommand/SetMeshFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetMeshFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetMeshFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp index 1d64a9aec..0ba356f7b 100644 --- a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetObjectListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetObjectListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setObjectList = std::make_shared(initData); ReadCommandId(setObjectList, reader); @@ -23,7 +23,7 @@ SetObjectListFactory::ReadResource(std::shared_ptr initDa return setObjectList; } -std::shared_ptr SetObjectListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetObjectListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setObjectList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h index 094c30a92..663ef2304 100644 --- a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetObjectListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetObjectListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp index 0e26e96e4..65af2e0de 100644 --- a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp @@ -5,8 +5,8 @@ #include namespace SOH { -std::shared_ptr -SetPathwaysFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetPathwaysFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setPathways = std::make_shared(initData); ReadCommandId(setPathways, reader); @@ -15,7 +15,7 @@ SetPathwaysFactory::ReadResource(std::shared_ptr initData setPathways->paths.reserve(setPathways->numPaths); for (uint32_t i = 0; i < setPathways->numPaths; i++) { std::string pathFileName = reader->ReadString(); - auto path = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(pathFileName.c_str())); + auto path = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(pathFileName.c_str())); setPathways->paths.push_back(path->GetPointer()); } @@ -26,7 +26,7 @@ SetPathwaysFactory::ReadResource(std::shared_ptr initData return setPathways; } -std::shared_ptr SetPathwaysFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetPathwaysFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setPathways = std::make_shared(initData); @@ -38,7 +38,7 @@ std::shared_ptr SetPathwaysFactoryXML::ReadResource(std::shared_ std::string childName = child->Name(); if (childName == "Pathway") { std::string pathFileName = child->Attribute("FilePath"); - auto path = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(pathFileName.c_str())); + auto path = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(pathFileName.c_str())); setPathways->paths.push_back(path->GetPointer()); setPathways->pathFileNames.push_back(pathFileName); } diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h index 2e334c7a5..783c9f45c 100644 --- a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetPathwaysFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetPathwaysFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp index 25a3bf931..14bb787ed 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetRoomBehaviorFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetRoomBehaviorFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setRoomBehavior = std::make_shared(initData); ReadCommandId(setRoomBehavior, reader); @@ -20,7 +20,7 @@ SetRoomBehaviorFactory::ReadResource(std::shared_ptr init return setRoomBehavior; } -std::shared_ptr SetRoomBehaviorFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetRoomBehaviorFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setRoomBehavior = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h index 97c5c7bb4..87e55194d 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetRoomBehaviorFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetRoomBehaviorFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp index 67c3afd0f..b19ac98d7 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetRoomListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetRoomListFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setRoomList = std::make_shared(initData); ReadCommandId(setRoomList, reader); @@ -31,7 +31,7 @@ SetRoomListFactory::ReadResource(std::shared_ptr initData return setRoomList; } -std::shared_ptr SetRoomListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetRoomListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setRoomList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h index c6e82dfa9..1e05c7e03 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetRoomListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetRoomListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp index 9147989dd..6c0ee1400 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetSkyboxModifierFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetSkyboxModifierFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setSkyboxModifier = std::make_shared(initData); ReadCommandId(setSkyboxModifier, reader); @@ -20,7 +20,7 @@ std::shared_ptr SetSkyboxModifierFactory::ReadResource(std::shar return setSkyboxModifier; } -std::shared_ptr SetSkyboxModifierFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetSkyboxModifierFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setSkyboxModifier = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h index cbd260ecc..a4ef58150 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetSkyboxModifierFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetSkyboxModifierFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp index 7f9f4d3d0..607909d65 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetSkyboxSettingsFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetSkyboxSettingsFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setSkyboxSettings = std::make_shared(initData); ReadCommandId(setSkyboxSettings, reader); @@ -22,7 +22,7 @@ std::shared_ptr SetSkyboxSettingsFactory::ReadResource(std::shar return setSkyboxSettings; } -std::shared_ptr SetSkyboxSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetSkyboxSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setSkyboxSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h index 6bc668667..352275b58 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetSkyboxSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetSkyboxSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp index 46d81c074..61c1892dd 100644 --- a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetSoundSettingsFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetSoundSettingsFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setSoundSettings = std::make_shared(initData); ReadCommandId(setSoundSettings, reader); @@ -21,7 +21,7 @@ std::shared_ptr SetSoundSettingsFactory::ReadResource(std::share return setSoundSettings; } -std::shared_ptr SetSoundSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetSoundSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setSoundSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h index fa6f0ac2f..14d1ebe84 100644 --- a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetSoundSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetSoundSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp index b90aa9c9d..f28393134 100644 --- a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetSpecialObjectsFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetSpecialObjectsFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setSpecialObjects = std::make_shared(initData); ReadCommandId(setSpecialObjects, reader); @@ -20,7 +20,7 @@ std::shared_ptr SetSpecialObjectsFactory::ReadResource(std::shar return setSpecialObjects; } -std::shared_ptr SetSpecialObjectsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetSpecialObjectsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setSpecialObjects = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h index 47b30bafc..38b1ea511 100644 --- a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetSpecialObjectsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetSpecialObjectsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp index abfa6f807..3dee5d992 100644 --- a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetStartPositionListFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetStartPositionListFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setStartPositionList = std::make_shared(initData); ReadCommandId(setStartPositionList, reader); @@ -34,7 +34,7 @@ std::shared_ptr SetStartPositionListFactory::ReadResource(std::s return setStartPositionList; } -std::shared_ptr SetStartPositionListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetStartPositionListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setStartPositionList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h index 4e381036a..b4894207e 100644 --- a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetStartPositionListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetStartPositionListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp index 8e54e4573..739da5330 100644 --- a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetTimeSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetTimeSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setTimeSettings = std::make_shared(initData); ReadCommandId(setTimeSettings, reader); @@ -21,7 +21,7 @@ SetTimeSettingsFactory::ReadResource(std::shared_ptr init return setTimeSettings; } -std::shared_ptr SetTimeSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetTimeSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setTimeSettings = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h index ff3fdda37..4b7b5c90f 100644 --- a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetTimeSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetTimeSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp index 5bf1a114d..4289ef46e 100644 --- a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr SetTransitionActorListFactory::ReadResource(std::shared_ptr initData, - std::shared_ptr reader) { +std::shared_ptr SetTransitionActorListFactory::ReadResource(std::shared_ptr initData, + std::shared_ptr reader) { auto setTransitionActorList = std::make_shared(initData); ReadCommandId(setTransitionActorList, reader); @@ -36,7 +36,7 @@ std::shared_ptr SetTransitionActorListFactory::ReadResource(std: return setTransitionActorList; } -std::shared_ptr SetTransitionActorListFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetTransitionActorListFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setTransitionActorList = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h index eaeb2b5ec..a3fc42f41 100644 --- a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetTransitionActorListFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetTransitionActorListFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp index 77991b12c..587e9dcc7 100644 --- a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp @@ -4,8 +4,8 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr -SetWindSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { +std::shared_ptr +SetWindSettingsFactory::ReadResource(std::shared_ptr initData, std::shared_ptr reader) { auto setWind = std::make_shared(initData); ReadCommandId(setWind, reader); @@ -22,7 +22,7 @@ SetWindSettingsFactory::ReadResource(std::shared_ptr init return setWind; } -std::shared_ptr SetWindSettingsFactoryXML::ReadResource(std::shared_ptr initData, +std::shared_ptr SetWindSettingsFactoryXML::ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto setWind = std::make_shared(initData); diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h index bab55dbd9..85381e517 100644 --- a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h @@ -5,13 +5,13 @@ namespace SOH { class SetWindSettingsFactory : public SceneCommandFactoryBinaryV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, std::shared_ptr reader) override; }; class SetWindSettingsFactoryXML : public SceneCommandFactoryXMLV0 { public: - std::shared_ptr - ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; + std::shared_ptr + ReadResource(std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; } // namespace SOH diff --git a/soh/soh/resource/logging/SceneCommandLoggers.cpp b/soh/soh/resource/logging/SceneCommandLoggers.cpp index b1eeb554d..7c55bcaf0 100644 --- a/soh/soh/resource/logging/SceneCommandLoggers.cpp +++ b/soh/soh/resource/logging/SceneCommandLoggers.cpp @@ -27,7 +27,7 @@ namespace SOH { -void LogEndMarkerAsXML(std::shared_ptr resource) { +void LogEndMarkerAsXML(std::shared_ptr resource) { std::shared_ptr endMarker = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -40,7 +40,7 @@ void LogEndMarkerAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogActorListAsXML(std::shared_ptr resource) { +void LogActorListAsXML(std::shared_ptr resource) { std::shared_ptr setActorList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -66,7 +66,7 @@ void LogActorListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogAlternateHeadersAsXML(std::shared_ptr resource) { +void LogAlternateHeadersAsXML(std::shared_ptr resource) { std::shared_ptr setAlternateHeaders = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -79,7 +79,7 @@ void LogAlternateHeadersAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogCameraSettingsAsXML(std::shared_ptr resource) { +void LogCameraSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setCameraSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -95,7 +95,7 @@ void LogCameraSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogSetCollisionHeaderAsXML(std::shared_ptr resource) { +void LogSetCollisionHeaderAsXML(std::shared_ptr resource) { std::shared_ptr setCollisionHeader = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -110,7 +110,7 @@ void LogSetCollisionHeaderAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogCsCameraAsXML(std::shared_ptr resource) { +void LogCsCameraAsXML(std::shared_ptr resource) { std::shared_ptr setCsCamera = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -123,7 +123,7 @@ void LogCsCameraAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogCutscenesAsXML(std::shared_ptr resource) { +void LogCutscenesAsXML(std::shared_ptr resource) { std::shared_ptr setCutscenes = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -138,7 +138,7 @@ void LogCutscenesAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogEchoSettingsAsXML(std::shared_ptr resource) { +void LogEchoSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setEchoSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -153,7 +153,7 @@ void LogEchoSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogEntranceListAsXML(std::shared_ptr resource) { +void LogEntranceListAsXML(std::shared_ptr resource) { std::shared_ptr setEntranceList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -173,7 +173,7 @@ void LogEntranceListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogExitListAsXML(std::shared_ptr resource) { +void LogExitListAsXML(std::shared_ptr resource) { std::shared_ptr setExitList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -192,7 +192,7 @@ void LogExitListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogLightingSettingsAsXML(std::shared_ptr resource) { +void LogLightingSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setLightingSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -234,7 +234,7 @@ void LogLightingSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogLightListAsXML(std::shared_ptr resource) { +void LogLightListAsXML(std::shared_ptr resource) { std::shared_ptr setLightList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -270,7 +270,7 @@ void LogLightListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogMeshAsXML(std::shared_ptr resource) { +void LogMeshAsXML(std::shared_ptr resource) { std::shared_ptr setMesh = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -371,7 +371,7 @@ void LogMeshAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogObjectListAsXML(std::shared_ptr resource) { +void LogObjectListAsXML(std::shared_ptr resource) { std::shared_ptr setObjectList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -390,7 +390,7 @@ void LogObjectListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogPathwaysAsXML(std::shared_ptr resource) { +void LogPathwaysAsXML(std::shared_ptr resource) { std::shared_ptr setPathways = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -409,7 +409,7 @@ void LogPathwaysAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogRoomBehaviorAsXML(std::shared_ptr resource) { +void LogRoomBehaviorAsXML(std::shared_ptr resource) { std::shared_ptr setRoomBehavior = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -425,7 +425,7 @@ void LogRoomBehaviorAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogRoomListAsXML(std::shared_ptr resource) { +void LogRoomListAsXML(std::shared_ptr resource) { std::shared_ptr setRoomList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -444,7 +444,7 @@ void LogRoomListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogSkyboxModifierAsXML(std::shared_ptr resource) { +void LogSkyboxModifierAsXML(std::shared_ptr resource) { std::shared_ptr setSkyboxModifier = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -460,7 +460,7 @@ void LogSkyboxModifierAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogSkyboxSettingsAsXML(std::shared_ptr resource) { +void LogSkyboxSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setSkyboxSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -478,7 +478,7 @@ void LogSkyboxSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogSoundSettingsAsXML(std::shared_ptr resource) { +void LogSoundSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setSoundSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -495,7 +495,7 @@ void LogSoundSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogSpecialObjectsAsXML(std::shared_ptr resource) { +void LogSpecialObjectsAsXML(std::shared_ptr resource) { std::shared_ptr setSpecialObjects = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -511,7 +511,7 @@ void LogSpecialObjectsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogStartPositionListAsXML(std::shared_ptr resource) { +void LogStartPositionListAsXML(std::shared_ptr resource) { std::shared_ptr setStartPositionList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -537,7 +537,7 @@ void LogStartPositionListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogTimeSettingsAsXML(std::shared_ptr resource) { +void LogTimeSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setTimeSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -554,7 +554,7 @@ void LogTimeSettingsAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogTransitionActorListAsXML(std::shared_ptr resource) { +void LogTransitionActorListAsXML(std::shared_ptr resource) { std::shared_ptr setTransitionActorList = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; @@ -582,7 +582,7 @@ void LogTransitionActorListAsXML(std::shared_ptr resource) { SPDLOG_INFO("{}: {}", resource->GetInitData()->Path, printer.CStr()); } -void LogWindSettingsAsXML(std::shared_ptr resource) { +void LogWindSettingsAsXML(std::shared_ptr resource) { std::shared_ptr setWindSettings = std::static_pointer_cast(resource); tinyxml2::XMLDocument doc; diff --git a/soh/soh/resource/logging/SceneCommandLoggers.h b/soh/soh/resource/logging/SceneCommandLoggers.h index 1351a5c77..f952ac766 100644 --- a/soh/soh/resource/logging/SceneCommandLoggers.h +++ b/soh/soh/resource/logging/SceneCommandLoggers.h @@ -3,30 +3,30 @@ namespace SOH { -void LogEndMarkerAsXML(std::shared_ptr resource); -void LogActorListAsXML(std::shared_ptr resource); -void LogAlternateHeadersAsXML(std::shared_ptr resource); -void LogCameraSettingsAsXML(std::shared_ptr resource); -void LogSetCollisionHeaderAsXML(std::shared_ptr resource); -void LogCsCameraAsXML(std::shared_ptr resource); -void LogCutscenesAsXML(std::shared_ptr resource); -void LogEchoSettingsAsXML(std::shared_ptr resource); -void LogEntranceListAsXML(std::shared_ptr resource); -void LogExitListAsXML(std::shared_ptr resource); -void LogLightingSettingsAsXML(std::shared_ptr resource); -void LogLightListAsXML(std::shared_ptr resource); -void LogMeshAsXML(std::shared_ptr resource); -void LogObjectListAsXML(std::shared_ptr resource); -void LogPathwaysAsXML(std::shared_ptr resource); -void LogRoomBehaviorAsXML(std::shared_ptr resource); -void LogRoomListAsXML(std::shared_ptr resource); -void LogSkyboxModifierAsXML(std::shared_ptr resource); -void LogSkyboxSettingsAsXML(std::shared_ptr resource); -void LogSoundSettingsAsXML(std::shared_ptr resource); -void LogSpecialObjectsAsXML(std::shared_ptr resource); -void LogStartPositionListAsXML(std::shared_ptr resource); -void LogTimeSettingsAsXML(std::shared_ptr resource); -void LogTransitionActorListAsXML(std::shared_ptr resource); -void LogWindSettingsAsXML(std::shared_ptr resource); +void LogEndMarkerAsXML(std::shared_ptr resource); +void LogActorListAsXML(std::shared_ptr resource); +void LogAlternateHeadersAsXML(std::shared_ptr resource); +void LogCameraSettingsAsXML(std::shared_ptr resource); +void LogSetCollisionHeaderAsXML(std::shared_ptr resource); +void LogCsCameraAsXML(std::shared_ptr resource); +void LogCutscenesAsXML(std::shared_ptr resource); +void LogEchoSettingsAsXML(std::shared_ptr resource); +void LogEntranceListAsXML(std::shared_ptr resource); +void LogExitListAsXML(std::shared_ptr resource); +void LogLightingSettingsAsXML(std::shared_ptr resource); +void LogLightListAsXML(std::shared_ptr resource); +void LogMeshAsXML(std::shared_ptr resource); +void LogObjectListAsXML(std::shared_ptr resource); +void LogPathwaysAsXML(std::shared_ptr resource); +void LogRoomBehaviorAsXML(std::shared_ptr resource); +void LogRoomListAsXML(std::shared_ptr resource); +void LogSkyboxModifierAsXML(std::shared_ptr resource); +void LogSkyboxSettingsAsXML(std::shared_ptr resource); +void LogSoundSettingsAsXML(std::shared_ptr resource); +void LogSpecialObjectsAsXML(std::shared_ptr resource); +void LogStartPositionListAsXML(std::shared_ptr resource); +void LogTimeSettingsAsXML(std::shared_ptr resource); +void LogTransitionActorListAsXML(std::shared_ptr resource); +void LogWindSettingsAsXML(std::shared_ptr resource); } //namespace SOH \ No newline at end of file diff --git a/soh/soh/resource/type/Animation.h b/soh/soh/resource/type/Animation.h index abd319d97..bf2497107 100644 --- a/soh/soh/resource/type/Animation.h +++ b/soh/soh/resource/type/Animation.h @@ -63,11 +63,11 @@ LinkAnimationHeader linkAnimationHeader; TransformUpdateIndex transformUpdateIndex; }; -class Animation : public LUS::Resource { +class Animation : public Ship::Resource { public: using Resource::Resource; - Animation() : Resource(std::shared_ptr()) {} + Animation() : Resource(std::shared_ptr()) {} AnimationData* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/AudioSample.h b/soh/soh/resource/type/AudioSample.h index 4d6929c59..f37659091 100644 --- a/soh/soh/resource/type/AudioSample.h +++ b/soh/soh/resource/type/AudioSample.h @@ -39,11 +39,11 @@ namespace SOH { s32 sampleRate; // For wav samples only... } Sample; // size = 0x10 - class AudioSample : public LUS::Resource { + class AudioSample : public Ship::Resource { public: using Resource::Resource; - AudioSample() : Resource(std::shared_ptr()) {} + AudioSample() : Resource(std::shared_ptr()) {} Sample* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/AudioSequence.h b/soh/soh/resource/type/AudioSequence.h index 457db6243..d7a8820a3 100644 --- a/soh/soh/resource/type/AudioSequence.h +++ b/soh/soh/resource/type/AudioSequence.h @@ -17,11 +17,11 @@ typedef struct { uint8_t fonts[16]; } Sequence; -class AudioSequence : public LUS::Resource { +class AudioSequence : public Ship::Resource { public: using Resource::Resource; - AudioSequence() : Resource(std::shared_ptr()) {} + AudioSequence() : Resource(std::shared_ptr()) {} Sequence* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/AudioSoundFont.h b/soh/soh/resource/type/AudioSoundFont.h index 11b899d3e..12d66b2d2 100644 --- a/soh/soh/resource/type/AudioSoundFont.h +++ b/soh/soh/resource/type/AudioSoundFont.h @@ -52,11 +52,11 @@ typedef struct { s32 fntIndex; } SoundFont; // size = 0x14 -class AudioSoundFont : public LUS::Resource { +class AudioSoundFont : public Ship::Resource { public: using Resource::Resource; - AudioSoundFont() : Resource(std::shared_ptr()) {} + AudioSoundFont() : Resource(std::shared_ptr()) {} SoundFont* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Background.h b/soh/soh/resource/type/Background.h index 9edc4b0d6..aa81edde4 100644 --- a/soh/soh/resource/type/Background.h +++ b/soh/soh/resource/type/Background.h @@ -3,11 +3,11 @@ #include "resource/Resource.h" namespace SOH { -class Background : public LUS::Resource { +class Background : public Ship::Resource { public: using Resource::Resource; - Background() : Resource(std::shared_ptr()) {} + Background() : Resource(std::shared_ptr()) {} uint8_t* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/CollisionHeader.h b/soh/soh/resource/type/CollisionHeader.h index e2ddf3f7a..dba5994ce 100644 --- a/soh/soh/resource/type/CollisionHeader.h +++ b/soh/soh/resource/type/CollisionHeader.h @@ -67,11 +67,11 @@ typedef struct { size_t cameraDataListLen; // OTRTODO: Added to allow for bounds checking the cameraDataList. } CollisionHeaderData; // original name: BGDataInfo -class CollisionHeader : public LUS::Resource { +class CollisionHeader : public Ship::Resource { public: using Resource::Resource; - CollisionHeader() : Resource(std::shared_ptr()) {} + CollisionHeader() : Resource(std::shared_ptr()) {} CollisionHeaderData* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Cutscene.h b/soh/soh/resource/type/Cutscene.h index c4d5fb0d5..664413d2d 100644 --- a/soh/soh/resource/type/Cutscene.h +++ b/soh/soh/resource/type/Cutscene.h @@ -41,11 +41,11 @@ enum class CutsceneCommands { Error = 0xFEAF, }; -class Cutscene : public LUS::Resource { +class Cutscene : public Ship::Resource { public: using Resource::Resource; - Cutscene() : Resource(std::shared_ptr()) {} + Cutscene() : Resource(std::shared_ptr()) {} uint32_t* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Path.h b/soh/soh/resource/type/Path.h index c4078bed3..5adf683d3 100644 --- a/soh/soh/resource/type/Path.h +++ b/soh/soh/resource/type/Path.h @@ -13,11 +13,11 @@ typedef struct { /* 0x04 */ Vec3s* points; // Segment Address to the array of points } PathData; // size = 0x8 -class Path : public LUS::Resource { +class Path : public Ship::Resource { public: using Resource::Resource; - Path() : Resource(std::shared_ptr()) {} + Path() : Resource(std::shared_ptr()) {} PathData* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/PlayerAnimation.h b/soh/soh/resource/type/PlayerAnimation.h index 416b3928c..e44d30b1b 100644 --- a/soh/soh/resource/type/PlayerAnimation.h +++ b/soh/soh/resource/type/PlayerAnimation.h @@ -5,11 +5,11 @@ #include "Resource.h" namespace SOH { -class PlayerAnimation : public LUS::Resource { +class PlayerAnimation : public Ship::Resource { public: using Resource::Resource; - PlayerAnimation() : Resource(std::shared_ptr()) {} + PlayerAnimation() : Resource(std::shared_ptr()) {} int16_t* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Scene.h b/soh/soh/resource/type/Scene.h index 79ff69392..722c51845 100644 --- a/soh/soh/resource/type/Scene.h +++ b/soh/soh/resource/type/Scene.h @@ -9,11 +9,11 @@ namespace SOH { -class Scene : public LUS::Resource { +class Scene : public Ship::Resource { public: using Resource::Resource; - Scene() : Resource(std::shared_ptr()) {} + Scene() : Resource(std::shared_ptr()) {} void* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Skeleton.cpp b/soh/soh/resource/type/Skeleton.cpp index 39c28f533..8abce78db 100644 --- a/soh/soh/resource/type/Skeleton.cpp +++ b/soh/soh/resource/type/Skeleton.cpp @@ -36,9 +36,9 @@ void SkeletonPatcher::RegisterSkeleton(std::string& path, SkelAnime* skelAnime) } // Determine if we're using an alternate skeleton - if (path.starts_with(LUS::IResource::gAltAssetPrefix)) { - info.vanillaSkeletonPath = path.substr(LUS::IResource::gAltAssetPrefix.length(), - path.size() - LUS::IResource::gAltAssetPrefix.length()); + if (path.starts_with(Ship::IResource::gAltAssetPrefix)) { + info.vanillaSkeletonPath = path.substr(Ship::IResource::gAltAssetPrefix.length(), + path.size() - Ship::IResource::gAltAssetPrefix.length()); } else { info.vanillaSkeletonPath = path; } @@ -68,8 +68,8 @@ void SkeletonPatcher::UpdateSkeletons() { bool isHD = CVarGetInteger("gAltAssets", 0); for (auto skel : skeletons) { Skeleton* newSkel = - (Skeleton*)LUS::Context::GetInstance()->GetResourceManager() - ->LoadResource((isHD ? LUS::IResource::gAltAssetPrefix : "") + skel.vanillaSkeletonPath, true) + (Skeleton*)Ship::Context::GetInstance()->GetResourceManager() + ->LoadResource((isHD ? Ship::IResource::gAltAssetPrefix : "") + skel.vanillaSkeletonPath, true) .get(); if (newSkel != nullptr) { diff --git a/soh/soh/resource/type/Skeleton.h b/soh/soh/resource/type/Skeleton.h index 81aa90c68..72d81c5a5 100644 --- a/soh/soh/resource/type/Skeleton.h +++ b/soh/soh/resource/type/Skeleton.h @@ -50,11 +50,11 @@ union SkeletonData { SkelCurveLimbList skelCurveLimbList; }; -class Skeleton : public LUS::Resource { +class Skeleton : public Ship::Resource { public: using Resource::Resource; - Skeleton() : Resource(std::shared_ptr()) {} + Skeleton() : Resource(std::shared_ptr()) {} SkeletonData* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/SkeletonLimb.h b/soh/soh/resource/type/SkeletonLimb.h index bae04092c..04b815f05 100644 --- a/soh/soh/resource/type/SkeletonLimb.h +++ b/soh/soh/resource/type/SkeletonLimb.h @@ -97,11 +97,11 @@ union SkeletonLimbData { SkinLimb skinLimb; }; -class SkeletonLimb : public LUS::Resource { +class SkeletonLimb : public Ship::Resource { public: using Resource::Resource; - SkeletonLimb() : Resource(std::shared_ptr()) {} + SkeletonLimb() : Resource(std::shared_ptr()) {} SkeletonLimbData* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/Text.h b/soh/soh/resource/type/Text.h index 03cf7340b..1ad8c9663 100644 --- a/soh/soh/resource/type/Text.h +++ b/soh/soh/resource/type/Text.h @@ -16,11 +16,11 @@ public: std::string msg; }; -class Text : public LUS::Resource { +class Text : public Ship::Resource { public: using Resource::Resource; - Text() : Resource(std::shared_ptr()) {} + Text() : Resource(std::shared_ptr()) {} MessageEntry* GetPointer(); size_t GetPointerSize(); diff --git a/soh/soh/resource/type/scenecommand/SceneCommand.h b/soh/soh/resource/type/scenecommand/SceneCommand.h index 5eb44ae9d..04216e09b 100644 --- a/soh/soh/resource/type/scenecommand/SceneCommand.h +++ b/soh/soh/resource/type/scenecommand/SceneCommand.h @@ -47,10 +47,10 @@ enum class SceneCommandID : uint8_t { Error = 0xFF }; -class ISceneCommand : public LUS::IResource { +class ISceneCommand : public Ship::IResource { public: using IResource::IResource; - ISceneCommand() : IResource(std::shared_ptr()) {} + ISceneCommand() : IResource(std::shared_ptr()) {} SceneCommandID cmdId; }; diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index 05432fc53..49e1e91c4 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -23,10 +23,10 @@ static void SetMessageEntry(MessageTableEntry& entry, const SOH::MessageEntry& m } static void OTRMessage_LoadCustom(const std::string& folderPath, MessageTableEntry*& table, size_t tableSize) { - auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(folderPath).get(); + auto lst = *Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(folderPath).get(); for (auto& tPath : lst) { - auto file = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(tPath)); + auto file = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(tPath)); for (size_t j = 0; j < file->messages.size(); ++j) { // Check if same text ID exists already @@ -43,7 +43,7 @@ static void OTRMessage_LoadCustom(const std::string& folderPath, MessageTableEnt } MessageTableEntry* OTRMessage_LoadTable(const std::string& filePath, bool isNES) { - auto file = std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(filePath)); + auto file = std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(filePath)); if (file == nullptr) return nullptr; @@ -120,7 +120,7 @@ extern "C" void OTRMessage_Init() if (sStaffMessageEntryTablePtr == NULL) { auto file2 = - std::static_pointer_cast(LUS::Context::GetInstance()->GetResourceManager()->LoadResource( + std::static_pointer_cast(Ship::Context::GetInstance()->GetResourceManager()->LoadResource( "text/staff_message_data_static/staff_message_data_static")); // OTRTODO: Should not be malloc'ing here. It's fine for now since we check that the message table is already null. sStaffMessageEntryTablePtr = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file2->messages.size()); diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 522a24eb8..ff485664d 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -13,9 +13,9 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn); s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene); //LUS::OTRResource* OTRPlay_LoadFile(PlayState* play, RomFile* file) { -LUS::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName) +Ship::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName) { - auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(fileName); + auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(fileName); return res.get(); } @@ -81,7 +81,7 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn) { if (IS_BOSS_RUSH && play->sceneNum != SCENE_CHAMBER_OF_THE_SAGES) { gSaveContext.isBossRushPaused = 0; } - /* auto data = static_cast(LUS::Context::GetInstance() + /* auto data = static_cast(Ship::Context::GetInstance() ->GetResourceManager() ->ResourceLoad("object_link_child\\object_link_childVtx_01FE08") .get()); diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 0b9ba98f9..6c5ba67df 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -34,13 +34,13 @@ #include "soh/resource/type/scenecommand/SetEchoSettings.h" #include "soh/resource/type/scenecommand/SetAlternateHeaders.h" -extern LUS::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName); +extern Ship::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName); extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); extern "C" RomFile sNaviMsgFiles[]; s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene); // Forward Declaration of function declared in OTRGlobals.cpp -std::shared_ptr GetResourceByNameHandlingMQ(const char* path); +std::shared_ptr GetResourceByNameHandlingMQ(const char* path); bool Scene_CommandSpawnList(PlayState* play, SOH::ISceneCommand* cmd) { // SOH::SetStartPositionList* cmdStartPos = std::static_pointer_cast(cmd);