diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2022-07-31 16:44:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 19:44:47 -0400 |
| commit | 9c6461751d81191a94c45e2cf2cf654c583624e8 (patch) | |
| tree | 4b23693601ac313ee73b08161cf510d590b9e21c /src/code | |
| parent | 706d5596bf4661ac895779bc6b9837ba8b0f8d99 (diff) | |
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>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 6 | ||||
| -rw-r--r-- | src/code/z_bgcheck.c | 10 | ||||
| -rw-r--r-- | src/code/z_camera.c | 8 | ||||
| -rw-r--r-- | src/code/z_demo.c | 8 | ||||
| -rw-r--r-- | src/code/z_horse.c | 62 | ||||
| -rw-r--r-- | src/code/z_kaleido_setup.c | 2 | ||||
| -rw-r--r-- | src/code/z_kankyo.c | 2 | ||||
| -rw-r--r-- | src/code/z_map_exp.c | 40 | ||||
| -rw-r--r-- | src/code/z_map_mark.c | 2 | ||||
| -rw-r--r-- | src/code/z_message_PAL.c | 8 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 52 | ||||
| -rw-r--r-- | src/code/z_play.c | 27 | ||||
| -rw-r--r-- | src/code/z_room.c | 2 | ||||
| -rw-r--r-- | src/code/z_scene.c | 16 | ||||
| -rw-r--r-- | src/code/z_scene_table.c | 22 | ||||
| -rw-r--r-- | src/code/z_sram.c | 18 |
16 files changed, 143 insertions, 142 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 75409861f..ab310a446 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1958,7 +1958,7 @@ void func_800304DC(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEnt SavedSceneFlags* savedSceneFlags; s32 i; - savedSceneFlags = &gSaveContext.sceneFlags[play->sceneNum]; + savedSceneFlags = &gSaveContext.sceneFlags[play->sceneId]; bzero(actorCtx, sizeof(*actorCtx)); @@ -3323,7 +3323,7 @@ Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius) { void Actor_SetTextWithPrefix(PlayState* play, Actor* actor, s16 baseTextId) { s16 prefix; - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_YDAN_BOSS: case SCENE_MORIBOSSROOM: @@ -4515,7 +4515,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 16: - if (play->sceneNum == SCENE_SPOT15) { + if (play->sceneId == SCENE_SPOT15) { retTextId = 0x7002; } else if (Flags_GetInfTable(INFTABLE_6A)) { retTextId = 0x7004; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index ff11a33ac..ceea25526 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1451,7 +1451,7 @@ s32 BgCheck_IsSpotScene(PlayState* play) { s16* i; for (i = spotScenes; i < spotScenes + ARRAY_COUNT(spotScenes); i++) { - if (play->sceneNum == *i) { + if (play->sceneId == *i) { return true; } } @@ -1528,7 +1528,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader if ((R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) || (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)) { - if (play->sceneNum == SCENE_MALON_STABLE) { + if (play->sceneId == SCENE_MALON_STABLE) { // "/* BGCheck LonLon Size %dbyte */\n" osSyncPrintf("/* BGCheck LonLonサイズ %dbyte */\n", 0x3520); colCtx->memSize = 0x3520; @@ -1554,7 +1554,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader colCtx->subdivAmount.y = 4; colCtx->subdivAmount.z = 16; } else { - if (BgCheck_TryGetCustomMemsize(play->sceneNum, &customMemSize)) { + if (BgCheck_TryGetCustomMemsize(play->sceneId, &customMemSize)) { colCtx->memSize = customMemSize; } else { colCtx->memSize = 0x1CC00; @@ -1567,7 +1567,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader useCustomSubdivisions = false; for (i = 0; i < ARRAY_COUNT(sceneSubdivisionList); i++) { - if (play->sceneNum == sceneSubdivisionList[i].sceneId) { + if (play->sceneId == sceneSubdivisionList[i].sceneId) { colCtx->subdivAmount.x = sceneSubdivisionList[i].subdivAmount.x; colCtx->subdivAmount.y = sceneSubdivisionList[i].subdivAmount.y; colCtx->subdivAmount.z = sceneSubdivisionList[i].subdivAmount.z; @@ -4146,7 +4146,7 @@ f32 sZorasDomainWaterBoxMaxZ = -967.0f; */ s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { - if (play->sceneNum == SCENE_SPOT07) { + if (play->sceneId == SCENE_SPOT07) { if (sZorasDomainWaterBoxMinX < x && x < sZorasDomainWaterBoxMaxX && sZorasDomainWaterBoxMinY < *ySurface && *ySurface < sZorasDomainWaterBoxMaxY && sZorasDomainWaterBoxMinZ < z && z < sZorasDomainWaterBoxMaxZ) { *outWaterBox = &sZorasDomainWaterBox; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 8b7dac260..950b67cde 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -6562,7 +6562,7 @@ s32 Camera_Special7(Camera* camera) { yOffset = Player_GetHeight(camera->player); if (camera->animState == 0) { - if (camera->play->sceneNum == SCENE_JYASINZOU) { + if (camera->play->sceneId == SCENE_JYASINZOU) { // Spirit Temple rwData->index = 3; } else if (playerPosRot->pos.x < 1500.0f) { @@ -7264,7 +7264,7 @@ s32 Camera_UpdateWater(Camera* camera) { if (camera->waterDistortionTimer > 0) { camera->waterDistortionTimer--; camera->distortionFlags |= DISTORTION_UNDERWATER_STRONG; - } else if (camera->play->sceneNum == SCENE_TURIBORI) { + } else if (camera->play->sceneId == SCENE_TURIBORI) { camera->distortionFlags |= DISTORTION_UNDERWATER_FISHING; } else { camera->distortionFlags |= DISTORTION_UNDERWATER_WEAK; @@ -7616,7 +7616,7 @@ Vec3s Camera_Update(Camera* camera) { Camera_UpdateDistortion(camera); - if ((camera->play->sceneNum == SCENE_SPOT00) && (camera->fov < 59.0f)) { + if ((camera->play->sceneId == SCENE_SPOT00) && (camera->fov < 59.0f)) { View_SetScale(&camera->play->view, 0.79f); } else { View_SetScale(&camera->play->view, 1.0f); @@ -7860,7 +7860,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) { } } if (((setting == CAM_SET_MEADOW_BIRDS_EYE) || (setting == CAM_SET_MEADOW_UNUSED)) && LINK_IS_ADULT && - (camera->play->sceneNum == SCENE_SPOT05)) { + (camera->play->sceneId == SCENE_SPOT05)) { camera->unk_14A |= 0x10; return -5; } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 9f4b21dde..d25bd3ad3 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -489,7 +489,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB s32 temp = 0; if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_END_CREDITS) && - (play->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) && + (play->sceneId != SCENE_SPOT00) && (csCtx->frames > 20) && (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) && @@ -1255,7 +1255,7 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm (gSaveContext.entranceIndex == ENTR_YOUSEI_IZUMI_YOKO_0))) { Audio_PlaySfxGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if ((temp == 0.0f) && (play->sceneNum == SCENE_GANONTIKA)) { + } else if ((temp == 0.0f) && (play->sceneId == SCENE_GANONTIKA)) { func_800788CC(NA_SE_EV_WHITE_OUT); } } else { @@ -2093,12 +2093,12 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { gSaveContext.cutsceneIndex = 0xFFF0; } else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_C4) && - (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) { + (gEntranceTable[((void)0, gSaveContext.entranceIndex)].sceneId == SCENE_TOKINOMA)) { Flags_SetEventChkInf(EVENTCHKINF_C4); gSaveContext.entranceIndex = ENTR_TOKINOMA_0; gSaveContext.cutsceneIndex = 0xFFF8; } else if (!Flags_GetEventChkInf(EVENTCHKINF_C7) && - (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO)) { + (gEntranceTable[((void)0, gSaveContext.entranceIndex)].sceneId == SCENE_GANON_DEMO)) { Flags_SetEventChkInf(EVENTCHKINF_C7); gSaveContext.entranceIndex = ENTR_GANON_DEMO_0; gSaveContext.cutsceneIndex = 0xFFF0; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 49a021cde..27cca3d2e 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -2,12 +2,12 @@ #include "vt.h" #include "src/overlays/actors/ovl_En_Horse/z_en_horse.h" -s32 func_8006CFC0(s32 scene) { - s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 }; +s32 func_8006CFC0(s32 sceneId) { + s32 validSceneIds[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 }; s32 i; - for (i = 0; i < ARRAY_COUNT(validScenes); i++) { - if (scene == validScenes[i]) { + for (i = 0; i < ARRAY_COUNT(validSceneIds); i++) { + if (sceneId == validSceneIds[i]) { return 1; } } @@ -16,7 +16,7 @@ s32 func_8006CFC0(s32 scene) { } void func_8006D074(PlayState* play) { - gSaveContext.horseData.scene = SCENE_SPOT00; + gSaveContext.horseData.sceneId = SCENE_SPOT00; gSaveContext.horseData.pos.x = -1840; gSaveContext.horseData.pos.y = 72; gSaveContext.horseData.pos.z = 5497; @@ -24,8 +24,8 @@ void func_8006D074(PlayState* play) { } void func_8006D0AC(PlayState* play) { - if (gSaveContext.horseData.scene == SCENE_SPOT06) { - gSaveContext.horseData.scene = SCENE_SPOT06; + if (gSaveContext.horseData.sceneId == SCENE_SPOT06) { + gSaveContext.horseData.sceneId = SCENE_SPOT06; gSaveContext.horseData.pos.x = -2065; gSaveContext.horseData.pos.y = -863; gSaveContext.horseData.pos.z = 1839; @@ -34,7 +34,7 @@ void func_8006D0AC(PlayState* play) { } typedef struct { - /* 0x00 */ s16 scene; + /* 0x00 */ s16 sceneId; /* 0x02 */ Vec3s pos; /* 0x08 */ s16 angle; /* 0x0A */ s16 type; @@ -57,12 +57,12 @@ void func_8006D0EC(PlayState* play, Player* player) { Actor_MountHorse(play, player, player->rideActor); func_8002DE74(play, player); - gSaveContext.horseData.scene = play->sceneNum; + gSaveContext.horseData.sceneId = play->sceneId; - if (play->sceneNum == SCENE_SPOT12) { + if (play->sceneId == SCENE_SPOT12) { player->rideActor->room = -1; } - } else if ((play->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) { + } else if ((play->sceneId == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) { Actor* horseActor; gSaveContext.minigameState = 0; horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1); @@ -71,39 +71,39 @@ void func_8006D0EC(PlayState* play, Player* player) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389); - } else if ((play->sceneNum == gSaveContext.horseData.scene) && + } else if ((play->sceneId == gSaveContext.horseData.sceneId) && (Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1) != 0)) { // "Set by existence of horse %d %d %d" - osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, + osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.sceneId, Flags_GetEventChkInf(EVENTCHKINF_18), DREG(1)); - if (func_8006CFC0(gSaveContext.horseData.scene)) { + if (func_8006CFC0(gSaveContext.horseData.sceneId)) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 414); - if (play->sceneNum == SCENE_SPOT12) { + if (play->sceneId == SCENE_SPOT12) { horseActor->room = -1; } } else { osSyncPrintf(VT_COL(RED, WHITE)); // "Horse_SetNormal():%d set spot is no good." - osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene); + osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.sceneId); osSyncPrintf(VT_RST); func_8006D074(play); } - } else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { + } else if ((play->sceneId == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443); } else if (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0)) { for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) { HorseSpawn* horseSpawn = &horseSpawns[i]; - if (horseSpawn->scene == play->sceneNum) { + if (horseSpawn->sceneId == play->sceneId) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y, horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 466); - if (play->sceneNum == SCENE_SPOT12) { + if (play->sceneId == SCENE_SPOT12) { horseActor->room = -1; } @@ -111,14 +111,14 @@ void func_8006D0EC(PlayState* play, Player* player) { } } } else if (!Flags_GetEventChkInf(EVENTCHKINF_18)) { - if ((DREG(1) == 0) && (play->sceneNum == SCENE_SOUKO) && !IS_DAY) { + if ((DREG(1) == 0) && (play->sceneId == SCENE_SOUKO) && !IS_DAY) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); } } } typedef struct { - /* 0x00 */ s16 scene; + /* 0x00 */ s16 sceneId; /* 0x04 */ s32 cutsceneIndex; /* 0x08 */ Vec3s pos; /* 0x0E */ s16 angle; @@ -156,8 +156,8 @@ void func_8006D684(PlayState* play, Player* player) { Actor_MountHorse(play, player, player->rideActor); func_8002DE74(play, player); - gSaveContext.horseData.scene = play->sceneNum; - } else if ((play->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && + gSaveContext.horseData.sceneId = play->sceneId; + } else if ((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5); @@ -165,9 +165,9 @@ void func_8006D684(PlayState* play, Player* player) { Actor_MountHorse(play, player, player->rideActor); func_8002DE74(play, player); - gSaveContext.horseData.scene = play->sceneNum; + gSaveContext.horseData.sceneId = play->sceneId; - if (play->sceneNum == SCENE_SPOT12) { + if (play->sceneId == SCENE_SPOT12) { player->rideActor->room = -1; } } else { @@ -183,10 +183,10 @@ void func_8006D684(PlayState* play, Player* player) { }; for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) { - if ((play->sceneNum == D_8011F9B8[i].scene) && + if ((play->sceneId == D_8011F9B8[i].sceneId) && (((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) { if (D_8011F9B8[i].type == 7) { - if ((play->sceneNum == SCENE_SPOT20) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { + if ((play->sceneId == SCENE_SPOT20) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { D_8011F9B8[i].pos.x = player->actor.world.pos.x; D_8011F9B8[i].pos.y = player->actor.world.pos.y; D_8011F9B8[i].pos.z = player->actor.world.pos.z; @@ -238,20 +238,20 @@ void func_8006D684(PlayState* play, Player* player) { void func_8006DC68(PlayState* play, Player* player) { if (LINK_IS_ADULT) { - if (!func_8006CFC0(gSaveContext.horseData.scene)) { + if (!func_8006CFC0(gSaveContext.horseData.sceneId)) { osSyncPrintf(VT_COL(RED, WHITE)); // "Horse_Set_Check():%d set spot is no good." - osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene); + osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.sceneId); osSyncPrintf(VT_RST); func_8006D074(play); } - if (func_8006CFC0(play->sceneNum)) { + if (func_8006CFC0(play->sceneId)) { if (IS_CUTSCENE_LAYER || ((gSaveContext.entranceIndex == ENTR_SPOT00_11 || gSaveContext.entranceIndex == ENTR_SPOT00_12 || gSaveContext.entranceIndex == ENTR_SPOT00_13 || gSaveContext.entranceIndex == ENTR_SPOT00_15) && (gSaveContext.respawnFlag == 0)) || - ((play->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && + ((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0))) { func_8006D684(play, player); } else { diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index b6314ece3..2becd626f 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -17,7 +17,7 @@ void KaleidoSetup_Update(PlayState* play) { gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) && play->shootingGalleryStatus <= 1 && gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY && gSaveContext.magicState != MAGIC_STATE_FILL && - (play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) { + (play->sceneId != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) { if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (BREG(0)) { diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index e35a1e378..92ac0336f 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -2361,7 +2361,7 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) { switch (sandstormState) { case SANDSTORM_ACTIVE: - if ((play->sceneNum == SCENE_SPOT13) && (play->roomCtx.curRoom.num == 0)) { + if ((play->sceneId == SCENE_SPOT13) && (play->roomCtx.curRoom.num == 0)) { envA1 = 0; primA1 = (play->envCtx.sandstormEnvA > 128) ? 255 : play->envCtx.sandstormEnvA >> 1; } else { diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 6f9483247..c8201c9d7 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -53,7 +53,7 @@ void Map_SetFloorPalettesData(PlayState* play, s16 floor) { interfaceCtx->mapPalette[31] = 1; } - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: @@ -87,7 +87,7 @@ void Map_InitData(PlayState* play, s16 room) { InterfaceContext* interfaceCtx = &play->interfaceCtx; s16 extendedMapIndex; - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -109,19 +109,19 @@ void Map_InitData(PlayState* play, s16 room) { case SCENE_SPOT20: case SCENE_GANON_TOU: extendedMapIndex = mapIndex; - if (play->sceneNum == SCENE_SPOT02) { + if (play->sceneId == SCENE_SPOT02) { if (CHECK_QUEST_ITEM(QUEST_SONG_NOCTURNE)) { extendedMapIndex = 0x14; } - } else if (play->sceneNum == SCENE_SPOT06) { + } else if (play->sceneId == SCENE_SPOT06) { if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) { extendedMapIndex = 0x15; } - } else if (play->sceneNum == SCENE_SPOT09) { + } else if (play->sceneId == SCENE_SPOT09) { if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { extendedMapIndex = 0x16; } - } else if (play->sceneNum == SCENE_SPOT12) { + } else if (play->sceneId == SCENE_SPOT12) { if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { extendedMapIndex = 0x17; } @@ -175,10 +175,10 @@ void Map_InitRoomData(PlayState* play, s16 room) { InterfaceContext* interfaceCtx = &play->interfaceCtx; osSyncPrintf("*******\n*******\nroom_no=%d (%d)(%d)\n*******\n*******\n", room, - mapIndex, play->sceneNum); + mapIndex, play->sceneId); if (room >= 0) { - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: @@ -233,11 +233,11 @@ void Map_Init(PlayState* play) { interfaceCtx->mapSegment = GameState_Alloc(&play->state, 0x1000, "../z_map_exp.c", 457); // "MAP texture initialization scene_data_ID=%d mapSegment=%x" - osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneNum, + osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneId, interfaceCtx->mapSegment, play); ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", "../z_map_exp.c", 459); - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -258,7 +258,7 @@ void Map_Init(PlayState* play) { case SCENE_SPOT18: case SCENE_SPOT20: case SCENE_GANON_TOU: - mapIndex = play->sceneNum - SCENE_SPOT00; + mapIndex = play->sceneId - SCENE_SPOT00; R_MAP_INDEX = gSaveContext.mapIndex = mapIndex; R_COMPASS_SCALE_X = gMapData->owCompassInfo[mapIndex][0]; R_COMPASS_SCALE_Y = gMapData->owCompassInfo[mapIndex][1]; @@ -293,9 +293,9 @@ void Map_Init(PlayState* play) { case SCENE_MIZUSIN_BS: case SCENE_JYASINBOSS: case SCENE_HAKADAN_BS: - mapIndex = (play->sceneNum >= SCENE_YDAN_BOSS) ? play->sceneNum - SCENE_YDAN_BOSS : play->sceneNum; + mapIndex = (play->sceneId >= SCENE_YDAN_BOSS) ? play->sceneId - SCENE_YDAN_BOSS : play->sceneId; R_MAP_INDEX = gSaveContext.mapIndex = mapIndex; - if ((play->sceneNum <= SCENE_ICE_DOUKUTO) || (play->sceneNum >= SCENE_YDAN_BOSS)) { + if ((play->sceneId <= SCENE_ICE_DOUKUTO) || (play->sceneId >= SCENE_YDAN_BOSS)) { R_COMPASS_SCALE_X = gMapData->dgnCompassInfo[mapIndex][0]; R_COMPASS_SCALE_Y = gMapData->dgnCompassInfo[mapIndex][1]; R_COMPASS_OFFSET_X = gMapData->dgnCompassInfo[mapIndex][2]; @@ -365,7 +365,7 @@ void Minimap_Draw(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_map_exp.c", 626); if (play->pauseCtx.state < 4) { - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: @@ -453,8 +453,8 @@ void Minimap_Draw(PlayState* play) { (R_OW_MINIMAP_Y + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - if (((play->sceneNum != SCENE_SPOT01) && (play->sceneNum != SCENE_SPOT04) && - (play->sceneNum != SCENE_SPOT08)) || + if (((play->sceneId != SCENE_SPOT01) && (play->sceneId != SCENE_SPOT04) && + (play->sceneId != SCENE_SPOT08)) || (LINK_AGE_IN_YEARS != YEARS_ADULT)) { if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && @@ -474,7 +474,7 @@ void Minimap_Draw(PlayState* play) { } } - if ((play->sceneNum == SCENE_SPOT08) && + if ((play->sceneId == SCENE_SPOT08) && (gSaveContext.infTable[INFTABLE_1AX_INDEX] & gBitFlags[INFTABLE_1A9_SHIFT])) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, @@ -521,7 +521,7 @@ void Map_Update(PlayState* play) { s16 i; if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: @@ -583,9 +583,9 @@ void Map_Update(PlayState* play) { case SCENE_MIZUSIN_BS: case SCENE_JYASINBOSS: case SCENE_HAKADAN_BS: - VREG(30) = gMapData->bossFloor[play->sceneNum - SCENE_YDAN_BOSS]; + VREG(30) = gMapData->bossFloor[play->sceneId - SCENE_YDAN_BOSS]; R_MAP_TEX_INDEX = - R_MAP_TEX_INDEX_BASE + gMapData->floorTexIndexOffset[play->sceneNum - SCENE_YDAN_BOSS][VREG(30)]; + R_MAP_TEX_INDEX_BASE + gMapData->floorTexIndexOffset[play->sceneId - SCENE_YDAN_BOSS][VREG(30)]; break; } } diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index a267f7e56..564ddc01e 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -132,7 +132,7 @@ void MapMark_DrawForDungeon(PlayState* play) { } void MapMark_Draw(PlayState* play) { - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index b9e9c420d..dc9f6622a 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -3097,7 +3097,7 @@ void Message_Update(PlayState* play) { if (D_8014B2F4 >= 4) { var = true; } - } else if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneNum == SCENE_HAIRAL_NIWA) { + } else if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneId == SCENE_HAIRAL_NIWA) { var = true; } else if (D_8014B2F4 >= 4 || msgCtx->talkActor == NULL) { var = true; @@ -3123,14 +3123,14 @@ void Message_Update(PlayState* play) { var = msgCtx->textBoxType; if (!msgCtx->textBoxPos) { // variable position - if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneNum == SCENE_HAIRAL_NIWA) { + if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneId == SCENE_HAIRAL_NIWA) { if (averageY < XREG(92)) { R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; } else { R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; } - } else if (play->sceneNum == SCENE_MARKET_DAY || play->sceneNum == SCENE_MARKET_NIGHT || - play->sceneNum == SCENE_MARKET_RUINS) { + } else if (play->sceneId == SCENE_MARKET_DAY || play->sceneId == SCENE_MARKET_NIGHT || + play->sceneId == SCENE_MARKET_RUINS) { if (averageY < XREG(93)) { R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; } else { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 2f696f2e2..d5c88e7c5 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -10,7 +10,7 @@ #define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex)) typedef struct { - /* 0x00 */ u8 scene; + /* 0x00 */ u8 sceneId; /* 0x01 */ u8 flags1; /* 0x02 */ u8 flags2; /* 0x03 */ u8 flags3; @@ -404,7 +404,7 @@ void func_80082850(PlayState* play, s16 maxAlpha) { interfaceCtx->magicAlpha = alpha; } - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -625,11 +625,11 @@ void func_80083108(PlayState* play) { s16 sp28 = false; if ((gSaveContext.cutsceneIndex < 0xFFF0) || - ((play->sceneNum == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF0))) { + ((play->sceneId == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF0))) { gSaveContext.unk_13E7 = 0; if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || - ((play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { + ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { gSaveContext.unk_13E7 = 1; @@ -644,7 +644,7 @@ void func_80083108(PlayState* play) { (gSaveContext.equips.buttonItems[0] != ITEM_NONE)) { gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; - if ((play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { + if ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { gSaveContext.equips.buttonItems[0] = ITEM_BOMBCHU; Interface_LoadItemIcon1(play, 0); } else { @@ -675,7 +675,7 @@ void func_80083108(PlayState* play) { Interface_ChangeAlpha(8); } else if (play->shootingGalleryStatus > 1) { Interface_ChangeAlpha(8); - } else if ((play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { + } else if ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { Interface_ChangeAlpha(8); } else if (player->stateFlags1 & PLAYER_STATE1_23) { Interface_ChangeAlpha(12); @@ -685,9 +685,9 @@ void func_80083108(PlayState* play) { Interface_ChangeAlpha(12); } } - } else if (play->sceneNum == SCENE_KENJYANOMA) { + } else if (play->sceneId == SCENE_KENJYANOMA) { Interface_ChangeAlpha(1); - } else if (play->sceneNum == SCENE_TURIBORI) { + } else if (play->sceneId == SCENE_TURIBORI) { gSaveContext.unk_13E7 = 2; if (play->interfaceCtx.unk_260 != 0) { if (gSaveContext.equips.buttonItems[0] != ITEM_FISHING_POLE) { @@ -1021,7 +1021,7 @@ void func_80083108(PlayState* play) { (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) && !((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - if ((play->sceneNum != SCENE_TAKARAYA) || + if ((play->sceneId != SCENE_TAKARAYA) || (gSaveContext.equips.buttonItems[i] != ITEM_LENS)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = true; @@ -1076,7 +1076,7 @@ void func_80083108(PlayState* play) { void Interface_SetSceneRestrictions(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; s16 i; - u8 currentScene; + u8 sceneId; interfaceCtx->restrictions.hGauge = interfaceCtx->restrictions.bButton = interfaceCtx->restrictions.aButton = interfaceCtx->restrictions.bottles = interfaceCtx->restrictions.tradeItems = @@ -1088,11 +1088,11 @@ void Interface_SetSceneRestrictions(PlayState* play) { i = 0; // "Data settings related to button display scene_data_ID=%d\n" - osSyncPrintf("ボタン表示関係データ設定 scene_data_ID=%d\n", play->sceneNum); + osSyncPrintf("ボタン表示関係データ設定 scene_data_ID=%d\n", play->sceneId); do { - currentScene = (u8)play->sceneNum; - if (sRestrictionFlags[i].scene == currentScene) { + sceneId = (u8)play->sceneId; + if (sRestrictionFlags[i].sceneId == sceneId) { interfaceCtx->restrictions.hGauge = (sRestrictionFlags[i].flags1 & 0xC0) >> 6; interfaceCtx->restrictions.bButton = (sRestrictionFlags[i].flags1 & 0x30) >> 4; interfaceCtx->restrictions.aButton = (sRestrictionFlags[i].flags1 & 0x0C) >> 2; @@ -1122,7 +1122,7 @@ void Interface_SetSceneRestrictions(PlayState* play) { return; } i++; - } while (sRestrictionFlags[i].scene != 0xFF); + } while (sRestrictionFlags[i].sceneId != 0xFF); } Gfx* Gfx_TextureIA8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, @@ -2895,7 +2895,7 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { ammo = play->interfaceCtx.hbaAmmo; } else if ((button == 0) && (play->shootingGalleryStatus > 1)) { ammo = play->shootingGalleryStatus - 1; - } else if ((button == 0) && (play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { + } else if ((button == 0) && (play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { ammo = play->bombchuBowlingStatus; if (ammo < 0) { ammo = 0; @@ -3105,7 +3105,7 @@ void Interface_Draw(PlayState* play) { gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, 26, 206, 16, 16, 1 << 10, 1 << 10); - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_BMORI1: case SCENE_HIDAN: case SCENE_MIZUSIN: @@ -3221,7 +3221,7 @@ void Interface_Draw(PlayState* play) { Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, 0); if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || - ((play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { + ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -3469,7 +3469,7 @@ void Interface_Draw(PlayState* play) { (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) && - (play->shootingGalleryStatus <= 1) && !((play->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { + (play->shootingGalleryStatus <= 1) && !((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { svar6 = 0; switch (gSaveContext.timer1State) { case 1: @@ -3731,10 +3731,10 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.timer2Value <= 0) { if (!Flags_GetSwitch(play, 0x37) || - ((play->sceneNum != SCENE_GANON_DEMO) && - (play->sceneNum != SCENE_GANON_FINAL) && - (play->sceneNum != SCENE_GANON_SONOGO) && - (play->sceneNum != SCENE_GANONTIKA_SONOGO))) { + ((play->sceneId != SCENE_GANON_DEMO) && + (play->sceneId != SCENE_GANON_FINAL) && + (play->sceneId != SCENE_GANON_SONOGO) && + (play->sceneId != SCENE_GANONTIKA_SONOGO))) { D_8015FFE6 = 40; gSaveContext.timer2State = 5; gSaveContext.cutsceneIndex = 0; @@ -3891,9 +3891,9 @@ void Interface_Update(PlayState* play) { if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { if ((gSaveContext.minigameState == 1) || !IS_CUTSCENE_LAYER || - ((play->sceneNum == SCENE_SPOT20) && (gSaveContext.sceneLayer == 4))) { + ((play->sceneId == SCENE_SPOT20) && (gSaveContext.sceneLayer == 4))) { if ((msgCtx->msgMode == MSGMODE_NONE) || - ((msgCtx->msgMode != MSGMODE_NONE) && (play->sceneNum == SCENE_BOWLING))) { + ((msgCtx->msgMode != MSGMODE_NONE) && (play->sceneId == SCENE_BOWLING))) { if (play->gameOverCtx.state == GAMEOVER_INACTIVE) { func_80083108(play); } @@ -3949,7 +3949,7 @@ void Interface_Update(PlayState* play) { interfaceCtx->magicAlpha = alpha1; } - switch (play->sceneNum) { + switch (play->sceneId) { case SCENE_SPOT00: case SCENE_SPOT01: case SCENE_SPOT02: @@ -4228,7 +4228,7 @@ void Interface_Update(PlayState* play) { play->unk_11DE9 = true; } - if (play->sceneNum == SCENE_SPOT13) { + if (play->sceneId == SCENE_SPOT13) { play->transitionType = TRANS_TYPE_SANDSTORM_PERSIST; gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_PERSIST; } diff --git a/src/code/z_play.c b/src/code/z_play.c index c32ef6b63..b0bce1622 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -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) { diff --git a/src/code/z_room.c b/src/code/z_room.c index c43450f62..3a6b33d4e 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -590,7 +590,7 @@ void func_80097534(PlayState* play, RoomContext* roomCtx) { func_80031B14(play, &play->actorCtx); Actor_SpawnTransitionActors(play, &play->actorCtx); Map_InitRoomData(play, roomCtx->curRoom.num); - if (!((play->sceneNum >= SCENE_SPOT00) && (play->sceneNum <= SCENE_SPOT20))) { + if (!((play->sceneId >= SCENE_SPOT00) && (play->sceneId <= SCENE_SPOT20))) { Map_SavePlayerInitialInfo(play); } Audio_SetEnvReverb(play->roomCtx.curRoom.echo); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 1b360385c..fc2d32295 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -38,19 +38,19 @@ void Object_InitBank(PlayState* play, ObjectContext* objectCtx) { u32 spaceSize; s32 i; - if (play2->sceneNum == SCENE_SPOT00) { + if (play2->sceneId == SCENE_SPOT00) { spaceSize = 1024000; - } else if (play2->sceneNum == SCENE_GANON_DEMO) { + } else if (play2->sceneId == SCENE_GANON_DEMO) { if (gSaveContext.sceneLayer != 4) { spaceSize = 1177600; } else { spaceSize = 1024000; } - } else if (play2->sceneNum == SCENE_JYASINBOSS) { + } else if (play2->sceneId == SCENE_JYASINBOSS) { spaceSize = 1075200; - } else if (play2->sceneNum == SCENE_KENJYANOMA) { + } else if (play2->sceneId == SCENE_KENJYANOMA) { spaceSize = 1075200; - } else if (play2->sceneNum == SCENE_GANON_BOSS) { + } else if (play2->sceneId == SCENE_GANON_BOSS) { spaceSize = 1075200; } else { spaceSize = 1024000; @@ -453,14 +453,14 @@ void Scene_CommandMiscSettings(PlayState* play, SceneCmd* cmd) { R_SCENE_CAM_TYPE = cmd->miscSettings.sceneCamType; gSaveContext.worldMapArea = cmd->miscSettings.area; - if ((play->sceneNum == SCENE_SHOP1) || (play->sceneNum == SCENE_SYATEKIJYOU)) { + if ((play->sceneId == SCENE_SHOP1) || (play->sceneId == SCENE_SYATEKIJYOU)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { gSaveContext.worldMapArea = 1; } } - if (((play->sceneNum >= SCENE_SPOT00) && (play->sceneNum <= SCENE_GANON_TOU)) || - ((play->sceneNum >= SCENE_ENTRA) && (play->sceneNum <= SCENE_SHRINE_R))) { + if (((play->sceneId >= SCENE_SPOT00) && (play->sceneId <= SCENE_GANON_TOU)) || + ((play->sceneId >= SCENE_ENTRA) && (play->sceneId <= SCENE_SHRINE_R))) { if (gSaveContext.cutsceneIndex < 0xFFF0) { gSaveContext.worldMapAreaData |= gBitFlags[gSaveContext.worldMapArea]; osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.worldMapAreaData, diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 3d99aa618..67d071ece 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -24,11 +24,11 @@ #include "overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h" // Entrance Table definition -#define DEFINE_ENTRANCE(_0, scene, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ - { scene, spawn, \ - (((continueBgm) ? ENTRANCE_INFO_CONTINUE_BGM_FLAG : 0) | \ - ((displayTitleCard) ? ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG : 0) | \ - (((endTransType) << ENTRANCE_INFO_END_TRANS_TYPE_SHIFT) & ENTRANCE_INFO_END_TRANS_TYPE_MASK) | \ +#define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ + { sceneId, spawn, \ + (((continueBgm) ? ENTRANCE_INFO_CONTINUE_BGM_FLAG : 0) | \ + ((displayTitleCard) ? ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG : 0) | \ + (((endTransType) << ENTRANCE_INFO_END_TRANS_TYPE_SHIFT) & ENTRANCE_INFO_END_TRANS_TYPE_MASK) | \ (((startTransType) << ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) & ENTRANCE_INFO_START_TRANS_TYPE_MASK)) }, EntranceInfo gEntranceTable[] = { @@ -378,7 +378,7 @@ void Scene_DrawConfigHakadan(PlayState* play) { gameplayFrames = play->gameplayFrames; - if (play->sceneNum == SCENE_HAKADAN_BS) { + if (play->sceneId == SCENE_HAKADAN_BS) { gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (gameplayFrames * 2) % 128, 0, 32, 32, 1, (gameplayFrames * 2) % 128, 0, 32, 32)); @@ -533,7 +533,7 @@ void Scene_DrawConfigHairalNiwa(PlayState* play) { (gameplayFrames * 3) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32)); - if (play->sceneNum == SCENE_HAIRAL_NIWA) { + if (play->sceneId == SCENE_HAIRAL_NIWA) { gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TexScroll(play->state.gfxCtx, 0, (gameplayFrames * 10) % 256, 32, 64)); } @@ -558,7 +558,7 @@ void Scene_DrawConfigGanonCastleExterior(PlayState* play) { gameplayFrames = play->gameplayFrames; - if (play->sceneNum == SCENE_GANON_TOU) { + if (play->sceneId == SCENE_GANON_TOU) { gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TexScroll(play->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 64, 64)); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 255 - (gameplayFrames * 1) % 256, 64, 64, 1, @@ -636,8 +636,8 @@ void Scene_DrawConfigGanonFinal(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6004); if (Flags_GetSwitch(play, 0x37)) { - if ((play->sceneNum == SCENE_GANON_DEMO) || (play->sceneNum == SCENE_GANON_FINAL) || - (play->sceneNum == SCENE_GANON_SONOGO) || (play->sceneNum == SCENE_GANONTIKA_SONOGO)) { + if ((play->sceneId == SCENE_GANON_DEMO) || (play->sceneId == SCENE_GANON_FINAL) || + (play->sceneId == SCENE_GANON_SONOGO) || (play->sceneId == SCENE_GANONTIKA_SONOGO)) { func_8009BEEC(play); } } @@ -1468,7 +1468,7 @@ void Scene_DrawConfigBdan(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7712); gameplayFrames = play->gameplayFrames; - if (play->sceneNum == SCENE_BDAN) { + if (play->sceneId == SCENE_BDAN) { gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32, 1, 127 - gameplayFrames % 128, diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 4afaff306..4aa722e66 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -27,7 +27,7 @@ typedef struct { /* 0x2E */ ItemEquips adultEquips; /* 0x38 */ u32 unk_38; // this may be incorrect, currently used for alignement /* 0x3C */ char unk_3C[0x0E]; - /* 0x4A */ s16 savedSceneNum; + /* 0x4A */ s16 savedSceneId; } SavePlayerData; // size = 0x4C typedef struct { @@ -126,7 +126,7 @@ static SavePlayerData sNewSavePlayerData = { }, // adultEquips 0, // unk_38 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // unk_3C - 0x34, // savedSceneNum + SCENE_LINK_HOME, // savedSceneId }; static ItemEquips sNewSaveEquips = { @@ -171,7 +171,7 @@ void Sram_InitNewSave(void) { gSaveContext.inventory = sNewSaveInventory; temp->checksum = sNewSaveChecksum; - gSaveContext.horseData.scene = SCENE_SPOT00; + gSaveContext.horseData.sceneId = SCENE_SPOT00; gSaveContext.horseData.pos.x = -1840; gSaveContext.horseData.pos.y = 72; gSaveContext.horseData.pos.z = 5497; @@ -211,7 +211,7 @@ static SavePlayerData sDebugSavePlayerData = { }, // adultEquips 0, // unk_38 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // unk_3C - 0x51, // savedSceneNum + SCENE_SPOT00, // savedSceneId }; static ItemEquips sDebugSaveEquips = { @@ -274,7 +274,7 @@ void Sram_InitDebugSave(void) { gSaveContext.inventory = sDebugSaveInventory; temp->checksum = sDebugSaveChecksum; - gSaveContext.horseData.scene = SCENE_SPOT00; + gSaveContext.horseData.sceneId = SCENE_SPOT00; gSaveContext.horseData.pos.x = -1840; gSaveContext.horseData.pos.y = 72; gSaveContext.horseData.pos.z = 5497; @@ -327,10 +327,10 @@ void Sram_OpenSave(SramContext* sramCtx) { MemCpy(&gSaveContext, sramCtx->readBuff + i, sizeof(Save)); osSyncPrintf(VT_FGCOL(YELLOW)); - osSyncPrintf("SCENE_DATA_ID = %d SceneNo = %d\n", gSaveContext.savedSceneNum, + osSyncPrintf("SCENE_DATA_ID = %d SceneNo = %d\n", gSaveContext.savedSceneId, ((void)0, gSaveContext.entranceIndex)); - switch (gSaveContext.savedSceneNum) { + switch (gSaveContext.savedSceneId) { case SCENE_YDAN: case SCENE_DDAN: case SCENE_BDAN: @@ -345,7 +345,7 @@ void Sram_OpenSave(SramContext* sramCtx) { case SCENE_MEN: case SCENE_GERUDOWAY: case SCENE_GANONTIKA: - gSaveContext.entranceIndex = sDungeonEntrances[gSaveContext.savedSceneNum]; + gSaveContext.entranceIndex = sDungeonEntrances[gSaveContext.savedSceneId]; break; case SCENE_YDAN_BOSS: @@ -389,7 +389,7 @@ void Sram_OpenSave(SramContext* sramCtx) { break; default: - if (gSaveContext.savedSceneNum != SCENE_LINK_HOME) { + if (gSaveContext.savedSceneId != SCENE_LINK_HOME) { gSaveContext.entranceIndex = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? ENTR_LINK_HOME_0 : ENTR_TOKINOMA_7; } else { gSaveContext.entranceIndex = ENTR_LINK_HOME_0; |
