1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

give scene layers names throughout code

This commit is contained in:
feacur 2024-11-28 18:11:34 +01:00
parent f728d55c36
commit 106cb1021b
24 changed files with 83 additions and 71 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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) {

View file

@ -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) {

View file

@ -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

View file

@ -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 {

View file

@ -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);

View file

@ -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 {

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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;

View file

@ -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) {

View file

@ -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) {

View file

@ -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,

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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) {

View file

@ -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;

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;