mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
Use gamemode enum (#5089)
* Use gamemode enum * update console command for file_select
This commit is contained in:
parent
51310db68f
commit
f023a46a5d
18 changed files with 34 additions and 36 deletions
|
@ -205,7 +205,7 @@ void OnZTitleUpdateSkipToFileSelect(void* gameState) {
|
|||
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
|
||||
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
|
||||
titleContext->state.running = false;
|
||||
|
||||
SET_NEXT_GAMESTATE(&titleContext->state, FileChoose_Init, FileChooseContext);
|
||||
|
|
|
@ -146,7 +146,7 @@ static bool SetPlayerHealthHandler(std::shared_ptr<Ship::Console> Console, const
|
|||
static bool LoadSceneHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>&, std::string* output) {
|
||||
gSaveContext.respawnFlag = 0;
|
||||
gSaveContext.seqId = 0xFF;
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.gameMode = GAMEMODE_NORMAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -489,13 +489,14 @@ static bool FWHandler(std::shared_ptr<Ship::Console> Console, const std::vector<
|
|||
}
|
||||
|
||||
static bool FileSelectHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
|
||||
if (gPlayState != nullptr) {
|
||||
SET_NEXT_GAMESTATE(&gPlayState->state, FileChoose_Init, FileChooseContext);
|
||||
gPlayState->state.running = 0;
|
||||
} else {
|
||||
ERROR_MESSAGE("gPlayState == nullptr");
|
||||
if (gGameState == nullptr) {
|
||||
ERROR_MESSAGE("gGameState == nullptr");
|
||||
return 1;
|
||||
}
|
||||
|
||||
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
|
||||
SET_NEXT_GAMESTATE(gGameState, FileChoose_Init, FileChooseContext);
|
||||
gGameState->running = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -440,7 +440,7 @@ void Entrance_SetWarpSongEntrance(void) {
|
|||
// have to force the grotto return afterwards
|
||||
Grotto_ForceGrottoReturnOnSpecialEntrance();
|
||||
|
||||
if (gSaveContext.gameMode != 0) {
|
||||
if (gSaveContext.gameMode != GAMEMODE_NORMAL) {
|
||||
// During DHWW the cutscene must play at the destination
|
||||
gSaveContext.respawnFlag = -3;
|
||||
} else if (gSaveContext.respawnFlag == -3) {
|
||||
|
|
|
@ -412,7 +412,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
|||
{
|
||||
if (CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) &&
|
||||
CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) {
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.gameMode = GAMEMODE_NORMAL;
|
||||
SET_NEXT_GAMESTATE(gameState, Select_Init, SelectContext);
|
||||
gameState->running = false;
|
||||
}
|
||||
|
|
|
@ -7589,7 +7589,7 @@ Vec3s Camera_Update(Camera* camera) {
|
|||
}
|
||||
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3)) {
|
||||
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_END_CREDITS)) {
|
||||
sCameraInterfaceFlags = 0;
|
||||
Camera_UpdateInterface(sCameraInterfaceFlags);
|
||||
} else if ((D_8011D3F0 != 0) && (camera->thisIdx == MAIN_CAM)) {
|
||||
|
|
|
@ -479,7 +479,7 @@ void Regs_InitDataImpl(void) {
|
|||
WREG(94) = 3;
|
||||
WREG(95) = 6;
|
||||
|
||||
if (gSaveContext.gameMode == 0) {
|
||||
if (gSaveContext.gameMode == GAMEMODE_NORMAL) {
|
||||
R_TEXTBOX_X = 52;
|
||||
R_TEXTBOX_Y = 36;
|
||||
VREG(2) = 214;
|
||||
|
|
|
@ -510,8 +510,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
|||
bool debugCsSkip = (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) &&
|
||||
(gSaveContext.fileNum != 0xFEDC) && CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0));
|
||||
|
||||
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (play->sceneNum != SCENE_HYRULE_FIELD) &&
|
||||
(csCtx->frames > 20) &&
|
||||
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_END_CREDITS) &&
|
||||
(play->sceneNum != SCENE_HYRULE_FIELD) && (csCtx->frames > 20) &&
|
||||
(CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
|
||||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) ||
|
||||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) &&
|
||||
|
@ -575,7 +575,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
|||
|
||||
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); // "Future fork designation=No. [%d]"
|
||||
|
||||
if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) {
|
||||
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (csCtx->frames != cmd->startFrame)) {
|
||||
gSaveContext.unk_13E7 = 1;
|
||||
}
|
||||
|
||||
|
@ -908,7 +908,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
|||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
break;
|
||||
case 54:
|
||||
gSaveContext.gameMode = 3;
|
||||
gSaveContext.gameMode = GAMEMODE_END_CREDITS;
|
||||
Audio_SetSoundBanksMute(0x6F);
|
||||
play->linkAgeOnLoad = 1;
|
||||
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_EAST_EXIT;
|
||||
|
@ -1288,7 +1288,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
|||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
||||
break;
|
||||
case 117:
|
||||
gSaveContext.gameMode = 3;
|
||||
gSaveContext.gameMode = GAMEMODE_END_CREDITS;
|
||||
Audio_SetSoundBanksMute(0x6F);
|
||||
play->linkAgeOnLoad = 0;
|
||||
play->nextEntranceIndex = ENTR_HYRULE_FIELD_PAST_BRIDGE_SPAWN;
|
||||
|
@ -2080,7 +2080,7 @@ void func_80068DC0(PlayState* play, CutsceneContext* csCtx) {
|
|||
|
||||
osSyncPrintf("\n\n\n\n\nやっぱりここかいな"); // "Right here, huh"
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.gameMode = GAMEMODE_NORMAL;
|
||||
|
||||
if (D_8015FCC8 != 0) {
|
||||
switch (gSaveContext.entranceIndex) {
|
||||
|
@ -2203,7 +2203,7 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == ENTR_DESERT_COLOSSUS_OUTSIDE_TEMPLE) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) {
|
||||
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT);
|
||||
gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
|
||||
|
|
|
@ -895,7 +895,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
EnvLightSettings* lightSettingsList = play->envCtx.lightSettingsList;
|
||||
s32 adjustment;
|
||||
|
||||
if ((((void)0, gSaveContext.gameMode) != 0) && (((void)0, gSaveContext.gameMode) != 3)) {
|
||||
if ((((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL) && (((void)0, gSaveContext.gameMode) != GAMEMODE_END_CREDITS)) {
|
||||
func_800AA16C(play);
|
||||
}
|
||||
|
||||
|
@ -925,9 +925,9 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
}
|
||||
|
||||
if ((pauseCtx->state == 0) && (gameOverCtx->state == GAMEOVER_INACTIVE)) {
|
||||
if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == 0)) || (((void)0, gSaveContext.gameMode) == 3)) {
|
||||
if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == 0)) || (((void)0, gSaveContext.gameMode) == GAMEMODE_END_CREDITS)) {
|
||||
if ((envCtx->unk_1A == 0) && !FrameAdvance_IsEnabled(play) &&
|
||||
(play->transitionMode == TRANS_MODE_OFF || ((void)0, gSaveContext.gameMode) != 0)) {
|
||||
(play->transitionMode == TRANS_MODE_OFF || ((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL)) {
|
||||
|
||||
if (IS_DAY || gTimeIncrement >= 0x190) {
|
||||
gSaveContext.dayTime += gTimeIncrement;
|
||||
|
|
|
@ -3215,7 +3215,7 @@ void Interface_UpdateMagicBar(PlayState* play) {
|
|||
case MAGIC_STATE_FILL:
|
||||
gSaveContext.magic += 4;
|
||||
|
||||
if (gSaveContext.gameMode == 0 && gSaveContext.sceneSetupIndex < 4) {
|
||||
if (gSaveContext.gameMode == GAMEMODE_NORMAL && gSaveContext.sceneSetupIndex < 4) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
}
|
||||
|
|
|
@ -1131,7 +1131,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL
|
|||
|
||||
if (((CVarGetInteger(CVAR_ENHANCEMENT("FirstPersonGauntlets"), 0) && LINK_IS_ADULT) || (overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson)) &&
|
||||
(overrideLimbDraw != Player_OverrideLimbDrawGameplayCrawling) &&
|
||||
(gSaveContext.gameMode != 3)) {
|
||||
(gSaveContext.gameMode != GAMEMODE_END_CREDITS)) {
|
||||
if (LINK_IS_ADULT) {
|
||||
s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ void EnLight_Init(Actor* thisx, PlayState* play) {
|
|||
EnLight* this = (EnLight*)thisx;
|
||||
s16 yOffset;
|
||||
|
||||
if (gSaveContext.gameMode == 3) {
|
||||
if (gSaveContext.gameMode == GAMEMODE_END_CREDITS) {
|
||||
// special case for the credits
|
||||
yOffset = (this->actor.params < 0) ? 1 : 40;
|
||||
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, yOffset + (s16)this->actor.world.pos.y,
|
||||
|
|
|
@ -251,7 +251,7 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) {
|
|||
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
|
||||
gSaveContext.gameMode = 2;
|
||||
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) {
|
|||
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
|
||||
gSaveContext.gameMode = 2;
|
||||
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
@ -1065,4 +1065,4 @@ void EnMag_Draw(Actor* thisx, PlayState* play) {
|
|||
POLY_OPA_DISP = gfx;
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -463,7 +463,7 @@ void func_80AAE294(EnMm* this, PlayState* play) {
|
|||
dustPos.y = this->actor.world.pos.y;
|
||||
dustPos.z = this->actor.world.pos.z;
|
||||
|
||||
if (gSaveContext.gameMode != 3) {
|
||||
if (gSaveContext.gameMode != GAMEMODE_END_CREDITS) {
|
||||
func_80033480(play, &dustPos, 50.0f, 2, 350, 20, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, PlayState* play) {
|
|||
Flags_UnsetEnv(play, 5); // clear storms env flag
|
||||
if (((play->pauseCtx.state == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(play->msgCtx.msgLength == 0) && (!FrameAdvance_IsEnabled(play)) &&
|
||||
((play->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != 0))) ||
|
||||
((play->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != GAMEMODE_NORMAL))) ||
|
||||
(this->timer >= 250)) {
|
||||
if (play->envCtx.indoors || play->envCtx.unk_1F != 1) {
|
||||
this->timer--;
|
||||
|
|
|
@ -10859,7 +10859,7 @@ void Player_Init(Actor* thisx, PlayState* play2) {
|
|||
}
|
||||
|
||||
if (startMode != PLAYER_START_MODE_NOTHING) {
|
||||
if ((gSaveContext.gameMode == 0) || (gSaveContext.gameMode == 3)) {
|
||||
if ((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_END_CREDITS)) {
|
||||
this->naviActor = Player_SpawnFairy(play, this, &thisx->world.pos, &D_80854778, FAIRY_NAVI);
|
||||
if (gSaveContext.dogParams != 0) {
|
||||
gSaveContext.dogParams |= 0x8000;
|
||||
|
|
|
@ -3112,7 +3112,7 @@ void FileChoose_LoadGame(GameState* thisx) {
|
|||
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
gSaveContext.fileNum = this->buttonIndex;
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.gameMode = GAMEMODE_NORMAL;
|
||||
|
||||
if ((this->buttonIndex == FS_BTN_SELECT_FILE_1 && CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0)) || this->buttonIndex == 0xFF) {
|
||||
if (this->buttonIndex == 0xFF) {
|
||||
|
@ -3737,7 +3737,4 @@ void FileChoose_Init(GameState* thisx) {
|
|||
Font_LoadOrderedFont(&this->font);
|
||||
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
|
||||
func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1);
|
||||
|
||||
// Originally this was only set when transitioning from the title screen, but gSkipLogoTitle skips that process so we're ensuring it's set here
|
||||
gSaveContext.gameMode = GAMEMODE_FILE_SELECT;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
void Sram_InitDebugSave(void);
|
||||
|
||||
void Opening_SetupTitleScreen(OpeningContext* this) {
|
||||
gSaveContext.gameMode = 1;
|
||||
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
|
||||
this->state.running = false;
|
||||
gSaveContext.linkAge = 0;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
|
|
|
@ -137,7 +137,7 @@ void Title_Main(GameState* thisx) {
|
|||
if (this->exit) {
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue