diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 5634e97c8a..43d17883cf 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1191,19 +1191,19 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti play->transitionType = TRANS_TYPE_FADE_BLACK; } else { switch (gSaveContext.sceneLayer) { - case 8: + case GET_CUTSCENE_LAYER(CS_INDEX_4): play->nextEntranceIndex = ENTR_SACRED_FOREST_MEADOW_0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_BLACK; break; - case 9: + case GET_CUTSCENE_LAYER(CS_INDEX_5): play->nextEntranceIndex = ENTR_DEATH_MOUNTAIN_CRATER_0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_BLACK; break; - case 10: + case GET_CUTSCENE_LAYER(CS_INDEX_6): play->nextEntranceIndex = ENTR_LAKE_HYLIA_0; play->transitionTrigger = TRANS_TRIGGER_START; gSaveContext.save.cutsceneIndex = CS_INDEX_0; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 7a4c155c1a..a6ddc4c5ee 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -962,7 +962,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex if ((((void)0, gSaveContext.save.dayTime) > ((void)0, gSaveContext.skyboxTime)) || (((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(1, 0) || gTimeSpeed < 0)) #else - if (((((void)0, gSaveContext.sceneLayer) >= 5 || gTimeSpeed != 0) && + if (((((void)0, gSaveContext.sceneLayer) >= GET_CUTSCENE_LAYER(CS_INDEX_1) || gTimeSpeed != 0) && ((void)0, gSaveContext.save.dayTime) > ((void)0, gSaveContext.skyboxTime)) || (((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(1, 0) || gTimeSpeed < 0)) #endif @@ -1421,7 +1421,8 @@ void Environment_DrawSunAndMoon(PlayState* play) { play->envCtx.sunPos.z = +(Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f; } - if (gSaveContext.save.entranceIndex != ENTR_HYRULE_FIELD_0 || ((void)0, gSaveContext.sceneLayer) != 5) { + if (gSaveContext.save.entranceIndex != ENTR_HYRULE_FIELD_0 || + ((void)0, gSaveContext.sceneLayer) != GET_CUTSCENE_LAYER(CS_INDEX_1)) { Matrix_Translate(play->view.eye.x + play->envCtx.sunPos.x, play->view.eye.y + play->envCtx.sunPos.y, play->view.eye.z + play->envCtx.sunPos.z, MTXMODE_NEW); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 907f9c15a7..20d0f2195a 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -4031,7 +4031,7 @@ void Interface_Update(PlayState* play) { if (!IS_PAUSED(&play->pauseCtx)) { if ((gSaveContext.minigameState == 1) || !IS_CUTSCENE_LAYER || - ((play->sceneId == SCENE_LON_LON_RANCH) && (gSaveContext.sceneLayer == 4))) { + ((play->sceneId == SCENE_LON_LON_RANCH) && (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)))) { if ((msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->msgMode != MSGMODE_NONE) && (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY))) { if (play->gameOverCtx.state == GAMEOVER_INACTIVE) { diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 51ceea96cc..9fd0755b5e 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -65,7 +65,7 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { if (play2->sceneId == SCENE_HYRULE_FIELD) { spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else if (play2->sceneId == SCENE_GANON_BOSS) { - if (gSaveContext.sceneLayer != 4) { + if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) { spaceSize = 1150 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else { spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; @@ -445,7 +445,7 @@ BAD_RETURN(s32) Scene_CommandAlternateHeaderList(PlayState* play, SceneCmd* cmd) PRINTF("\n[ZU]sceneset time =[%X]", ((void)0, gSaveContext.save.cutsceneIndex)); PRINTF("\n[ZU]sceneset counter=[%X]", ((void)0, gSaveContext.sceneLayer)); - if (gSaveContext.sceneLayer != 0) { + if (gSaveContext.sceneLayer != SCENE_LAYER_CHILD_DAY) { SceneCmd* altHeader = ((SceneCmd**)SEGMENTED_TO_VIRTUAL(cmd->altHeaders.data))[gSaveContext.sceneLayer - 1]; if (altHeader != NULL) { diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 24521f3aa3..7c1858ebf1 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -350,7 +350,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5145); - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { gCustomLensFlareOn = true; gCustomLensFlarePos.x = -20.0f; gCustomLensFlarePos.y = 1220.0f; @@ -1186,9 +1186,9 @@ void Scene_DrawConfigKokiriForest(PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128); - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { spA3 = 255 - (u8)play->roomCtx.drawParams[0]; - } else if (gSaveContext.sceneLayer == 6) { + } else if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { spA0 = play->roomCtx.drawParams[0] + 500; } else if ( #if OOT_VERSION < PAL_1_0 diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 775ad9700f..a261a9f1b6 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -69,14 +69,15 @@ void BgSpot00Hanebasi_Init(Actor* thisx, PlayState* play) { return; } - if ((gSaveContext.sceneLayer != 6) && - ((gSaveContext.sceneLayer == 4) || (gSaveContext.sceneLayer == 5) || (!LINK_IS_ADULT && !IS_DAY))) { + if ((gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_2)) && + ((gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) || + (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) || (!LINK_IS_ADULT && !IS_DAY))) { this->dyna.actor.shape.rot.x = -0x4000; } else { this->dyna.actor.shape.rot.x = 0; } - if (gSaveContext.sceneLayer != 6) { + if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_2)) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !GET_EVENTCHKINF(EVENTCHKINF_80)) { this->dyna.actor.shape.rot.x = -0x4000; @@ -226,7 +227,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { } } - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { u16 dayTime; s32 tmp; @@ -242,7 +243,8 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { dayTime = gSaveContext.save.dayTime; - if ((dayTime > CLOCK_TIME(4, 0)) && (dayTime < CLOCK_TIME(4, 30)) && (gSaveContext.sceneLayer == 5)) { + if ((dayTime > CLOCK_TIME(4, 0)) && (dayTime < CLOCK_TIME(4, 30)) && + (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1))) { gTimeSpeed = 0; } } @@ -308,7 +310,7 @@ void BgSpot00Hanebasi_Draw(Actor* thisx, PlayState* play) { thisx->child->child->world.pos.y = newPos.y; thisx->child->child->world.pos.z = newPos.z; - if (gSaveContext.sceneLayer != 12) { + if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_8)) { if (IS_CUTSCENE_LAYER || (!LINK_IS_ADULT && (thisx->shape.rot.x < -0x2000))) { BgSpot00Hanebasi_DrawTorches(thisx, play); } else { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 475940dd53..37f146fd92 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -307,10 +307,10 @@ void BgSpot01Idohashira_Init(Actor* thisx, PlayState* play) { } else { this->action = 0; } - } else if (gSaveContext.sceneLayer == 4) { + } else if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { this->action = 1; this->dyna.actor.shape.yOffset = -(kREG(10) + 1100.0f); - } else if (gSaveContext.sceneLayer == 6) { + } else if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { this->action = 0; } else { Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index e25280ed0b..b24a3bc61a 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -76,7 +76,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) { this->actor.draw = NULL; } - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { play->roomCtx.drawParams[0] = 0xFF; } @@ -118,7 +118,7 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { } } } - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { if (play->roomCtx.drawParams[0] > 0) { play->roomCtx.drawParams[0]--; } else { diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index ef0e25f404..4bd2f0a475 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -73,7 +73,7 @@ void BgTreemouth_Init(Actor* thisx, PlayState* play) { if (!IS_CUTSCENE_LAYER && !LINK_IS_ADULT) { BgTreemouth_SetupAction(this, func_808BC8B8); - } else if (LINK_IS_ADULT || (gSaveContext.sceneLayer == 7)) { + } else if (LINK_IS_ADULT || (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_3))) { this->unk_168 = 0.0f; BgTreemouth_SetupAction(this, BgTreemouth_DoNothing); } else { @@ -116,7 +116,8 @@ void func_808BC6F8(BgTreemouth* this, PlayState* play) { this->unk_168 = 1.0f; } - if ((gSaveContext.sceneLayer == 6) && (play->csCtx.curFrame > 700) && (play->state.frames % 8 == 0)) { + if ((gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) && (play->csCtx.curFrame > 700) && + (play->state.frames % 8 == 0)) { sp34.x = (Rand_ZeroOne() * 1158.0f) + 3407.0f; sp34.y = 970.0f; sp34.z = (Rand_ZeroOne() * 2026.0f) + -2163.0f; @@ -248,7 +249,7 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) { } else { // needed to match } - if (gSaveContext.sceneLayer == 6) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { alpha = (play->roomCtx.drawParams[0] + 0x1F4); } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 2a3e8c4531..cf8baf3a35 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -678,7 +678,8 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { } else { Actor_SetScale(&this->actor, 84 * 0.001f); } - } else if (gSaveContext.sceneLayer == 5 || gSaveContext.sceneLayer == 4 || + } else if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1) || + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0) || (gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4 && !GET_EVENTCHKINF(EVENTCHKINF_C9))) { SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 59.0f, 59.0f, 0.0f); SkelCurve_Update(play, &this->skelCurve); @@ -834,7 +835,8 @@ void DemoEffect_UpdateTriforceSpot(DemoEffect* this, PlayState* play) { } } - if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0 && gSaveContext.sceneLayer == 6 && + if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0 && + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2) && play->csCtx.curFrame == FRAMERATE_CONST(143, 120)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } @@ -1060,11 +1062,12 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { break; } - if (play->sceneId == SCENE_KOKIRI_FOREST && gSaveContext.sceneLayer == 6 && play->csCtx.curFrame == 197) { + if (play->sceneId == SCENE_KOKIRI_FOREST && gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2) && + play->csCtx.curFrame == 197) { Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_OUT); } - if (play->sceneId == SCENE_DEATH_MOUNTAIN_TRAIL && gSaveContext.sceneLayer == 5) { + if (play->sceneId == SCENE_DEATH_MOUNTAIN_TRAIL && gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { if (!DemoEffect_CheckForCue(this, play, 1)) { Actor_PlaySfx(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); } @@ -1075,7 +1078,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { if (0) {} } - if (play->sceneId == SCENE_ZORAS_FOUNTAIN && gSaveContext.sceneLayer == 4) { + if (play->sceneId == SCENE_ZORAS_FOUNTAIN && gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { if (!DemoEffect_CheckForCue(this, play, 1)) { Actor_PlaySfx(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); } @@ -1087,7 +1090,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { if (0) {} } - if (play->sceneId == SCENE_TEMPLE_OF_TIME && gSaveContext.sceneLayer == 14) { + if (play->sceneId == SCENE_TEMPLE_OF_TIME && gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_A)) { if (1) {} if (play->csCtx.actorCues[this->cueChannel]->id == 2) { @@ -1145,7 +1148,7 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { - case 4: + case GET_CUTSCENE_LAYER(CS_INDEX_0): if (play->csCtx.curFrame == FRAMERATE_CONST(288, 240)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } @@ -1154,13 +1157,13 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, PlayState* play) { } break; - case 6: + case GET_CUTSCENE_LAYER(CS_INDEX_2): if (play->csCtx.curFrame == FRAMERATE_CONST(55, 25)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; - case 11: + case GET_CUTSCENE_LAYER(CS_INDEX_7): if (play->csCtx.curFrame == FRAMERATE_CONST(350, 353)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } @@ -1200,18 +1203,18 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { - case 4: + case GET_CUTSCENE_LAYER(CS_INDEX_0): if (play->csCtx.curFrame == FRAMERATE_CONST(298, 248)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } break; - case 6: + case GET_CUTSCENE_LAYER(CS_INDEX_2): if (play->csCtx.curFrame == FRAMERATE_CONST(105, 88)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; - case 11: + case GET_CUTSCENE_LAYER(CS_INDEX_7): if (play->csCtx.curFrame == FRAMERATE_CONST(360, 362)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } @@ -1219,7 +1222,8 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) { } } - if (gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0 && gSaveContext.sceneLayer == 4) { + if (gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0 && + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { if (play->csCtx.curFrame == FRAMERATE_CONST(72, 57)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } @@ -1259,19 +1263,19 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { - case 4: + case GET_CUTSCENE_LAYER(CS_INDEX_0): if (play->csCtx.curFrame == FRAMERATE_CONST(315, 265)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } break; - case 6: + case GET_CUTSCENE_LAYER(CS_INDEX_2): if (play->csCtx.curFrame == FRAMERATE_CONST(80, 60)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; - case 11: + case GET_CUTSCENE_LAYER(CS_INDEX_7): if (play->csCtx.curFrame == FRAMERATE_CONST(370, 371)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } @@ -1764,7 +1768,7 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { if (!DemoEffect_CheckForCue(this, play, 2)) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { if (play->csCtx.curFrame <= 680) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); } diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index ac9afd8d84..231a100656 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -936,7 +936,7 @@ void func_80986CFC(DemoIm* this, PlayState* play) { void func_80986D40(DemoIm* this, PlayState* play) { #if DEBUG_FEATURES - if (gSaveContext.sceneLayer == 6) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { this->action = 19; this->drawConfig = 1; return; 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 a83552b9bf..7a0105a25f 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -864,7 +864,7 @@ void func_80A03CF8(EnElf* this, PlayState* play) { func_80A02C98(this, &nextPos, 0.2f); } - if ((play->sceneId == SCENE_LINKS_HOUSE) && (gSaveContext.sceneLayer == 4)) { + if ((play->sceneId == SCENE_LINKS_HOUSE) && (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0))) { // play dash sound effect as Navi enters Links house in the intro if (1) {} if (play->csCtx.curFrame == 55) { diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index c9af4d3b58..ec619fc2c1 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -109,7 +109,8 @@ void EnHoll_SetupAction(EnHoll* this, EnHollActionFunc func) { } int EnHoll_IsKokiriLayer8(void) { - return gSaveContext.save.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.sceneLayer == 8; + return gSaveContext.save.entranceIndex == ENTR_KOKIRI_FOREST_0 && + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_4); } void EnHoll_ChooseAction(EnHoll* this) { 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 0912c57991..16aad0b67a 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -3619,7 +3619,8 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->cyl1.base.atFlags &= ~AT_ON; } - if (gSaveContext.save.entranceIndex != ENTR_LON_LON_RANCH_0 || gSaveContext.sceneLayer != 9) { + if (gSaveContext.save.entranceIndex != ENTR_LON_LON_RANCH_0 || + gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_5)) { if (this->dustFlags & 1) { this->dustFlags &= ~1; func_800287AC(play, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index 6650e31715..7de638ef72 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -147,7 +147,8 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) { i = 1; // Credits scene. The magic carpet man is friends with the bean guy and the lakeside professor. - if ((gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0) && (gSaveContext.sceneLayer == 8)) { + if ((gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0) && + (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_4))) { Actor* actorProfessor; Actor* actorBeanGuy; diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index ab116e7913..734408e3b5 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -166,7 +166,7 @@ s16 EnMa1_UpdateTalkState(PlayState* play, Actor* thisx) { } s32 EnMa1_ShouldSpawn(EnMa1* this, PlayState* play) { - if ((this->actor.shape.rot.z == 3) && (gSaveContext.sceneLayer == 5)) { + if ((this->actor.shape.rot.z == 3) && (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1))) { return true; } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 35796e1eb7..ee8c015494 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -169,7 +169,7 @@ void EnMs_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0 && - gSaveContext.sceneLayer == 8) { // ride carpet if in credits + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_4)) { // ride carpet if in credits Actor_MoveXZGravity(&this->actor); PRINTF("OOOHHHHHH %f\n", this->actor.velocity.y); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 8271dc4a6c..8cbad3bf80 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -122,7 +122,7 @@ void func_80AE7590(EnRl* this, PlayState* play) { Vec3f pos; s16 sceneId = play->sceneId; - if ((gSaveContext.sceneLayer == 4) && (sceneId == SCENE_CHAMBER_OF_THE_SAGES) && + if ((gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) && (sceneId == SCENE_CHAMBER_OF_THE_SAGES) && (play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[6] != NULL) && (play->csCtx.actorCues[6]->id == 2) && !this->lightMedallionGiven) { player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index e2d612d61b..cc6f842002 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -124,7 +124,7 @@ void EnTr_Destroy(Actor* thisx, PlayState* play) { void EnTr_CrySpellcast(EnTr* this, PlayState* play) { if (this->timer == 11) { // Both cry in the title screen cutscene, but only Kotake in the in-game cutscene - if ((this->actor.params != TR_KOUME) || (gSaveContext.sceneLayer == 6)) { + if ((this->actor.params != TR_KOUME) || (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2))) { Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_VOICE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 0b0594ed86..3c5924531e 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -199,7 +199,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { s32 animationEnded; if (type == ENVIEWER_TYPE_2_ZELDA) { - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { csCurFrame = play->csCtx.curFrame; if (csCurFrame == 792) { Actor_PlaySfx(&this->actor, NA_SE_VO_Z0_SURPRISE); @@ -213,7 +213,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { this->actor.uncullZoneScale = 10000.0f; this->actor.uncullZoneDownward = 10000.0f; } else if (type == ENVIEWER_TYPE_3_GANONDORF) { - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { switch (play->csCtx.curFrame) { case 20: case 59: @@ -231,7 +231,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { break; } } - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { if (play->csCtx.curFrame == 1508) { Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_ST_LAUGH); } @@ -248,7 +248,8 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (type == ENVIEWER_TYPE_6_HORSE_GANONDORF) { - if (gSaveContext.sceneLayer == 5 || gSaveContext.sceneLayer == 10) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1) || + gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_6)) { Actor_PlaySfx(&this->actor, NA_SE_EV_HORSE_RUN_LEVEL - SFX_FLAG); } } else if (type == ENVIEWER_TYPE_4_HORSE_GANONDORF) { @@ -357,7 +358,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { } } } else if (type == ENVIEWER_TYPE_1_IMPA) { - if (gSaveContext.sceneLayer == 5) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_1)) { if (play->csCtx.curFrame == 845) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_ITEM_OCARINA, 4.0f, 81.0f, 2600.0f, 0, 0, 0, 0); @@ -493,7 +494,7 @@ void EnViewer_Update(Actor* thisx, PlayState* play) { s32 EnViewer_Ganondorf3OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { if (play->csCtx.curFrame >= 400) { if (limbIndex == YOUNG_GANONDORF_LIMB_LEFT_HAND) { *dList = gYoungGanondorfOpenLeftHandDL; @@ -537,7 +538,7 @@ void EnViewer_DrawGanondorf(EnViewer* this, PlayState* play) { if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF) { - if (gSaveContext.sceneLayer != 4) { + if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) { frames = 149; } @@ -649,7 +650,7 @@ void EnViewer_DrawZelda(EnViewer* this, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeOutTex)); } - if (gSaveContext.sceneLayer == 6) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(gChildZeldaMouthSurprisedTex)); } else { if (play->csCtx.curFrame < 758) { diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index ccf9bf873f..bd727888fe 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -427,7 +427,7 @@ void EnXc_SetLandingSFX(EnXc* this, PlayState* play) { u32 sfxId; s16 sceneId = play->sceneId; - if ((gSaveContext.sceneLayer != 4) || (sceneId != SCENE_DESERT_COLOSSUS)) { + if ((gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) || (sceneId != SCENE_DESERT_COLOSSUS)) { if (Animation_OnFrame(&this->skelAnime, 11.0f)) { sfxId = NA_SE_PL_WALK_GROUND; sfxId += SurfaceType_GetSfxOffset(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); @@ -439,7 +439,7 @@ void EnXc_SetLandingSFX(EnXc* this, PlayState* play) { void EnXc_SetColossusAppearSFX(EnXc* this, PlayState* play) { s16 sceneId; - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { sceneId = play->sceneId; if (sceneId == SCENE_DESERT_COLOSSUS) { CutsceneContext* csCtx = &play->csCtx; @@ -465,13 +465,14 @@ void EnXc_SetColossusAppearSFX(EnXc* this, PlayState* play) { void func_80B3D118(PlayState* play) { s16 sceneId; - if ((gSaveContext.sceneLayer != 4) || (sceneId = play->sceneId, sceneId != SCENE_DESERT_COLOSSUS)) { + if ((gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) || + (sceneId = play->sceneId, sceneId != SCENE_DESERT_COLOSSUS)) { Sfx_PlaySfxCentered2(NA_SE_PL_SKIP); } } void EnXc_SetColossusWindSFX(PlayState* play) { - if (gSaveContext.sceneLayer == 4) { + if (gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_0)) { static s32 D_80B41D90 = 0; static Vec3f sPos = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80B42DB0; diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index a2b2e50fcf..0fcb77f399 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -105,7 +105,7 @@ void EnYabusameMark_Init(Actor* thisx, PlayState* play) { Collider_SetQuad(play, &this->collider, &this->actor, &sQuadInit); this->worldPos = this->actor.world.pos; this->actor.flags |= ACTOR_FLAG_4; - if (gSaveContext.sceneLayer != 4) { + if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index df08e74937..a619f7104c 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -191,7 +191,7 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, PlayState* play) { player = GET_PLAYER(play); - if (play->sceneId == SCENE_KOKIRI_FOREST && gSaveContext.sceneLayer == 7) { + if (play->sceneId == SCENE_KOKIRI_FOREST && gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_3)) { dist = Math3D_Vec3f_DistXYZ(&this->prevEyePos, &play->view.eye); this->prevEyePos.x = play->view.eye.x; @@ -227,8 +227,8 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, PlayState* play) { } if (play->envCtx.precipitation[PRECIP_SNOW_MAX] < 64 && - (gSaveContext.save.entranceIndex != ENTR_KOKIRI_FOREST_0 || gSaveContext.sceneLayer != 4 || - play->envCtx.precipitation[PRECIP_SNOW_MAX])) { + (gSaveContext.save.entranceIndex != ENTR_KOKIRI_FOREST_0 || + gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0) || play->envCtx.precipitation[PRECIP_SNOW_MAX])) { play->envCtx.precipitation[PRECIP_SNOW_MAX] += 16; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 8e534c52d8..4130b93550 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -41,8 +41,7 @@ typedef struct GetItemEntry { #define CHEST_ANIM_SHORT 0 #define CHEST_ANIM_LONG 1 -#define GET_ITEM_NONE \ - { ITEM_NONE, 0, 0, 0, OBJECT_INVALID } +#define GET_ITEM_NONE { ITEM_NONE, 0, 0, 0, OBJECT_INVALID } typedef struct ExplosiveInfo { /* 0x00 */ u8 itemId; @@ -81,10 +80,10 @@ typedef enum AnimSfxType { #define ANIMSFX_SHIFT_TYPE(type) ((type) << 11) -#define ANIMSFX_DATA(type, frame) ((ANIMSFX_SHIFT_TYPE(type) | ((frame)&0x7FF))) +#define ANIMSFX_DATA(type, frame) ((ANIMSFX_SHIFT_TYPE(type) | ((frame) & 0x7FF))) -#define ANIMSFX_GET_TYPE(data) ((data)&0x7800) -#define ANIMSFX_GET_FRAME(data) ((data)&0x7FF) +#define ANIMSFX_GET_TYPE(data) ((data) & 0x7800) +#define ANIMSFX_GET_FRAME(data) ((data) & 0x7FF) typedef struct AnimSfxEntry { /* 0x00 */ u16 sfxId;