diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-04-07 13:09:00 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-07 13:09:00 +1000 |
| commit | 4faad208c6a30bd696b7c78f255900b905354e1b (patch) | |
| tree | 27d61a0ceff303ebe1a4f9c206d62b30468a317e /src/code | |
| parent | f39d412bfe940afef4e152ad863ecc79cb2b2bd3 (diff) | |
Introduce `SaveContext.gameMode` enum (#1198)
* gamemode enum
* owl save
* trailing enum comma
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_demo.c | 9 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 4 | ||||
| -rw-r--r-- | src/code/z_play.c | 15 |
3 files changed, 15 insertions, 13 deletions
diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 499561623..08d56de69 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -558,7 +558,7 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase* Audio_SetCutsceneFlag(false); gSaveContext.cutsceneTransitionControl = 1; - if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) { + if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (csCtx->frames != cmd->startFrame)) { gSaveContext.hudVisibilityForceButtonAlphasByStatus = true; } @@ -567,7 +567,7 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase* play->nextEntrance = play->csCtx.sceneCsList[play->csCtx.currentCsIndex].nextEntrance; gSaveContext.nextCutsceneIndex = 0; play->transitionTrigger = TRANS_TRIGGER_START; - if (gSaveContext.gameMode != 1) { + if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { Scene_SetExitFade(play); } else { D_801BB12C++; @@ -1416,7 +1416,7 @@ void func_800EDA04(PlayState* play, CutsceneContext* csCtx) { } gSaveContext.save.cutscene = 0; - gSaveContext.gameMode = 0; + gSaveContext.gameMode = GAMEMODE_NORMAL; ActorCutscene_Stop(0x7F); Audio_SetCutsceneFlag(false); csCtx->state = CS_STATE_0; @@ -1469,7 +1469,8 @@ void func_800EDBE0(PlayState* play) { SceneTableEntry* sp24; s32 temp_v0_3; - if (((gSaveContext.gameMode == 0) || (gSaveContext.gameMode == 1)) && (gSaveContext.respawnFlag <= 0)) { + if (((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_TITLE_SCREEN)) && + (gSaveContext.respawnFlag <= 0)) { sp2A = func_800F21CC(); if (sp2A != -1) { temp_v0_3 = func_800F2138(sp2A); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index c008e3abc..be5cc01bc 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -3701,7 +3701,7 @@ void Magic_Update(PlayState* play) { // Add magic until magicFillTarget is reached gSaveContext.save.playerData.magic += 0x10; - if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneLayer < 4)) { + if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.sceneLayer < 4)) { play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG); } @@ -4482,7 +4482,7 @@ void Interface_DrawClock(PlayState* play) { if (R_TIME_SPEED != 0) { if ((msgCtx->msgMode == 0) || ((play->actorCtx.flags & ACTORCTX_FLAG_1) && !Play_InCsMode(play)) || (msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) || - (gSaveContext.gameMode == 3)) { + (gSaveContext.gameMode == GAMEMODE_END_CREDITS)) { if (!FrameAdvance_IsEnabled(&play->state) && !Environment_IsTimeStopped() && (gSaveContext.save.day < 4)) { /** * Changes Clock's transparancy depending if Player is moving or not and possibly other things diff --git a/src/code/z_play.c b/src/code/z_play.c index ea86b2e82..08309b32f 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -689,10 +689,10 @@ void Play_UpdateTransition(PlayState* this) { D_801D0D54 = false; } - if (gSaveContext.gameMode == 4) { + if (gSaveContext.gameMode == GAMEMODE_OWL_SAVE) { STOP_GAMESTATE(&this->state); SET_NEXT_GAMESTATE(&this->state, TitleSetup_Init, sizeof(TitleSetupState)); - } else if (gSaveContext.gameMode != 2) { + } else if (gSaveContext.gameMode != GAMEMODE_FILE_SELECT) { STOP_GAMESTATE(&this->state); SET_NEXT_GAMESTATE(&this->state, Play_Init, sizeof(PlayState)); gSaveContext.save.entrance = this->nextEntrance; @@ -700,7 +700,7 @@ void Play_UpdateTransition(PlayState* this) { if (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) { gSaveContext.minigameStatus = MINIGAME_STATUS_END; } - } else { // 2 + } else { // GAMEMODE_FILE_SELECT STOP_GAMESTATE(&this->state); SET_NEXT_GAMESTATE(&this->state, FileSelect_Init, sizeof(FileSelectState)); } @@ -946,7 +946,7 @@ void Play_UpdateMain(PlayState* this) { } Play_UpdateTransition(this); if (gTransitionTileState != TRANS_TILE_READY) { - if ((gSaveContext.gameMode == 0) && + if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (((this->msgCtx.msgMode == 0)) || ((this->msgCtx.currentTextId == 0xFF) && (this->msgCtx.msgMode == 0x42) && (this->msgCtx.unk12020 == 0x41)) || @@ -1076,7 +1076,7 @@ void Play_PostWorldDraw(PlayState* this) { KaleidoScopeCall_Draw(this); } - if (gSaveContext.gameMode == 0) { + if (gSaveContext.gameMode == GAMEMODE_NORMAL) { Interface_Draw(this); } @@ -2202,7 +2202,8 @@ void Play_Init(GameState* thisx) { func_800EDDB0(this); - if (((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 1)) || (gSaveContext.save.cutscene >= 0xFFF0)) { + if (((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN)) || + (gSaveContext.save.cutscene >= 0xFFF0)) { gSaveContext.unk_3DC0 = 0; Magic_Reset(this); gSaveContext.sceneLayer = (gSaveContext.save.cutscene & 0xF) + 1; @@ -2263,7 +2264,7 @@ void Play_Init(GameState* thisx) { this->haltAllActors = false; this->unk_18844 = false; - if (gSaveContext.gameMode != 1) { + if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) { this->transitionType = (Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) + sceneLayer) >> 7) & 0x7F; |
