From 6eaaa8706cf31c13bb88dc026fdb6d8ceeee8d98 Mon Sep 17 00:00:00 2001 From: feacur Date: Tue, 5 Nov 2024 17:00:42 +0100 Subject: [PATCH] rename the flag for freeing `nextCutsceneIndex` --- include/z64cutscene.h | 2 +- src/code/z_common_data.c | 2 +- src/code/z_play.c | 4 ++-- src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c | 6 +++--- src/overlays/gamestates/ovl_file_choose/z_file_choose.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/z64cutscene.h b/include/z64cutscene.h index c930744fd7..f5ef708e83 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -360,7 +360,7 @@ correlation with `enum EntranceIndex` */ typedef enum CutsceneIndex { CS_INDEX_NONE = 0x0000, - CS_INDEX_NEXT_USED = 0xFFEF, // assigned cutscene index, can schedule next again + CS_INDEX_NEXT_EMPTY = 0xFFEF, // is allowed to schedule a cutscene CS_INDEX_0 = 0xFFF0, CS_INDEX_1 = 0xFFF1, CS_INDEX_2 = 0xFFF2, diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 9837cf3c14..4de25ced8f 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -16,7 +16,7 @@ void SaveContext_Init(void) { gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX; - gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_USED; + gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_EMPTY; gSaveContext.cutsceneTrigger = 0; gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST; gSaveContext.nextDayTime = NEXT_TIME_NONE; diff --git a/src/code/z_play.c b/src/code/z_play.c index 7d18d4223a..9fff885c53 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -324,9 +324,9 @@ void Play_Init(GameState* thisx) { AnimTaskQueue_Reset(&this->animTaskQueue); Cutscene_InitContext(this, &this->csCtx); - if (gSaveContext.nextCutsceneIndex != CS_INDEX_NEXT_USED) { + if (gSaveContext.nextCutsceneIndex != CS_INDEX_NEXT_EMPTY) { gSaveContext.save.cutsceneIndex = gSaveContext.nextCutsceneIndex; - gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_USED; + gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_EMPTY; } if (gSaveContext.save.cutsceneIndex == CS_INDEX_TRIGGERED) { diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 47336a342c..0cfe68c609 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -489,7 +489,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { Math_SmoothStepToF(&this->lightRayAlpha, 0.0f, 0.2f, 6.0f, 0.01f); this->warpTimer++; - if (sWarpTimerTarget < this->warpTimer && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_USED) { + if (sWarpTimerTarget < this->warpTimer && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_EMPTY) { PRINTF("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", play->transitionTrigger, TRANS_TRIGGER_START); if (play->sceneId == SCENE_DODONGOS_CAVERN_BOSS) { @@ -600,7 +600,7 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, PlayState* play) { Math_SmoothStepToF(&this->lightRayAlpha, 0.0f, 0.2f, 6.0f, 0.01f); this->warpTimer++; - if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_USED) { + if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_EMPTY) { SET_EVENTCHKINF(EVENTCHKINF_37); Item_Give(play, ITEM_ZORA_SAPPHIRE); play->nextEntranceIndex = ENTR_ZORAS_FOUNTAIN_0; @@ -700,7 +700,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { } this->warpTimer++; - if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_USED) { + if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == CS_INDEX_NEXT_EMPTY) { if (play->sceneId == SCENE_FOREST_TEMPLE_BOSS) { if (!GET_EVENTCHKINF(EVENTCHKINF_48)) { SET_EVENTCHKINF(EVENTCHKINF_48); diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index c1272ac540..e606215e46 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1890,7 +1890,7 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX; gSaveContext.skyboxTime = CLOCK_TIME(0, 0); gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; - gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_USED; + gSaveContext.nextCutsceneIndex = CS_INDEX_NEXT_EMPTY; gSaveContext.cutsceneTrigger = 0; gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST; gSaveContext.nextDayTime = NEXT_TIME_NONE;