diff --git a/include/functions.h b/include/functions.h index b19b75af99..99e030cde6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1356,7 +1356,7 @@ void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 actorActionIndex void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 actorActionIndex); void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex); void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex); -s32 Cutscene_GetSceneSetupIndex(PlayState* play); +s32 Cutscene_GetSceneLayer(PlayState* play); s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd); s32 Cutscene_CheckActorAction(PlayState* play, u16 actorActionCmd); u8 Cutscene_IsPlaying(PlayState* play); diff --git a/include/z64save.h b/include/z64save.h index 74cf31c8e3..c357479722 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -304,7 +304,7 @@ typedef struct SaveContext { /* 0x3CA6 */ u8 unk_3CA6; /* 0x3CA7 */ u8 unk_3CA7; // "day_night_flag" /* 0x3CA8 */ s32 gameMode; // "mode" - /* 0x3CAC */ s32 sceneSetupIndex; // "counter" + /* 0x3CAC */ s32 sceneLayer; // "counter" /* 0x3CB0 */ s32 respawnFlag; // "restart_flag" /* 0x3CB4 */ RespawnData respawn[RESPAWN_MODE_MAX]; // "restart_data" /* 0x3DB4 */ f32 entranceSpeed; // "player_wipe_speedF" diff --git a/include/z64scene.h b/include/z64scene.h index 18d7b81f98..9658c4f4d2 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -767,7 +767,7 @@ typedef enum { /* * 0xFE00: Index into sSceneEntranceTable (Scene) * 0x01F0: Index into the scenes specific entrance table (Spawn) -* 0x000F: Index into the specific entrance table (Layer), stored seperately in sceneSetupIndex +* 0x000F: Index into the specific entrance table (Layer), stored seperately in sceneLayer */ #define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4)) diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 7dd357fbd4..6c83e83915 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1497,7 +1497,7 @@ void func_800EDBE0(PlayState* play) { sp24 = play->loadedScene; if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) { if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) + - ((void)0, gSaveContext.sceneSetupIndex)) & + ((void)0, gSaveContext.sceneLayer)) & 0x4000) != 0) { func_80151A68(play, sp24->titleTextId); } @@ -1608,13 +1608,13 @@ void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 ac actor->shape.rot.y = actor->world.rot.y; } -s32 Cutscene_GetSceneSetupIndex(PlayState* play) { - s32 sceneSetupIndex = 0; +s32 Cutscene_GetSceneLayer(PlayState* play) { + s32 sceneLayer = 0; - if (gSaveContext.sceneSetupIndex > 0) { - sceneSetupIndex = gSaveContext.sceneSetupIndex; + if (gSaveContext.sceneLayer > 0) { + sceneLayer = gSaveContext.sceneLayer; } - return sceneSetupIndex; + return sceneLayer; } s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index eb110c0c7d..3a2da402c7 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2264,7 +2264,7 @@ void Magic_Update(PlayState* play) { // Add magic until magicFillTarget is reached gSaveContext.save.playerData.magic += 0x10; - if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneSetupIndex < 4)) { + if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneLayer < 4)) { play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG); } @@ -2863,7 +2863,7 @@ void Interface_DrawTimers(PlayState* play) { if (sTimerId == TIMER_ID_MOON_CRASH) { gSaveContext.save.day = 4; - if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneSetupIndex == 3)) { + if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneLayer == 3)) { play->nextEntrance = ENTRANCE(TERMINA_FIELD, 1); gSaveContext.nextCutsceneIndex = 0xFFF0; play->transitionTrigger = TRANS_TRIGGER_START; diff --git a/src/code/z_scene.c b/src/code/z_scene.c index ce5ddf7694..7b88d4520f 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -455,9 +455,9 @@ void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd) { SceneCmd** altHeaderList; SceneCmd* altHeader; - if (gSaveContext.sceneSetupIndex != 0) { + if (gSaveContext.sceneLayer != 0) { altHeaderList = Lib_SegmentedToVirtual(cmd->altHeaders.segment); - altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1]; + altHeader = altHeaderList[gSaveContext.sceneLayer - 1]; if (altHeader != NULL) { Scene_ProcessHeader(play, Lib_SegmentedToVirtual(altHeader)); diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 81397039df..c0e9bdc42b 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -131,7 +131,7 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play) { func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG); } - if ((play->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) && (play->csCtx.currentCsIndex == 4) && + if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 4) && (play->csCtx.frames == 1495)) { func_8019F128(NA_SE_EV_DOOR_UNLOCK); } diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index cd130e218f..82e5157f61 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -451,13 +451,13 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { if (play->csCtx.state != 0) { switch (play->sceneId) { case SCENE_LOST_WOODS: - if (gSaveContext.sceneSetupIndex == 1) { + if (gSaveContext.sceneLayer == 1) { func_80AA561C(this, play); } break; case SCENE_OPENINGDAN: - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { if (play->csCtx.currentCsIndex == 0) { func_80AA5720(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -469,7 +469,7 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { break; case SCENE_OKUJOU: - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { if (play->csCtx.currentCsIndex == 0) { func_80AA58CC(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -477,7 +477,7 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { } else if (play->csCtx.currentCsIndex == 2) { func_80AA5960(this, play); } - } else if (gSaveContext.sceneSetupIndex == 2) { + } else if (gSaveContext.sceneLayer == 2) { if (play->csCtx.currentCsIndex == 0) { func_80AA59E4(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -487,13 +487,13 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { break; case SCENE_00KEIKOKU: - if (gSaveContext.sceneSetupIndex == 3) { + if (gSaveContext.sceneLayer == 3) { if (play->csCtx.currentCsIndex == 0) { func_80AA5AF4(this, play); } else if (play->csCtx.currentCsIndex == 2) { func_80AA5E2C(this, play); } - } else if (gSaveContext.sceneSetupIndex == 7) { + } else if (gSaveContext.sceneLayer == 7) { if (play->csCtx.currentCsIndex == 0) { func_80AA5BF8(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -503,19 +503,19 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { break; case SCENE_MITURIN: - if ((gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 1)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) { func_80AA5DC8(this, play); } break; case SCENE_INSIDETOWER: - if ((gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 0)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) { func_80AA5D10(this, play); } break; case SCENE_PIRATE: - if ((gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 0)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) { func_80AA5D6C(this, play); } break; @@ -853,7 +853,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { void func_80AA67F8(DmChar00* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((play->csCtx.state == 0) && (gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 1)) { + if ((play->csCtx.state == 0) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) { if (this->unk_261 != 42) { this->unk_261 = 42; func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); @@ -914,9 +914,9 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) { s32 pad; Gfx* gfx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Gfx) * 4); - if ((play->csCtx.state == 0) && ((play->sceneId != SCENE_OPENINGDAN) || (gSaveContext.sceneSetupIndex != 0) || - (play->roomCtx.curRoom.num != 0) || (play->csCtx.currentCsIndex != 1) || - (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) { + if ((play->csCtx.state == 0) && + ((play->sceneId != SCENE_OPENINGDAN) || (gSaveContext.sceneLayer != 0) || (play->roomCtx.curRoom.num != 0) || + (play->csCtx.currentCsIndex != 1) || (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) { return; } diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c index 900530f4d8..2f715afed4 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -73,7 +73,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { break; } - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { play->envCtx.unk_1F = 5; play->envCtx.unk_20 = 5; } @@ -87,7 +87,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, &gWoodfallSceneryPoisonWaterDamageCol); this->unk_34D = true; - if (gSaveContext.sceneSetupIndex == 1) { + if (gSaveContext.sceneLayer == 1) { this->unk_34C = 1; this->actionFunc = func_80AA8C28; } else { @@ -97,7 +97,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { break; case DMCHAR01_1: - if ((gSaveContext.save.weekEventReg[20] & 2) || (gSaveContext.sceneSetupIndex == 1)) { + if ((gSaveContext.save.weekEventReg[20] & 2) || (gSaveContext.sceneLayer == 1)) { this->unk_34C = 1; this->actionFunc = func_80AA8F1C; } else { @@ -411,7 +411,7 @@ void DmChar01_Draw(Actor* thisx, PlayState* play) { break; case 1: - if (gSaveContext.sceneSetupIndex == 1) { + if (gSaveContext.sceneLayer == 1) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(&gWoodfallSceneryPurifiedWaterTexAnim)); Gfx_DrawDListOpa(play, gWoodfallSceneryFloorDL); Gfx_DrawDListXlu(play, gWoodfallSceneryPurifiedWaterDL); diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index c0cb242812..5b66138138 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -545,7 +545,7 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_3) { if (play->sceneId == SCENE_OKUJOU) { - if (gSaveContext.sceneSetupIndex == 2) { + if (gSaveContext.sceneLayer == 2) { if (play->csCtx.currentCsIndex == 0) { func_80AAD3F8(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -553,11 +553,11 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { } } } else if (play->sceneId == SCENE_SPOT00) { - if (gSaveContext.sceneSetupIndex == 9) { + if (gSaveContext.sceneLayer == 9) { if ((play->csCtx.currentCsIndex == 0) && (play->csCtx.frames == 255)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); } - } else if ((gSaveContext.sceneSetupIndex == 0xB) && (play->csCtx.frames == 115)) { + } else if ((gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 115)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER_PREDEMO); } } diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c index 910293b77f..7a41429714 100644 --- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c +++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c @@ -95,7 +95,7 @@ void DmOpstage_Update(Actor* thisx, PlayState* play) { DmOpstage* this = THIS; this->actionFunc(this, play); - if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0) && (play->csCtx.frames == 480)) { + if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 0) && (play->csCtx.frames == 480)) { // This actor is responsible for playing the fairy sound during the exposition in the intro, // during the transition to Lost Woods, before Ocarina gets stolen. func_8019F128(NA_SE_EV_NAVY_FLY_REBIRTH); diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index 9a0f95004c..2be56dda3c 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -919,23 +919,23 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { if (play->csCtx.state != 0) { switch (play->sceneId) { case SCENE_LOST_WOODS: - if (gSaveContext.sceneSetupIndex == 1) { + if (gSaveContext.sceneLayer == 1) { DmStk_PlaySfxForIntroCutsceneFirstPart(this, play); - } else if (gSaveContext.sceneSetupIndex == 0) { + } else if (gSaveContext.sceneLayer == 0) { DmStk_PlaySfxForIntroCutsceneSecondPart(this, play); - } else if ((gSaveContext.sceneSetupIndex == 2) && (play->csCtx.currentCsIndex == 0)) { + } else if ((gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) { DmStk_PlaySfxForObtainingMajorasMaskCutscene(this, play); } break; case SCENE_CLOCKTOWER: - if (gSaveContext.sceneSetupIndex == 1) { + if (gSaveContext.sceneLayer == 1) { DmStk_PlaySfxForTitleCutscene(this, play); } break; case SCENE_OPENINGDAN: - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { if (play->csCtx.currentCsIndex == 0) { DmStk_PlaySfxForCurseCutsceneFirstPart(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -945,7 +945,7 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { break; case SCENE_OKUJOU: - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { if (play->csCtx.currentCsIndex == 0) { DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -955,7 +955,7 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { } else if (play->csCtx.currentCsIndex == 3) { DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(this, play); } - } else if (gSaveContext.sceneSetupIndex == 2) { + } else if (gSaveContext.sceneLayer == 2) { if (play->csCtx.currentCsIndex == 0) { DmStk_PlaySfxForMoonWarpCutsceneVersion1(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -965,13 +965,13 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { break; case SCENE_00KEIKOKU: - if (gSaveContext.sceneSetupIndex == 3) { + if (gSaveContext.sceneLayer == 3) { if (play->csCtx.currentCsIndex == 0) { DmStk_PlaySfxForShiveringInRainCutscene(this, play); } else if (play->csCtx.currentCsIndex == 2) { DmStk_PlaySfxForPlayingWithFairiesCutscene(this, play); } - } else if (gSaveContext.sceneSetupIndex == 7) { + } else if (gSaveContext.sceneLayer == 7) { if (play->csCtx.currentCsIndex == 0) { DmStk_PlaySfxForEndingCutsceneFirstPart(this, play); } else if (play->csCtx.currentCsIndex == 1) { @@ -1028,7 +1028,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->fogG = play->lightCtx.unk8; this->fogB = play->lightCtx.unk9; - if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneSetupIndex == 1)) { + if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1)) { this->alpha = 0; this->fogN = 0; this->fogF = 1000; @@ -1044,7 +1044,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_ROOFTOP, 0)) { - if (gSaveContext.sceneSetupIndex == 0) { + if (gSaveContext.sceneLayer == 0) { if (gSaveContext.timerStates[TIMER_ID_MOON_CRASH] == TIMER_STATE_OFF) { // Starts a 5 minute (300 second) timer until the moon falls. Interface_StartTimer(TIMER_ID_MOON_CRASH, 300); @@ -1060,7 +1060,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->actionFunc = DmStk_ClockTower_StartIntroCutsceneVersion2; } - } else if (gSaveContext.sceneSetupIndex == 3) { + } else if (gSaveContext.sceneLayer == 3) { this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; if (gSaveContext.timerStates[TIMER_ID_MOON_CRASH] == TIMER_STATE_OFF) { // This code is called when the Giants fail to stop the moon. @@ -1088,7 +1088,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - } else if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 0)) { + } else if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0)) { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { Actor_MarkForDeath(&this->actor); } @@ -1127,7 +1127,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 3) && (play->csCtx.currentCsIndex > 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.currentCsIndex > 0)) { play->envCtx.unk_17 = 15; play->envCtx.unk_18 = 15; } @@ -1684,7 +1684,7 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK; } else if (((this->animIndex >= SK_ANIM_HUDDLE_WITH_FAIRIES) && (this->animIndex <= SK_ANIM_DRAW)) || ((this->animIndex >= SK_ANIM_PLAY_FLUTE) && (this->animIndex <= SK_ANIM_CARTWHEEL)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 7))) { + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 7))) { this->maskType = SK_MASK_TYPE_NO_MASK; if ((this->animIndex == SK_ANIM_HOLD_UP_MASK_START) || (this->animIndex == SK_ANIM_HOLD_UP_MASK_LOOP)) { this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK_AND_FLUTE; @@ -1823,7 +1823,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) { } } - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 3) && (play->csCtx.currentCsIndex > 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.currentCsIndex > 0)) { play->envCtx.unk_17 = 15; play->envCtx.unk_18 = 15; } @@ -1886,7 +1886,7 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot break; case SK_MASK_TYPE_NORMAL: - if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneSetupIndex == 1) && + if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1) && (play->csCtx.frames < 1400)) { if (this->fogN == this->fogF) { this->fogF = this->fogN; @@ -1948,7 +1948,7 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot case SK_HAND_TYPE_HOLDING_OCARINA: gSPDisplayList(POLY_OPA_DISP++, gSkullKidOcarinaHoldingRightHand); - if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneSetupIndex == 1)) { + if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1)) { gSPDisplayList(POLY_OPA_DISP++, gSkullKidOcarinaOfTimeDL); } break; @@ -1986,7 +1986,7 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot break; case SK_HAND_TYPE_HOLDING_OCARINA: - if ((play->sceneId != SCENE_LOST_WOODS) || (gSaveContext.sceneSetupIndex != 1)) { + if ((play->sceneId != SCENE_LOST_WOODS) || (gSaveContext.sceneLayer != 1)) { gSPDisplayList(POLY_OPA_DISP++, gSkullKidOcarinaOfTimeDL); } gSPDisplayList(POLY_OPA_DISP++, gSkullKidTwoFingersExtendedLeftHand); diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 0086742925..50a027efa3 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -448,7 +448,7 @@ void func_80A52074(EnDnk* this, PlayState* play) { void func_80A52134(EnDnk* this, PlayState* play) { if ((play->csCtx.state != 0) && (ENDNK_GET_3C(&this->actor) == 4) && (play->sceneId == SCENE_SPOT00) && - (gSaveContext.sceneSetupIndex == 2)) { + (gSaveContext.sceneLayer == 2)) { func_80A52074(this, play); } } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index f551373676..c9b3939804 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -903,14 +903,14 @@ void func_8088E850(EnElf* this, PlayState* play) { func_8088D660(this, &nextPos, 0.2f); } - if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 0) && + if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && ((play->csCtx.frames == 149) || (play->csCtx.frames == 381) || (play->csCtx.frames == 591))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } - if ((play->sceneId == SCENE_SECOM) && (gSaveContext.sceneSetupIndex == 0) && - (play->csCtx.currentCsIndex == 4) && (play->csCtx.frames == 95)) { + if ((play->sceneId == SCENE_SECOM) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 4) && + (play->csCtx.frames == 95)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } else { diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index 54ea52a459..d7d3e446e2 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -315,8 +315,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { static s32 sGiantsCutsceneState = 0; - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 1) && - (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { switch (sGiantsCutsceneState) { case 0: if (play->csCtx.state != 0) { @@ -409,7 +408,7 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat } } - if (play->sceneId == SCENE_OKUJOU && gSaveContext.sceneSetupIndex == 2) { + if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneLayer == 2)) { switch (play->csCtx.currentCsIndex) { case 0: switch (play->csCtx.frames) { @@ -575,7 +574,7 @@ void EnFall_Fireball_SetPerVertexAlpha(f32 fireballAlpha) { void EnFall_Fireball_Update(Actor* thisx, PlayState* play) { EnFall* this = THIS; - if (play->sceneId == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 0 && play->csCtx.currentCsIndex == 2) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 2)) { play->skyboxCtx.rotY -= 0.05f; } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 7021b0e0cf..7d2819ff9c 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -220,7 +220,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { this->sfxId = 0xFFFF; if (GIANT_TYPE_IS_CHAMBER_OR_ENDING(type)) { - switch (gSaveContext.sceneSetupIndex) { + switch (gSaveContext.sceneLayer) { case 0: case 10: this->sfxId = NA_SE_EV_KYOJIN_GRATITUDE2 - SFX_FLAG; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index b10f78ac30..c85815ee74 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -762,7 +762,7 @@ s32 func_8094EFC4(EnGm* this, PlayState* play) { if (play->csCtx.state != 0) { if (this->unk_3F8 == 0) { - if ((play->sceneId == SCENE_MILK_BAR) && (gSaveContext.sceneSetupIndex == 2)) { + if ((play->sceneId == SCENE_MILK_BAR) && (gSaveContext.sceneLayer == 2)) { func_8094E054(this, play, 0); this->unk_258 = 255; } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 2b855edab2..8692fbba1c 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -539,7 +539,7 @@ s32 func_80A1222C(EnGo* this, PlayState* play) { (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) && (this->unk_3EC == 0) && (this->actor.xzDistToPlayer < 400.0f)) || (!(gSaveContext.save.weekEventReg[22] & 4) && (play->sceneId == SCENE_16GORON_HOUSE) && - (gSaveContext.sceneSetupIndex == 0) && (this->unk_3EC == 0) && (play->csCtx.currentCsIndex == 1))) { + (gSaveContext.sceneLayer == 0) && (this->unk_3EC == 0) && (play->csCtx.currentCsIndex == 1))) { ret = true; } return ret; @@ -711,7 +711,7 @@ s32 func_80A12868(EnGo* this, PlayState* play) { s32 func_80A12954(EnGo* this, PlayState* play) { if ((ENGO_GET_F(&this->actor) == ENGO_F_4) && (play->csCtx.state != 0) && (this->actor.draw != NULL) && - (play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneSetupIndex == 1) && + (play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { if (this->unk_3F0 == 0) { this->actor.flags &= ~ACTOR_FLAG_1; @@ -1412,7 +1412,7 @@ void func_80A144F4(EnGo* this, PlayState* play) { void func_80A145AC(EnGo* this, PlayState* play) { if ((ENGO_GET_70(&this->actor) == ENGO_70_1) && - (((play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneSetupIndex == 1) && + (((play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) || !(gSaveContext.save.weekEventReg[21] & 8))) { this->actor.child = func_80A13400(this, play); diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c index cf32db0bc0..f9085e8253 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c @@ -323,15 +323,15 @@ void func_80B23910(EnHanabi* this, PlayState* play) { } void func_80B23934(EnHanabi* this, PlayState* play) { - if ((gSaveContext.save.entrance == ENTRANCE(TERMINA_FIELD, 1)) && (gSaveContext.sceneSetupIndex == 7)) { + if ((gSaveContext.save.entrance == ENTRANCE(TERMINA_FIELD, 1)) && (gSaveContext.sceneLayer == 7)) { if (play->csCtx.frames > 1650) { func_80B236C8(this, play); func_800B8FE8(&this->actor, NA_SE_EV_FIREWORKS_LAUNCH - SFX_FLAG); } } - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 7) && - (play->csCtx.currentCsIndex == 0) && (play->csCtx.frames == 610)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 7) && (play->csCtx.currentCsIndex == 0) && + (play->csCtx.frames == 610)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_GROAN); } } diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 83e0935f5c..07b2564873 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -158,8 +158,8 @@ void func_80BCF398(EnHg* this, PlayState* play) { !Cutscene_CheckActorAction(play, 0x1E3)) { func_80BCF468(this); } - if ((gSaveContext.sceneSetupIndex == 0 && play->csCtx.currentCsIndex == 0) && - (play->csCtx.frames == 20 || play->csCtx.frames == 60)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && + ((play->csCtx.frames == 20) || (play->csCtx.frames == 60))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); } } diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c index 83fbe5988c..53e4e91c34 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -287,7 +287,7 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) { case 1: if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_312 == 0)) { this->unk_312 = 1; - if ((gSaveContext.sceneSetupIndex == 0) && + if ((gSaveContext.sceneLayer == 0) && ((play->csCtx.currentCsIndex == 2) || (play->csCtx.currentCsIndex == 4))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GBVO02); } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 4388c7c739..a9b233aa53 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -793,7 +793,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } if (((play->sceneId == SCENE_KOEPONARACE) && (GET_RACE_FLAGS == 1)) || - ((gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 0)) && Cutscene_GetSceneSetupIndex(play))) { + ((gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 0)) && Cutscene_GetSceneLayer(play))) { this->stateFlags |= ENHORSE_FLAG_25; } @@ -1569,7 +1569,7 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) { if ((this->stateFlags & ENHORSE_STOPPING_NEIGH_SOUND) && (this->skin.skelAnime.curFrame > 29.0f)) { this->actor.speedXZ = 0.0f; if ((Rand_ZeroOne() > 0.5f) && - ((gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 0)) || !Cutscene_GetSceneSetupIndex(play))) { + ((gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 0)) || !Cutscene_GetSceneLayer(play))) { if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_NEIGH); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 398bac6ca8..d5b23bdaea 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -158,7 +158,7 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) { this->unk_1E8 = 0; this->unk_1E4 = 0; - if (gSaveContext.sceneSetupIndex >= 4) { + if (gSaveContext.sceneLayer >= 4) { func_808DEFE8(this); } else { func_808DEFE8(this); diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index b7ad5c9ddc..60ebb2474b 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -948,8 +948,7 @@ void EnJg_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (!EN_JG_IS_IN_GORON_SHRINE(thisx)) { - if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7) && - (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7) && (play->csCtx.currentCsIndex == 0)) { // This is the elder that appears in the cutscene for learning the full Goron Lullaby. this->animIndex = EN_JG_ANIM_IDLE; this->action = EN_JG_ACTION_LULLABY_INTRO_CS; diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 47f0997eb2..0860857c86 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -207,7 +207,7 @@ void EnMa4_Init(Actor* thisx, PlayState* play) { this->hasBow = false; } - if (Cutscene_GetSceneSetupIndex(play) != 0) { // if (sceneSetupIndex != 0) + if (Cutscene_GetSceneLayer(play) != 0) { EnMa4_ChangeAnim(this, 0); this->state = MA4_STATE_HORSEBACKGAME; EnMa4_InitHorsebackGame(this, play); diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index da72fc3088..b7199cb1db 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -393,7 +393,7 @@ void EnMag_Update(Actor* thisx, PlayState* play) { play->transitionType = TRANS_TYPE_02; play->nextEntrance = ENTRANCE(CUTSCENE, 0); gSaveContext.save.cutscene = 0; - gSaveContext.sceneSetupIndex = 0; + gSaveContext.sceneLayer = 0; } this->unk11F54 = 15; this->unk11F56 = 25; diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index fd3146032c..1f9cb3da82 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -731,7 +731,7 @@ void func_80AD16A8(EnOsn* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); } - if ((this->unk_1EC == 5) && (play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0xB) && + if ((this->unk_1EC == 5) && (play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 400)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_OMVO00); } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 75bcbc8e80..1f5aebe64b 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1017,7 +1017,7 @@ s32 func_80AF86F0(EnPm* this, PlayState* play) { s32 func_80AF87C4(EnPm* this, PlayState* play) { s32 ret = false; - if ((play->csCtx.state != 0) && (play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 9) && + if ((play->csCtx.state != 0) && (play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 9) && (play->curSpawn == 1)) { if (!this->unk_380) { func_80AF7E98(this, 0); diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index 088e06149b..bfb7014844 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -296,7 +296,7 @@ void EnRailSkb_Init(Actor* thisx, PlayState* play) { this->unk_3F8 = 0; } - if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { this->actor.flags |= ACTOR_FLAG_100000; } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index ea4f7be32b..d0c02e4fa9 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -230,7 +230,7 @@ void EnSkb_Init(Actor* thisx, PlayState* play) { this->unk_3D6 = ENSKB_GET_F0(&this->actor); this->actor.floorHeight = this->actor.world.pos.y; - if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { this->actor.flags |= ACTOR_FLAG_100000; } diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index bda36c0b6b..0ea1d448f5 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -206,8 +206,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA) && - ((play->csCtx.currentCsIndex != 2) || (gSaveContext.sceneSetupIndex != 0) || - (play->sceneId != SCENE_30GYOSON))) { + ((play->csCtx.currentCsIndex != 2) || (gSaveContext.sceneLayer != 0) || (play->sceneId != SCENE_30GYOSON))) { Actor_MarkForDeath(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 7758fc5bc9..33de741002 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -36,7 +36,7 @@ void ObjJgGakki_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &gGoronElderDrumSkel, NULL, NULL, NULL, 0); - if (((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) && (play->csCtx.currentCsIndex == 0)) { + if (((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7)) && (play->csCtx.currentCsIndex == 0)) { Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, frameCount, frameCount, ANIMMODE_ONCE, 0.0f); } else if ((play->sceneId == SCENE_17SETUGEN) || (play->sceneId == SCENE_10YUKIYAMANOMURA)) { diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c index 2c8e42c7d0..6d49230430 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c @@ -195,8 +195,7 @@ void ObjTokeiStep_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) { DynaPolyActor_LoadMesh(play, &this->dyna, &gClocktowerPanelCol); ObjTokeiStep_InitSteps(this); ObjTokeiStep_SetupBeginOpen(this); diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 34d43d354b..421f5dcf0b 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -121,10 +121,8 @@ void ObjTokeidai_ExteriorGear_Init(ObjTokeidai* this, PlayState* play) { this->opaDList = gClockTowerExteriorGearDL; ObjTokeidai_SetupClockOrExteriorGear(this); - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { ObjTokeidai_SetupTowerOpening(this); } else if ((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) { this->actionFunc = ObjTokeidai_ExteriorGear_OpenedIdle; @@ -140,10 +138,8 @@ void ObjTokeidai_TowerClock_Init(ObjTokeidai* this, PlayState* play) { this->actor.draw = ObjTokeidai_Clock_Draw; ObjTokeidai_Clock_Init(this); - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { ObjTokeidai_SetupTowerOpening(this); } else if ((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) { this->actor.world.pos.y += (this->actor.scale.y * 5191.0f) - 50.0f; @@ -175,10 +171,8 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, PlayState* play) { this->spotlightIntensity = 0; } - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) && - (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { this->spotlightIntensity = 0; ObjTokeidai_SetupTowerOpening(this); @@ -448,9 +442,9 @@ void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 132) != 0 && play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 5) { gSaveContext.save.weekEventReg[8] |= 0x40; - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) && + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { Audio_SetCutsceneFlag(false); gSaveContext.save.cutscene = 0; diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index b7e5ec3788..42336b9bca 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -17,7 +17,7 @@ void TitleSetup_SetupTitleScreen(TitleSetupState* this) { gSaveContext.save.entrance = sOpeningEntrances[D_801BB12C]; gSaveContext.nextCutsceneIndex = gSaveContext.save.cutscene = sOpeningCutscenes[D_801BB12C]; - gSaveContext.sceneSetupIndex = 0; + gSaveContext.sceneLayer = 0; gSaveContext.save.time = CLOCK_TIME(8, 0); gSaveContext.save.day = 1; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 3b949a49c9..b71390a057 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1578,7 +1578,7 @@ 0x800EDF24:("Cutscene_ActorTranslateAndYaw",), 0x800EDF78:("Cutscene_ActorTranslateAndYawSmooth",), 0x800EE0CC:("Cutscene_ActorTranslateXZAndYawSmooth",), - 0x800EE1D8:("Cutscene_GetSceneSetupIndex",), + 0x800EE1D8:("Cutscene_GetSceneLayer",), 0x800EE200:("Cutscene_GetActorActionIndex",), 0x800EE29C:("Cutscene_CheckActorAction",), 0x800EE2F4:("Cutscene_IsPlaying",), diff --git a/tools/namefixer.py b/tools/namefixer.py index b432879716..a5d13493b2 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -533,10 +533,11 @@ wordReplace = { "func_800EDF24": "Cutscene_ActorTranslateAndYaw", "func_800EDF78": "Cutscene_ActorTranslateAndYawSmooth", "func_800EE0CC": "Cutscene_ActorTranslateXZAndYawSmooth", - "func_800EE1D8": "Cutscene_GetSceneSetupIndex", + "func_800EE1D8": "Cutscene_GetSceneLayer", "func_800EE200": "Cutscene_GetActorActionIndex", "func_800EE29C": "Cutscene_CheckActorAction", "func_800EE2F4": "Cutscene_IsPlaying", + "Cutscene_GetSceneSetupIndex": "Cutscene_GetSceneLayer", "func_801343C0": "SkelAnime_DrawTransformFlexOpa", "func_80134148": "SkelAnime_DrawTransformFlexLimbOpa", "func_80114E90": "Inventory_HasEmptyBottle", @@ -704,6 +705,7 @@ wordReplace = { "gSaveContext.unk_3F30": "gSaveContext.magicFillTarget", "gSaveContext.unk_3F2C": "gSaveContext.magicFlag", "gSaveContext.save.entranceIndex": "gSaveContext.save.entrance", + "gSaveContext.sceneSetupIndex": "gSaveContext.sceneLayer", "gSaveContext.seqIndex": "gSaveContext.seqId", "gSaveContext.nightSeqIndex": "gSaveContext.ambienceId", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 968fa65d37..33b82cef00 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1092,7 +1092,7 @@ asm/non_matchings/code/z_demo/Cutscene_ActorTranslate.s,Cutscene_ActorTranslate, asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYaw.s,Cutscene_ActorTranslateAndYaw,0x800EDF24,0x15 asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYawSmooth.s,Cutscene_ActorTranslateAndYawSmooth,0x800EDF78,0x55 asm/non_matchings/code/z_demo/Cutscene_ActorTranslateXZAndYawSmooth.s,Cutscene_ActorTranslateXZAndYawSmooth,0x800EE0CC,0x43 -asm/non_matchings/code/z_demo/Cutscene_GetSceneSetupIndex.s,Cutscene_GetSceneSetupIndex,0x800EE1D8,0xA +asm/non_matchings/code/z_demo/Cutscene_GetSceneLayer.s,Cutscene_GetSceneLayer,0x800EE1D8,0xA asm/non_matchings/code/z_demo/Cutscene_GetActorActionIndex.s,Cutscene_GetActorActionIndex,0x800EE200,0x27 asm/non_matchings/code/z_demo/Cutscene_CheckActorAction.s,Cutscene_CheckActorAction,0x800EE29C,0x16 asm/non_matchings/code/z_demo/Cutscene_IsPlaying.s,Cutscene_IsPlaying,0x800EE2F4,0xB