mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-04-23 08:14:31 +00:00
use bool over s8 (#6547)
This commit is contained in:
parent
92ba43d675
commit
f3d60e0ddd
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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[] = {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ std::unordered_map<std::string, HintType> SpoilerfileHintTypeNameToEnum;
|
|||
std::set<RandomizerCheck> excludedLocations;
|
||||
std::set<RandomizerCheck> 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<GameInteractor::OnGenerationCompletion>();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue