1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 19:04:38 +00:00

Rename "Scene Setup Index" to "Scene Layer" (#1300)

* setup -> layer

* IS_CUTSCENE_LAYER

* review

* backtick

* remove some more mentions of setup

* alt header block

* clarifying comment
This commit is contained in:
fig02 2022-07-30 17:28:50 -04:00 committed by GitHub
parent d7ea63c75d
commit afbc312024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 169 additions and 156 deletions

View file

@ -222,7 +222,7 @@ void Play_Init(GameState* thisx) {
Player* player;
s32 playerStartBgCamIndex;
s32 i;
u8 tempSetupIndex;
u8 baseSceneLayer;
s32 pad[2];
if (gSaveContext.entranceIndex == ENTR_LOAD_OPENING) {
@ -291,41 +291,42 @@ void Play_Init(GameState* thisx) {
if (gSaveContext.gameMode != GAMEMODE_NORMAL || gSaveContext.cutsceneIndex >= 0xFFF0) {
gSaveContext.nayrusLoveTimer = 0;
Magic_Reset(this);
gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4;
gSaveContext.sceneLayer = SCENE_LAYER_CUTSCENE_FIRST + (gSaveContext.cutsceneIndex & 0xF);
} else if (!LINK_IS_ADULT && IS_DAY) {
gSaveContext.sceneSetupIndex = 0;
gSaveContext.sceneLayer = SCENE_LAYER_CHILD_DAY;
} else if (!LINK_IS_ADULT && !IS_DAY) {
gSaveContext.sceneSetupIndex = 1;
gSaveContext.sceneLayer = SCENE_LAYER_CHILD_NIGHT;
} else if (LINK_IS_ADULT && IS_DAY) {
gSaveContext.sceneSetupIndex = 2;
gSaveContext.sceneLayer = SCENE_LAYER_ADULT_DAY;
} else {
gSaveContext.sceneSetupIndex = 3;
gSaveContext.sceneLayer = SCENE_LAYER_ADULT_NIGHT;
}
tempSetupIndex = gSaveContext.sceneSetupIndex;
// save the base scene layer (before accounting for the special cases below) to use later for the transition type
baseSceneLayer = gSaveContext.sceneLayer;
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && !LINK_IS_ADULT &&
gSaveContext.sceneSetupIndex < 4) {
!IS_CUTSCENE_LAYER) {
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
gSaveContext.sceneSetupIndex = 1;
gSaveContext.sceneLayer = 1;
} else {
gSaveContext.sceneSetupIndex = 0;
gSaveContext.sceneLayer = 0;
}
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT &&
gSaveContext.sceneSetupIndex < 4) {
gSaveContext.sceneSetupIndex = GET_EVENTCHKINF(EVENTCHKINF_48) ? 3 : 2;
!IS_CUTSCENE_LAYER) {
gSaveContext.sceneLayer = GET_EVENTCHKINF(EVENTCHKINF_48) ? 3 : 2;
}
Play_SpawnScene(
this, gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene,
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].spawn);
Play_SpawnScene(this,
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].scene,
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].spawn);
osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneSetupIndex);
osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneLayer);
// When entering Gerudo Valley in the right setup, trigger the GC emulator to play the ending movie.
// When entering Gerudo Valley in the credits, trigger the GC emulator to play the ending movie.
// The emulator constantly checks whether PC is 0x81000000, so this works even though it's not a valid address.
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT09) &&
gSaveContext.sceneSetupIndex == 6) {
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT09) && gSaveContext.sceneLayer == 6) {
osSyncPrintf("エンディングはじまるよー\n"); // "The ending starts"
((void (*)(void))0x81000000)();
osSyncPrintf("出戻り?\n"); // "Return?"
@ -372,7 +373,7 @@ void Play_Init(GameState* thisx) {
if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) {
if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) {
this->transitionType = ENTRANCE_INFO_END_TRANS_TYPE(
gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field);
gEntranceTable[((void)0, gSaveContext.entranceIndex) + baseSceneLayer].field);
} else {
this->transitionType = gSaveContext.nextTransitionType;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
@ -504,16 +505,16 @@ void Play_Update(PlayState* this) {
switch (this->transitionMode) {
case TRANS_MODE_SETUP:
if (this->transitionTrigger != TRANS_TRIGGER_END) {
s16 sceneSetupIndex = 0;
s16 sceneLayer = SCENE_LAYER_CHILD_DAY;
Interface_ChangeAlpha(1);
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4;
sceneLayer = SCENE_LAYER_CUTSCENE_FIRST + (gSaveContext.cutsceneIndex & 0xF);
}
// fade out bgm if "continue bgm" flag is not set
if (!(gEntranceTable[this->nextEntranceIndex + sceneSetupIndex].field &
if (!(gEntranceTable[this->nextEntranceIndex + sceneLayer].field &
ENTRANCE_INFO_CONTINUE_BGM_FLAG)) {
// "Sound initalized. 111"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");