mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-13 03:14:38 +00:00
sceneNum -> sceneId (#1338)
* sceneNum -> sceneId * forgot to save play * scene -> sceneId where appropriate * Missed 1 + format * Update src/code/z_sram.c Co-authored-by: mzxrules <mzxrules@gmail.com> * Update src/code/z_sram.c Co-authored-by: mzxrules <mzxrules@gmail.com> * PR * Fix Co-authored-by: mzxrules <mzxrules@gmail.com>
This commit is contained in:
parent
706d5596bf
commit
9c6461751d
83 changed files with 444 additions and 445 deletions
|
@ -13,7 +13,7 @@ FaultClient D_801614B8;
|
|||
s16 sTransitionFillTimer;
|
||||
u64 D_801614D0[0xA00];
|
||||
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneNum, s32 spawn);
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
|
||||
|
||||
// This macro prints the number "1" with a file and line number if R_ENABLE_PLAY_LOGS is enabled.
|
||||
// For example, it can be used to trace the play state execution at a high level.
|
||||
|
@ -305,7 +305,7 @@ void Play_Init(GameState* thisx) {
|
|||
// 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 &&
|
||||
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].sceneId == SCENE_SPOT00) && !LINK_IS_ADULT &&
|
||||
!IS_CUTSCENE_LAYER) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
|
||||
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
|
@ -313,20 +313,21 @@ void Play_Init(GameState* thisx) {
|
|||
} else {
|
||||
gSaveContext.sceneLayer = 0;
|
||||
}
|
||||
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT &&
|
||||
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].sceneId == SCENE_SPOT04) && LINK_IS_ADULT &&
|
||||
!IS_CUTSCENE_LAYER) {
|
||||
gSaveContext.sceneLayer = GET_EVENTCHKINF(EVENTCHKINF_48) ? 3 : 2;
|
||||
}
|
||||
|
||||
Play_SpawnScene(this,
|
||||
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].scene,
|
||||
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].sceneId,
|
||||
gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].spawn);
|
||||
|
||||
osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneLayer);
|
||||
|
||||
// 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.sceneLayer == 6) {
|
||||
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].sceneId == SCENE_SPOT09) &&
|
||||
gSaveContext.sceneLayer == 6) {
|
||||
osSyncPrintf("エンディングはじまるよー\n"); // "The ending starts"
|
||||
((void (*)(void))0x81000000)();
|
||||
osSyncPrintf("出戻り?\n"); // "Return?"
|
||||
|
@ -1415,12 +1416,12 @@ void Play_InitScene(PlayState* this, s32 spawn) {
|
|||
Play_InitEnvironment(this, this->skyboxId);
|
||||
}
|
||||
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneNum, s32 spawn) {
|
||||
SceneTableEntry* scene = &gSceneTable[sceneNum];
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
|
||||
SceneTableEntry* scene = &gSceneTable[sceneId];
|
||||
|
||||
scene->unk_13 = 0;
|
||||
this->loadedScene = scene;
|
||||
this->sceneNum = sceneNum;
|
||||
this->sceneId = sceneId;
|
||||
this->sceneDrawConfig = scene->drawConfig;
|
||||
|
||||
osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
|
||||
|
@ -1662,7 +1663,7 @@ s16 func_800C09D8(PlayState* this, s16 camId, s16 arg2) {
|
|||
}
|
||||
|
||||
void Play_SaveSceneFlags(PlayState* this) {
|
||||
SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[this->sceneNum];
|
||||
SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[this->sceneId];
|
||||
|
||||
savedSceneFlags->chest = this->actorCtx.flags.chest;
|
||||
savedSceneFlags->swch = this->actorCtx.flags.swch;
|
||||
|
@ -1688,7 +1689,7 @@ void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams)
|
|||
s32 entranceIndex;
|
||||
s8 roomIndex;
|
||||
|
||||
if ((this->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (this->sceneNum != SCENE_KAKUSIANA)) {
|
||||
if ((this->sceneId != SCENE_YOUSEI_IZUMI_TATE) && (this->sceneId != SCENE_KAKUSIANA)) {
|
||||
roomIndex = this->roomCtx.curRoom.num;
|
||||
entranceIndex = gSaveContext.entranceIndex;
|
||||
Play_SetRespawnData(this, respawnMode, entranceIndex, roomIndex, playerParams, &player->actor.world.pos,
|
||||
|
@ -1709,8 +1710,8 @@ void Play_LoadToLastEntrance(PlayState* this) {
|
|||
gSaveContext.respawnFlag = -1;
|
||||
this->transitionTrigger = TRANS_TRIGGER_START;
|
||||
|
||||
if ((this->sceneNum == SCENE_GANON_SONOGO) || (this->sceneNum == SCENE_GANON_FINAL) ||
|
||||
(this->sceneNum == SCENE_GANONTIKA_SONOGO) || (this->sceneNum == SCENE_GANON_DEMO)) {
|
||||
if ((this->sceneId == SCENE_GANON_SONOGO) || (this->sceneId == SCENE_GANON_FINAL) ||
|
||||
(this->sceneId == SCENE_GANONTIKA_SONOGO) || (this->sceneId == SCENE_GANON_DEMO)) {
|
||||
this->nextEntranceIndex = ENTR_GANON_FINAL_0;
|
||||
Item_Give(this, ITEM_SWORD_MASTER);
|
||||
} else if ((gSaveContext.entranceIndex == ENTR_SPOT00_11) || (gSaveContext.entranceIndex == ENTR_SPOT00_12) ||
|
||||
|
@ -1733,7 +1734,7 @@ s32 Play_CamIsNotFixed(PlayState* this) {
|
|||
// but the scene mesh header handles all shop cases regardless
|
||||
return (this->roomCtx.curRoom.meshHeader->base.type != MESH_HEADER_TYPE_1) &&
|
||||
(R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) && (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED) &&
|
||||
(R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_MARKET) && (this->sceneNum != SCENE_HAIRAL_NIWA);
|
||||
(R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_MARKET) && (this->sceneId != SCENE_HAIRAL_NIWA);
|
||||
}
|
||||
|
||||
s32 FrameAdvance_IsEnabled(PlayState* this) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue