diff --git a/soh/soh/Enhancements/randomizer/ColoredMapsAndCompasses.cpp b/soh/soh/Enhancements/randomizer/ColoredMapsAndCompasses.cpp index 161cf87b0..1d831c5f2 100644 --- a/soh/soh/Enhancements/randomizer/ColoredMapsAndCompasses.cpp +++ b/soh/soh/Enhancements/randomizer/ColoredMapsAndCompasses.cpp @@ -17,10 +17,9 @@ extern "C" { CVarGetInteger(CVAR_COLORED_MAPS_AND_COMPASSES_NAME, CVAR_COLORED_MAPS_AND_COMPASSES_DEFAULT) void RegisterColoredMapsAndCompasses() { - s8 mapsAndCompassesCanBeOutsideDungeon = + bool mapsAndCompassesCanBeOutsideDungeon = IS_RANDO && DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_SHUFFLE_MAPANDCOMPASS); - s8 isColoredMapsAndCompassesEnabled = mapsAndCompassesCanBeOutsideDungeon && CVAR_COLORED_MAPS_AND_COMPASSES_VALUE; - if (isColoredMapsAndCompassesEnabled) { + if (mapsAndCompassesCanBeOutsideDungeon && CVAR_COLORED_MAPS_AND_COMPASSES_VALUE) { ResourceMgr_PatchGfxByName(gGiDungeonMapDL, "Map_PrimColor", 5, gsDPNoOp()); ResourceMgr_PatchGfxByName(gGiDungeonMapDL, "Map_EnvColor", 6, gsDPNoOp()); ResourceMgr_PatchGfxByName(gGiCompassDL, "Compass_PrimColor", 5, gsDPNoOp()); diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index f16ae7440..89aea46ac 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -86,7 +86,7 @@ Color_RGB8 MapOrCompassColor[10] = { extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); extern "C" void Randomizer_DrawSmallKey(PlayState* play, GetItemEntry* getItemEntry) { - s8 isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); + bool isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); int slot = getItemEntry->drawItemId - RG_FOREST_TEMPLE_SMALL_KEY; Gfx* customIconDLs[] = { @@ -171,7 +171,7 @@ extern "C" void Randomizer_DrawCompass(PlayState* play, GetItemEntry* getItemEnt } extern "C" void Randomizer_DrawBossKey(PlayState* play, GetItemEntry* getItemEntry) { - s8 isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); + bool isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); s16 slot = getItemEntry->drawItemId - RG_FOREST_TEMPLE_BOSS_KEY; std::string CvarValue[6] = { @@ -235,7 +235,7 @@ extern "C" void Randomizer_DrawBossKey(PlayState* play, GetItemEntry* getItemEnt } extern "C" void Randomizer_DrawKeyRing(PlayState* play, GetItemEntry* getItemEntry) { - s8 isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); + bool isCustomKeysEnabled = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"), 1); int slot = getItemEntry->drawItemId - RG_FOREST_TEMPLE_KEY_RING; Gfx* CustomIconDLs[] = { diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 42dee748c..e0740e16c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -47,7 +47,7 @@ std::unordered_map SpoilerfileHintTypeNameToEnum; std::set excludedLocations; std::set spoilerExcludedLocations; -u8 generated; +bool generated; bool Rando_HandleSpoilerDrop(char* filePath) { if (SohUtils::IsStringEmpty(filePath)) { @@ -4184,14 +4184,14 @@ void GenerateRandomizerImgui(std::string seed = "") { CVarSetInteger(CVAR_GENERAL("RandoGenerating"), 0); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - generated = 1; + generated = true; GameInteractor::Instance->ExecuteHooks(); } bool GenerateRandomizer(std::string seed /*= ""*/) { if (generated) { - generated = 0; + generated = false; randoThread.join(); } if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) { @@ -4206,7 +4206,7 @@ static bool tricksTabOpen = false; void JoinRandoGenerationThread() { if (generated) { - generated = 0; + generated = false; randoThread.join(); } } diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index 0154cd99f..5b078fc53 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -77,8 +77,8 @@ static DungeonEntranceInfo dungeons[] = { // clang-format on }; -static s8 hasCopiedEntranceTable = 0; -static s8 hasModifiedEntranceTable = 0; +static bool hasCopiedEntranceTable = false; +static bool hasModifiedEntranceTable = false; void Entrance_SetEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance); @@ -130,14 +130,14 @@ static void Entrance_ReplaceChildTempleWarps() { void Entrance_CopyOriginalEntranceTable(void) { if (!hasCopiedEntranceTable) { memcpy(originalEntranceTable, gEntranceTable, sizeof(EntranceInfo) * ENTRANCE_TABLE_SIZE); - hasCopiedEntranceTable = 1; + hasCopiedEntranceTable = true; } } void Entrance_ResetEntranceTable(void) { if (hasCopiedEntranceTable && hasModifiedEntranceTable) { memcpy(gEntranceTable, originalEntranceTable, sizeof(EntranceInfo) * ENTRANCE_TABLE_SIZE); - hasModifiedEntranceTable = 0; + hasModifiedEntranceTable = false; } } @@ -258,7 +258,7 @@ void Entrance_Init(void) { } } - hasModifiedEntranceTable = 1; + hasModifiedEntranceTable = true; } s16 Entrance_GetOverride(s16 index) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index 5fe087527..51576725d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -94,7 +94,7 @@ static s16 grottoExitList[NUM_GROTTOS] = { 0 }; static s16 grottoLoadList[NUM_GROTTOS] = { 0 }; static s8 grottoId = 0xFF; static s8 lastEntranceType = NOT_GROTTO; -static u8 overridingNextEntrance = false; +static bool overridingNextEntrance = false; // Initialize both lists so that each index refers to itself. An index referring // to itself means that the entrance is not shuffled. Indices will be overwritten diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 68cd7a783..d96cf0ab2 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -175,7 +175,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { // LACS - u8 meetsLACSRequirements = + bool meetsLACSRequirements = LINK_IS_ADULT && (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TEMPLE_OF_TIME) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&