Use PlayState instead of GlobalContext (#1927)

* Use PlayState instead of GlobalContext
- GlobalContext -> PlayState
- globalCtx -> play
- GlobalCtx -> PlayState
- globalContext -> playState

* Find and replace Gameplay_ with Play_

* Correct some misnamed argument cases
This commit is contained in:
Garrett Cox
2022-11-06 02:24:34 -06:00
committed by GitHub
parent 710a768d76
commit 99260acaf1
926 changed files with 41210 additions and 41210 deletions

View File

@@ -1,23 +1,23 @@
#include "global.h"
void GameOver_Init(GlobalContext* globalCtx) {
globalCtx->gameOverCtx.state = GAMEOVER_INACTIVE;
void GameOver_Init(PlayState* play) {
play->gameOverCtx.state = GAMEOVER_INACTIVE;
}
void GameOver_FadeInLights(GlobalContext* globalCtx) {
GameOverContext* gameOverCtx = &globalCtx->gameOverCtx;
void GameOver_FadeInLights(PlayState* play) {
GameOverContext* gameOverCtx = &play->gameOverCtx;
if ((gameOverCtx->state >= GAMEOVER_DEATH_WAIT_GROUND && gameOverCtx->state < GAMEOVER_REVIVE_START) ||
(gameOverCtx->state >= GAMEOVER_REVIVE_RUMBLE && gameOverCtx->state < GAMEOVER_REVIVE_FADE_OUT)) {
Environment_FadeInGameOverLights(globalCtx);
Environment_FadeInGameOverLights(play);
}
}
// This variable cannot be moved into this file as all of z_message_PAL rodata is in the way
extern s16 gGameOverTimer;
void GameOver_Update(GlobalContext* globalCtx) {
GameOverContext* gameOverCtx = &globalCtx->gameOverCtx;
void GameOver_Update(PlayState* play) {
GameOverContext* gameOverCtx = &play->gameOverCtx;
s16 i;
s16 j;
s32 v90;
@@ -26,7 +26,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
switch (gameOverCtx->state) {
case GAMEOVER_DEATH_START:
Message_CloseTextbox(globalCtx);
Message_CloseTextbox(play);
gSaveContext.timer1State = 0;
gSaveContext.timer2State = 0;
@@ -42,7 +42,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
for (j = 1; j < ARRAY_COUNT(gSaveContext.equips.buttonItems); j++) {
if (gSaveContext.equips.buttonItems[j] == gSpoilingItems[i]) {
gSaveContext.equips.buttonItems[j] = gSpoilingItemReverts[i];
Interface_LoadItemIcon1(globalCtx, j);
Interface_LoadItemIcon1(play, j);
}
}
}
@@ -75,7 +75,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
}
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0;
Environment_InitGameOverLights(globalCtx);
Environment_InitGameOverLights(play);
gGameOverTimer = 20;
v90 = VREG(90);
v91 = VREG(91);
@@ -94,7 +94,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
gGameOverTimer--;
if (gGameOverTimer == 0) {
globalCtx->pauseCtx.state = 8;
play->pauseCtx.state = 8;
gameOverCtx->state++;
func_800AA15C();
}
@@ -103,7 +103,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
case GAMEOVER_REVIVE_START:
gameOverCtx->state++;
gGameOverTimer = 0;
Environment_InitGameOverLights(globalCtx);
Environment_InitGameOverLights(play);
ShrinkWindow_SetVal(0x20);
return;
@@ -138,7 +138,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
break;
case GAMEOVER_REVIVE_FADE_OUT:
Environment_FadeOutGameOverLights(globalCtx);
Environment_FadeOutGameOverLights(play);
gGameOverTimer--;
if (gGameOverTimer == 0) {