mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-23 15:55:47 +00:00
Add IS_PAUSED
macro
This commit is contained in:
parent
f752add633
commit
c8d0ca5499
9 changed files with 37 additions and 41 deletions
|
@ -771,6 +771,9 @@ typedef enum {
|
||||||
#define IS_PAUSE_STATE_GAMEOVER(pauseCtx) \
|
#define IS_PAUSE_STATE_GAMEOVER(pauseCtx) \
|
||||||
(((pauseCtx)->state >= PAUSE_STATE_8) && ((pauseCtx)->state <= PAUSE_STATE_17))
|
(((pauseCtx)->state >= PAUSE_STATE_8) && ((pauseCtx)->state <= PAUSE_STATE_17))
|
||||||
|
|
||||||
|
#define IS_PAUSED(pauseCtx) \
|
||||||
|
(((pauseCtx)->state != PAUSE_STATE_OFF) || ((pauseCtx)->debugState != 0))
|
||||||
|
|
||||||
// Sub-states of PAUSE_STATE_MAIN
|
// Sub-states of PAUSE_STATE_MAIN
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* 0 */ PAUSE_MAIN_STATE_IDLE,
|
/* 0 */ PAUSE_MAIN_STATE_IDLE,
|
||||||
|
|
|
@ -3218,10 +3218,7 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) {
|
||||||
|
|
||||||
dynaActor = DynaPoly_GetActor(dynaRaycastDown->colCtx, *dynaRaycastDown->bgId);
|
dynaActor = DynaPoly_GetActor(dynaRaycastDown->colCtx, *dynaRaycastDown->bgId);
|
||||||
if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycastDown->play != NULL)) {
|
if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycastDown->play != NULL)) {
|
||||||
pauseState = dynaRaycastDown->play->pauseCtx.state != PAUSE_STATE_OFF;
|
pauseState = IS_PAUSED(&dynaRaycastDown->play->pauseCtx);
|
||||||
if (!pauseState) {
|
|
||||||
pauseState = dynaRaycastDown->play->pauseCtx.debugState != 0;
|
|
||||||
}
|
|
||||||
if (!pauseState && (dynaRaycastDown->colCtx->dyna.bgActorFlags[*dynaRaycastDown->bgId] & BGACTOR_1)) {
|
if (!pauseState && (dynaRaycastDown->colCtx->dyna.bgActorFlags[*dynaRaycastDown->bgId] & BGACTOR_1)) {
|
||||||
curTransform = &dynaRaycastDown->dyna->bgActors[*dynaRaycastDown->bgId].curTransform;
|
curTransform = &dynaRaycastDown->dyna->bgActors[*dynaRaycastDown->bgId].curTransform;
|
||||||
polyMin =
|
polyMin =
|
||||||
|
|
|
@ -56,7 +56,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||||
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
|
|
||||||
if ((pauseCtx->state != PAUSE_STATE_OFF) || (pauseCtx->debugState != 0)) {
|
if (IS_PAUSED(pauseCtx)) {
|
||||||
if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) {
|
if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) {
|
||||||
if (Letterbox_GetSize() == 0) {
|
if (Letterbox_GetSize() == 0) {
|
||||||
HREG(80) = 7;
|
HREG(80) = 7;
|
||||||
|
@ -101,7 +101,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||||
sKaleidoScopeUpdateFunc(play);
|
sKaleidoScopeUpdateFunc(play);
|
||||||
|
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0)) {
|
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||||
osSyncPrintf(VT_FGCOL(GREEN));
|
osSyncPrintf(VT_FGCOL(GREEN));
|
||||||
// "Kaleido area Kaleidoscope Emission"
|
// "Kaleido area Kaleidoscope Emission"
|
||||||
osSyncPrintf("カレイド領域 カレイドスコープ排出\n");
|
osSyncPrintf("カレイド領域 カレイドスコープ排出\n");
|
||||||
|
|
|
@ -42,11 +42,11 @@ void KaleidoSetup_Update(PlayState* play) {
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
Input* input = &play->state.input[0];
|
Input* input = &play->state.input[0];
|
||||||
|
|
||||||
if (pauseCtx->state == PAUSE_STATE_OFF && pauseCtx->debugState == 0 &&
|
if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
||||||
play->gameOverCtx.state == GAMEOVER_INACTIVE && play->transitionTrigger == TRANS_TRIGGER_OFF &&
|
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF &&
|
||||||
play->transitionMode == TRANS_MODE_OFF && gSaveContext.cutsceneIndex < 0xFFF0 &&
|
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) &&
|
||||||
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) && play->shootingGalleryStatus <= 1 &&
|
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY &&
|
||||||
gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY && gSaveContext.magicState != MAGIC_STATE_FILL &&
|
gSaveContext.magicState != MAGIC_STATE_FILL &&
|
||||||
(play->sceneId != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
|
(play->sceneId != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
|
||||||
|
|
||||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
||||||
|
|
|
@ -887,7 +887,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pauseCtx->state == PAUSE_STATE_OFF) {
|
if (pauseCtx->state == PAUSE_STATE_OFF) {
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0)) {
|
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||||
if (play->skyboxId == SKYBOX_NORMAL_SKY) {
|
if (play->skyboxId == SKYBOX_NORMAL_SKY) {
|
||||||
play->skyboxCtx.rot.y -= 0.001f;
|
play->skyboxCtx.rot.y -= 0.001f;
|
||||||
} else if (play->skyboxId == SKYBOX_CUTSCENE_MAP) {
|
} else if (play->skyboxId == SKYBOX_CUTSCENE_MAP) {
|
||||||
|
|
|
@ -506,8 +506,7 @@ void Health_UpdateBeatingHeart(PlayState* play) {
|
||||||
if (interfaceCtx->beatingHeartOscillator <= 0) {
|
if (interfaceCtx->beatingHeartOscillator <= 0) {
|
||||||
interfaceCtx->beatingHeartOscillator = 0;
|
interfaceCtx->beatingHeartOscillator = 0;
|
||||||
interfaceCtx->beatingHeartOscillatorDirection = 0;
|
interfaceCtx->beatingHeartOscillatorDirection = 0;
|
||||||
if (!Player_InCsMode(play) && (play->pauseCtx.state == PAUSE_STATE_OFF) &&
|
if (!Player_InCsMode(play) && !IS_PAUSED(&play->pauseCtx) && Health_IsCritical() && !Play_InCsMode(play)) {
|
||||||
(play->pauseCtx.debugState == 0) && Health_IsCritical() && !Play_InCsMode(play)) {
|
|
||||||
func_80078884(NA_SE_SY_HITPOINT_ALARM);
|
func_80078884(NA_SE_SY_HITPOINT_ALARM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -522,7 +522,7 @@ void Map_Update(PlayState* play) {
|
||||||
s16 floor;
|
s16 floor;
|
||||||
s16 i;
|
s16 i;
|
||||||
|
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0)) {
|
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||||
switch (play->sceneId) {
|
switch (play->sceneId) {
|
||||||
case SCENE_YDAN:
|
case SCENE_YDAN:
|
||||||
case SCENE_DDAN:
|
case SCENE_DDAN:
|
||||||
|
|
|
@ -2517,10 +2517,9 @@ void Magic_Update(PlayState* play) {
|
||||||
|
|
||||||
case MAGIC_STATE_CONSUME_LENS:
|
case MAGIC_STATE_CONSUME_LENS:
|
||||||
// Slowly consume magic while lens is on
|
// Slowly consume magic while lens is on
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0) &&
|
if (!IS_PAUSED(&play->pauseCtx) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||||
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
||||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
|
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
|
||||||
!Play_InCsMode(play)) {
|
|
||||||
if ((gSaveContext.magic == 0) ||
|
if ((gSaveContext.magic == 0) ||
|
||||||
((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
|
((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
|
||||||
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) ||
|
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) ||
|
||||||
|
@ -2774,7 +2773,7 @@ void Interface_DrawItemButtons(PlayState* play) {
|
||||||
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1);
|
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1);
|
||||||
|
|
||||||
if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) {
|
if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) {
|
||||||
if ((play->pauseCtx.state != PAUSE_STATE_OFF) || (play->pauseCtx.debugState != 0)) {
|
if (IS_PAUSED(&play->pauseCtx)) {
|
||||||
// Start Button Texture, Color & Label
|
// Start Button Texture, Color & Label
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha);
|
||||||
|
@ -2802,8 +2801,7 @@ void Interface_DrawItemButtons(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interfaceCtx->naviCalling && (play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0) &&
|
if (interfaceCtx->naviCalling && !IS_PAUSED(&play->pauseCtx) && (play->csCtx.state == CS_STATE_IDLE)) {
|
||||||
(play->csCtx.state == CS_STATE_IDLE)) {
|
|
||||||
if (!sCUpInvisible) {
|
if (!sCUpInvisible) {
|
||||||
// C-Up Button Texture, Color & Label (Navi Text)
|
// C-Up Button Texture, Color & Label (Navi Text)
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
|
@ -3383,7 +3381,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
|
|
||||||
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
|
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
|
||||||
|
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0)) {
|
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||||
if (gSaveContext.minigameState != 1) {
|
if (gSaveContext.minigameState != 1) {
|
||||||
// Carrots rendering if the action corresponds to riding a horse
|
// Carrots rendering if the action corresponds to riding a horse
|
||||||
if (interfaceCtx->unk_1EE == 8) {
|
if (interfaceCtx->unk_1EE == 8) {
|
||||||
|
@ -3480,11 +3478,11 @@ void Interface_Draw(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0) &&
|
if (!IS_PAUSED(&play->pauseCtx) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||||
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) &&
|
||||||
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
|
||||||
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
|
!Play_InCsMode(play) && (gSaveContext.minigameState != 1) && (play->shootingGalleryStatus <= 1) &&
|
||||||
(play->shootingGalleryStatus <= 1) && !((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) {
|
!((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) {
|
||||||
|
|
||||||
timerId = TIMER_ID_MAIN;
|
timerId = TIMER_ID_MAIN;
|
||||||
|
|
||||||
|
@ -3936,7 +3934,7 @@ void Interface_Update(PlayState* play) {
|
||||||
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
|
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0)) {
|
if (!IS_PAUSED(&play->pauseCtx)) {
|
||||||
if ((gSaveContext.minigameState == 1) || !IS_CUTSCENE_LAYER ||
|
if ((gSaveContext.minigameState == 1) || !IS_CUTSCENE_LAYER ||
|
||||||
((play->sceneId == SCENE_SPOT20) && (gSaveContext.sceneLayer == 4))) {
|
((play->sceneId == SCENE_SPOT20) && (gSaveContext.sceneLayer == 4))) {
|
||||||
if ((msgCtx->msgMode == MSGMODE_NONE) ||
|
if ((msgCtx->msgMode == MSGMODE_NONE) ||
|
||||||
|
@ -4081,10 +4079,10 @@ void Interface_Update(PlayState* play) {
|
||||||
|
|
||||||
Health_UpdateMeter(play);
|
Health_UpdateMeter(play);
|
||||||
|
|
||||||
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && (play->pauseCtx.state == PAUSE_STATE_OFF) &&
|
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && !IS_PAUSED(&play->pauseCtx) &&
|
||||||
(play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) &&
|
||||||
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
|
||||||
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {}
|
!Play_InCsMode(play)) {}
|
||||||
|
|
||||||
if (gSaveContext.rupeeAccumulator != 0) {
|
if (gSaveContext.rupeeAccumulator != 0) {
|
||||||
if (gSaveContext.rupeeAccumulator > 0) {
|
if (gSaveContext.rupeeAccumulator > 0) {
|
||||||
|
@ -4167,10 +4165,9 @@ void Interface_Update(PlayState* play) {
|
||||||
WREG(7) = interfaceCtx->unk_1F4;
|
WREG(7) = interfaceCtx->unk_1F4;
|
||||||
|
|
||||||
// Update Magic
|
// Update Magic
|
||||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugState == 0) &&
|
if (!IS_PAUSED(&play->pauseCtx) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||||
(msgCtx->msgMode == MSGMODE_NONE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||||
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionMode == TRANS_MODE_OFF) &&
|
(play->transitionMode == TRANS_MODE_OFF) && ((play->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(play))) {
|
||||||
((play->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(play))) {
|
|
||||||
|
|
||||||
if (gSaveContext.isMagicAcquired && (gSaveContext.magicLevel == 0)) {
|
if (gSaveContext.isMagicAcquired && (gSaveContext.magicLevel == 0)) {
|
||||||
gSaveContext.magicLevel = gSaveContext.isDoubleMagicAcquired + 1;
|
gSaveContext.magicLevel = gSaveContext.isDoubleMagicAcquired + 1;
|
||||||
|
|
|
@ -839,7 +839,7 @@ void Play_Update(PlayState* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PLAY_LOG(3551);
|
PLAY_LOG(3551);
|
||||||
isPaused = (this->pauseCtx.state != PAUSE_STATE_OFF) || (this->pauseCtx.debugState != 0);
|
isPaused = IS_PAUSED(&this->pauseCtx);
|
||||||
|
|
||||||
PLAY_LOG(3555);
|
PLAY_LOG(3555);
|
||||||
AnimationContext_Reset(&this->animationCtx);
|
AnimationContext_Reset(&this->animationCtx);
|
||||||
|
@ -916,7 +916,7 @@ void Play_Update(PlayState* this) {
|
||||||
|
|
||||||
if (this->viewpoint != VIEWPOINT_NONE) {
|
if (this->viewpoint != VIEWPOINT_NONE) {
|
||||||
if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) {
|
if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) {
|
||||||
if ((this->pauseCtx.state != PAUSE_STATE_OFF) || (this->pauseCtx.debugState != 0)) {
|
if (IS_PAUSED(&this->pauseCtx)) {
|
||||||
// "Changing viewpoint is prohibited due to the kaleidoscope"
|
// "Changing viewpoint is prohibited due to the kaleidoscope"
|
||||||
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
|
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
|
||||||
} else if (Player_InCsMode(this)) {
|
} else if (Player_InCsMode(this)) {
|
||||||
|
@ -940,7 +940,7 @@ void Play_Update(PlayState* this) {
|
||||||
|
|
||||||
PLAY_LOG(3716);
|
PLAY_LOG(3716);
|
||||||
|
|
||||||
if ((this->pauseCtx.state != PAUSE_STATE_OFF) || (this->pauseCtx.debugState != 0)) {
|
if (IS_PAUSED(&this->pauseCtx)) {
|
||||||
PLAY_LOG(3721);
|
PLAY_LOG(3721);
|
||||||
KaleidoScopeCall_Update(this);
|
KaleidoScopeCall_Update(this);
|
||||||
} else if (this->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
} else if (this->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
||||||
|
@ -1003,7 +1003,7 @@ skip:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Play_DrawOverlayElements(PlayState* this) {
|
void Play_DrawOverlayElements(PlayState* this) {
|
||||||
if ((this->pauseCtx.state != PAUSE_STATE_OFF) || (this->pauseCtx.debugState != 0)) {
|
if (IS_PAUSED(&this->pauseCtx)) {
|
||||||
KaleidoScopeCall_Draw(this);
|
KaleidoScopeCall_Draw(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue