Skip to content

Commit

Permalink
Lus updates (#2822)
Browse files Browse the repository at this point in the history
* Changes for LUS renames in ResourceManager and Archive.

* Moves WriteSaveFile and ReadSaveFile to SaveManager.

* Removes ImGui namespace.

* Bump LUS

* Update soh/soh/GameMenuBar.cpp

* Bump LUS

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
  • Loading branch information
Kenix3 and briaguya-ai authored May 4, 2023
1 parent 859bf85 commit 4980ae8
Show file tree
Hide file tree
Showing 105 changed files with 487 additions and 460 deletions.
2 changes: 1 addition & 1 deletion libultraship
Submodule libultraship updated 59 files
+1 −1 .github/workflows/tidy-format-validation.yml
+0 −4 extern/ImGui/backends/wiiu/imgui_impl_wiiu.cpp
+44 −0 extern/ZAPDUtils/Utils/StringHelper.cpp
+6 −0 extern/ZAPDUtils/Utils/StringHelper.h
+14 −14 extern/ZAPDUtils/Vec2f.h
+16 −16 extern/ZAPDUtils/Vec3f.h
+16 −16 extern/ZAPDUtils/Vec3s.h
+1 −1 include/libultraship/classes.h
+4 −4 src/CMakeLists.txt
+8 −8 src/binarytools/BinaryReader.cpp
+4 −4 src/binarytools/BinaryReader.h
+1 −1 src/controller/ControlDeck.cpp
+1 −0 src/core/ConsoleVariable.cpp
+23 −41 src/core/Window.cpp
+11 −9 src/core/Window.h
+2 −2 src/core/bridge/audioplayerbridge.cpp
+4 −4 src/core/bridge/resourcebridge.cpp
+1 −1 src/core/libultra/os.cpp
+11 −12 src/debug/CrashHandler.cpp
+6 −1 src/graphic/Fast3D/gfx_cc.h
+10 −10 src/graphic/Fast3D/gfx_direct3d11.cpp
+2 −2 src/graphic/Fast3D/gfx_dxgi.cpp
+49 −19 src/graphic/Fast3D/gfx_gx2.cpp
+1 −1 src/graphic/Fast3D/gfx_opengl.cpp
+8 −8 src/graphic/Fast3D/gfx_pc.cpp
+6 −6 src/graphic/Fast3D/gfx_sdl2.cpp
+15 −5 src/graphic/Fast3D/gfx_wiiu.cpp
+284 −102 src/graphic/Fast3D/gx2_shader_gen.c
+6 −9 src/log/spd/ConsoleSink.h
+2 −4 src/menu/Console.cpp
+13 −13 src/menu/GameOverlay.cpp
+15 −18 src/menu/ImGuiImpl.cpp
+5 −5 src/menu/ImGuiImpl.h
+19 −19 src/menu/InputEditor.cpp
+1 −0 src/misc/stox.h
+2 −2 src/port/wiiu/WiiUImpl.cpp
+32 −31 src/resource/Archive.cpp
+12 −12 src/resource/Archive.h
+1 −1 src/resource/File.h
+2 −2 src/resource/Resource.cpp
+3 −3 src/resource/Resource.h
+1 −1 src/resource/ResourceFactory.cpp
+3 −3 src/resource/ResourceFactory.h
+3 −3 src/resource/ResourceLoader.cpp
+2 −2 src/resource/ResourceLoader.h
+37 −49 src/resource/ResourceManager.cpp
+10 −13 src/resource/ResourceManager.h
+1 −1 src/resource/factory/ArrayFactory.cpp
+1 −1 src/resource/factory/ArrayFactory.h
+1 −1 src/resource/factory/BlobFactory.cpp
+1 −1 src/resource/factory/BlobFactory.h
+2 −2 src/resource/factory/DisplayListFactory.cpp
+2 −2 src/resource/factory/DisplayListFactory.h
+1 −1 src/resource/factory/MatrixFactory.cpp
+1 −1 src/resource/factory/MatrixFactory.h
+1 −1 src/resource/factory/TextureFactory.cpp
+1 −1 src/resource/factory/TextureFactory.h
+2 −2 src/resource/factory/VertexFactory.cpp
+2 −2 src/resource/factory/VertexFactory.h
4 changes: 2 additions & 2 deletions soh/soh/Enhancements/audio/AudioCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) {
excludedSequences.insert(seqInfo);
includedSequences.erase(seqInfo);
CVarSetInteger(cvarKey.c_str(), 1);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
}

void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
const std::string cvarKey = "gAudioEditor.Excluded." + seqInfo->sfxKey;
includedSequences.insert(seqInfo);
excludedSequences.erase(seqInfo);
CVarClear(cvarKey.c_str());
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
}

void AudioCollection::InitializeShufflePool() {
Expand Down
18 changes: 9 additions & 9 deletions soh/soh/Enhancements/audio/AudioEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
const std::string randomizeAllButton = "Randomize All" + hiddenTabId;
if (ImGui::Button(resetAllButton.c_str())) {
ResetGroup(map, type);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM();
}
}
ImGui::SameLine();
if (ImGui::Button(randomizeAllButton.c_str())) {
RandomizeGroup(type);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM();
}
Expand Down Expand Up @@ -205,7 +205,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {

if (ImGui::Selectable(seqData.label.c_str())) {
CVarSetInteger(cvarKey.c_str(), value);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, type);
}
}
Expand All @@ -219,7 +219,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::PushItemWidth(-FLT_MIN);
if (ImGui::Button(resetButton.c_str())) {
CVarSetInteger(cvarKey.c_str(), defaultValue);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, seqData.category);
}
ImGui::SameLine();
Expand All @@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto it = validSequences.begin();
const auto& seqData = *std::next(it, rand() % validSequences.size());
CVarSetInteger(cvarKey.c_str(), seqData->sequenceId);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(seqData->sequenceId, type);
}
}
Expand Down Expand Up @@ -378,7 +378,7 @@ void DrawSfxEditor(bool& open) {
const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
if (ImGui::Button(resetButton.c_str())) {
CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
}

ImGui::NewLine();
Expand Down Expand Up @@ -552,7 +552,7 @@ void DrawSfxEditor(bool& open) {

void InitAudioEditor() {
//Draw the bar in the menu.
SohImGui::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor);
Ship::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor);
}

std::vector<SeqType> allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX };
Expand All @@ -562,7 +562,7 @@ void AudioEditor_RandomizeAll() {
RandomizeGroup(type);
}

SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
ReplayCurrentBGM();
}

Expand All @@ -571,6 +571,6 @@ void AudioEditor_ResetAll() {
ResetGroup(AudioCollection::Instance->GetAllSequences(), type);
}

SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
ReplayCurrentBGM();
}
42 changes: 21 additions & 21 deletions soh/soh/Enhancements/controls/GameControlEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace GameControlEditor {
void DrawUI(bool&);

void Init() {
SohImGui::AddWindow("Enhancements", "Game Control Editor", DrawUI);
Ship::AddWindow("Enhancements", "Game Control Editor", DrawUI);

addButtonName(BTN_A, "A");
addButtonName(BTN_B, "B");
Expand Down Expand Up @@ -136,7 +136,7 @@ namespace GameControlEditor {
}
if (ImGui::Selectable(i->second, i->first == currentButton)) {
CVarSetInteger(mapping.cVarName, i->first);
SohImGui::RequestCvarSaveOnNextTick();
Ship::RequestCvarSaveOnNextTick();
}
}
ImGui::EndCombo();
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace GameControlEditor {
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
TableHelper::InitHeader(false);

SohImGui::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize("D5").x + 10;
DrawMapping(ocarinaD5, labelWidth, disableMask);
DrawMapping(ocarinaB4, labelWidth, disableMask);
Expand All @@ -181,16 +181,16 @@ namespace GameControlEditor {
DrawMapping(ocarinaD4, labelWidth, disableMask);
ImGui::Dummy(ImVec2(0, 5));
float cursorY = ImGui::GetCursorPosY();
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();

TableHelper::NextCol();

SohImGui::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10;
DrawMapping(ocarinaSongDisable, labelWidth, disableMask);
DrawMapping(ocarinaSharp, labelWidth, disableMask);
DrawMapping(ocarinaFlat, labelWidth, disableMask);
SohImGui::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
Ship::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);

ImGui::EndTable();
}
Expand All @@ -201,7 +201,7 @@ namespace GameControlEditor {
UIWidgets::Spacer(0);
}

SohImGui::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
Ship::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);
Expand All @@ -213,18 +213,18 @@ namespace GameControlEditor {
UIWidgets::Spacer(0);
ImGui::EndTable();
}
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();

ImGui::EndTable();
}

// CurrentPort is indexed started at 1 here due to the Generic tab, instead of 0 like in InputEditor
// Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort
void DrawCustomButtons() {
SohImGui::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);
Ship::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);

SohImGui::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
SohImGui::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
Ship::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
Ship::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
}

void DrawCameraControlPanel() {
Expand All @@ -233,7 +233,7 @@ namespace GameControlEditor {
}

UIWidgets::Spacer(0);
SohImGui::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming");
DrawHelpIcon("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming");
UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", "gInvertAimingXAxis");
Expand All @@ -252,10 +252,10 @@ namespace GameControlEditor {
CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f);
}
UIWidgets::Spacer(0);
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();

UIWidgets::Spacer(0);
SohImGui::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());

UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera");
DrawHelpIcon("Enables free camera control\nNote: You must remap C buttons off of the right stick in the "
Expand All @@ -273,7 +273,7 @@ namespace GameControlEditor {
"gFreeCameraDistMax", 100, 900, "", 185, true, false, true);
UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed",
"gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true);
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();
}

void DrawDpadControlPanel() {
Expand All @@ -283,7 +283,7 @@ namespace GameControlEditor {

ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
SohImGui::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause");
DrawHelpIcon("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");
Expand All @@ -292,7 +292,7 @@ namespace GameControlEditor {
"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");
DrawHelpIcon("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");
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();
}

void DrawMiscControlPanel() {
Expand All @@ -302,7 +302,7 @@ namespace GameControlEditor {

ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
SohImGui::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail());
Ship::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);
Expand All @@ -313,16 +313,16 @@ namespace GameControlEditor {
DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above");
if (CVarGetInteger("gEnableWalkModify", 0)) {
UIWidgets::Spacer(5);
SohImGui::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
Ship::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false);
UIWidgets::PaddedEnhancementSliderFloat("Modifier 1: %d %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
UIWidgets::PaddedEnhancementSliderFloat("Modifier 2: %d %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();
}
UIWidgets::Spacer(0);
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
SohImGui::EndGroupPanel();
Ship::EndGroupPanel();

}

Expand Down
Loading

0 comments on commit 4980ae8

Please sign in to comment.