From 79e4200ddf5fdfad5e2123fc0905d947ee2d13ff Mon Sep 17 00:00:00 2001 From: briaguya Date: Fri, 3 Jun 2022 02:37:02 -0400 Subject: [PATCH] it builds! also seed generation runs! --- libultraship/libultraship/SohImGuiImpl.h | 1 - .../randomizer/3drando/item_pool.hpp | 1 + .../Enhancements/randomizer/3drando/music.hpp | 2 +- .../randomizer/3drando/rando_main.cpp | 2 +- .../randomizer/3drando/sound_effects.cpp | 1 + .../randomizer/3drando/sound_effects.hpp | 1 + .../randomizer/3drando/starting_inventory.hpp | 1 + .../Enhancements/randomizer/randomizer.cpp | 31 +++++++++---------- soh/soh/Enhancements/randomizer/randomizer.h | 4 +-- soh/soh/OTRGlobals.cpp | 2 +- soh/soh/OTRGlobals.h | 2 +- 11 files changed, 25 insertions(+), 23 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.h b/libultraship/libultraship/SohImGuiImpl.h index 850c740e5..421c71778 100644 --- a/libultraship/libultraship/SohImGuiImpl.h +++ b/libultraship/libultraship/SohImGuiImpl.h @@ -74,7 +74,6 @@ namespace SohImGui { void DrawMainMenuAndCalculateGameSize(void); - void GenerateRandomizerImgui(); void DrawFramebufferAndGameInput(void); void Render(void); void CancelFrame(void); diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.hpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.hpp index fa1d3ab21..d71e4cb2f 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.hpp @@ -4,6 +4,7 @@ #include #include +#include class ItemLocation; diff --git a/soh/soh/Enhancements/randomizer/3drando/music.hpp b/soh/soh/Enhancements/randomizer/3drando/music.hpp index 0f65ea773..90f7fc9dd 100644 --- a/soh/soh/Enhancements/randomizer/3drando/music.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/music.hpp @@ -2,7 +2,7 @@ #include #include - +#include namespace Music { const uint32_t BGM_BASE = 0x1000585; diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index 94c4accb4..ab62ef964 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -4,7 +4,7 @@ #include "item_location.hpp" #include "location_access.hpp" #include "rando_main.hpp" -#include +// #include #include #include diff --git a/soh/soh/Enhancements/randomizer/3drando/sound_effects.cpp b/soh/soh/Enhancements/randomizer/3drando/sound_effects.cpp index 21ab9f8aa..b4be7abfb 100644 --- a/soh/soh/Enhancements/randomizer/3drando/sound_effects.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/sound_effects.cpp @@ -1,6 +1,7 @@ #include "sound_effects.hpp" #include "settings.hpp" #include +#include namespace SFX { const std::array seqTypesSFX = { diff --git a/soh/soh/Enhancements/randomizer/3drando/sound_effects.hpp b/soh/soh/Enhancements/randomizer/3drando/sound_effects.hpp index 759b6a3a5..ee9aa3a09 100644 --- a/soh/soh/Enhancements/randomizer/3drando/sound_effects.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/sound_effects.hpp @@ -2,6 +2,7 @@ #include #include +#include #define SFX_BASE 0x1000001 #define SFX_COUNT 1388 diff --git a/soh/soh/Enhancements/randomizer/3drando/starting_inventory.hpp b/soh/soh/Enhancements/randomizer/3drando/starting_inventory.hpp index 23ade7716..e2c85c875 100644 --- a/soh/soh/Enhancements/randomizer/3drando/starting_inventory.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/starting_inventory.hpp @@ -3,6 +3,7 @@ #include "keys.hpp" #include +#include extern std::vector StartingInventory; extern uint8_t AdditionalHeartContainers; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index ae8eec7df..eca1b61f9 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2056,6 +2056,20 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act std::thread randoThread; +void GenerateRandomizerImgui() { + CVar_SetS32("gRandoGenerating", 1); + Game::SaveSettings(); + + RandoMain::GenerateRando(); + + CVar_SetS32("gRandoGenerating", 0); + Game::SaveSettings(); + + Game::LoadSettings(); + + generated = 1; +} + void DrawRandoEditor(bool& open) { if (!open) { return; @@ -2074,7 +2088,7 @@ void DrawRandoEditor(bool& open) { } if (ImGui::Button("Generate")) { - // GenerateRandomizerImgui(); + GenerateRandomizerImgui(); } // if (generated) { @@ -2085,21 +2099,6 @@ void DrawRandoEditor(bool& open) { ImGui::End(); } -void GenerateRandomizerImgui() { - CVar_SetS32("gRandoGenerating", 1); - Game::SaveSettings(); - - // WHY CAN'T I FIND THIS?????????????????? - RandoMain::GenerateRando(); - - CVar_SetS32("gRandoGenerating", 0); - Game::SaveSettings(); - - Game::LoadSettings(); - - generated = 1; -} - // void EnhancementCheckbox(const char* text, const char* cvarName) // { // bool val = (bool)CVar_GetS32(cvarName, 0); diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 3f02f1930..ce147b71f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -3,8 +3,8 @@ #include #include -#include "../../include/ultra64.h" -#include "../../include/z64item.h" +#include "../../../include/ultra64.h" +#include "../../../include/z64item.h" // #include "randomizer/keys.hpp" // #include #include diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index f08b6ffb8..dbb173fef 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -29,7 +29,7 @@ #include "AudioPlayer.h" #include "Enhancements/debugconsole.h" #include "Enhancements/debugger/debugger.h" -#include "Enhancements/randomizer.h" +#include "Enhancements/randomizer/randomizer.h" #include "soh/frame_interpolation.h" #include "Utils/BitConverter.h" #include "variables.h" diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index bfbd43a46..90184f254 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -7,7 +7,7 @@ #ifdef __cplusplus #include "Enhancements/savestates.h" -#include "Enhancements/randomizer.h" +#include "Enhancements/randomizer/randomizer.h" // #include "randomizer/spoiler_log.hpp" class OTRGlobals