From aadb5f9c474e9f5773bb78bcfdd5cbedeed5169c Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 17 May 2022 18:41:50 -0400 Subject: [PATCH] Gameplay_ -> Play_ and this (#1229) --- include/functions.h | 46 +- src/code/graph.c | 2 +- src/code/z_actor.c | 6 +- src/code/z_camera.c | 8 +- src/code/z_demo.c | 54 +- src/code/z_eff_ss_dead.c | 4 +- src/code/z_en_item00.c | 2 +- src/code/z_game_dlftbls.c | 2 +- src/code/z_horse.c | 2 +- src/code/z_kaleido_setup.c | 6 +- src/code/z_lifemeter.c | 2 +- src/code/z_map_exp.c | 6 +- src/code/z_onepointdemo.c | 88 +- src/code/z_parameter.c | 6 +- src/code/z_play.c | 1124 ++++++++--------- src/code/z_player_lib.c | 4 +- src/code/z_sample.c | 2 +- src/code/z_scene.c | 2 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 4 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 2 +- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 3 +- src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 2 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 4 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 2 +- .../z_bg_spot00_hanebasi.c | 2 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 28 +- src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 12 +- src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 12 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 32 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 58 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 12 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 40 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 38 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 40 +- src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 36 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 42 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 2 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 6 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 14 +- .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 14 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 8 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 16 +- .../ovl_En_Diving_Game/z_en_diving_game.c | 18 +- .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 2 +- src/overlays/actors/ovl_En_Eg/z_en_eg.c | 2 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 2 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 12 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 28 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 2 +- src/overlays/actors/ovl_En_In/z_en_in.c | 22 +- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 14 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 4 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 2 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 2 +- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 14 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 2 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 2 +- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 6 +- src/overlays/actors/ovl_En_Zl1/z_en_zl1.c | 24 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 10 +- src/overlays/actors/ovl_En_fHG/z_en_fhg.c | 12 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 34 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 2 +- .../actors/ovl_player_actor/z_player.c | 92 +- .../ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c | 2 +- .../ovl_file_choose/z_file_choose.c | 2 +- .../gamestates/ovl_opening/z_opening.c | 2 +- src/overlays/gamestates/ovl_select/z_select.c | 2 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 8 +- 78 files changed, 1059 insertions(+), 1078 deletions(-) diff --git a/include/functions.h b/include/functions.h index 0c76d5bc40..6801761c81 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1494,34 +1494,32 @@ void KaleidoScopeCall_Draw(GlobalContext* globalCtx); void func_800BC490(GlobalContext* globalCtx, s16 point); s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1); void func_800BC590(GlobalContext* globalCtx); -void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType); -Gfx* Gameplay_SetFog(GlobalContext* globalCtx, Gfx* gfx); -void Gameplay_Destroy(GameState* thisx); -void Gameplay_Init(GameState* thisx); -void Gameplay_Main(GameState* thisx); -s32 Gameplay_InCsMode(GlobalContext* globalCtx); +Gfx* Play_SetFog(GlobalContext* globalCtx, Gfx* gfx); +void Play_Destroy(GameState* thisx); +void Play_Init(GameState* thisx); +void Play_Main(GameState* thisx); +s32 Play_InCsMode(GlobalContext* globalCtx); f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec); -void* Gameplay_LoadFile(GlobalContext* globalCtx, RomFile* file); -void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn); +void* Play_LoadFile(GlobalContext* globalCtx, RomFile* file); void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest); -s16 Gameplay_CreateSubCamera(GlobalContext* globalCtx); -s16 Gameplay_GetActiveCamId(GlobalContext* globalCtx); -s16 Gameplay_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status); -void Gameplay_ClearCamera(GlobalContext* globalCtx, s16 camId); -void Gameplay_ClearAllSubCameras(GlobalContext* globalCtx); -Camera* Gameplay_GetCamera(GlobalContext* globalCtx, s16 camId); -s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye); -s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up); -s32 Gameplay_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov); -s32 Gameplay_SetCameraRoll(GlobalContext* globalCtx, s16 camId, s16 roll); -void Gameplay_CopyCamera(GlobalContext* globalCtx, s16 destCamId, s16 srcCamId); +s16 Play_CreateSubCamera(GlobalContext* globalCtx); +s16 Play_GetActiveCamId(GlobalContext* globalCtx); +s16 Play_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status); +void Play_ClearCamera(GlobalContext* globalCtx, s16 camId); +void Play_ClearAllSubCameras(GlobalContext* globalCtx); +Camera* Play_GetCamera(GlobalContext* globalCtx, s16 camId); +s32 Play_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye); +s32 Play_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up); +s32 Play_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov); +s32 Play_SetCameraRoll(GlobalContext* globalCtx, s16 camId, s16 roll); +void Play_CopyCamera(GlobalContext* globalCtx, s16 destCamId, s16 srcCamId); s32 func_800C0808(GlobalContext* globalCtx, s16 camId, Player* player, s16 setting); -s32 Gameplay_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting); +s32 Play_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting); void func_800C08AC(GlobalContext* globalCtx, s16 camId, s16 arg2); -void Gameplay_SaveSceneFlags(GlobalContext* globalCtx); -void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 playerParams); -void Gameplay_TriggerVoidOut(GlobalContext* globalCtx); -void Gameplay_TriggerRespawn(GlobalContext* globalCtx); +void Play_SaveSceneFlags(GlobalContext* globalCtx); +void Play_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 playerParams); +void Play_TriggerVoidOut(GlobalContext* globalCtx); +void Play_TriggerRespawn(GlobalContext* globalCtx); s32 func_800C0CB8(GlobalContext* globalCtx); s32 FrameAdvance_IsEnabled(GlobalContext* globalCtx); s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw); diff --git a/src/code/graph.c b/src/code/graph.c index 6bf87ae904..868506c7d2 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -108,7 +108,7 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) { if (gameStateInitFunc == Title_Init) { return &gGameStateOverlayTable[2]; } - if (gameStateInitFunc == Gameplay_Init) { + if (gameStateInitFunc == Play_Init) { return &gGameStateOverlayTable[3]; } if (gameStateInitFunc == Opening_Init) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index b0b5aba840..ac9e8a38d0 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1010,7 +1010,7 @@ void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { void func_8002DE74(GlobalContext* globalCtx, Player* player) { if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) { - Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_HORSE); + Camera_ChangeSetting(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_HORSE); } } @@ -2564,7 +2564,7 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { actorCtx->absoluteSpace = NULL; } - Gameplay_SaveSceneFlags(globalCtx); + Play_SaveSceneFlags(globalCtx); func_80030488(globalCtx); ActorOverlayTable_Cleanup(); } @@ -2874,7 +2874,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC if ((player != NULL) && (actor == player->unk_664)) { func_8008EDF0(player); - Camera_ChangeMode(Gameplay_GetCamera(globalCtx, Gameplay_GetActiveCamId(globalCtx)), 0); + Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCamId(globalCtx)), 0); } if (actor == actorCtx->targetCtx.arrowPointedActor) { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index a00611af3d..81e6a1c653 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -6111,7 +6111,7 @@ s32 Camera_Demo6(Camera* camera) { s16 stateTimers[4]; Demo6ReadWriteData* rwData = &camera->paramData.demo6.rwData; - mainCam = Gameplay_GetCamera(camera->globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(camera->globalCtx, CAM_ID_MAIN); camFocus = camera->target; stateTimers[1] = 0x37; stateTimers[2] = 0x46; @@ -6216,7 +6216,7 @@ s32 Camera_Demo9(Camera* camera) { f32* camFOV = &camera->fov; Demo9ReadWriteData* rwData = &camera->paramData.demo9.rwData; - mainCam = Gameplay_GetCamera(camera->globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(camera->globalCtx, CAM_ID_MAIN); mainCamPlayerPosRot = &mainCam->playerPosRot; if (RELOAD_PARAMS(camera) || R_RELOAD_CAM_PARAMS) { values = sCameraSettings[camera->setting].cameraModes[camera->mode].values; @@ -7630,7 +7630,7 @@ void Camera_Finish(Camera* camera) { Player* player = GET_PLAYER(camera->globalCtx); if (camera->timer == 0) { - Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(camera->globalCtx, camera->parentCamId, CAM_STAT_ACTIVE); if ((camera->parentCamId == CAM_ID_MAIN) && (camera->csId != 0)) { player->actor.freezeTimer = 0; @@ -7660,7 +7660,7 @@ void Camera_Finish(Camera* camera) { camera->timer = -1; camera->globalCtx->envCtx.fillScreen = false; - Gameplay_ClearCamera(camera->globalCtx, camera->camId); + Play_ClearCamera(camera->globalCtx, camera->camId); } } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index c2c6e9d06d..0340327673 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1217,7 +1217,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt break; case 118: gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = ENTR_GANON_DEMO_0; - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); gSaveContext.respawnFlag = -2; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; break; @@ -1346,11 +1346,11 @@ s32 Cutscene_Command_CameraEyePoints(GlobalContext* globalCtx, CutsceneContext* if (csCtx->unk_1A != 0) { csCtx->unk_18 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - Gameplay_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_CS_0); - Gameplay_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); - Camera_ResetAnim(Gameplay_GetCamera(globalCtx, csCtx->subCamId)); - Camera_SetCSParams(Gameplay_GetCamera(globalCtx, csCtx->subCamId), csCtx->subCamLookAtPoints, + Play_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_CS_0); + Play_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); + Camera_ResetAnim(Play_GetCamera(globalCtx, csCtx->subCamId)); + Camera_SetCSParams(Play_GetCamera(globalCtx, csCtx->subCamId), csCtx->subCamLookAtPoints, csCtx->subCamEyePoints, GET_PLAYER(globalCtx), relativeToLink); } } @@ -1383,11 +1383,11 @@ s32 Cutscene_Command_CameraLookAtPoints(GlobalContext* globalCtx, CutsceneContex if (csCtx->unk_1B != 0) { D_8015FCC0 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - Gameplay_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_CS_0); - Gameplay_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); - Camera_ResetAnim(Gameplay_GetCamera(globalCtx, csCtx->subCamId)); - Camera_SetCSParams(Gameplay_GetCamera(globalCtx, csCtx->subCamId), csCtx->subCamLookAtPoints, + Play_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_CS_0); + Play_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); + Camera_ResetAnim(Play_GetCamera(globalCtx, csCtx->subCamId)); + Camera_SetCSParams(Play_GetCamera(globalCtx, csCtx->subCamId), csCtx->subCamLookAtPoints, csCtx->subCamEyePoints, GET_PLAYER(globalCtx), relativeToLink); } } @@ -1423,11 +1423,11 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm if (csCtx->unk_1A != 0) { D_8015FCC2 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - subCam = Gameplay_GetCamera(globalCtx, csCtx->subCamId); + subCam = Play_GetCamera(globalCtx, csCtx->subCamId); subCam->player = NULL; - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); - Gameplay_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_FREE0); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); + Play_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_FREE0); sp28 = csCtx->subCamLookAtPoints->cameraRoll * 1.40625f; Camera_SetParam(subCam, 64, &sp28); sp3C.x = csCtx->subCamLookAtPoints->pos.x; @@ -1436,8 +1436,8 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm sp30.x = csCtx->subCamEyePoints->pos.x; sp30.y = csCtx->subCamEyePoints->pos.y; sp30.z = csCtx->subCamEyePoints->pos.z; - Gameplay_CameraSetAtEye(globalCtx, csCtx->subCamId, &sp3C, &sp30); - Gameplay_CameraSetFov(globalCtx, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle); + Play_CameraSetAtEye(globalCtx, csCtx->subCamId, &sp3C, &sp30); + Play_CameraSetFov(globalCtx, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle); } } } @@ -1466,19 +1466,19 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm if (csCtx->unk_1B != 0) { D_8015FCC4 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - subCam = Gameplay_GetCamera(globalCtx, csCtx->subCamId); + subCam = Play_GetCamera(globalCtx, csCtx->subCamId); subCam->player = NULL; - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); - Gameplay_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_FREE0); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, csCtx->subCamId, CAM_STAT_ACTIVE); + Play_CameraChangeSetting(globalCtx, csCtx->subCamId, CAM_SET_FREE0); sp3C.x = csCtx->subCamLookAtPoints->pos.x; sp3C.y = csCtx->subCamLookAtPoints->pos.y; sp3C.z = csCtx->subCamLookAtPoints->pos.z; sp30.x = csCtx->subCamEyePoints->pos.x; sp30.y = csCtx->subCamEyePoints->pos.y; sp30.z = csCtx->subCamEyePoints->pos.z; - Gameplay_CameraSetAtEye(globalCtx, csCtx->subCamId, &sp3C, &sp30); - Gameplay_CameraSetFov(globalCtx, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle); + Play_CameraSetAtEye(globalCtx, csCtx->subCamId, &sp3C, &sp30); + Play_CameraSetFov(globalCtx, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle); } } } @@ -1967,11 +1967,11 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) { case 0x028E: case 0x0292: case 0x0476: - Gameplay_CopyCamera(globalCtx, sReturnToCamId, csCtx->subCamId); + Play_CopyCamera(globalCtx, sReturnToCamId, csCtx->subCamId); } - Gameplay_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, csCtx->subCamId); + Play_ChangeCameraStatus(globalCtx, sReturnToCamId, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, csCtx->subCamId); func_8005B1A4(globalCtx->cameraPtrs[sReturnToCamId]); } @@ -2014,7 +2014,7 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) { sReturnToCamId = globalCtx->activeCamId; if (D_8015FCC8 != 0) { - csCtx->subCamId = Gameplay_CreateSubCamera(globalCtx); + csCtx->subCamId = Play_CreateSubCamera(globalCtx); } if (gSaveContext.cutsceneTrigger == 0) { diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index b3978547be..af2c6ee737 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -56,7 +56,7 @@ void func_80026608(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 159); gDPPipeSync(POLY_OPA_DISP++); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 164); } @@ -115,7 +115,7 @@ void func_80026A6C(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 217); gDPPipeSync(POLY_XLU_DISP++); - POLY_XLU_DISP = Gameplay_SetFog(globalCtx, POLY_XLU_DISP); + POLY_XLU_DISP = Play_SetFog(globalCtx, POLY_XLU_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 222); } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index d9964a3ca3..196a1c8eb4 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -847,7 +847,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); if (this->actor.params == ITEM00_BOMBS_SPECIAL) { texIndex = 1; diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c index a8cc077339..6f66976193 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -12,7 +12,7 @@ GameStateOverlay gGameStateOverlayTable[] = { GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)), GAMESTATE_OVERLAY(select, Select_Init, Select_Destroy, sizeof(SelectContext)), GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)), - GAMESTATE_OVERLAY_INTERNAL(Gameplay_Init, Gameplay_Destroy, sizeof(GlobalContext)), + GAMESTATE_OVERLAY_INTERNAL(Play_Init, Play_Destroy, sizeof(GlobalContext)), GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)), GAMESTATE_OVERLAY(file_choose, FileChoose_Init, FileChoose_Destroy, sizeof(FileChooseContext)), }; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 8a3deac6e3..d194448120 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -223,7 +223,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { sp54.y = player->actor.world.pos.y + 100.0f; sp54.z = player->actor.world.pos.z; - Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamId, &player->actor.world.pos, &sp54); + Play_CameraSetAtEye(globalCtx, globalCtx->activeCamId, &player->actor.world.pos, &sp54); } else { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 3a6713f9cb..cb05b520e7 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -14,9 +14,9 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) { if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE && globalCtx->transitionTrigger == TRANS_TRIGGER_OFF && globalCtx->transitionMode == TRANS_MODE_OFF && - gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && - !Gameplay_InCsMode(globalCtx) && globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && - gSaveContext.unk_13F0 != 9 && (globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) { + gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(globalCtx) && + globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 && + (globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 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_lifemeter.c b/src/code/z_lifemeter.c index 977a3c62de..df2d552a99 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -507,7 +507,7 @@ void Health_UpdateBeatingHeart(GlobalContext* globalCtx) { interfaceCtx->beatingHeartOscillator = 0; interfaceCtx->beatingHeartOscillatorDirection = 0; if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) && - (globalCtx->pauseCtx.debugState == 0) && Health_IsCritical() && !Gameplay_InCsMode(globalCtx)) { + (globalCtx->pauseCtx.debugState == 0) && Health_IsCritical() && !Play_InCsMode(globalCtx)) { func_80078884(NA_SE_SY_HITPOINT_ALARM); } } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 92ef5681a1..1e0e818e2e 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -406,8 +406,8 @@ void Minimap_Draw(GlobalContext* globalCtx) { } } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { - osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx)); + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Play_InCsMode(globalCtx)) { + osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(globalCtx)); // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, @@ -493,7 +493,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Play_InCsMode(globalCtx)) { // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index a4d6edeb13..0eb0b946c6 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -119,7 +119,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A break; case 5010: func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_ATTENTION); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &mainCam->at, &mainCam->eye); + Play_CameraSetAtEye(globalCtx, subCamId, &mainCam->at, &mainCam->eye); subCam->roll = 0; break; case 9500: @@ -255,7 +255,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A csInfo->keyFrames = D_801211D4; csInfo->keyFrameCnt = 2; } - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_C); } break; case 2290: { @@ -298,8 +298,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.pitch = 0x3E8; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); func_8002DF54(globalCtx, NULL, 8); subCam->roll = 0; subCam->fov = 50.0f; @@ -322,19 +322,19 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_C); break; case 1010: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &childCam->at, &childCam->eye); - Gameplay_CameraSetFov(globalCtx, subCamId, childCam->fov); - Gameplay_SetCameraRoll(globalCtx, subCamId, childCam->roll); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &childCam->at, &childCam->eye); + Play_CameraSetFov(globalCtx, subCamId, childCam->fov); + Play_SetCameraRoll(globalCtx, subCamId, childCam->roll); break; case 9601: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); - Gameplay_CameraChangeSetting(globalCtx, CAM_ID_MAIN, mainCam->prevSetting); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); + Play_CameraChangeSetting(globalCtx, CAM_ID_MAIN, mainCam->prevSetting); OnePointCutscene_SetCsCamPoints(subCam, D_80120430 | 0x1000, D_8012042C, D_80120308, D_80120398); break; case 9602: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); - Gameplay_CameraChangeSetting(globalCtx, CAM_ID_MAIN, mainCam->prevSetting); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); + Play_CameraChangeSetting(globalCtx, CAM_ID_MAIN, mainCam->prevSetting); OnePointCutscene_SetCsCamPoints(subCam, D_80120430 | 0x1000, D_8012042C, D_80120308, D_80120434); break; case 4175: @@ -350,8 +350,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spB4.x = -1979.0f; spB4.y = 703.0f; spB4.z = -269.0f; - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 6; subCam->fov = 75.0f; func_8002DF54(globalCtx, NULL, 8); @@ -422,7 +422,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A Actor_GetFocus(&spA0, actor); spC0 = spA0.pos; func_800C0808(globalCtx, subCamId, player, CAM_SET_PIVOT_VERTICAL); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 70.0f; func_8002DF54(globalCtx, NULL, 8); @@ -448,7 +448,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_C); break; case 3050: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); func_8002DF54(globalCtx, &player->actor, 5); OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); func_80078884(NA_SE_SY_CORRECT_CHIME); @@ -506,8 +506,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spB4.x = 1729.0f; spB4.y = 995.0f; spB4.z = -1405.0f; - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0x50; subCam->fov = 55.0f; func_8002DF38(globalCtx, &player->actor, 8); @@ -521,9 +521,9 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A Actor_GetWorld(&spA0, &player->actor); spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); - Gameplay_CopyCamera(globalCtx, CAM_ID_MAIN, subCamId); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CopyCamera(globalCtx, CAM_ID_MAIN, subCamId); subCam->roll = -1; subCam->fov = 55.0f; func_8002DF38(globalCtx, actor, 1); @@ -535,8 +535,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.yaw = spA0.rot.y; spD0.r = 150.0f; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 55.0f; func_8002DF38(globalCtx, &player->actor, 8); @@ -549,14 +549,14 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.yaw = spA0.rot.y; spD0.pitch = -0xAF0; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 60.0f; func_8002DF38(globalCtx, actor, 1); break; case 3190: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FOREST_DEFEAT_POE); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FOREST_DEFEAT_POE); Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); func_8002DF38(globalCtx, actor, 0xC); break; @@ -567,8 +567,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spB4.x = 80.0f; spB4.y = 445.0f; spB4.z = -1425.0f; - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0x1E; subCam->fov = 75.0f; func_8002DF38(globalCtx, &player->actor, 8); @@ -581,7 +581,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.pitch = 0x5DC; spD0.r = 120.0f; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &spC0, &spB4); + Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &spC0, &spB4); i = Quake_Add(subCam, 3); Quake_SetSpeed(i, 22000); @@ -596,8 +596,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.yaw = spA0.rot.y + 0x7FFF; spD0.r = 300.0f; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 45.0f; func_8002DF38(globalCtx, &player->actor, 8); @@ -612,7 +612,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A spD0.r = 400.0f; OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); spB4.y = spA0.pos.y + 60.0f; - Gameplay_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); + Play_CameraSetAtEye(globalCtx, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 75.0f; player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = spD0.yaw + 0x7FFF; @@ -628,7 +628,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_C); break; case 6001: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); func_8002DF54(globalCtx, NULL, 8); Actor_GetWorld(&spA0, actor); if (spA0.pos.z > -750.0f) { @@ -643,7 +643,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A Quake_SetCountdown(i, D_801208E4 - 10); break; case 3400: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_CS_3); func_8002DF38(globalCtx, &player->actor, 8); OnePointCutscene_SetCsCamPoints(subCam, D_8012069C | 0x2000, D_80120698, D_801204D4, D_801205B4); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos); @@ -664,9 +664,9 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A func_800C0808(globalCtx, subCamId, player, CAM_SET_CS_C); break; case 3310: - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FIRE_STAIRCASE); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FIRE_STAIRCASE); func_8002DF54(globalCtx, NULL, 8); - Gameplay_CopyCamera(globalCtx, subCamId, CAM_ID_MAIN); + Play_CopyCamera(globalCtx, subCamId, CAM_ID_MAIN); i = Quake_Add(subCam, 1); Quake_SetSpeed(i, 32000); @@ -958,8 +958,8 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 subCamId, s16 csId, A func_800C0808(globalCtx, subCamId, player, CAM_SET_TURN_AROUND); subCam->data2 = 0xC; } else { - Gameplay_CopyCamera(globalCtx, subCamId, CAM_ID_MAIN); - Gameplay_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); + Play_CopyCamera(globalCtx, subCamId, CAM_ID_MAIN); + Play_CameraChangeSetting(globalCtx, subCamId, CAM_SET_FREE2); } break; case 9908: @@ -1132,7 +1132,7 @@ s32 OnePointCutscene_RemoveCamera(GlobalContext* globalCtx, s16 subCamId) { subCam->parentCamId = CAM_ID_MAIN; subCam->childCamId = subCam->parentCamId; subCam->timer = -1; - Gameplay_ClearCamera(subCam->globalCtx, subCam->camId); + Play_ClearCamera(subCam->globalCtx, subCam->camId); return nextCamId; } @@ -1155,7 +1155,7 @@ s16 OnePointCutscene_Init(GlobalContext* globalCtx, s16 csId, s16 timer, Actor* if (parentCamId == CAM_ID_NONE) { parentCamId = globalCtx->activeCamId; } - subCamId = Gameplay_CreateSubCamera(globalCtx); + subCamId = Play_CreateSubCamera(globalCtx); if (subCamId == CAM_ID_NONE) { osSyncPrintf(VT_COL(RED, WHITE) "onepoint demo: error: too many cameras ... give up! type=%d\n" VT_RST, csId); return CAM_ID_NONE; @@ -1185,12 +1185,12 @@ s16 OnePointCutscene_Init(GlobalContext* globalCtx, s16 csId, s16 timer, Actor* subCam->csId = csId; if (parentCamId == CAM_ID_MAIN) { - Gameplay_ChangeCameraStatus(globalCtx, parentCamId, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, parentCamId, CAM_STAT_UNK3); } else { - Gameplay_ChangeCameraStatus(globalCtx, parentCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, parentCamId, CAM_STAT_WAIT); } OnePointCutscene_SetInfo(globalCtx, subCamId, csId, actor, timer); - Gameplay_ChangeCameraStatus(globalCtx, subCamId, vSubCamStatus); + Play_ChangeCameraStatus(globalCtx, subCamId, vSubCamStatus); // Removes all lower priority cutscenes in front of this cutscene from the queue. vCurCamId = subCamId; @@ -1205,7 +1205,7 @@ s16 OnePointCutscene_Init(GlobalContext* globalCtx, s16 csId, s16 timer, Actor* vNextCamId, nextCsId, thisCsId); if (globalCtx->cameraPtrs[vNextCamId]->csId != 5010) { if ((vNextCamId = OnePointCutscene_RemoveCamera(globalCtx, vNextCamId)) != CAM_ID_NONE) { - Gameplay_ChangeCameraStatus(globalCtx, vNextCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, vNextCamId, CAM_STAT_ACTIVE); } } else { vCurCamId = vNextCamId; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index e6e448fd00..9b6a48e664 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2485,7 +2485,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (globalCtx->transitionMode == TRANS_MODE_OFF) && - !Gameplay_InCsMode(globalCtx)) { + !Play_InCsMode(globalCtx)) { if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) || ((gSaveContext.equips.buttonItems[1] != ITEM_LENS) && (gSaveContext.equips.buttonItems[2] != ITEM_LENS) && @@ -3430,7 +3430,7 @@ void Interface_Draw(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && - (globalCtx->transitionMode == TRANS_MODE_OFF) && !Gameplay_InCsMode(globalCtx) && + (globalCtx->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) && (globalCtx->shootingGalleryStatus <= 1) && !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { svar6 = 0; @@ -3996,7 +3996,7 @@ void Interface_Update(GlobalContext* globalCtx) { if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (globalCtx->transitionMode == TRANS_MODE_OFF) && - !Gameplay_InCsMode(globalCtx)) {} + !Play_InCsMode(globalCtx)) {} if (gSaveContext.rupeeAccumulator != 0) { if (gSaveContext.rupeeAccumulator > 0) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 7aa115f1fc..b0993bec00 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -13,38 +13,40 @@ FaultClient D_801614B8; s16 sTransitionFillTimer; u64 D_801614D0[0xA00]; -void func_800BC450(GlobalContext* globalCtx) { - Camera_ChangeDataIdx(GET_ACTIVE_CAM(globalCtx), globalCtx->unk_1242B - 1); +void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn); + +void func_800BC450(GlobalContext* this) { + Camera_ChangeDataIdx(GET_ACTIVE_CAM(this), this->unk_1242B - 1); } -void func_800BC490(GlobalContext* globalCtx, s16 point) { +void func_800BC490(GlobalContext* this, s16 point) { ASSERT(point == 1 || point == 2, "point == 1 || point == 2", "../z_play.c", 2160); - globalCtx->unk_1242B = point; + this->unk_1242B = point; if ((YREG(15) != 0x10) && (gSaveContext.cutsceneIndex < 0xFFF0)) { Audio_PlaySoundGeneral((point == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - func_800BC450(globalCtx); + func_800BC450(this); } -s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) { - return (arg1 == globalCtx->unk_1242B); +s32 func_800BC56C(GlobalContext* this, s16 arg1) { + return (arg1 == this->unk_1242B); } // original name: "Game_play_shop_pr_vr_switch_set" -void func_800BC590(GlobalContext* globalCtx) { +void func_800BC590(GlobalContext* this) { osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n"); if (YREG(15) == 0x10) { - globalCtx->unk_1242B = 2; + this->unk_1242B = 2; } } -void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { - TransitionContext* transitionCtx = &globalCtx->transitionCtx; +void Play_SetupTransition(GlobalContext* this, s32 transitionType) { + TransitionContext* transitionCtx = &this->transitionCtx; bzero(transitionCtx, sizeof(TransitionContext)); @@ -111,27 +113,27 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { case TRANS_TYPE_FILL_WHITE2: case TRANS_TYPE_FILL_WHITE: - globalCtx->transitionMode = TRANS_MODE_FILL_WHITE_INIT; + this->transitionMode = TRANS_MODE_FILL_WHITE_INIT; break; case TRANS_TYPE_INSTANT: - globalCtx->transitionMode = TRANS_MODE_INSTANT; + this->transitionMode = TRANS_MODE_INSTANT; break; case TRANS_TYPE_FILL_BROWN: - globalCtx->transitionMode = TRANS_MODE_FILL_BROWN_INIT; + this->transitionMode = TRANS_MODE_FILL_BROWN_INIT; break; case TRANS_TYPE_SANDSTORM_PERSIST: - globalCtx->transitionMode = TRANS_MODE_SANDSTORM_INIT; + this->transitionMode = TRANS_MODE_SANDSTORM_INIT; break; case TRANS_TYPE_SANDSTORM_END: - globalCtx->transitionMode = TRANS_MODE_SANDSTORM_END_INIT; + this->transitionMode = TRANS_MODE_SANDSTORM_END_INIT; break; case TRANS_TYPE_CS_BLACK_FILL: - globalCtx->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT; + this->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT; break; default: @@ -141,60 +143,60 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { } } -void func_800BC88C(GlobalContext* globalCtx) { - globalCtx->transitionCtx.transitionType = -1; +void func_800BC88C(GlobalContext* this) { + this->transitionCtx.transitionType = -1; } -Gfx* Gameplay_SetFog(GlobalContext* globalCtx, Gfx* gfx) { - return Gfx_SetFog2(gfx, globalCtx->lightCtx.fogColor[0], globalCtx->lightCtx.fogColor[1], - globalCtx->lightCtx.fogColor[2], 0, globalCtx->lightCtx.fogNear, 1000); +Gfx* Play_SetFog(GlobalContext* this, Gfx* gfx) { + return Gfx_SetFog2(gfx, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1], this->lightCtx.fogColor[2], 0, + this->lightCtx.fogNear, 1000); } -void Gameplay_Destroy(GameState* thisx) { - GlobalContext* globalCtx = (GlobalContext*)thisx; - Player* player = GET_PLAYER(globalCtx); +void Play_Destroy(GameState* thisx) { + GlobalContext* this = (GlobalContext*)thisx; + Player* player = GET_PLAYER(this); - globalCtx->state.gfxCtx->callback = NULL; - globalCtx->state.gfxCtx->callbackParam = 0; + this->state.gfxCtx->callback = NULL; + this->state.gfxCtx->callbackParam = 0; SREG(91) = 0; R_PAUSE_MENU_MODE = 0; - PreRender_Destroy(&globalCtx->pauseBgPreRender); - Effect_DeleteAll(globalCtx); - EffectSs_ClearAll(globalCtx); - CollisionCheck_DestroyContext(globalCtx, &globalCtx->colChkCtx); + PreRender_Destroy(&this->pauseBgPreRender); + Effect_DeleteAll(this); + EffectSs_ClearAll(this); + CollisionCheck_DestroyContext(this, &this->colChkCtx); if (gTrnsnUnkState == 3) { TransitionUnk_Destroy(&sTrnsnUnk); gTrnsnUnkState = 0; } - if (globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); - func_800BC88C(globalCtx); - globalCtx->transitionMode = TRANS_MODE_OFF; + if (this->transitionMode == TRANS_MODE_INSTANCE_RUNNING) { + this->transitionCtx.destroy(&this->transitionCtx.instanceData); + func_800BC88C(this); + this->transitionMode = TRANS_MODE_OFF; } ShrinkWindow_Destroy(); - TransitionFade_Destroy(&globalCtx->transitionFade); + TransitionFade_Destroy(&this->transitionFade); VisMono_Destroy(&D_80161498); - if (gSaveContext.linkAge != globalCtx->linkAgeOnLoad) { + if (gSaveContext.linkAge != this->linkAgeOnLoad) { Inventory_SwapAgeEquipment(); - Player_SetEquipmentData(globalCtx, player); + Player_SetEquipmentData(this, player); } - func_80031C3C(&globalCtx->actorCtx, globalCtx); - func_80110990(globalCtx); - KaleidoScopeCall_Destroy(globalCtx); + func_80031C3C(&this->actorCtx, this); + func_80110990(this); + KaleidoScopeCall_Destroy(this); KaleidoManager_Destroy(); ZeldaArena_Cleanup(); Fault_RemoveClient(&D_801614B8); } -void Gameplay_Init(GameState* thisx) { - GlobalContext* globalCtx = (GlobalContext*)thisx; - GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; +void Play_Init(GameState* thisx) { + GlobalContext* this = (GlobalContext*)thisx; + GraphicsContext* gfxCtx = this->state.gfxCtx; u32 zAlloc; u32 zAllocAligned; size_t zAllocSize; @@ -206,44 +208,44 @@ void Gameplay_Init(GameState* thisx) { if (gSaveContext.entranceIndex == ENTR_LOAD_OPENING) { gSaveContext.entranceIndex = 0; - globalCtx->state.running = false; - SET_NEXT_GAMESTATE(&globalCtx->state, Opening_Init, OpeningContext); + this->state.running = false; + SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext); return; } SystemArena_Display(); - GameState_Realloc(&globalCtx->state, 0x1D4790); - KaleidoManager_Init(globalCtx); - View_Init(&globalCtx->view, gfxCtx); + GameState_Realloc(&this->state, 0x1D4790); + KaleidoManager_Init(this); + View_Init(&this->view, gfxCtx); Audio_SetExtraFilter(0); Quake_Init(); - for (i = 0; i < ARRAY_COUNT(globalCtx->cameraPtrs); i++) { - globalCtx->cameraPtrs[i] = NULL; + for (i = 0; i < ARRAY_COUNT(this->cameraPtrs); i++) { + this->cameraPtrs[i] = NULL; } - Camera_Init(&globalCtx->mainCamera, &globalCtx->view, &globalCtx->colCtx, globalCtx); - Camera_ChangeStatus(&globalCtx->mainCamera, CAM_STAT_ACTIVE); + Camera_Init(&this->mainCamera, &this->view, &this->colCtx, this); + Camera_ChangeStatus(&this->mainCamera, CAM_STAT_ACTIVE); for (i = 0; i < 3; i++) { - Camera_Init(&globalCtx->subCameras[i], &globalCtx->view, &globalCtx->colCtx, globalCtx); - Camera_ChangeStatus(&globalCtx->subCameras[i], CAM_STAT_UNK100); + Camera_Init(&this->subCameras[i], &this->view, &this->colCtx, this); + Camera_ChangeStatus(&this->subCameras[i], CAM_STAT_UNK100); } - globalCtx->cameraPtrs[CAM_ID_MAIN] = &globalCtx->mainCamera; - globalCtx->cameraPtrs[CAM_ID_MAIN]->uid = 0; - globalCtx->activeCamId = CAM_ID_MAIN; - func_8005AC48(&globalCtx->mainCamera, 0xFF); - Sram_Init(globalCtx, &globalCtx->sramCtx); - func_80112098(globalCtx); - Message_Init(globalCtx); - GameOver_Init(globalCtx); - SoundSource_InitAll(globalCtx); - Effect_InitContext(globalCtx); - EffectSs_InitInfo(globalCtx, 0x55); - CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); - AnimationContext_Reset(&globalCtx->animationCtx); - func_8006450C(globalCtx, &globalCtx->csCtx); + this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera; + this->cameraPtrs[CAM_ID_MAIN]->uid = 0; + this->activeCamId = CAM_ID_MAIN; + func_8005AC48(&this->mainCamera, 0xFF); + Sram_Init(this, &this->sramCtx); + func_80112098(this); + Message_Init(this); + GameOver_Init(this); + SoundSource_InitAll(this); + Effect_InitContext(this); + EffectSs_InitInfo(this, 0x55); + CollisionCheck_InitContext(this, &this->colChkCtx); + AnimationContext_Reset(&this->animationCtx); + func_8006450C(this, &this->csCtx); if (gSaveContext.nextCutsceneIndex != 0xFFEF) { gSaveContext.cutsceneIndex = gSaveContext.nextCutsceneIndex; @@ -265,11 +267,11 @@ void Gameplay_Init(GameState* thisx) { gSaveContext.nightFlag = 0; } - Cutscene_HandleConditionalTriggers(globalCtx); + Cutscene_HandleConditionalTriggers(this); if (gSaveContext.gameMode != 0 || gSaveContext.cutsceneIndex >= 0xFFF0) { gSaveContext.nayrusLoveTimer = 0; - func_800876C8(globalCtx); + func_800876C8(this); gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4; } else if (!LINK_IS_ADULT && IS_DAY) { gSaveContext.sceneSetupIndex = 0; @@ -295,9 +297,8 @@ void Gameplay_Init(GameState* thisx) { gSaveContext.sceneSetupIndex = GET_EVENTCHKINF(EVENTCHKINF_48) ? 3 : 2; } - Gameplay_SpawnScene( - globalCtx, - gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene, + Play_SpawnScene( + this, gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene, gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].spawn); osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneSetupIndex); @@ -310,18 +311,18 @@ void Gameplay_Init(GameState* thisx) { osSyncPrintf("出戻り?\n"); // "Return?" } - Cutscene_HandleEntranceTriggers(globalCtx); - KaleidoScopeCall_Init(globalCtx); - func_801109B0(globalCtx); + Cutscene_HandleEntranceTriggers(this); + KaleidoScopeCall_Init(this); + func_801109B0(this); if (gSaveContext.nextDayTime != 0xFFFF) { if (gSaveContext.nextDayTime == 0x8001) { gSaveContext.totalDays++; gSaveContext.bgsDayCount++; gSaveContext.dogIsLost = true; - if (Inventory_ReplaceItem(globalCtx, ITEM_WEIRD_EGG, ITEM_CHICKEN) || - Inventory_ReplaceItem(globalCtx, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) { - Message_StartTextbox(globalCtx, 0x3066, NULL); + if (Inventory_ReplaceItem(this, ITEM_WEIRD_EGG, ITEM_CHICKEN) || + Inventory_ReplaceItem(this, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) { + Message_StartTextbox(this, 0x3066, NULL); } gSaveContext.nextDayTime = 0xFFFE; } else { @@ -331,46 +332,46 @@ void Gameplay_Init(GameState* thisx) { SREG(91) = -1; R_PAUSE_MENU_MODE = 0; - PreRender_Init(&globalCtx->pauseBgPreRender); - PreRender_SetValuesSave(&globalCtx->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0); - PreRender_SetValues(&globalCtx->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); + PreRender_Init(&this->pauseBgPreRender); + PreRender_SetValuesSave(&this->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0); + PreRender_SetValues(&this->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); gTrnsnUnkState = 0; - globalCtx->transitionMode = TRANS_MODE_OFF; - FrameAdvance_Init(&globalCtx->frameAdvCtx); + this->transitionMode = TRANS_MODE_OFF; + FrameAdvance_Init(&this->frameAdvCtx); Rand_Seed((u32)osGetTime()); - Matrix_Init(&globalCtx->state); - globalCtx->state.main = Gameplay_Main; - globalCtx->state.destroy = Gameplay_Destroy; - globalCtx->transitionTrigger = TRANS_TRIGGER_END; - globalCtx->unk_11E16 = 0xFF; - globalCtx->unk_11E18 = 0; - globalCtx->unk_11DE9 = false; + Matrix_Init(&this->state); + this->state.main = Play_Main; + this->state.destroy = Play_Destroy; + this->transitionTrigger = TRANS_TRIGGER_END; + this->unk_11E16 = 0xFF; + this->unk_11E18 = 0; + this->unk_11DE9 = false; if (gSaveContext.gameMode != 1) { if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) { // fade in - globalCtx->transitionType = + this->transitionType = (gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; } else { - globalCtx->transitionType = gSaveContext.nextTransitionType; + this->transitionType = gSaveContext.nextTransitionType; gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; } } else { - globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_SLOW; + this->transitionType = TRANS_TYPE_FADE_BLACK_SLOW; } ShrinkWindow_Init(); - TransitionFade_Init(&globalCtx->transitionFade); - TransitionFade_SetType(&globalCtx->transitionFade, 3); - TransitionFade_SetColor(&globalCtx->transitionFade, RGBA8(160, 160, 160, 255)); - TransitionFade_Start(&globalCtx->transitionFade); + TransitionFade_Init(&this->transitionFade); + TransitionFade_SetType(&this->transitionFade, 3); + TransitionFade_SetColor(&this->transitionFade, RGBA8(160, 160, 160, 255)); + TransitionFade_Start(&this->transitionFade); VisMono_Init(&D_80161498); D_801614B0.a = 0; - Flags_UnsetAllEnv(globalCtx); + Flags_UnsetAllEnv(this); - osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&globalCtx->state.tha)); - zAllocSize = THA_GetSize(&globalCtx->state.tha); - zAlloc = GameState_Alloc(&globalCtx->state, zAllocSize, "../z_play.c", 2918); + osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&this->state.tha)); + zAllocSize = THA_GetSize(&this->state.tha); + zAlloc = GameState_Alloc(&this->state, zAllocSize, "../z_play.c", 2918); zAllocAligned = (zAlloc + 8) & ~0xF; ZeldaArena_Init(zAllocAligned, zAllocSize - zAllocAligned + zAlloc); // "Zelda Heap" @@ -378,36 +379,36 @@ void Gameplay_Init(GameState* thisx) { (s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc)); Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); - func_800304DC(globalCtx, &globalCtx->actorCtx, globalCtx->linkActorEntry); + func_800304DC(this, &this->actorCtx, this->linkActorEntry); - while (!func_800973FC(globalCtx, &globalCtx->roomCtx)) { + while (!func_800973FC(this, &this->roomCtx)) { ; // Empty Loop } - player = GET_PLAYER(globalCtx); - Camera_InitPlayerSettings(&globalCtx->mainCamera, player); - Camera_ChangeMode(&globalCtx->mainCamera, CAM_MODE_NORMAL); + player = GET_PLAYER(this); + Camera_InitPlayerSettings(&this->mainCamera, player); + Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL); playerStartCamId = player->actor.params & 0xFF; if (playerStartCamId != 0xFF) { osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartCamId); - Camera_ChangeDataIdx(&globalCtx->mainCamera, playerStartCamId); + Camera_ChangeDataIdx(&this->mainCamera, playerStartCamId); } if (YREG(15) == 32) { - globalCtx->unk_1242B = 2; + this->unk_1242B = 2; } else if (YREG(15) == 16) { - globalCtx->unk_1242B = 1; + this->unk_1242B = 1; } else { - globalCtx->unk_1242B = 0; + this->unk_1242B = 0; } - Interface_SetSceneRestrictions(globalCtx); - Environment_PlaySceneSequence(globalCtx); - gSaveContext.seqId = globalCtx->sequenceCtx.seqId; - gSaveContext.natureAmbienceId = globalCtx->sequenceCtx.natureAmbienceId; - func_8002DF18(globalCtx, GET_PLAYER(globalCtx)); - AnimationContext_Update(globalCtx, &globalCtx->animationCtx); + Interface_SetSceneRestrictions(this); + Environment_PlaySceneSequence(this); + gSaveContext.seqId = this->sequenceCtx.seqId; + gSaveContext.natureAmbienceId = this->sequenceCtx.natureAmbienceId; + func_8002DF18(this, GET_PLAYER(this)); + AnimationContext_Update(this, &this->animationCtx); gSaveContext.respawnFlag = 0; if (dREG(95) != 0) { @@ -417,14 +418,14 @@ void Gameplay_Init(GameState* thisx) { } } -void Gameplay_Update(GlobalContext* globalCtx) { +void Play_Update(GlobalContext* this) { s32 pad1; s32 sp80; Input* input; u32 i; s32 pad2; - input = globalCtx->state.input; + input = this->state.input; if ((SREG(1) < 0) || (DREG(0) != 0)) { SREG(1) = 0; @@ -449,13 +450,13 @@ void Gameplay_Update(GlobalContext* globalCtx) { ActorOverlayTable_LogPrint(); } - gSegments[4] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); - gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); - if (FrameAdvance_Update(&globalCtx->frameAdvCtx, &input[1])) { - if ((globalCtx->transitionMode == TRANS_MODE_OFF) && (globalCtx->transitionTrigger != TRANS_TRIGGER_OFF)) { - globalCtx->transitionMode = TRANS_MODE_SETUP; + if (FrameAdvance_Update(&this->frameAdvCtx, &input[1])) { + if ((this->transitionMode == TRANS_MODE_OFF) && (this->transitionTrigger != TRANS_TRIGGER_OFF)) { + this->transitionMode = TRANS_MODE_SETUP; } if (gTrnsnUnkState != 0) { @@ -476,10 +477,10 @@ void Gameplay_Update(GlobalContext* globalCtx) { } } - if (globalCtx->transitionMode) { - switch (globalCtx->transitionMode) { + if (this->transitionMode) { + switch (this->transitionMode) { case TRANS_MODE_SETUP: - if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { + if (this->transitionTrigger != TRANS_TRIGGER_END) { s16 sceneSetupIndex = 0; Interface_ChangeAlpha(1); @@ -489,11 +490,10 @@ void Gameplay_Update(GlobalContext* globalCtx) { } // fade out bgm if "continue bgm" flag is not set - if (!(gEntranceTable[globalCtx->nextEntranceIndex + sceneSetupIndex].field & 0x8000)) { + if (!(gEntranceTable[this->nextEntranceIndex + sceneSetupIndex].field & 0x8000)) { // "Sound initalized. 111" osSyncPrintf("\n\n\nサウンドイニシャル来ました。111"); - if ((globalCtx->transitionType < TRANS_TYPE_MAX) && - !Environment_IsForcedSequenceDisabled()) { + if ((this->transitionType < TRANS_TYPE_MAX) && !Environment_IsForcedSequenceDisabled()) { // "Sound initalized. 222" osSyncPrintf("\n\n\nサウンドイニシャル来ました。222"); func_800F6964(0x14); @@ -504,29 +504,29 @@ void Gameplay_Update(GlobalContext* globalCtx) { } if (!R_TRANS_DBG_ENABLED) { - Gameplay_SetupTransition(globalCtx, globalCtx->transitionType); + Play_SetupTransition(this, this->transitionType); } else { - Gameplay_SetupTransition(globalCtx, R_TRANS_DBG_TYPE); + Play_SetupTransition(this, R_TRANS_DBG_TYPE); } - if (globalCtx->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) { + if (this->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) { // non-instance modes break out of this switch break; } // fallthrough case TRANS_MODE_INSTANCE_INIT: - globalCtx->transitionCtx.init(&globalCtx->transitionCtx.instanceData); + this->transitionCtx.init(&this->transitionCtx.instanceData); // circle types - if ((globalCtx->transitionCtx.transitionType >> 5) == 1) { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, - globalCtx->transitionCtx.transitionType | TC_SET_PARAMS); + if ((this->transitionCtx.transitionType >> 5) == 1) { + this->transitionCtx.setType(&this->transitionCtx.instanceData, + this->transitionCtx.transitionType | TC_SET_PARAMS); } gSaveContext.transWipeSpeed = 14; - if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) { + if ((this->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) || + (this->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) { //! @bug TRANS_TYPE_FILL_WHITE2 will never reach this code. //! It is a non-instance type transition which doesn't run this case. gSaveContext.transWipeSpeed = 28; @@ -534,92 +534,88 @@ void Gameplay_Update(GlobalContext* globalCtx) { gSaveContext.transFadeDuration = 60; - if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) { + if ((this->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) { gSaveContext.transFadeDuration = 20; - } else if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_SLOW) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW)) { + } else if ((this->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_SLOW) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW)) { gSaveContext.transFadeDuration = 150; - } else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT) { + } else if (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT) { gSaveContext.transFadeDuration = 2; } - if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) || - (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, - RGBA8(160, 160, 160, 255)); - if (globalCtx->transitionCtx.setUnkColor != NULL) { - globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, - RGBA8(160, 160, 160, 255)); + if ((this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) || + (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) { + this->transitionCtx.setColor(&this->transitionCtx.instanceData, RGBA8(160, 160, 160, 255)); + if (this->transitionCtx.setUnkColor != NULL) { + this->transitionCtx.setUnkColor(&this->transitionCtx.instanceData, + RGBA8(160, 160, 160, 255)); } - } else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, - RGBA8(140, 140, 100, 255)); + } else if (this->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) { + this->transitionCtx.setColor(&this->transitionCtx.instanceData, RGBA8(140, 140, 100, 255)); - if (globalCtx->transitionCtx.setUnkColor != NULL) { - globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, - RGBA8(140, 140, 100, 255)); + if (this->transitionCtx.setUnkColor != NULL) { + this->transitionCtx.setUnkColor(&this->transitionCtx.instanceData, + RGBA8(140, 140, 100, 255)); } - } else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, - RGBA8(70, 100, 110, 255)); + } else if (this->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) { + this->transitionCtx.setColor(&this->transitionCtx.instanceData, RGBA8(70, 100, 110, 255)); - if (globalCtx->transitionCtx.setUnkColor != NULL) { - globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, - RGBA8(70, 100, 110, 255)); + if (this->transitionCtx.setUnkColor != NULL) { + this->transitionCtx.setUnkColor(&this->transitionCtx.instanceData, + RGBA8(70, 100, 110, 255)); } } else { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, RGBA8(0, 0, 0, 0)); + this->transitionCtx.setColor(&this->transitionCtx.instanceData, RGBA8(0, 0, 0, 0)); - if (globalCtx->transitionCtx.setUnkColor != NULL) { - globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, - RGBA8(0, 0, 0, 0)); + if (this->transitionCtx.setUnkColor != NULL) { + this->transitionCtx.setUnkColor(&this->transitionCtx.instanceData, RGBA8(0, 0, 0, 0)); } } - if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 1); + if (this->transitionTrigger == TRANS_TRIGGER_END) { + this->transitionCtx.setType(&this->transitionCtx.instanceData, 1); } else { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 2); + this->transitionCtx.setType(&this->transitionCtx.instanceData, 2); } - globalCtx->transitionCtx.start(&globalCtx->transitionCtx.instanceData); + this->transitionCtx.start(&this->transitionCtx.instanceData); - if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) { - globalCtx->transitionMode = TRANS_MODE_INSTANCE_WAIT; + if (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) { + this->transitionMode = TRANS_MODE_INSTANCE_WAIT; } else { - globalCtx->transitionMode = TRANS_MODE_INSTANCE_RUNNING; + this->transitionMode = TRANS_MODE_INSTANCE_RUNNING; } break; case TRANS_MODE_INSTANCE_RUNNING: - if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx.instanceData)) { - if (globalCtx->transitionCtx.transitionType >= TRANS_TYPE_MAX) { - if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); - func_800BC88C(globalCtx); - globalCtx->transitionMode = TRANS_MODE_OFF; + if (this->transitionCtx.isDone(&this->transitionCtx.instanceData)) { + if (this->transitionCtx.transitionType >= TRANS_TYPE_MAX) { + if (this->transitionTrigger == TRANS_TRIGGER_END) { + this->transitionCtx.destroy(&this->transitionCtx.instanceData); + func_800BC88C(this); + this->transitionMode = TRANS_MODE_OFF; } - } else if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { - globalCtx->state.running = false; + } else if (this->transitionTrigger != TRANS_TRIGGER_END) { + this->state.running = false; if (gSaveContext.gameMode != 2) { - SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); - gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); + gSaveContext.entranceIndex = this->nextEntranceIndex; if (gSaveContext.minigameState == 1) { gSaveContext.minigameState = 3; } } else { - SET_NEXT_GAMESTATE(&globalCtx->state, FileChoose_Init, FileChooseContext); + SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext); } } else { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); - func_800BC88C(globalCtx); - globalCtx->transitionMode = TRANS_MODE_OFF; + this->transitionCtx.destroy(&this->transitionCtx.instanceData); + func_800BC88C(this); + this->transitionMode = TRANS_MODE_OFF; if (gTrnsnUnkState == 3) { TransitionUnk_Destroy(&sTrnsnUnk); @@ -628,54 +624,54 @@ void Gameplay_Update(GlobalContext* globalCtx) { } } - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionTrigger = TRANS_TRIGGER_OFF; } else { - globalCtx->transitionCtx.update(&globalCtx->transitionCtx.instanceData, R_UPDATE_RATE); + this->transitionCtx.update(&this->transitionCtx.instanceData, R_UPDATE_RATE); } break; } // update non-instance transitions - switch (globalCtx->transitionMode) { + switch (this->transitionMode) { case TRANS_MODE_FILL_WHITE_INIT: sTransitionFillTimer = 0; - globalCtx->envCtx.fillScreen = true; - globalCtx->envCtx.screenFillColor[0] = 160; - globalCtx->envCtx.screenFillColor[1] = 160; - globalCtx->envCtx.screenFillColor[2] = 160; + this->envCtx.fillScreen = true; + this->envCtx.screenFillColor[0] = 160; + this->envCtx.screenFillColor[1] = 160; + this->envCtx.screenFillColor[2] = 160; - if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { - globalCtx->envCtx.screenFillColor[3] = 0; - globalCtx->transitionMode = TRANS_MODE_FILL_IN; + if (this->transitionTrigger != TRANS_TRIGGER_END) { + this->envCtx.screenFillColor[3] = 0; + this->transitionMode = TRANS_MODE_FILL_IN; } else { - globalCtx->envCtx.screenFillColor[3] = 255; - globalCtx->transitionMode = TRANS_MODE_FILL_OUT; + this->envCtx.screenFillColor[3] = 255; + this->transitionMode = TRANS_MODE_FILL_OUT; } break; case TRANS_MODE_FILL_IN: - globalCtx->envCtx.screenFillColor[3] = (sTransitionFillTimer / 20.0f) * 255.0f; + this->envCtx.screenFillColor[3] = (sTransitionFillTimer / 20.0f) * 255.0f; if (sTransitionFillTimer >= 20) { - globalCtx->state.running = false; - SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); - gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + this->state.running = false; + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); + gSaveContext.entranceIndex = this->nextEntranceIndex; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } else { sTransitionFillTimer++; } break; case TRANS_MODE_FILL_OUT: - globalCtx->envCtx.screenFillColor[3] = (1 - sTransitionFillTimer / 20.0f) * 255.0f; + this->envCtx.screenFillColor[3] = (1 - sTransitionFillTimer / 20.0f) * 255.0f; if (sTransitionFillTimer >= 20) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; - globalCtx->envCtx.fillScreen = false; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; + this->envCtx.fillScreen = false; } else { sTransitionFillTimer++; } @@ -683,51 +679,51 @@ void Gameplay_Update(GlobalContext* globalCtx) { case TRANS_MODE_FILL_BROWN_INIT: sTransitionFillTimer = 0; - globalCtx->envCtx.fillScreen = true; - globalCtx->envCtx.screenFillColor[0] = 170; - globalCtx->envCtx.screenFillColor[1] = 160; - globalCtx->envCtx.screenFillColor[2] = 150; + this->envCtx.fillScreen = true; + this->envCtx.screenFillColor[0] = 170; + this->envCtx.screenFillColor[1] = 160; + this->envCtx.screenFillColor[2] = 150; - if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { - globalCtx->envCtx.screenFillColor[3] = 0; - globalCtx->transitionMode = TRANS_MODE_FILL_IN; + if (this->transitionTrigger != TRANS_TRIGGER_END) { + this->envCtx.screenFillColor[3] = 0; + this->transitionMode = TRANS_MODE_FILL_IN; } else { - globalCtx->envCtx.screenFillColor[3] = 255; - globalCtx->transitionMode = TRANS_MODE_FILL_OUT; + this->envCtx.screenFillColor[3] = 255; + this->transitionMode = TRANS_MODE_FILL_OUT; } break; case TRANS_MODE_INSTANT: - if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { - globalCtx->state.running = false; - SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); - gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + if (this->transitionTrigger != TRANS_TRIGGER_END) { + this->state.running = false; + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); + gSaveContext.entranceIndex = this->nextEntranceIndex; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } else { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } break; case TRANS_MODE_INSTANCE_WAIT: if (gSaveContext.cutsceneTransitionControl != 0) { - globalCtx->transitionMode = TRANS_MODE_INSTANCE_RUNNING; + this->transitionMode = TRANS_MODE_INSTANCE_RUNNING; } break; case TRANS_MODE_SANDSTORM_INIT: - if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) { + if (this->transitionTrigger != TRANS_TRIGGER_END) { // trigger in, leaving area - globalCtx->envCtx.sandstormState = SANDSTORM_FILL; - globalCtx->transitionMode = TRANS_MODE_SANDSTORM; + this->envCtx.sandstormState = SANDSTORM_FILL; + this->transitionMode = TRANS_MODE_SANDSTORM; } else { - globalCtx->envCtx.sandstormState = SANDSTORM_UNFILL; - globalCtx->envCtx.sandstormPrimA = 255; - globalCtx->envCtx.sandstormEnvA = 255; - globalCtx->transitionMode = TRANS_MODE_SANDSTORM; + this->envCtx.sandstormState = SANDSTORM_UNFILL; + this->envCtx.sandstormPrimA = 255; + this->envCtx.sandstormEnvA = 255; + this->transitionMode = TRANS_MODE_SANDSTORM; } break; @@ -736,34 +732,34 @@ void Gameplay_Update(GlobalContext* globalCtx) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - if (globalCtx->envCtx.sandstormPrimA < 110) { + if (this->transitionTrigger == TRANS_TRIGGER_END) { + if (this->envCtx.sandstormPrimA < 110) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } } else { - if (globalCtx->envCtx.sandstormEnvA == 255) { - globalCtx->state.running = false; - SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); - gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + if (this->envCtx.sandstormEnvA == 255) { + this->state.running = false; + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); + gSaveContext.entranceIndex = this->nextEntranceIndex; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } } break; case TRANS_MODE_SANDSTORM_END_INIT: - if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - globalCtx->envCtx.sandstormState = SANDSTORM_DISSIPATE; - globalCtx->envCtx.sandstormPrimA = 255; - globalCtx->envCtx.sandstormEnvA = 255; + if (this->transitionTrigger == TRANS_TRIGGER_END) { + this->envCtx.sandstormState = SANDSTORM_DISSIPATE; + this->envCtx.sandstormPrimA = 255; + this->envCtx.sandstormEnvA = 255; // "It's here!!!!!!!!!" LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471); - globalCtx->transitionMode = TRANS_MODE_SANDSTORM_END; + this->transitionMode = TRANS_MODE_SANDSTORM_END; } else { - globalCtx->transitionMode = TRANS_MODE_SANDSTORM_INIT; + this->transitionMode = TRANS_MODE_SANDSTORM_INIT; } break; @@ -771,34 +767,34 @@ void Gameplay_Update(GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - if (globalCtx->envCtx.sandstormPrimA <= 0) { + if (this->transitionTrigger == TRANS_TRIGGER_END) { + if (this->envCtx.sandstormPrimA <= 0) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } } break; case TRANS_MODE_CS_BLACK_FILL_INIT: sTransitionFillTimer = 0; - globalCtx->envCtx.fillScreen = true; - globalCtx->envCtx.screenFillColor[0] = 0; - globalCtx->envCtx.screenFillColor[1] = 0; - globalCtx->envCtx.screenFillColor[2] = 0; - globalCtx->envCtx.screenFillColor[3] = 255; - globalCtx->transitionMode = TRANS_MODE_CS_BLACK_FILL; + this->envCtx.fillScreen = true; + this->envCtx.screenFillColor[0] = 0; + this->envCtx.screenFillColor[1] = 0; + this->envCtx.screenFillColor[2] = 0; + this->envCtx.screenFillColor[3] = 255; + this->transitionMode = TRANS_MODE_CS_BLACK_FILL; break; case TRANS_MODE_CS_BLACK_FILL: if (gSaveContext.cutsceneTransitionControl != 0) { - globalCtx->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl; + this->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl; if (gSaveContext.cutsceneTransitionControl <= 100) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; - globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; - globalCtx->transitionMode = TRANS_MODE_OFF; + this->transitionTrigger = TRANS_TRIGGER_OFF; + this->transitionMode = TRANS_MODE_OFF; } } break; @@ -814,28 +810,28 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3542); } - if ((gSaveContext.gameMode == 0) && (globalCtx->msgCtx.msgMode == MSGMODE_NONE) && - (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE)) { - KaleidoSetup_Update(globalCtx); + if ((gSaveContext.gameMode == 0) && (this->msgCtx.msgMode == MSGMODE_NONE) && + (this->gameOverCtx.state == GAMEOVER_INACTIVE)) { + KaleidoSetup_Update(this); } if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3551); } - sp80 = (globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0); + sp80 = (this->pauseCtx.state != 0) || (this->pauseCtx.debugState != 0); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3555); } - AnimationContext_Reset(&globalCtx->animationCtx); + AnimationContext_Reset(&this->animationCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3561); } - Object_UpdateBank(&globalCtx->objectCtx); + Object_UpdateBank(&this->objectCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3577); @@ -846,83 +842,82 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3580); } - globalCtx->gameplayFrames++; + this->gameplayFrames++; func_800AA178(1); - if (globalCtx->actorCtx.freezeFlashTimer && (globalCtx->actorCtx.freezeFlashTimer-- < 5)) { - osSyncPrintf("FINISH=%d\n", globalCtx->actorCtx.freezeFlashTimer); - if ((globalCtx->actorCtx.freezeFlashTimer > 0) && - ((globalCtx->actorCtx.freezeFlashTimer % 2) != 0)) { - globalCtx->envCtx.fillScreen = true; - globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] = - globalCtx->envCtx.screenFillColor[2] = 150; - globalCtx->envCtx.screenFillColor[3] = 80; + if (this->actorCtx.freezeFlashTimer && (this->actorCtx.freezeFlashTimer-- < 5)) { + osSyncPrintf("FINISH=%d\n", this->actorCtx.freezeFlashTimer); + if ((this->actorCtx.freezeFlashTimer > 0) && ((this->actorCtx.freezeFlashTimer % 2) != 0)) { + this->envCtx.fillScreen = true; + this->envCtx.screenFillColor[0] = this->envCtx.screenFillColor[1] = + this->envCtx.screenFillColor[2] = 150; + this->envCtx.screenFillColor[3] = 80; } else { - globalCtx->envCtx.fillScreen = false; + this->envCtx.fillScreen = false; } } else { if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3606); } - func_800973FC(globalCtx, &globalCtx->roomCtx); + func_800973FC(this, &this->roomCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3612); } - CollisionCheck_AT(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_AT(this, &this->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3618); } - CollisionCheck_OC(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_OC(this, &this->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3624); } - CollisionCheck_Damage(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_Damage(this, &this->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3631); } - CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_ClearContext(this, &this->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3637); } - if (!globalCtx->unk_11DE9) { - Actor_UpdateAll(globalCtx, &globalCtx->actorCtx); + if (!this->unk_11DE9) { + Actor_UpdateAll(this, &this->actorCtx); } if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3643); } - func_80064558(globalCtx, &globalCtx->csCtx); + func_80064558(this, &this->csCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3648); } - func_800645A0(globalCtx, &globalCtx->csCtx); + func_800645A0(this, &this->csCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3651); } - Effect_UpdateAll(globalCtx); + Effect_UpdateAll(this); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3657); } - EffectSs_UpdateAll(globalCtx); + EffectSs_UpdateAll(this); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3662); @@ -936,64 +931,64 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3672); } - func_80095AA0(globalCtx, &globalCtx->roomCtx.curRoom, &input[1], 0); + func_80095AA0(this, &this->roomCtx.curRoom, &input[1], 0); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3675); } - func_80095AA0(globalCtx, &globalCtx->roomCtx.prevRoom, &input[1], 1); + func_80095AA0(this, &this->roomCtx.prevRoom, &input[1], 1); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3677); } - if (globalCtx->unk_1242B != 0) { + if (this->unk_1242B != 0) { if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) { - if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) { + if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugState != 0)) { // "Changing viewpoint is prohibited due to the kaleidoscope" osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST); - } else if (Player_InCsMode(globalCtx)) { + } else if (Player_InCsMode(this)) { // "Changing viewpoint is prohibited during the cutscene" osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST); } else if (YREG(15) == 0x10) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - func_800BC490(globalCtx, globalCtx->unk_1242B ^ 3); + func_800BC490(this, this->unk_1242B ^ 3); } } - func_800BC450(globalCtx); + func_800BC450(this); } if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3708); } - SkyboxDraw_Update(&globalCtx->skyboxCtx); + SkyboxDraw_Update(&this->skyboxCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3716); } - if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) { + if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugState != 0)) { if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3721); } - KaleidoScopeCall_Update(globalCtx); - } else if (globalCtx->gameOverCtx.state != GAMEOVER_INACTIVE) { + KaleidoScopeCall_Update(this); + } else if (this->gameOverCtx.state != GAMEOVER_INACTIVE) { if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3727); } - GameOver_Update(globalCtx); + GameOver_Update(this); } else { if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3733); } - Message_Update(globalCtx); + Message_Update(this); } if (1 && HREG(63)) { @@ -1004,19 +999,19 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3742); } - Interface_Update(globalCtx); + Interface_Update(this); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3765); } - AnimationContext_Update(globalCtx, &globalCtx->animationCtx); + AnimationContext_Update(this, &this->animationCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3771); } - SoundSource_UpdateAll(globalCtx); + SoundSource_UpdateAll(this); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3777); @@ -1028,7 +1023,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3783); } - TransitionFade_Update(&globalCtx->transitionFade, R_UPDATE_RATE); + TransitionFade_Update(&this->transitionFade, R_UPDATE_RATE); } else { goto skip; } @@ -1047,23 +1042,23 @@ skip: s32 pad3[5]; s32 i; - globalCtx->nextCamId = globalCtx->activeCamId; + this->nextCamId = this->activeCamId; if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3806); } for (i = 0; i < NUM_CAMS; i++) { - if ((i != globalCtx->nextCamId) && (globalCtx->cameraPtrs[i] != NULL)) { + if ((i != this->nextCamId) && (this->cameraPtrs[i] != NULL)) { if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3809); } - Camera_Update(globalCtx->cameraPtrs[i]); + Camera_Update(this->cameraPtrs[i]); } } - Camera_Update(globalCtx->cameraPtrs[globalCtx->nextCamId]); + Camera_Update(this->cameraPtrs[this->nextCamId]); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3814); @@ -1074,78 +1069,77 @@ skip: LOG_NUM("1", 1, "../z_play.c", 3816); } - Environment_Update(globalCtx, &globalCtx->envCtx, &globalCtx->lightCtx, &globalCtx->pauseCtx, &globalCtx->msgCtx, - &globalCtx->gameOverCtx, globalCtx->state.gfxCtx); + Environment_Update(this, &this->envCtx, &this->lightCtx, &this->pauseCtx, &this->msgCtx, &this->gameOverCtx, + this->state.gfxCtx); } -void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) { - if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) { - KaleidoScopeCall_Draw(globalCtx); +void Play_DrawOverlayElements(GlobalContext* this) { + if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugState != 0)) { + KaleidoScopeCall_Draw(this); } if (gSaveContext.gameMode == 0) { - Interface_Draw(globalCtx); + Interface_Draw(this); } - Message_Draw(globalCtx); + Message_Draw(this); - if (globalCtx->gameOverCtx.state != GAMEOVER_INACTIVE) { - GameOver_FadeInLights(globalCtx); + if (this->gameOverCtx.state != GAMEOVER_INACTIVE) { + GameOver_FadeInLights(this); } } -void Gameplay_Draw(GlobalContext* globalCtx) { - GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; +void Play_Draw(GlobalContext* this) { + GraphicsContext* gfxCtx = this->state.gfxCtx; Lights* sp228; Vec3f sp21C; OPEN_DISPS(gfxCtx, "../z_play.c", 3907); - gSegments[4] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); - gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gSPSegment(POLY_XLU_DISP++, 0x00, NULL); gSPSegment(OVERLAY_DISP++, 0x00, NULL); - gSPSegment(POLY_OPA_DISP++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSPSegment(OVERLAY_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSPSegment(OVERLAY_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x02, globalCtx->sceneSegment); - gSPSegment(POLY_XLU_DISP++, 0x02, globalCtx->sceneSegment); - gSPSegment(OVERLAY_DISP++, 0x02, globalCtx->sceneSegment); + gSPSegment(POLY_OPA_DISP++, 0x02, this->sceneSegment); + gSPSegment(POLY_XLU_DISP++, 0x02, this->sceneSegment); + gSPSegment(OVERLAY_DISP++, 0x02, this->sceneSegment); func_80095248(gfxCtx, 0, 0, 0); if ((HREG(80) != 10) || (HREG(82) != 0)) { - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); - POLY_XLU_DISP = Gameplay_SetFog(globalCtx, POLY_XLU_DISP); + POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP); + POLY_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP); - View_SetPerspective(&globalCtx->view, globalCtx->view.fovy, globalCtx->view.zNear, globalCtx->lightCtx.fogFar); - View_Apply(&globalCtx->view, VIEW_ALL); + View_SetPerspective(&this->view, this->view.fovy, this->view.zNear, this->lightCtx.fogFar); + View_Apply(&this->view, VIEW_ALL); // The billboard matrix temporarily stores the viewing matrix - Matrix_MtxToMtxF(&globalCtx->view.viewing, &globalCtx->billboardMtxF); - Matrix_MtxToMtxF(&globalCtx->view.projection, &globalCtx->viewProjectionMtxF); - Matrix_Mult(&globalCtx->viewProjectionMtxF, MTXMODE_NEW); + Matrix_MtxToMtxF(&this->view.viewing, &this->billboardMtxF); + Matrix_MtxToMtxF(&this->view.projection, &this->viewProjectionMtxF); + Matrix_Mult(&this->viewProjectionMtxF, MTXMODE_NEW); // The billboard is still a viewing matrix at this stage - Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY); - Matrix_Get(&globalCtx->viewProjectionMtxF); - globalCtx->billboardMtxF.mf[0][3] = globalCtx->billboardMtxF.mf[1][3] = globalCtx->billboardMtxF.mf[2][3] = - globalCtx->billboardMtxF.mf[3][0] = globalCtx->billboardMtxF.mf[3][1] = globalCtx->billboardMtxF.mf[3][2] = - 0.0f; + Matrix_Mult(&this->billboardMtxF, MTXMODE_APPLY); + Matrix_Get(&this->viewProjectionMtxF); + this->billboardMtxF.mf[0][3] = this->billboardMtxF.mf[1][3] = this->billboardMtxF.mf[2][3] = + this->billboardMtxF.mf[3][0] = this->billboardMtxF.mf[3][1] = this->billboardMtxF.mf[3][2] = 0.0f; // This transpose is where the viewing matrix is properly converted into a billboard matrix - Matrix_Transpose(&globalCtx->billboardMtxF); - globalCtx->billboardMtx = Matrix_MtxFToMtx(Matrix_CheckFloats(&globalCtx->billboardMtxF, "../z_play.c", 4005), - Graph_Alloc(gfxCtx, sizeof(Mtx))); + Matrix_Transpose(&this->billboardMtxF); + this->billboardMtx = Matrix_MtxFToMtx(Matrix_CheckFloats(&this->billboardMtxF, "../z_play.c", 4005), + Graph_Alloc(gfxCtx, sizeof(Mtx))); - gSPSegment(POLY_OPA_DISP++, 0x01, globalCtx->billboardMtx); + gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx); if ((HREG(80) != 10) || (HREG(92) != 0)) { Gfx* gfxP; @@ -1154,9 +1148,8 @@ void Gameplay_Draw(GlobalContext* globalCtx) { gfxP = Graph_GfxPlusOne(sp1CC); gSPDisplayList(OVERLAY_DISP++, gfxP); - if ((globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || - (globalCtx->transitionMode == TRANS_MODE_INSTANCE_WAIT) || - (globalCtx->transitionCtx.transitionType >= 56)) { + if ((this->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || + (this->transitionMode == TRANS_MODE_INSTANCE_WAIT) || (this->transitionCtx.transitionType >= 56)) { View view; View_Init(&view, gfxCtx); @@ -1165,10 +1158,10 @@ void Gameplay_Draw(GlobalContext* globalCtx) { SET_FULLSCREEN_VIEWPORT(&view); View_ApplyTo(&view, VIEW_ALL, &gfxP); - globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.instanceData, &gfxP); + this->transitionCtx.draw(&this->transitionCtx.instanceData, &gfxP); } - TransitionFade_Draw(&globalCtx->transitionFade, &gfxP); + TransitionFade_Draw(&this->transitionFade, &gfxP); if (D_801614B0.a > 0) { D_80161498.primColor.rgba = D_801614B0.rgba; @@ -1185,14 +1178,13 @@ void Gameplay_Draw(GlobalContext* globalCtx) { TransitionUnk_Draw(&sTrnsnUnk, &sp88); POLY_OPA_DISP = sp88; - goto Gameplay_Draw_DrawOverlayElements; + goto Play_Draw_DrawOverlayElements; } else { - PreRender_SetValues(&globalCtx->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, gfxCtx->curFrameBuffer, - gZBuffer); + PreRender_SetValues(&this->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, gfxCtx->curFrameBuffer, gZBuffer); if (R_PAUSE_MENU_MODE == 2) { MsgEvent_SendNullTask(); - PreRender_Calc(&globalCtx->pauseBgPreRender); + PreRender_Calc(&this->pauseBgPreRender); R_PAUSE_MENU_MODE = 3; } else if (R_PAUSE_MENU_MODE >= 4) { R_PAUSE_MENU_MODE = 0; @@ -1201,46 +1193,43 @@ void Gameplay_Draw(GlobalContext* globalCtx) { if (R_PAUSE_MENU_MODE == 3) { Gfx* sp84 = POLY_OPA_DISP; - func_800C24BC(&globalCtx->pauseBgPreRender, &sp84); + func_800C24BC(&this->pauseBgPreRender, &sp84); POLY_OPA_DISP = sp84; - goto Gameplay_Draw_DrawOverlayElements; + goto Play_Draw_DrawOverlayElements; } else { s32 sp80; if ((HREG(80) != 10) || (HREG(83) != 0)) { - if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) && - !globalCtx->envCtx.skyboxDisabled) { - if ((globalCtx->skyboxId == SKYBOX_NORMAL_SKY) || - (globalCtx->skyboxId == SKYBOX_CUTSCENE_MAP)) { - Environment_UpdateSkybox(globalCtx->skyboxId, &globalCtx->envCtx, &globalCtx->skyboxCtx); - SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, - globalCtx->envCtx.skyboxBlend, globalCtx->view.eye.x, globalCtx->view.eye.y, - globalCtx->view.eye.z); - } else if (globalCtx->skyboxCtx.unk_140 == 0) { - SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, 0, - globalCtx->view.eye.x, globalCtx->view.eye.y, globalCtx->view.eye.z); + if (this->skyboxId && (this->skyboxId != SKYBOX_UNSET_1D) && !this->envCtx.skyboxDisabled) { + if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_CUTSCENE_MAP)) { + Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx); + SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, this->envCtx.skyboxBlend, + this->view.eye.x, this->view.eye.y, this->view.eye.z); + } else if (this->skyboxCtx.unk_140 == 0) { + SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x, + this->view.eye.y, this->view.eye.z); } } } if ((HREG(80) != 10) || (HREG(90) & 2)) { - if (!globalCtx->envCtx.sunMoonDisabled) { - Environment_DrawSunAndMoon(globalCtx); + if (!this->envCtx.sunMoonDisabled) { + Environment_DrawSunAndMoon(this); } } if ((HREG(80) != 10) || (HREG(90) & 1)) { - Environment_DrawSkyboxFilters(globalCtx); + Environment_DrawSkyboxFilters(this); } if ((HREG(80) != 10) || (HREG(90) & 4)) { - Environment_UpdateLightningStrike(globalCtx); - Environment_DrawLightning(globalCtx, 0); + Environment_UpdateLightningStrike(this); + Environment_DrawLightning(this, 0); } if ((HREG(80) != 10) || (HREG(90) & 8)) { - sp228 = LightContext_NewLights(&globalCtx->lightCtx, gfxCtx); - Lights_BindAll(sp228, globalCtx->lightCtx.listHead, NULL); + sp228 = LightContext_NewLights(&this->lightCtx, gfxCtx); + Lights_BindAll(sp228, this->lightCtx.listHead, NULL); Lights_Draw(sp228, gfxCtx); } @@ -1251,44 +1240,42 @@ void Gameplay_Draw(GlobalContext* globalCtx) { } else { sp80 = HREG(84); } - Scene_Draw(globalCtx); - Room_Draw(globalCtx, &globalCtx->roomCtx.curRoom, sp80 & 3); - Room_Draw(globalCtx, &globalCtx->roomCtx.prevRoom, sp80 & 3); + Scene_Draw(this); + Room_Draw(this, &this->roomCtx.curRoom, sp80 & 3); + Room_Draw(this, &this->roomCtx.prevRoom, sp80 & 3); } } if ((HREG(80) != 10) || (HREG(83) != 0)) { - if ((globalCtx->skyboxCtx.unk_140 != 0) && - (GET_ACTIVE_CAM(globalCtx)->setting != CAM_SET_PREREND_FIXED)) { + if ((this->skyboxCtx.unk_140 != 0) && (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) { Vec3f sp74; - Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(globalCtx)); - SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, 0, - globalCtx->view.eye.x + sp74.x, globalCtx->view.eye.y + sp74.y, - globalCtx->view.eye.z + sp74.z); + Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(this)); + SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp74.x, + this->view.eye.y + sp74.y, this->view.eye.z + sp74.z); } } - if (globalCtx->envCtx.unk_EE[1] != 0) { - Environment_DrawRain(globalCtx, &globalCtx->view, gfxCtx); + if (this->envCtx.unk_EE[1] != 0) { + Environment_DrawRain(this, &this->view, gfxCtx); } if ((HREG(80) != 10) || (HREG(84) != 0)) { - Environment_FillScreen(gfxCtx, 0, 0, 0, globalCtx->unk_11E18, FILL_SCREEN_OPA); + Environment_FillScreen(gfxCtx, 0, 0, 0, this->unk_11E18, FILL_SCREEN_OPA); } if ((HREG(80) != 10) || (HREG(85) != 0)) { - func_800315AC(globalCtx, &globalCtx->actorCtx); + func_800315AC(this, &this->actorCtx); } if ((HREG(80) != 10) || (HREG(86) != 0)) { - if (!globalCtx->envCtx.sunMoonDisabled) { - sp21C.x = globalCtx->view.eye.x + globalCtx->envCtx.sunPos.x; - sp21C.y = globalCtx->view.eye.y + globalCtx->envCtx.sunPos.y; - sp21C.z = globalCtx->view.eye.z + globalCtx->envCtx.sunPos.z; - Environment_DrawSunLensFlare(globalCtx, &globalCtx->envCtx, &globalCtx->view, gfxCtx, sp21C, 0); + if (!this->envCtx.sunMoonDisabled) { + sp21C.x = this->view.eye.x + this->envCtx.sunPos.x; + sp21C.y = this->view.eye.y + this->envCtx.sunPos.y; + sp21C.z = this->view.eye.z + this->envCtx.sunPos.z; + Environment_DrawSunLensFlare(this, &this->envCtx, &this->view, gfxCtx, sp21C, 0); } - Environment_DrawCustomLensFlare(globalCtx); + Environment_DrawCustomLensFlare(this); } if ((HREG(80) != 10) || (HREG(87) != 0)) { @@ -1297,12 +1284,11 @@ void Gameplay_Draw(GlobalContext* globalCtx) { FILL_SCREEN_OPA | FILL_SCREEN_XLU); } - switch (globalCtx->envCtx.fillScreen) { + switch (this->envCtx.fillScreen) { case 1: - Environment_FillScreen( - gfxCtx, globalCtx->envCtx.screenFillColor[0], globalCtx->envCtx.screenFillColor[1], - globalCtx->envCtx.screenFillColor[2], globalCtx->envCtx.screenFillColor[3], - FILL_SCREEN_OPA | FILL_SCREEN_XLU); + Environment_FillScreen(gfxCtx, this->envCtx.screenFillColor[0], + this->envCtx.screenFillColor[1], this->envCtx.screenFillColor[2], + this->envCtx.screenFillColor[3], FILL_SCREEN_OPA | FILL_SCREEN_XLU); break; default: break; @@ -1310,60 +1296,59 @@ void Gameplay_Draw(GlobalContext* globalCtx) { } if ((HREG(80) != 10) || (HREG(88) != 0)) { - if (globalCtx->envCtx.sandstormState != SANDSTORM_OFF) { - Environment_DrawSandstorm(globalCtx, globalCtx->envCtx.sandstormState); + if (this->envCtx.sandstormState != SANDSTORM_OFF) { + Environment_DrawSandstorm(this, this->envCtx.sandstormState); } } if ((HREG(80) != 10) || (HREG(93) != 0)) { - DebugDisplay_DrawObjects(globalCtx); + DebugDisplay_DrawObjects(this); } if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) { Gfx* sp70 = OVERLAY_DISP; - globalCtx->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer; - globalCtx->pauseBgPreRender.fbufSave = (u16*)gZBuffer; - func_800C1F20(&globalCtx->pauseBgPreRender, &sp70); + this->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer; + this->pauseBgPreRender.fbufSave = (u16*)gZBuffer; + func_800C1F20(&this->pauseBgPreRender, &sp70); if (R_PAUSE_MENU_MODE == 1) { - globalCtx->pauseBgPreRender.cvgSave = (u8*)gfxCtx->curFrameBuffer; - func_800C20B4(&globalCtx->pauseBgPreRender, &sp70); + this->pauseBgPreRender.cvgSave = (u8*)gfxCtx->curFrameBuffer; + func_800C20B4(&this->pauseBgPreRender, &sp70); R_PAUSE_MENU_MODE = 2; } else { gTrnsnUnkState = 2; } OVERLAY_DISP = sp70; - globalCtx->unk_121C7 = 2; + this->unk_121C7 = 2; SREG(33) |= 1; } else { - Gameplay_Draw_DrawOverlayElements: + Play_Draw_DrawOverlayElements: if ((HREG(80) != 10) || (HREG(89) != 0)) { - Gameplay_DrawOverlayElements(globalCtx); + Play_DrawOverlayElements(this); } } } } } - if (globalCtx->view.unk_124 != 0) { - Camera_Update(GET_ACTIVE_CAM(globalCtx)); - View_UpdateViewingMatrix(&globalCtx->view); - globalCtx->view.unk_124 = 0; - if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) && !globalCtx->envCtx.skyboxDisabled) { - SkyboxDraw_UpdateMatrix(&globalCtx->skyboxCtx, globalCtx->view.eye.x, globalCtx->view.eye.y, - globalCtx->view.eye.z); + if (this->view.unk_124 != 0) { + Camera_Update(GET_ACTIVE_CAM(this)); + View_UpdateViewingMatrix(&this->view); + this->view.unk_124 = 0; + if (this->skyboxId && (this->skyboxId != SKYBOX_UNSET_1D) && !this->envCtx.skyboxDisabled) { + SkyboxDraw_UpdateMatrix(&this->skyboxCtx, this->view.eye.x, this->view.eye.y, this->view.eye.z); } } - Camera_Finish(GET_ACTIVE_CAM(globalCtx)); + Camera_Finish(GET_ACTIVE_CAM(this)); CLOSE_DISPS(gfxCtx, "../z_play.c", 4508); } -void Gameplay_Main(GameState* thisx) { - GlobalContext* globalCtx = (GlobalContext*)thisx; +void Play_Main(GameState* thisx) { + GlobalContext* this = (GlobalContext*)thisx; - D_8012D1F8 = &globalCtx->state.input[0]; + D_8012D1F8 = &this->state.input[0]; DebugDisplay_Init(); @@ -1389,14 +1374,14 @@ void Gameplay_Main(GameState* thisx) { } if ((HREG(80) != 10) || (HREG(81) != 0)) { - Gameplay_Update(globalCtx); + Play_Update(this); } if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 4583); } - Gameplay_Draw(globalCtx); + Play_Draw(this); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 4587); @@ -1404,11 +1389,11 @@ void Gameplay_Main(GameState* thisx) { } // original name: "Game_play_demo_mode_check" -s32 Gameplay_InCsMode(GlobalContext* globalCtx) { - return (globalCtx->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(globalCtx); +s32 Play_InCsMode(GlobalContext* this) { + return (this->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(this); } -f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { +f32 func_800BFCB8(GlobalContext* this, MtxF* mf, Vec3f* vec) { CollisionPoly poly; f32 temp1; f32 temp2; @@ -1419,7 +1404,7 @@ f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { f32 nz; s32 pad[5]; - floorY = BgCheck_AnyRaycastFloor1(&globalCtx->colCtx, &poly, vec); + floorY = BgCheck_AnyRaycastFloor1(&this->colCtx, &poly, vec); if (floorY > BGCHECK_Y_MIN) { nx = COLPOLY_GET_NORMAL(poly.normal.x); @@ -1474,81 +1459,80 @@ f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { return floorY; } -void* Gameplay_LoadFile(GlobalContext* globalCtx, RomFile* file) { +void* Play_LoadFile(GlobalContext* this, RomFile* file) { u32 size; void* allocp; size = file->vromEnd - file->vromStart; - allocp = GameState_Alloc(&globalCtx->state, size, "../z_play.c", 4692); + allocp = GameState_Alloc(&this->state, size, "../z_play.c", 4692); DmaMgr_SendRequest1(allocp, file->vromStart, size, "../z_play.c", 4694); return allocp; } -void Gameplay_InitEnvironment(GlobalContext* globalCtx, s16 skyboxId) { - Skybox_Init(&globalCtx->state, &globalCtx->skyboxCtx, skyboxId); - Environment_Init(globalCtx, &globalCtx->envCtx, 0); +void Play_InitEnvironment(GlobalContext* this, s16 skyboxId) { + Skybox_Init(&this->state, &this->skyboxCtx, skyboxId); + Environment_Init(this, &this->envCtx, 0); } -void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) { - globalCtx->curSpawn = spawn; - globalCtx->linkActorEntry = NULL; - globalCtx->unk_11DFC = NULL; - globalCtx->setupEntranceList = NULL; - globalCtx->setupExitList = NULL; - globalCtx->cUpElfMsgs = NULL; - globalCtx->setupPathList = NULL; - globalCtx->numSetupActors = 0; - Object_InitBank(globalCtx, &globalCtx->objectCtx); - LightContext_Init(globalCtx, &globalCtx->lightCtx); - TransitionActor_InitContext(&globalCtx->state, &globalCtx->transiActorCtx); - func_80096FD4(globalCtx, &globalCtx->roomCtx.curRoom); +void Play_InitScene(GlobalContext* this, s32 spawn) { + this->curSpawn = spawn; + this->linkActorEntry = NULL; + this->unk_11DFC = NULL; + this->setupEntranceList = NULL; + this->setupExitList = NULL; + this->cUpElfMsgs = NULL; + this->setupPathList = NULL; + this->numSetupActors = 0; + Object_InitBank(this, &this->objectCtx); + LightContext_Init(this, &this->lightCtx); + TransitionActor_InitContext(&this->state, &this->transiActorCtx); + func_80096FD4(this, &this->roomCtx.curRoom); YREG(15) = 0; gSaveContext.worldMapArea = 0; - Scene_ExecuteCommands(globalCtx, globalCtx->sceneSegment); - Gameplay_InitEnvironment(globalCtx, globalCtx->skyboxId); + Scene_ExecuteCommands(this, this->sceneSegment); + Play_InitEnvironment(this, this->skyboxId); } -void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) { +void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn) { SceneTableEntry* scene = &gSceneTable[sceneNum]; scene->unk_13 = 0; - globalCtx->loadedScene = scene; - globalCtx->sceneNum = sceneNum; - globalCtx->sceneConfig = scene->config; + this->loadedScene = scene; + this->sceneNum = sceneNum; + this->sceneConfig = scene->config; osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); - globalCtx->sceneSegment = Gameplay_LoadFile(globalCtx, &scene->sceneFile); + this->sceneSegment = Play_LoadFile(this, &scene->sceneFile); scene->unk_13 = 0; - ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); + ASSERT(this->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); - gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); + gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); - Gameplay_InitScene(globalCtx, spawn); + Play_InitScene(this, spawn); - osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(globalCtx, &globalCtx->roomCtx) / 1024.0f); + osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f); } -void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest) { +void func_800C016C(GlobalContext* this, Vec3f* src, Vec3f* dest) { f32 temp; - Matrix_Mult(&globalCtx->viewProjectionMtxF, MTXMODE_NEW); + Matrix_Mult(&this->viewProjectionMtxF, MTXMODE_NEW); Matrix_MultVec3f(src, dest); - temp = globalCtx->viewProjectionMtxF.ww + - (globalCtx->viewProjectionMtxF.wx * src->x + globalCtx->viewProjectionMtxF.wy * src->y + - globalCtx->viewProjectionMtxF.wz * src->z); + temp = this->viewProjectionMtxF.ww + (this->viewProjectionMtxF.wx * src->x + this->viewProjectionMtxF.wy * src->y + + this->viewProjectionMtxF.wz * src->z); dest->x = 160.0f + ((dest->x / temp) * 160.0f); dest->y = 120.0f - ((dest->y / temp) * 120.0f); } -s16 Gameplay_CreateSubCamera(GlobalContext* globalCtx) { +s16 Play_CreateSubCamera(GlobalContext* this) { s16 i; for (i = CAM_ID_SUB_FIRST; i < NUM_CAMS; i++) { - if (globalCtx->cameraPtrs[i] == NULL) { + if (this->cameraPtrs[i] == NULL) { break; } } @@ -1562,37 +1546,37 @@ s16 Gameplay_CreateSubCamera(GlobalContext* globalCtx) { CYAN) " " VT_RST "\n", i); - globalCtx->cameraPtrs[i] = &globalCtx->subCameras[i - CAM_ID_SUB_FIRST]; - Camera_Init(globalCtx->cameraPtrs[i], &globalCtx->view, &globalCtx->colCtx, globalCtx); - globalCtx->cameraPtrs[i]->camId = i; + this->cameraPtrs[i] = &this->subCameras[i - CAM_ID_SUB_FIRST]; + Camera_Init(this->cameraPtrs[i], &this->view, &this->colCtx, this); + this->cameraPtrs[i]->camId = i; return i; } -s16 Gameplay_GetActiveCamId(GlobalContext* globalCtx) { - return globalCtx->activeCamId; +s16 Play_GetActiveCamId(GlobalContext* this) { + return this->activeCamId; } -s16 Gameplay_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status) { - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; +s16 Play_ChangeCameraStatus(GlobalContext* this, s16 camId, s16 status) { + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; if (status == CAM_STAT_ACTIVE) { - globalCtx->activeCamId = camIdx; + this->activeCamId = camIdx; } - return Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], status); + return Camera_ChangeStatus(this->cameraPtrs[camIdx], status); } -void Gameplay_ClearCamera(GlobalContext* globalCtx, s16 camId) { - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; +void Play_ClearCamera(GlobalContext* this, s16 camId) { + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; if (camIdx == CAM_ID_MAIN) { osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: never clear camera !!\n" VT_RST); } - if (globalCtx->cameraPtrs[camIdx] != NULL) { - Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], CAM_STAT_UNK100); - globalCtx->cameraPtrs[camIdx] = NULL; + if (this->cameraPtrs[camIdx] != NULL) { + Camera_ChangeStatus(this->cameraPtrs[camIdx], CAM_STAT_UNK100); + this->cameraPtrs[camIdx] = NULL; osSyncPrintf("camera control: " VT_BGCOL(CYAN) " " VT_COL(WHITE, BLUE) " clear sub camera [%d] " VT_BGCOL( CYAN) " " VT_RST "\n", camIdx); @@ -1601,28 +1585,28 @@ void Gameplay_ClearCamera(GlobalContext* globalCtx, s16 camId) { } } -void Gameplay_ClearAllSubCameras(GlobalContext* globalCtx) { +void Play_ClearAllSubCameras(GlobalContext* this) { s16 subCamId; for (subCamId = CAM_ID_SUB_FIRST; subCamId < NUM_CAMS; subCamId++) { - if (globalCtx->cameraPtrs[subCamId] != NULL) { - Gameplay_ClearCamera(globalCtx, subCamId); + if (this->cameraPtrs[subCamId] != NULL) { + Play_ClearCamera(this, subCamId); } } - globalCtx->activeCamId = CAM_ID_MAIN; + this->activeCamId = CAM_ID_MAIN; } -Camera* Gameplay_GetCamera(GlobalContext* globalCtx, s16 camId) { - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; +Camera* Play_GetCamera(GlobalContext* this, s16 camId) { + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; - return globalCtx->cameraPtrs[camIdx]; + return this->cameraPtrs[camIdx]; } -s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye) { +s32 Play_CameraSetAtEye(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye) { s32 ret = 0; - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; - Camera* camera = globalCtx->cameraPtrs[camIdx]; + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; + Camera* camera = this->cameraPtrs[camIdx]; Player* player; ret |= Camera_SetParam(camera, 1, at); @@ -1645,10 +1629,10 @@ s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3 return ret; } -s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up) { +s32 Play_CameraSetAtEyeUp(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up) { s32 ret = 0; - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; - Camera* camera = globalCtx->cameraPtrs[camIdx]; + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; + Camera* camera = this->cameraPtrs[camIdx]; Player* player; ret |= Camera_SetParam(camera, 1, at); @@ -1673,67 +1657,67 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve return ret; } -s32 Gameplay_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov) { - s32 ret = Camera_SetParam(globalCtx->cameraPtrs[camId], 0x20, &fov) & 1; +s32 Play_CameraSetFov(GlobalContext* this, s16 camId, f32 fov) { + s32 ret = Camera_SetParam(this->cameraPtrs[camId], 0x20, &fov) & 1; if (1) {} return ret; } -s32 Gameplay_SetCameraRoll(GlobalContext* globalCtx, s16 camId, s16 roll) { - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; - Camera* camera = globalCtx->cameraPtrs[camIdx]; +s32 Play_SetCameraRoll(GlobalContext* this, s16 camId, s16 roll) { + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; + Camera* camera = this->cameraPtrs[camIdx]; camera->roll = roll; return 1; } -void Gameplay_CopyCamera(GlobalContext* globalCtx, s16 destCamId, s16 srcCamId) { - s16 srcCamId2 = (srcCamId == CAM_ID_NONE) ? globalCtx->activeCamId : srcCamId; - s16 destCamId1 = (destCamId == CAM_ID_NONE) ? globalCtx->activeCamId : destCamId; +void Play_CopyCamera(GlobalContext* this, s16 destCamId, s16 srcCamId) { + s16 srcCamId2 = (srcCamId == CAM_ID_NONE) ? this->activeCamId : srcCamId; + s16 destCamId1 = (destCamId == CAM_ID_NONE) ? this->activeCamId : destCamId; - Camera_Copy(globalCtx->cameraPtrs[destCamId1], globalCtx->cameraPtrs[srcCamId2]); + Camera_Copy(this->cameraPtrs[destCamId1], this->cameraPtrs[srcCamId2]); } -s32 func_800C0808(GlobalContext* globalCtx, s16 camId, Player* player, s16 setting) { +s32 func_800C0808(GlobalContext* this, s16 camId, Player* player, s16 setting) { Camera* camera; - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; - camera = globalCtx->cameraPtrs[camIdx]; + camera = this->cameraPtrs[camIdx]; Camera_InitPlayerSettings(camera, player); return Camera_ChangeSetting(camera, setting); } -s32 Gameplay_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting) { - return Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, camId), setting); +s32 Play_CameraChangeSetting(GlobalContext* this, s16 camId, s16 setting) { + return Camera_ChangeSetting(Play_GetCamera(this, camId), setting); } -void func_800C08AC(GlobalContext* globalCtx, s16 camId, s16 arg2) { - s16 camIdx = (camId == CAM_ID_NONE) ? globalCtx->activeCamId : camId; +void func_800C08AC(GlobalContext* this, s16 camId, s16 arg2) { + s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId; s16 i; - Gameplay_ClearCamera(globalCtx, camIdx); + Play_ClearCamera(this, camIdx); for (i = CAM_ID_SUB_FIRST; i < NUM_CAMS; i++) { - if (globalCtx->cameraPtrs[i] != NULL) { + if (this->cameraPtrs[i] != NULL) { osSyncPrintf( VT_COL(RED, WHITE) "camera control: error: return to main, other camera left. %d cleared!!\n" VT_RST, i); - Gameplay_ClearCamera(globalCtx, i); + Play_ClearCamera(this, i); } } if (arg2 <= 0) { - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); - globalCtx->cameraPtrs[CAM_ID_MAIN]->childCamId = globalCtx->cameraPtrs[CAM_ID_MAIN]->parentCamId = CAM_ID_MAIN; + Play_ChangeCameraStatus(this, CAM_ID_MAIN, CAM_STAT_ACTIVE); + this->cameraPtrs[CAM_ID_MAIN]->childCamId = this->cameraPtrs[CAM_ID_MAIN]->parentCamId = CAM_ID_MAIN; } else { - OnePointCutscene_Init(globalCtx, 1020, arg2, NULL, CAM_ID_MAIN); + OnePointCutscene_Init(this, 1020, arg2, NULL, CAM_ID_MAIN); } } -s16 Gameplay_CameraGetUID(GlobalContext* globalCtx, s16 camId) { - Camera* camera = globalCtx->cameraPtrs[camId]; +s16 Play_CameraGetUID(GlobalContext* this, s16 camId) { + Camera* camera = this->cameraPtrs[camId]; if (camera != NULL) { return camera->uid; @@ -1742,8 +1726,8 @@ s16 Gameplay_CameraGetUID(GlobalContext* globalCtx, s16 camId) { } } -s16 func_800C09D8(GlobalContext* globalCtx, s16 camId, s16 arg2) { - Camera* camera = globalCtx->cameraPtrs[camId]; +s16 func_800C09D8(GlobalContext* this, s16 camId, s16 arg2) { + Camera* camera = this->cameraPtrs[camId]; if (camera != NULL) { return 0; @@ -1756,17 +1740,17 @@ s16 func_800C09D8(GlobalContext* globalCtx, s16 camId, s16 arg2) { } } -void Gameplay_SaveSceneFlags(GlobalContext* globalCtx) { - SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[globalCtx->sceneNum]; +void Play_SaveSceneFlags(GlobalContext* this) { + SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[this->sceneNum]; - savedSceneFlags->chest = globalCtx->actorCtx.flags.chest; - savedSceneFlags->swch = globalCtx->actorCtx.flags.swch; - savedSceneFlags->clear = globalCtx->actorCtx.flags.clear; - savedSceneFlags->collect = globalCtx->actorCtx.flags.collect; + savedSceneFlags->chest = this->actorCtx.flags.chest; + savedSceneFlags->swch = this->actorCtx.flags.swch; + savedSceneFlags->clear = this->actorCtx.flags.clear; + savedSceneFlags->collect = this->actorCtx.flags.collect; } -void Gameplay_SetRespawnData(GlobalContext* globalCtx, s32 respawnMode, s16 entranceIndex, s32 roomIndex, - s32 playerParams, Vec3f* pos, s16 yaw) { +void Play_SetRespawnData(GlobalContext* this, s32 respawnMode, s16 entranceIndex, s32 roomIndex, s32 playerParams, + Vec3f* pos, s16 yaw) { RespawnData* respawnData = &gSaveContext.respawn[respawnMode]; respawnData->entranceIndex = entranceIndex; @@ -1774,65 +1758,65 @@ void Gameplay_SetRespawnData(GlobalContext* globalCtx, s32 respawnMode, s16 entr respawnData->pos = *pos; respawnData->yaw = yaw; respawnData->playerParams = playerParams; - respawnData->tempSwchFlags = globalCtx->actorCtx.flags.tempSwch; - respawnData->tempCollectFlags = globalCtx->actorCtx.flags.tempCollect; + respawnData->tempSwchFlags = this->actorCtx.flags.tempSwch; + respawnData->tempCollectFlags = this->actorCtx.flags.tempCollect; } -void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 playerParams) { - Player* player = GET_PLAYER(globalCtx); +void Play_SetupRespawnPoint(GlobalContext* this, s32 respawnMode, s32 playerParams) { + Player* player = GET_PLAYER(this); s32 entranceIndex; s8 roomIndex; - if ((globalCtx->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (globalCtx->sceneNum != SCENE_KAKUSIANA)) { - roomIndex = globalCtx->roomCtx.curRoom.num; + if ((this->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (this->sceneNum != SCENE_KAKUSIANA)) { + roomIndex = this->roomCtx.curRoom.num; entranceIndex = gSaveContext.entranceIndex; - Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams, - &player->actor.world.pos, player->actor.shape.rot.y); + Play_SetRespawnData(this, respawnMode, entranceIndex, roomIndex, playerParams, &player->actor.world.pos, + player->actor.shape.rot.y); } } -void Gameplay_TriggerVoidOut(GlobalContext* globalCtx) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = globalCtx->actorCtx.flags.tempSwch; - gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = globalCtx->actorCtx.flags.tempCollect; +void Play_TriggerVoidOut(GlobalContext* this) { + gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = this->actorCtx.flags.tempSwch; + gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = this->actorCtx.flags.tempCollect; gSaveContext.respawnFlag = 1; - globalCtx->transitionTrigger = TRANS_TRIGGER_START; - globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex; - globalCtx->transitionType = TRANS_TYPE_FADE_BLACK; + this->transitionTrigger = TRANS_TRIGGER_START; + this->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex; + this->transitionType = TRANS_TYPE_FADE_BLACK; } -void Gameplay_LoadToLastEntrance(GlobalContext* globalCtx) { +void Play_LoadToLastEntrance(GlobalContext* this) { gSaveContext.respawnFlag = -1; - globalCtx->transitionTrigger = TRANS_TRIGGER_START; + this->transitionTrigger = TRANS_TRIGGER_START; - if ((globalCtx->sceneNum == SCENE_GANON_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_FINAL) || - (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_DEMO)) { - globalCtx->nextEntranceIndex = ENTR_GANON_FINAL_0; - Item_Give(globalCtx, ITEM_SWORD_MASTER); + if ((this->sceneNum == SCENE_GANON_SONOGO) || (this->sceneNum == SCENE_GANON_FINAL) || + (this->sceneNum == SCENE_GANONTIKA_SONOGO) || (this->sceneNum == 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) || (gSaveContext.entranceIndex == ENTR_SPOT00_13) || (gSaveContext.entranceIndex == ENTR_SPOT00_15)) { - globalCtx->nextEntranceIndex = ENTR_SPOT00_6; + this->nextEntranceIndex = ENTR_SPOT00_6; } else { - globalCtx->nextEntranceIndex = gSaveContext.entranceIndex; + this->nextEntranceIndex = gSaveContext.entranceIndex; } - globalCtx->transitionType = TRANS_TYPE_FADE_BLACK; + this->transitionType = TRANS_TYPE_FADE_BLACK; } -void Gameplay_TriggerRespawn(GlobalContext* globalCtx) { - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); - Gameplay_LoadToLastEntrance(globalCtx); +void Play_TriggerRespawn(GlobalContext* this) { + Play_SetupRespawnPoint(this, RESPAWN_MODE_DOWN, 0xDFF); + Play_LoadToLastEntrance(this); } -s32 func_800C0CB8(GlobalContext* globalCtx) { - return (globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) && - (YREG(15) != 0x40) && (globalCtx->sceneNum != SCENE_HAIRAL_NIWA); +s32 func_800C0CB8(GlobalContext* this) { + return (this->roomCtx.curRoom.mesh->polygon.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) && + (YREG(15) != 0x40) && (this->sceneNum != SCENE_HAIRAL_NIWA); } -s32 FrameAdvance_IsEnabled(GlobalContext* globalCtx) { - return !!globalCtx->frameAdvCtx.enabled; +s32 FrameAdvance_IsEnabled(GlobalContext* this) { + return !!this->frameAdvCtx.enabled; } -s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { +s32 func_800C0D34(GlobalContext* this, Actor* actor, s16* yaw) { TransitionActorEntry* transitionActor; s32 frontRoom; @@ -1840,7 +1824,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { return 0; } - transitionActor = &globalCtx->transiActorCtx.list[(u16)actor->params >> 10]; + transitionActor = &this->transiActorCtx.list[(u16)actor->params >> 10]; frontRoom = transitionActor->sides[0].room; if (frontRoom == transitionActor->sides[1].room) { @@ -1856,7 +1840,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { return 1; } -s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) { +s32 func_800C0DB4(GlobalContext* this, Vec3f* pos) { WaterBox* waterBox; CollisionPoly* poly; Vec3f waterSurfacePos; @@ -1864,10 +1848,10 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) { waterSurfacePos = *pos; - if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, waterSurfacePos.x, waterSurfacePos.z, &waterSurfacePos.y, + if (WaterBox_GetSurface1(this, &this->colCtx, waterSurfacePos.x, waterSurfacePos.z, &waterSurfacePos.y, &waterBox) == true && pos->y < waterSurfacePos.y && - BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &poly, &bgId, &waterSurfacePos) != BGCHECK_Y_MIN) { + BgCheck_EntityRaycastFloor3(&this->colCtx, &poly, &bgId, &waterSurfacePos) != BGCHECK_Y_MIN) { return true; } else { return false; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 9c9a6a075b..1b1323f7e0 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -616,8 +616,8 @@ void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) { this->unk_664 = actor; this->unk_684 = actor; this->stateFlags1 |= PLAYER_STATE1_16; - Camera_SetParam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 8, actor); - Camera_ChangeMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_FOLLOWTARGET); + Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, actor); + Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_FOLLOWTARGET); } s32 func_8008EF30(GlobalContext* globalCtx) { diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 79f3968859..2957aea9b5 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -2,7 +2,7 @@ void Sample_HandleStateChange(SampleContext* this) { if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) { - SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); this->state.running = false; } } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 3eedd21a33..69ade19cdf 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -239,7 +239,7 @@ void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) { } if (cmd->specialFiles.cUpElfMsgNum != 0) { - globalCtx->cUpElfMsgs = Gameplay_LoadFile(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]); + globalCtx->cUpElfMsgs = Play_LoadFile(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]); } } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 4288bf6b58..833adda9aa 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -193,7 +193,7 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) { } } - if (!Gameplay_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) { + if (!Play_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -79.0f; } else { this->dyna.actor.world.pos.y = (this->dyna.actor.home.pos.y + -79.0f) - 5.0f; @@ -431,7 +431,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); this->actionFunc = BgBdanObjects_DoNothing; // Using `CAM_ID_NONE` here defaults to the active camera - Gameplay_CopyCamera(globalCtx, CAM_ID_MAIN, CAM_ID_NONE); + Play_CopyCamera(globalCtx, CAM_ID_MAIN, CAM_ID_NONE); } else { func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); } diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 4ecb53f1a7..b1971b5342 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -248,7 +248,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { s16 i; Gfx* phi_s2; Gfx* phi_s1; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); Actor* actor; BgGanonOtyuka* platform; BossGanon* ganondorf; diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 8eba98c64f..bb5a068cbe 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -73,8 +73,7 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.world.pos.x > -70.0f) && (player->actor.world.pos.x < 300.0f) && (player->actor.world.pos.y > 1340.0f) && - (player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) && - !Gameplay_InCsMode(globalCtx)) { + (player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) && !Play_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gRainbowBridgeCs); gSaveContext.cutsceneTrigger = 1; this->actionFunc = BgGjyoBridge_SpawnBridge; diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index af83709785..cbf40164e1 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -71,7 +71,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { Message_StartTextbox(globalCtx, 0x5073, NULL); this->dyna.actor.params = 100; this->actionFunc = func_8087BAE4; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 89ca9b8212..d6c507014b 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -127,7 +127,7 @@ void BgHakaShip_Move(BgHakaShip* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - 7650.0f; this->dyna.actor.speedXZ = 0.0f; } - if (distanceFromHome > 7600.0f && !Gameplay_InCsMode(globalCtx)) { + if (distanceFromHome > 7600.0f && !Play_InCsMode(globalCtx)) { this->counter = 40; this->dyna.actor.speedXZ = 0.0f; Message_StartTextbox(globalCtx, 0x5071, NULL); @@ -179,7 +179,7 @@ void BgHakaShip_CrashFall(BgHakaShip* this, GlobalContext* globalCtx) { } else { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG); if ((this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 500.0f) && func_8004356C(&this->dyna)) { - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); } } } diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 35a8be7ac9..8e7754adce 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -172,7 +172,7 @@ void func_808A932C(BgRelayObjects* this, GlobalContext* globalCtx) { if (this->timer == 0) { if (!Player_InCsMode(globalCtx)) { func_80078884(NA_SE_OC_ABYSS); - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); this->actionFunc = BgRelayObjects_DoNothing; } } 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 2e9ed07842..a2320bb80d 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 @@ -216,7 +216,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) { if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) && (player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) && - (!(Gameplay_InCsMode(globalCtx)))) { + (!(Play_InCsMode(globalCtx)))) { SET_EVENTCHKINF(EVENTCHKINF_80); Flags_SetEventChkInf(EVENTCHKINF_82); this->actionFunc = BgSpot00Hanebasi_DoNothing; 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 a63db7675c..c4e692e751 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 @@ -94,7 +94,7 @@ void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { if (!GET_EVENTCHKINF(EVENTCHKINF_4F) && (gSaveContext.sceneSetupIndex < 4) && - Actor_IsFacingAndNearPlayer(&this->actor, 800.0f, 0x7530) && !Gameplay_InCsMode(globalCtx)) { + Actor_IsFacingAndNearPlayer(&this->actor, 800.0f, 0x7530) && !Play_InCsMode(globalCtx)) { SET_EVENTCHKINF(EVENTCHKINF_4F); globalCtx->csCtx.segment = D_808BBD90; gSaveContext.cutsceneTrigger = 1; diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index e6981e59e0..9fceefb581 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -244,7 +244,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, GlobalContext* globalCtx) { Vec3f subCamAt; Vec3f subCamUp; - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); if (this->unk_196 != 0) { this->unk_196--; @@ -270,10 +270,10 @@ void BossDodongo_IntroCutscene(BossDodongo* this, GlobalContext* globalCtx) { case 1: func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - Gameplay_ClearAllSubCameras(globalCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ClearAllSubCameras(globalCtx); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->csState = 2; this->unk_196 = 0x3C; this->unk_198 = 160; @@ -445,7 +445,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, GlobalContext* globalCtx) { subCamUp.y = 1.0f; subCamUp.z = this->unk_20C; - Gameplay_CameraSetAtEyeUp(globalCtx, this->subCamId, &subCamAt, &subCamEye, &subCamUp); + Play_CameraSetAtEyeUp(globalCtx, this->subCamId, &subCamAt, &subCamEye, &subCamUp); } } @@ -1136,7 +1136,7 @@ void BossDodongo_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, BossDodongo_OverrideLimbDraw, BossDodongo_PostLimbDraw, this); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_dodongo.c", 3981); @@ -1304,10 +1304,10 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) { this->csState = 5; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); this->subCamEye.x = mainCam->eye.x; this->subCamEye.y = mainCam->eye.y; this->subCamEye.z = mainCam->eye.z; @@ -1604,7 +1604,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) { Math_CosS(this->actor.shape.rot.y) * -50.0f + this->actor.world.pos.z, 0, 0, 0, 0); } if (this->unk_1DA == 600) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -1612,7 +1612,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) { this->unk_1BC = 0; this->subCamId = SUB_CAM_ID_DONE; this->csState = 100; - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); func_80064534(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 7); Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, -890.0f, -1523.76f, @@ -1635,7 +1635,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx) { break; } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index c1eba01bf8..14e2a7806d 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -165,7 +165,7 @@ void BossFd_UpdateCamera(BossFd* this, GlobalContext* globalCtx) { this->subCamAtVel.z * this->subCamVelFactor); Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel); this->subCamAt.y += this->subCamAtYOffset; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); Math_ApproachZeroF(&this->subCamAtYOffset, 1.0f, 0.1f); } } @@ -300,7 +300,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) { if (this->introState != BFD_CS_NONE) { Player* player2 = GET_PLAYER(globalCtx); - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); switch (this->introState) { case BFD_CS_WAIT: @@ -316,9 +316,9 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) { this->introState = BFD_CS_START; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); player2->actor.world.pos.x = 380.0f; player2->actor.world.pos.y = 100.0f; player2->actor.world.pos.z = 0.0f; @@ -1648,7 +1648,7 @@ void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx) { } BossFd_DrawBody(globalCtx, this); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4243); } diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 93c568331e..44476ce413 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -631,7 +631,7 @@ void BossFd2_UpdateCamera(BossFd2* this, GlobalContext* globalCtx) { this->subCamAtVel.z * this->subCamVelFactor); Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel); this->subCamAt.y += this->subCamAtYOffset; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); Math_ApproachF(&this->subCamAtYOffset, 0.0f, 1.0f, 0.1f); } } @@ -641,7 +641,7 @@ void BossFd2_Death(BossFd2* this, GlobalContext* globalCtx) { Vec3f sp70; Vec3f sp64; BossFd* bossFd = (BossFd*)this->actor.parent; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); f32 pad3; f32 pad2; f32 pad1; @@ -654,9 +654,9 @@ void BossFd2_Death(BossFd2* this, GlobalContext* globalCtx) { this->deathState = DEATH_RETREAT; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEye = mainCam->eye; this->subCamAt = mainCam->at; this->subCamEyeVel.x = 100.0f; @@ -1211,7 +1211,7 @@ void BossFd2_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, BossFd2_OverrideLimbDraw, BossFd2_PostLimbDraw, &this->actor); BossFd2_DrawMane(this, globalCtx); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd2.c", 2688); } diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index b615e40ef3..94b9bb56c7 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -559,9 +559,9 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->csCamIndex = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); + this->csCamIndex = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); this->csCamFov = 60.0f; if (GET_EVENTCHKINF(EVENTCHKINF_78)) { @@ -1122,7 +1122,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { } if (this->csTimer == 120) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->csCamEye; mainCam->eyeNext = this->csCamEye; mainCam->at = this->csCamAt; @@ -1157,8 +1157,8 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { this->csCamAtMaxStep.z * this->csCamMaxStepScale); } - Gameplay_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); - Gameplay_CameraSetFov(globalCtx, this->csCamIndex, this->csCamFov); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); + Play_CameraSetFov(globalCtx, this->csCamIndex, this->csCamFov); } } @@ -1235,9 +1235,9 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) case 0: func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->csCamIndex = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); + this->csCamIndex = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = 70.0f; @@ -1506,9 +1506,9 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) case 100: func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->csCamIndex = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); + this->csCamIndex = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->csCamIndex, CAM_STAT_ACTIVE); Animation_MorphToPlayOnce(&this->skelAnime, &object_ganon_anime2_Anim_00ADDC, 0.0f); this->fwork[1] = Animation_GetLastFrame(&object_ganon_anime2_Anim_00EA00); this->csState = 101; @@ -1782,7 +1782,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamAt.z = (sZelda->actor.world.pos.z - 25.0f) + 80.0f; if (this->csTimer > 50) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->csCamEye; mainCam->eyeNext = this->csCamEye; @@ -1824,7 +1824,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) sp64 = this->csCamAt; sp64.y += this->unk_70C; - Gameplay_CameraSetAtEye(globalCtx, this->csCamIndex, &sp64, &this->csCamEye); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &sp64, &this->csCamEye); } } @@ -3807,7 +3807,7 @@ void BossGanon_Draw(Actor* thisx, GlobalContext* globalCtx) { this->unk_2EC[0].y = this->unk_2EC[1].y + 30.0f; this->unk_2EC[0].z = this->unk_2EC[1].z; - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); BossGanon_DrawEffects(globalCtx); @@ -4708,7 +4708,7 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) { } } else if (eff->type == GDF_EFF_LIGHTNING) { if (eff->unk_3C == 0.0f) { - eff->unk_44 = BINANG_TO_RAD_ALT(Camera_GetInputDirYaw(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN))); + eff->unk_44 = BINANG_TO_RAD_ALT(Camera_GetInputDirYaw(Play_GetCamera(globalCtx, CAM_ID_MAIN))); } else { eff->unk_44 = M_PI / 2; } diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index a9285e5f96..1e8f020bb8 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -196,9 +196,9 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, objectIdx)) { func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->unk_39C = 1; sZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 970.0f, 1086.0f, -200.0f, 0, 0, 0, 1); @@ -313,7 +313,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamEye.z, -20.0f, 0.1f, this->unk_410.x * 170.0f); Math_ApproachF(&this->unk_410.x, 0.04f, 1.0f, 0.0005f); if (this->unk_398 == 100) { - Camera* camera = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN); camera->eye = this->subCamEye; camera->eyeNext = this->subCamEye; @@ -333,9 +333,9 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { this->unk_39C = 10; this->unk_398 = 0; func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); } else { break; } @@ -539,7 +539,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { sp8D = true; } if (this->unk_398 >= 60) { - Camera* camera = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN); camera->eye = this->subCamEye; camera->eyeNext = this->subCamEye; @@ -860,7 +860,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_ROAR); } if (Animation_OnFrame(&this->skelAnime, this->unk_194)) { - Camera* camera = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN); camera->eye = this->subCamEye; camera->eyeNext = this->subCamEye; @@ -889,7 +889,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { osSyncPrintf(NULL, 0, 0); } this->subCamAt.y += this->unk_41C; - Gameplay_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); + Play_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); } } @@ -1278,7 +1278,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { f32 temp_f12; f32 temp_f2; - mainCam1 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam1 = Play_GetCamera(globalCtx, CAM_ID_MAIN); player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); this->unk_398++; @@ -1287,9 +1287,9 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { switch (this->unk_39C) { case 0: func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, &this->actor, 8); this->unk_39C = 1; this->subCamEye = mainCam1->eye; @@ -1331,7 +1331,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { Message_StartTextbox(globalCtx, 0x70D7, NULL); } if ((this->unk_1A2[1] < 30) && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE)) { - mainCam2 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam2 = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam2->eye = this->subCamEye; mainCam2->eyeNext = this->subCamEye; mainCam2->at = this->subCamAt; @@ -1344,9 +1344,9 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { break; case 10: func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->unk_39C = 11; this->unk_334 = 1; func_8002DF54(globalCtx, &this->actor, 0x60); @@ -1362,7 +1362,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { this->subCamAt.y = (player->actor.world.pos.y + 60.0f) - 25.0f; this->subCamAt.z = player->actor.world.pos.z; if (this->unk_398 == 80) { - mainCam3 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam3 = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam3->eye = this->subCamEye; mainCam3->eyeNext = this->subCamEye; mainCam3->at = this->subCamAt; @@ -1376,7 +1376,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } switch (this->unk_1AC) { @@ -1472,9 +1472,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { switch (this->unk_39C) { case 0: func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, &this->actor, 8); this->unk_39C = 1; this->unk_398 = 0; @@ -1608,7 +1608,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { this->subCamAt.y = player->actor.world.pos.y + 40.0f; this->subCamAt.z = player->actor.world.pos.z; if (this->unk_398 == 166) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -1627,9 +1627,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) && (player->meleeWeaponState != 0) && (player->heldItemActionParam == PLAYER_AP_SWORD_MASTER)) { func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->unk_39C = 7; this->unk_398 = 0; Animation_MorphToPlayOnce(&this->skelAnime, &object_ganon2_Anim_003B1C, 0.0f); @@ -1801,7 +1801,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); + Play_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); } switch (this->unk_1AC) { @@ -2775,7 +2775,7 @@ void BossGanon2_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, BossGanon2_OverrideLimbDraw, BossGanon2_PostLimbDraw, this); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); BossGanon2_GenShadowTexture(shadowTexture, this, globalCtx); BossGanon2_DrawShadowTexture(shadowTexture, this, globalCtx); break; diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 724befa434..fe14f78553 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -942,7 +942,7 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) { f32 camZ; f32 pad; Player* player = GET_PLAYER(globalCtx); - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); osSyncPrintf("PYP %f\n", player->actor.floorHeight); SkelAnime_Update(&this->skelAnime); @@ -956,10 +956,10 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) { case DEATH_START: func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); osSyncPrintf("7\n"); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); osSyncPrintf("8\n"); this->deathState = DEATH_THROES; player->actor.speedXZ = 0.0f; @@ -1215,7 +1215,7 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel); } - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } @@ -1516,7 +1516,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, BossGanondrof_OverrideLimbDraw, BossGanondrof_PostLimbDraw, this); osSyncPrintf("DRAW 22\n"); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_ganondrof.c", 3814); osSyncPrintf("DRAW END %d\n", this->actor.params); } diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 75cf395f3d..1b0c8f7e96 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -621,16 +621,16 @@ void BossGoma_UpdateCeilingMovement(BossGoma* this, GlobalContext* globalCtx, f3 void BossGoma_SetupEncounterState4(BossGoma* this, GlobalContext* globalCtx) { Player* player; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); player = GET_PLAYER(globalCtx); this->actionState = 4; this->actor.flags |= ACTOR_FLAG_0; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); Animation_Change(&this->skelanime, &gGohmaEyeRollAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGohmaEyeRollAnim), ANIMMODE_ONCE, 0.0f); this->currentAnimFrameCount = Animation_GetLastFrame(&gGohmaEyeRollAnim); @@ -692,10 +692,10 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { case 1: // player entered the room func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); + this->subCamId = Play_CreateSubCamera(globalCtx); osSyncPrintf("MAKE CAMERA !!! 1 !!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->actionState = 2; // ceiling center this->actor.world.pos.x = -150.0f; @@ -742,7 +742,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { this->subCamAt.z = player->actor.world.pos.z; } - Gameplay_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &this->subCamAt, &this->subCamEye); if (this->frameCount == 176) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_SHUTTER, 164.72f, -480.0f, @@ -759,7 +759,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { } if (this->frameCount >= 228) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -942,7 +942,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { if (this->framesUntilNextAction == 0) { this->framesUntilNextAction = 30; this->actionState = 150; - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); } break; @@ -953,7 +953,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->subCamEye.z, this->actor.world.pos.z + 220.0f, 0.2f, 100.0f, 0.1f); if (this->framesUntilNextAction == 0) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -969,7 +969,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } @@ -1054,10 +1054,10 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { this->actionState = 1; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 1); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); this->subCamEye.x = mainCam->eye.x; this->subCamEye.y = mainCam->eye.y; this->subCamEye.z = mainCam->eye.z; @@ -1113,7 +1113,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->actionState = 2; - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_UNK3); this->timer = 70; this->decayingProgress = 0; this->subCamFollowSpeed = 0.0f; @@ -1123,7 +1123,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { break; case 2: - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); Math_SmoothStepToF(&this->subCamEye.x, mainCam->eye.x, 0.2f, this->subCamFollowSpeed * 50.0f, 0.1f); Math_SmoothStepToF(&this->subCamEye.y, mainCam->eye.y, 0.2f, this->subCamFollowSpeed * 50.0f, 0.1f); Math_SmoothStepToF(&this->subCamEye.z, mainCam->eye.z, 0.2f, this->subCamFollowSpeed * 50.0f, 0.1f); @@ -1174,7 +1174,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { if (this->timer == 0) { if (Math_SmoothStepToF(&this->actor.scale.y, 0, 1.0f, 0.00075f, 0.0f) <= 0.001f) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -1191,7 +1191,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } if (this->blinkTimer != 0) { diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index acc3c1b4d8..3fbbfd8878 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -767,7 +767,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) { Math_ApproachS(&player->actor.shape.rot.y, this->grabPosRot.rot.y, 2, 0x7D0); Math_ApproachS(&player->actor.shape.rot.z, this->grabPosRot.rot.z, 2, 0x7D0); if (this->timers[0] == 0) { - mainCam1 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam1 = Play_GetCamera(globalCtx, CAM_ID_MAIN); this->work[MO_TENT_ACTION_STATE] = MO_TENT_SHAKE; this->tentMaxAngle = .001f; this->fwork[MO_TENT_SWING_RATE_X] = this->fwork[MO_TENT_SWING_RATE_Z] = @@ -777,9 +777,9 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) { this->sfxTimer = 30; Audio_ResetIncreasingTranspose(); func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEye = mainCam1->eye; this->subCamAt = mainCam1->at; this->subCamYaw = Math_FAtan2F(this->subCamEye.x - this->actor.world.pos.x, @@ -859,7 +859,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamAt.x, player->actor.world.pos.x, 0.5f, 50.0f); Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y, 0.5f, 50.0f); Math_ApproachF(&this->subCamAt.z, player->actor.world.pos.z, 0.5f, 50.0f); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } break; case MO_TENT_CUT: @@ -895,9 +895,9 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamAt.x, player->actor.world.pos.x, 0.5f, 50.0f); Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y, 0.5f, 50.0f); Math_ApproachF(&this->subCamAt.z, player->actor.world.pos.z, 0.5f, 50.0f); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); if (player->actor.world.pos.y <= 42.0f) { - mainCam2 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam2 = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam2->eye = this->subCamEye; mainCam2->eyeNext = this->subCamEye; mainCam2->at = this->subCamAt; @@ -1201,7 +1201,7 @@ void BossMo_IntroCs(BossMo* this, GlobalContext* globalCtx) { f32 sp7C; f32 sp78; Player* player = GET_PLAYER(globalCtx); - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); Vec3f bubblePos; Vec3f bubblePos2; Camera* mainCam2; @@ -1228,9 +1228,9 @@ void BossMo_IntroCs(BossMo* this, GlobalContext* globalCtx) { // checks if Link is on one of the four platforms func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->actor.speedXZ = 0.0f; this->csState = MO_INTRO_START; this->timers[2] = 50; @@ -1440,7 +1440,7 @@ void BossMo_IntroCs(BossMo* this, GlobalContext* globalCtx) { sMorphaTent1->timers[0] = 50; } if (this->timers[2] == 20) { - mainCam2 = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam2 = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam2->eye = this->subCamEye; mainCam2->eyeNext = this->subCamEye; mainCam2->at = this->subCamAt; @@ -1483,11 +1483,11 @@ void BossMo_IntroCs(BossMo* this, GlobalContext* globalCtx) { this->subCamUp.x = this->subCamUp.z = sinf(this->work[MO_TENT_VAR_TIMER] * 0.03f) * this->subCamYawShake * (-2.0f); this->subCamUp.y = 1.0f; - Gameplay_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); + Play_CameraSetAtEyeUp(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; - Gameplay_CameraSetFov(globalCtx, this->subCamId, this->subCamFov); + Play_CameraSetFov(globalCtx, this->subCamId, this->subCamFov); } if ((this->csState > MO_INTRO_START) && (this->work[MO_TENT_MOVE_TIMER] > 540)) { @@ -1506,7 +1506,7 @@ void BossMo_DeathCs(BossMo* this, GlobalContext* globalCtx) { f32 sp7C; Vec3f sp70; Vec3f sp64; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); Vec3f velocity; Vec3f pos; @@ -1514,9 +1514,9 @@ void BossMo_DeathCs(BossMo* this, GlobalContext* globalCtx) { case MO_DEATH_START: func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->csState = MO_DEATH_MO_CORE_BURST; this->subCamEye = mainCam->eye; this->timers[0] = 90; @@ -1727,7 +1727,7 @@ void BossMo_DeathCs(BossMo* this, GlobalContext* globalCtx) { this->subCamAtVel.y * this->subCamVelFactor); Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel); } - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 112b88d86c..ad0aca12cf 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -374,15 +374,15 @@ void BossSst_HeadSetupIntro(BossSst* this, GlobalContext* globalCtx) { func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); Math_Vec3f_Copy(&sSubCamAt, &player->actor.world.pos); if (GET_EVENTCHKINF(EVENTCHKINF_77)) { sSubCamEye.z = ROOM_CENTER_Z - 100.0f; } - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); this->actionFunc = BossSst_HeadIntro; } @@ -409,11 +409,11 @@ void BossSst_HeadIntro(BossSst* this, GlobalContext* globalCtx) { func_8002DF54(globalCtx, &this->actor, 7); sSubCamAt.y += 30.0f; sSubCamAt.z += 300.0f; - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); - Gameplay_CopyCamera(globalCtx, CAM_ID_MAIN, sSubCamId); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, sSubCamId); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CopyCamera(globalCtx, CAM_ID_MAIN, sSubCamId); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, sSubCamId); SET_EVENTCHKINF(EVENTCHKINF_77); BossSst_HeadSetupNeutral(this); this->colliderJntSph.base.ocFlags1 |= OC1_ON; @@ -612,7 +612,7 @@ void BossSst_HeadIntro(BossSst* this, GlobalContext* globalCtx) { } if (this->actionFunc != BossSst_HeadNeutral) { - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); } } @@ -995,7 +995,7 @@ void BossSst_UpdateDeathCamera(BossSst* this, GlobalContext* globalCtx) { subCamEye.x = this->actor.world.pos.x + (sSubCamEye.z * sn) + (sSubCamEye.x * cs); subCamEye.y = this->actor.home.pos.y - 140.0f + sSubCamEye.y; subCamEye.z = this->actor.world.pos.z + (sSubCamEye.z * cs) - (sSubCamEye.x * sn); - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &subCamAt, &subCamEye); } void BossSst_HeadSetupDeath(BossSst* this, GlobalContext* globalCtx) { @@ -1012,10 +1012,10 @@ void BossSst_HeadSetupDeath(BossSst* this, GlobalContext* globalCtx) { sHands[LEFT]->colliderJntSph.base.ocFlags1 &= ~OC1_ON; sHands[RIGHT]->colliderJntSph.base.ocFlags1 &= ~OC1_ON; Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); - Gameplay_CopyCamera(globalCtx, sSubCamId, CAM_ID_MAIN); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + Play_CopyCamera(globalCtx, sSubCamId, CAM_ID_MAIN); func_8002DF54(globalCtx, &player->actor, 8); func_80064520(globalCtx, &globalCtx->csCtx); Math_Vec3f_Copy(&sSubCamEye, &GET_ACTIVE_CAM(globalCtx)->eye); @@ -1034,7 +1034,7 @@ void BossSst_HeadDeath(BossSst* this, GlobalContext* globalCtx) { BossSst_HandSetupThrash(sHands[RIGHT]); BossSst_HeadSetupThrash(this); } else if (this->timer > 48) { - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &this->actor.focus.pos, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &this->actor.focus.pos, &sSubCamEye); Math_StepToF(&this->radius, -350.0f, 10.0f); } else if (this->timer == 48) { Player* player = GET_PLAYER(globalCtx); @@ -1175,10 +1175,10 @@ void BossSst_HeadFinish(BossSst* this, GlobalContext* globalCtx) { if (this->effectMode == BONGO_NULL) { if (this->timer < -170) { BossSst_UpdateDeathCamera(this, globalCtx); - Gameplay_CopyCamera(globalCtx, CAM_ID_MAIN, sSubCamId); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, sSubCamId); + Play_CopyCamera(globalCtx, CAM_ID_MAIN, sSubCamId); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, sSubCamId); func_8002DF54(globalCtx, &GET_PLAYER(globalCtx)->actor, 7); func_80064534(globalCtx, &globalCtx->csCtx); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index d9850344bb..e4577fc4a5 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -1509,9 +1509,9 @@ void BossTw_TwinrovaMergeCS(BossTw* this, GlobalContext* globalCtx) { this->csState2 = 1; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 0x39); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamDist = 800.0f; this->subCamYaw = M_PI; sKoumePtr->actor.world.rot.x = 0; @@ -1570,9 +1570,9 @@ void BossTw_TwinrovaMergeCS(BossTw* this, GlobalContext* globalCtx) { if (this->subCamId != SUB_CAM_ID_DONE) { if (this->unk_5F9 == 0) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } else { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt2, &this->subCamEye2); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt2, &this->subCamEye2); } } @@ -1715,7 +1715,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, GlobalContext* globalCtx) { } if (this->timers[2] == 1) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; @@ -1805,9 +1805,9 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) { this->csState2 = 1; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 0x39); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEye.x = 0.0f; this->subCamEye.y = 350; this->subCamEye.z = 200; @@ -2280,7 +2280,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) { } if (this->work[CS_TIMER_1] == 260) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; @@ -2311,7 +2311,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) { this->subCamAtVel.z * this->subCamUpdateRate); } - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } @@ -2618,7 +2618,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) { s16 i; Vec3f spD0; Player* player = GET_PLAYER(globalCtx); - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); SkelAnime_Update(&this->skelAnime); this->work[UNK_S8] += 20; @@ -2696,9 +2696,9 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) { this->csState2 = 1; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEye = mainCam->eye; this->subCamAt = mainCam->at; Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); @@ -2815,7 +2815,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) { Actor_SetScale(&sKoumePtr->actor, sKoumePtr->actor.scale.x); Actor_SetScale(&sKotakePtr->actor, sKoumePtr->actor.scale.x); if (this->work[CS_TIMER_2] >= 1020) { - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -2842,7 +2842,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) { if (this->subCamId != SUB_CAM_ID_DONE) { if (1) {} - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } @@ -3538,7 +3538,7 @@ void BossTw_Draw(Actor* thisx, GlobalContext* globalCtx2) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, BossTw_OverrideLimbDraw, BossTw_PostLimbDraw, this); Matrix_Pop(); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); } if (this->actor.params == TW_KOTAKE) { diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index ec6d9e9602..d43cb8d02a 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -649,16 +649,16 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) { globalCtx->envCtx.screenFillColor[2] = 0xBE; globalCtx->envCtx.screenFillColor[3] = 0xD2; func_80064520(globalCtx, &globalCtx->csCtx); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); sSubCamEyeNext.x = sSubCamEye.x = 140.0f; sSubCamEyeNext.y = sSubCamEye.y = 205.0f; sSubCamEyeNext.z = sSubCamEye.z = -20.0f; sSubCamAtNext.x = sSubCamAt.x = 10.0f; sSubCamAtNext.y = sSubCamAt.y = 50.0f; sSubCamAtNext.z = sSubCamAt.z = -220.0f; - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); this->timer = 20; for (i = BOSSVA_BARI_LOWER_5; i >= BOSSVA_BARI_UPPER_1; i--) { @@ -791,10 +791,10 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) { case INTRO_LOOK_DOOR: func_80064520(globalCtx, &globalCtx->csCtx); if (sSubCamId == SUB_CAM_ID_DONE) { - sSubCamId = Gameplay_CreateSubCamera(globalCtx); + sSubCamId = Play_CreateSubCamera(globalCtx); } - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); sSubCamEyeNext.x = sSubCamEye.x = 13.0f; sSubCamEyeNext.y = sSubCamEye.y = 124.0f; @@ -833,10 +833,10 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) { case INTRO_SPAWN_BARI: func_80064520(globalCtx, &globalCtx->csCtx); if (sSubCamId == SUB_CAM_ID_DONE) { - sSubCamId = Gameplay_CreateSubCamera(globalCtx); + sSubCamId = Play_CreateSubCamera(globalCtx); } - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); sSubCamEyeNext.x = sSubCamEye.x = 13.0f; sSubCamEyeNext.y = sSubCamEye.y = 124.0f; @@ -1011,10 +1011,10 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) { case INTRO_FINISH: this->timer--; if (this->timer == 0) { - Gameplay_ClearCamera(globalCtx, sSubCamId); + Play_ClearCamera(globalCtx, sSubCamId); sSubCamId = SUB_CAM_ID_DONE; func_80064534(globalCtx, &globalCtx->csCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, &this->actor, 7); sCsState++; SET_EVENTCHKINF(EVENTCHKINF_76); @@ -1042,7 +1042,7 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&sSubCamAt.x, sSubCamAtNext.x, 0.3f, sSubCamAtMaxVelFrac.x, 0.075f); Math_SmoothStepToF(&sSubCamAt.y, sSubCamAtNext.y, 0.3f, sSubCamAtMaxVelFrac.y, 0.075f); Math_SmoothStepToF(&sSubCamAt.z, sSubCamAtNext.z, 0.3f, sSubCamAtMaxVelFrac.z, 0.075f); - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); } } @@ -1526,7 +1526,7 @@ void BossVa_SetupBodyDeath(BossVa* this, GlobalContext* globalCtx) { void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) { s32 i; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); s32 sp7C; Player* player = GET_PLAYER(globalCtx); s16 tmp16; @@ -1535,9 +1535,9 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) { case DEATH_START: func_8002DF54(globalCtx, &this->actor, 1); func_80064520(globalCtx, &globalCtx->csCtx); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); sSubCamAtNext.x = this->actor.world.pos.x; sSubCamAtNext.y = this->actor.world.pos.y; @@ -1628,10 +1628,10 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) { this->timer--; if (this->timer == 0) { - Gameplay_ClearCamera(globalCtx, sSubCamId); + Play_ClearCamera(globalCtx, sSubCamId); sSubCamId = SUB_CAM_ID_DONE; func_80064534(globalCtx, &globalCtx->csCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); mainCam->eyeNext = mainCam->eye = sSubCamEye; @@ -1666,7 +1666,7 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&sSubCamAt.x, sSubCamAtNext.x, 0.3f, sSubCamAtMaxVelFrac.x, 0.15f); Math_SmoothStepToF(&sSubCamAt.y, sSubCamAtNext.y, 0.3f, sSubCamAtMaxVelFrac.y, 0.15f); Math_SmoothStepToF(&sSubCamAt.z, sSubCamAtNext.z, 0.3f, sSubCamAtMaxVelFrac.z, 0.15f); - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); } SkelAnime_Update(&this->skelAnime); @@ -3511,7 +3511,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; u8 materialFlag = 0; BossVaEffect* effectHead = effect; - Camera* subCam = Gameplay_GetCamera(globalCtx, sSubCamId); + Camera* subCam = Play_GetCamera(globalCtx, sSubCamId); OPEN_DISPS(gfxCtx, "../z_boss_va.c", 4953); 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 f8c8f79bf7..bf4f93a950 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -845,7 +845,7 @@ s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) { f32 playerPosX = player->actor.world.pos.x; f32 thisPosX = this->actor.world.pos.x; - if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) { + if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Play_InCsMode(globalCtx))) { return true; } else { return false; diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 5d5b1c8a17..f872dcc84f 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -131,7 +131,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { if ((this->actor.targetMode != 0) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_31) && (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 0c9078beba..6fd5523c68 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -549,7 +549,7 @@ void func_80997220(DoorShutter* this, GlobalContext* globalCtx) { globalCtx->roomCtx.unk_30 ^= 1; } func_80097534(globalCtx, &globalCtx->roomCtx); - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0x0EFF); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0x0EFF); } this->unk_164 = 0; this->dyna.actor.velocity.y = 0.0f; @@ -572,7 +572,7 @@ void func_809973E8(DoorShutter* this, GlobalContext* globalCtx) { 10, false); } Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); - quakeId = Quake_Add(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 3); + quakeId = Quake_Add(Play_GetCamera(globalCtx, CAM_ID_MAIN), 3); Quake_SetSpeed(quakeId, -32536); Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetCountdown(quakeId, 10); @@ -767,7 +767,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { } void func_8099803C(GlobalContext* globalCtx, s16 y, s16 countdown, s16 camId) { - s16 quakeId = Quake_Add(Gameplay_GetCamera(globalCtx, camId), 3); + s16 quakeId = Quake_Add(Play_GetCamera(globalCtx, camId), 3); func_800A9F6C(0.0f, 180, 20, 100); Quake_SetSpeed(quakeId, 20000); diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index e848e7eca8..72e7acec22 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -556,10 +556,10 @@ void func_80999EE0(DoorWarp1* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->rutoWarpState == WARP_BLUE_RUTO_STATE_3) { - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - sRutoWarpSubCamId = Gameplay_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + sRutoWarpSubCamId = Play_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, sRutoWarpSubCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, sRutoWarpSubCamId, CAM_STAT_ACTIVE); at.x = this->actor.world.pos.x; at.y = 49.0f; at.z = this->actor.world.pos.z; @@ -567,8 +567,8 @@ void func_80999EE0(DoorWarp1* this, GlobalContext* globalCtx) { eye.y = 43.0f; eye.z = player->actor.world.pos.z; - Gameplay_CameraSetAtEye(globalCtx, sRutoWarpSubCamId, &at, &eye); - Gameplay_CameraSetFov(globalCtx, sRutoWarpSubCamId, 90.0f); + Play_CameraSetAtEye(globalCtx, sRutoWarpSubCamId, &at, &eye); + Play_CameraSetFov(globalCtx, sRutoWarpSubCamId, 90.0f); this->rutoWarpState = WARP_BLUE_RUTO_STATE_TALKING; Message_StartTextbox(globalCtx, 0x4022, NULL); DoorWarp1_SetupAction(this, func_80999FE4); @@ -581,8 +581,8 @@ void func_80999FE4(DoorWarp1* this, GlobalContext* globalCtx) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); OnePointCutscene_Init(globalCtx, 0x25E9, 999, &this->actor, CAM_ID_MAIN); // Using `CAM_ID_NONE` here defaults to the active camera - Gameplay_CopyCamera(globalCtx, CAM_ID_NONE, sRutoWarpSubCamId); - Gameplay_ChangeCameraStatus(globalCtx, sRutoWarpSubCamId, CAM_STAT_WAIT); + Play_CopyCamera(globalCtx, CAM_ID_NONE, sRutoWarpSubCamId); + Play_ChangeCameraStatus(globalCtx, sRutoWarpSubCamId, CAM_STAT_WAIT); this->rutoWarpState = WARP_BLUE_RUTO_STATE_WARPING; DoorWarp1_SetupAction(this, DoorWarp1_RutoWarpOut); } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index b44ad431e9..3a4c33efa3 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -70,9 +70,9 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { func_8002DF54(globalCtx, NULL, 8); chu->timer = 1; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamAtMaxVelFrac.x = this->subCamAtMaxVelFrac.y = this->subCamAtMaxVelFrac.z = 0.1f; this->subCamEyeMaxVelFrac.x = this->subCamEyeMaxVelFrac.y = this->subCamEyeMaxVelFrac.z = 0.1f; @@ -101,7 +101,7 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { this->subCamAtVel.y = fabsf(this->subCamAt.y - this->subCamAtNext.y) * 0.02f; this->subCamAtVel.z = fabsf(this->subCamAt.z - this->subCamAtNext.z) * 0.02f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); this->actor.textId = 0xF; Message_StartTextbox(globalCtx, this->actor.textId, NULL); this->unk_154 = TEXT_STATE_EVENT; @@ -127,7 +127,7 @@ void EnBomBowlPit_CameraDollyIn(EnBomBowlPit* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamEye.z, this->subCamEyeNext.z, this->subCamEyeMaxVelFrac.z, this->subCamEyeVel.z); } - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); if ((this->unk_154 == Message_GetState(&globalCtx->msgCtx)) && Message_ShouldAdvance(globalCtx)) { Message_CloseTextbox(globalCtx); @@ -167,8 +167,8 @@ void EnBomBowlPit_SetupGivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) { break; } - Gameplay_ClearCamera(globalCtx, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, NULL, 8); this->actionFunc = EnBomBowlPit_GivePrize; } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index a252f6985c..dd1351aa34 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -590,9 +590,9 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) { // Initializes Arwing cutscene camera data. this->cutsceneMode = CLEAR_TAG_CUTSCENE_MODE_PLAY; func_80064520(globalCtx, &globalCtx->csCtx); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); case CLEAR_TAG_CUTSCENE_MODE_PLAY: // Update the Arwing cutscene camera to spin around in a circle. cutsceneTimer = this->frameCounter * 128; @@ -613,7 +613,7 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachF(&this->subCamAt.x, subCamAtNext.x, 0.2f, 500.0f); Math_ApproachF(&this->subCamAt.y, subCamAtNext.y, 0.2f, 500.0f); Math_ApproachF(&this->subCamAt.z, subCamAtNext.z, 0.2f, 500.0f); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } // Cutscene has finished. diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index d51e7fa3f0..5485bab99e 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -463,12 +463,12 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) { if (1) {} this->subCamAtNext.z = this->subCamAt.z = this->actor.world.pos.z; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); - Gameplay_CameraSetFov(globalCtx, this->subCamId, globalCtx->mainCamera.fov); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetFov(globalCtx, this->subCamId, globalCtx->mainCamera.fov); func_8002DF54(globalCtx, &this->actor, 1); } @@ -483,7 +483,7 @@ void EnDaiku_UpdateSubCamera(EnDaiku* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->subCamAt.y, this->subCamAtNext.y, 1.0f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->subCamAt.z, this->subCamAtNext.z, 1.0f, 1000.0f, 0.0f); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } void EnDaiku_EscapeSuccess(EnDaiku* this, GlobalContext* globalCtx) { @@ -491,8 +491,8 @@ void EnDaiku_EscapeSuccess(EnDaiku* this, GlobalContext* globalCtx) { Actor* gerudoGuard; Vec3f vec; - Gameplay_ClearCamera(globalCtx, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); this->subCamActive = false; if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX], diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 3181890ca5..2216cd17a4 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -125,7 +125,7 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, GlobalContext* globalCtx) { } s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, GlobalContext* globalCtx) { - if (gSaveContext.timer1State == 10 && !Gameplay_InCsMode(globalCtx)) { + if (gSaveContext.timer1State == 10 && !Play_InCsMode(globalCtx)) { // Failed. gSaveContext.timer1State = 0; func_800F5B58(); @@ -297,9 +297,9 @@ void func_809EE194(EnDivingGame* this, GlobalContext* globalCtx) { void EnDivingGame_SetupRupeeThrow(EnDivingGame* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->spawnRuppyTimer = 10; this->subCamAtNext.x = -210.0f; this->subCamAtNext.y = -80.0f; @@ -326,8 +326,8 @@ void EnDivingGame_SetupRupeeThrow(EnDivingGame* this, GlobalContext* globalCtx) this->subCamAtVel.x = fabsf(this->subCamAt.x - this->subCamAtNext.x) * 0.04f; this->subCamAtVel.y = fabsf(this->subCamAt.y - this->subCamAtNext.y) * 0.04f; this->subCamAtVel.z = fabsf(this->subCamAt.z - this->subCamAtNext.z) * 0.04f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); - Gameplay_CameraSetFov(globalCtx, this->subCamId, globalCtx->mainCamera.fov); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetFov(globalCtx, this->subCamId, globalCtx->mainCamera.fov); this->subCamTimer = 60; this->actionFunc = EnDivingGame_RupeeThrow; this->subCamVelFactor = 0.0f; @@ -352,7 +352,7 @@ void EnDivingGame_RupeeThrow(EnDivingGame* this, GlobalContext* globalCtx) { this->subCamAtVel.z * this->subCamVelFactor); Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, 0.02f); } - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); if (!this->allRupeesThrown && this->spawnRuppyTimer == 0) { this->spawnRuppyTimer = 5; EnDivingGame_SpawnRuppy(this, globalCtx); @@ -403,8 +403,8 @@ void EnDivingGame_SetupUnderwaterViewCs(EnDivingGame* this, GlobalContext* globa void func_809EE780(EnDivingGame* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->subCamTimer == 0) { - Gameplay_ClearCamera(globalCtx, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); this->actor.textId = 0x405A; Message_ContinueTextbox(globalCtx, this->actor.textId); this->unk_292 = TEXT_STATE_EVENT; diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 6cc12dd497..b26eda46d5 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -116,7 +116,7 @@ void EnDntJiji_Wait(EnDntJiji* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); - if ((this->timer == 1) && (this->actor.xzDistToPlayer < 150.0f) && !Gameplay_InCsMode(globalCtx) && + if ((this->timer == 1) && (this->actor.xzDistToPlayer < 150.0f) && !Play_InCsMode(globalCtx) && !(player->stateFlags1 & PLAYER_STATE1_11)) { OnePointCutscene_Init(globalCtx, 2230, -99, &this->actor, CAM_ID_MAIN); this->timer = 0; diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 06ca22eb0e..6ba2ba7d74 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -50,7 +50,7 @@ void EnEg_Init(Actor* thisx, GlobalContext* globalCtx) { void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) { if (!voided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) { // Void the player out - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); gSaveContext.respawnFlag = -2; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); globalCtx->transitionType = TRANS_TYPE_FADE_BLACK; 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 d90b3f7726..1225a0e3e5 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1418,7 +1418,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_elf.c", 2595); } - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { if (gSaveContext.naviTimer < 25800) { gSaveContext.naviTimer++; } else if (!(this->fairyFlags & 0x80)) { diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 1b91abdab5..fdde2ae4ba 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -177,7 +177,7 @@ void EnFhgFire_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnFhgFire_LightningStrike(EnFhgFire* this, GlobalContext* globalCtx) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); s16 i; switch (this->work[FHGFIRE_FIRE_MODE]) { diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 91a028a55a..8116f0c81a 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1460,9 +1460,9 @@ void EnGo2_GoronLinkAnimation(EnGo2* this, GlobalContext* globalCtx) { void EnGo2_GoronFireCamera(EnGo2* this, GlobalContext* globalCtx) { s16 yaw; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); Path_CopyLastPoint(this->path, &this->subCamAt); yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->subCamAt) + 0xE38; this->subCamEye.x = Math_SinS(yaw) * 100.0f + this->actor.world.pos.x; @@ -1471,12 +1471,12 @@ void EnGo2_GoronFireCamera(EnGo2* this, GlobalContext* globalCtx) { this->subCamAt.x = this->actor.world.pos.x; this->subCamAt.y = this->actor.world.pos.y + 40.0f; this->subCamAt.z = this->actor.world.pos.z; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } void EnGo2_GoronFireClearCamera(EnGo2* this, GlobalContext* globalCtx) { - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); } void EnGo2_BiggoronAnimation(EnGo2* this) { diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 48ed4d5ed0..67498710d6 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -220,7 +220,7 @@ void func_80A4E910(EnGs* this, GlobalContext* globalCtx) { this->unk_1EC = 0.0f; } else if ((this->unk_19F == 1) && (func_80A4E754(this, globalCtx, &this->unk_1E8, &this->unk_1EC, &this->unk_200, 0.8f, 0.007f, 0.001f, 7, 0) == 0.0f)) { - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { Message_StartTextbox(globalCtx, 0x71B1, NULL); } this->unk_19C = 0; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 34b4140263..fd333b3d71 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -308,9 +308,9 @@ void func_80A5372C(EnHeishi2* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f); this->unk_2F2[0] = 200; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEye.x = 947.0f; this->subCamEye.y = 1195.0f; this->subCamEye.z = 2682.0f; @@ -319,7 +319,7 @@ void func_80A5372C(EnHeishi2* this, GlobalContext* globalCtx) { this->subCamAt.y = 1145.0f; this->subCamAt.z = 3014.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); this->actionFunc = func_80A53850; } @@ -327,11 +327,11 @@ void func_80A53850(EnHeishi2* this, GlobalContext* globalCtx) { BgSpot15Saku* gate; SkelAnime_Update(&this->skelAnime); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); gate = (BgSpot15Saku*)this->gate; if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) { - Gameplay_ClearCamera(globalCtx, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); Message_CloseTextbox(globalCtx); this->unk_30C = 1; func_8002DF54(globalCtx, NULL, 7); @@ -472,9 +472,9 @@ void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f); this->unk_2F2[0] = 200; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamEyeInit.x = -71.0f; this->subCamEye.x = -71.0f; this->subCamEyeInit.y = 571.0f; @@ -487,7 +487,7 @@ void func_80A53DF8(EnHeishi2* this, GlobalContext* globalCtx) { this->subCamAt.y = 417.0f; this->subCamAtInit.z = -1079.0f; this->subCamAt.z = -1079.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); this->actionFunc = func_80A53F30; } @@ -495,11 +495,11 @@ void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx) { BgGateShutter* gate; SkelAnime_Update(&this->skelAnime); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamEye, &this->subCamAt); gate = (BgGateShutter*)this->gate; if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) { - Gameplay_ClearCamera(globalCtx, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); if (this->unk_30A != 2) { if (this->unk_30A == 0) { this->actor.textId = 0x2015; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index b91c11e349..92274e98bb 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1424,7 +1424,7 @@ void func_80A78160(EnIk* this, GlobalContext* globalCtx) { void func_80A781CC(Actor* thisx, GlobalContext* globalCtx) { EnIk* this = (EnIk*)thisx; - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { this->actor.update = EnIk_Update; this->actor.draw = EnIk_Draw; Cutscene_SetSegment(globalCtx, gSpiritBossNabooruKnuckleDefeatCs); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 9ed1bd5902..3e78dd988f 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -446,16 +446,16 @@ void func_80A79C78(EnIn* this, GlobalContext* globalCtx) { Vec3f subCamEye; Vec3s zeroVec = { 0, 0, 0 }; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); subCamAt.x = this->actor.world.pos.x; subCamAt.y = this->actor.world.pos.y + 60.0f; subCamAt.z = this->actor.world.pos.z; subCamEye.x = subCamAt.x; subCamEye.y = subCamAt.y - 22.0f; subCamEye.z = subCamAt.z + 40.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &subCamEye); this->unk_308.unk_08 = zeroVec; this->unk_308.unk_0E = zeroVec; @@ -762,10 +762,10 @@ void func_80A7AA40(EnIn* this, GlobalContext* globalCtx) { Vec3f subCamAt; Vec3f subCamEye; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); + this->subCamId = Play_CreateSubCamera(globalCtx); this->returnToCamId = globalCtx->activeCamId; - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->subCamAtOffset.x = 0.0f; this->subCamAtOffset.y = 50.0f; @@ -785,7 +785,7 @@ void func_80A7AA40(EnIn* this, GlobalContext* globalCtx) { subCamEye.y += this->subCamEyeOffset.y; subCamEye.z += this->subCamEyeOffset.z; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); this->actor.textId = 0x203B; Message_StartTextbox(globalCtx, this->actor.textId, NULL); this->unk_308.unk_00 = 1; @@ -849,13 +849,13 @@ void func_80A7ABD4(EnIn* this, GlobalContext* globalCtx) { subCamEye.x += this->subCamEyeOffset.x; subCamEye.y += this->subCamEyeOffset.y; subCamEye.z += this->subCamEyeOffset.z; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); } } void func_80A7AE84(EnIn* this, GlobalContext* globalCtx) { - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); func_8002DF54(globalCtx, &this->actor, 7); Interface_ChangeAlpha(0x32); this->actionFunc = func_80A7AEF0; diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index d2036cc5e1..58534a81b8 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -367,16 +367,16 @@ void EnKz_SetupMweep(EnKz* this, GlobalContext* globalCtx) { Vec3f subCamAt; Vec3f subCamEye; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); + this->subCamId = Play_CreateSubCamera(globalCtx); this->returnToCamId = globalCtx->activeCamId; - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); subCamAt = this->actor.world.pos; subCamEye = this->actor.home.pos; subCamAt.y += 60.0f; subCamEye.y += -100.0f; subCamEye.z += 260.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); func_8002DF54(globalCtx, &this->actor, 8); this->actor.speedXZ = 0.1f; this->actionFunc = EnKz_Mweep; @@ -392,7 +392,7 @@ void EnKz_Mweep(EnKz* this, GlobalContext* globalCtx) { subCamAt.y += 60.0f; subCamEye.y += -100.0f; subCamEye.z += 260.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); if ((EnKz_FollowPath(this, globalCtx) == 1) && (this->waypoint == 0)) { Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_1); Inventory_ReplaceItem(globalCtx, ITEM_LETTER_RUTO, ITEM_BOTTLE); @@ -407,8 +407,8 @@ void EnKz_Mweep(EnKz* this, GlobalContext* globalCtx) { } void EnKz_StopMweep(EnKz* this, GlobalContext* globalCtx) { - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); func_8002DF54(globalCtx, &this->actor, 7); this->actionFunc = EnKz_Wait; } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 8922514bd0..07e1bbbcb9 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -245,7 +245,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) { func_800F4254(&player->actor.projectedPos, 0); } - if (Gameplay_InCsMode(globalCtx)) { + if (Play_InCsMode(globalCtx)) { Actor_Kill(&this->actor); } } @@ -295,7 +295,7 @@ void func_80A9F9B4(EnMThunder* this, GlobalContext* globalCtx) { func_80A9F938(this, globalCtx); - if (Gameplay_InCsMode(globalCtx)) { + if (Play_InCsMode(globalCtx)) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 262197cf2c..30c6c0d14d 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -928,7 +928,7 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.xzDistToPlayer < 50.0f) { - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { owlType = (this->actor.params & 0xFC0) >> 6; osSyncPrintf(VT_FGCOL(CYAN)); osSyncPrintf("%dのフクロウ\n", owlType); // "%d owl" diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 6d145e0bb6..42ebc4eeeb 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -134,7 +134,7 @@ void EnPoDesert_WaitForPlayer(EnPoDesert* this, GlobalContext* globalCtx) { func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.lensActive)) { if (this->currentPathPoint == 2) { - if (Gameplay_InCsMode(globalCtx)) { + if (Play_InCsMode(globalCtx)) { this->actor.shape.rot.y += 0x800; return; } diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index c8b7aac4be..b317075944 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -855,7 +855,7 @@ void func_80AEC780(EnRu1* this, GlobalContext* globalCtx) { s32 pad; Player* player = GET_PLAYER(globalCtx); - if ((func_80AEC5FC(this, globalCtx)) && (!Gameplay_InCsMode(globalCtx)) && + if ((func_80AEC5FC(this, globalCtx)) && (!Play_InCsMode(globalCtx)) && (!(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 2274ded488..312552aea5 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -631,7 +631,7 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) { } void func_80AF3878(EnRu2* this, GlobalContext* globalCtx) { - if (func_80AF383C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) { + if (func_80AF383C(this, globalCtx) && !Play_InCsMode(globalCtx)) { this->action = 16; OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index abd2a77c32..55bda07a80 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -616,7 +616,7 @@ void func_80AF67D0(EnSa* this, GlobalContext* globalCtx) { void func_80AF683C(EnSa* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (!(player->actor.world.pos.z >= -2220.0f) && !Gameplay_InCsMode(globalCtx)) { + if (!(player->actor.world.pos.z >= -2220.0f) && !Play_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_scene_Cs_005730); gSaveContext.cutsceneTrigger = 1; this->actionFunc = func_80AF68E4; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 4316c2970e..1bf1f8a8f2 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -991,7 +991,7 @@ void func_80B0EEA4(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_sw.c", 2205); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_sw.c", 2207); } diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index a9c9756983..ae0422dac3 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -522,10 +522,10 @@ void func_80B14E28(EnTa* this, GlobalContext* globalCtx) { Vec3f subCamEye; Vec3f subCamAt; - this->subCamId = Gameplay_CreateSubCamera(globalCtx); + this->subCamId = Play_CreateSubCamera(globalCtx); this->returnToCamId = globalCtx->activeCamId; - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); subCamEye.x = 1053.0f; subCamEye.y = 11.0f; @@ -535,12 +535,12 @@ void func_80B14E28(EnTa* this, GlobalContext* globalCtx) { subCamAt.y = 45.0f; subCamAt.z = -40.0f; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); } void func_80B14EDC(EnTa* this, GlobalContext* globalCtx) { - Gameplay_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, this->subCamId); + Play_ChangeCameraStatus(globalCtx, this->returnToCamId, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); } void func_80B14F20(EnTa* this, EnTaActionFunc arg1) { @@ -737,7 +737,7 @@ void func_80B154FC(EnTa* this, GlobalContext* globalCtx) { func_800F5918(); } - if (gSaveContext.timer1Value == 0 && !Gameplay_InCsMode(globalCtx)) { + if (gSaveContext.timer1Value == 0 && !Play_InCsMode(globalCtx)) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); this->unk_2E0 &= ~0x200; func_80078884(NA_SE_SY_FOUND); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 2f8ca16a9b..6653e93a3e 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -215,7 +215,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sp5A = player->actor.shape.rot.y - this->actor.shape.rot.y; input->cur.button = 0; - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); attackItem = EnTorch2_GetAttackItem(globalCtx, this); switch (sActionState) { case ENTORCH2_WAIT: diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 004e59ba6a..0bbda6c5b0 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -467,7 +467,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { if (this->timer == 0x1E) { func_80078884(NA_SE_OC_ABYSS); - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); } } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 8f2716344c..5a91fa7486 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -218,7 +218,7 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) { } if (((this->actor.xzDistToPlayer < (40.0f + this->triggerRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && - !Gameplay_InCsMode(globalCtx)) { + !Play_InCsMode(globalCtx)) { if (this->unk_158 >= 2) { osSyncPrintf("\n\n"); // "Transparent Message Kimi Seto" 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 96c3cb8c7d..f6f1109448 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -288,7 +288,7 @@ s32 EnXc_MinuetCS(EnXc* this, GlobalContext* globalCtx) { f32 z = player->actor.world.pos.z; if (z < -2225.0f) { - if (!Gameplay_InCsMode(globalCtx)) { + if (!Play_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_50); @@ -319,7 +319,7 @@ s32 EnXc_BoleroCS(EnXc* this, GlobalContext* globalCtx) { posRot = &player->actor.world; if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) && (posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) && - !Gameplay_InCsMode(globalCtx)) { + !Play_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_51); @@ -349,7 +349,7 @@ s32 EnXc_SerenadeCS(EnXc* this, GlobalContext* globalCtx) { s32 stateFlags = player->stateFlags1; if (CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !GET_EVENTCHKINF(EVENTCHKINF_52) && - !(stateFlags & PLAYER_STATE1_29) && !Gameplay_InCsMode(globalCtx)) { + !(stateFlags & PLAYER_STATE1_29) && !Play_InCsMode(globalCtx)) { Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_52); // Learned Serenade of Water Flag diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index c1f2c94343..4ee1e6e2b7 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -169,17 +169,17 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) { if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) { Animation_Change(&this->skelAnime, &gChildZelda1Anim_10B38, 1.0f, 0.0f, Animation_GetLastFrame(&gChildZelda1Anim_10B38), ANIMMODE_ONCE_INTERP, -10.0f); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); func_800C0808(globalCtx, this->subCamId, player, CAM_SET_FREE0); globalCtx->envCtx.screenFillColor[0] = 255; globalCtx->envCtx.screenFillColor[1] = 255; globalCtx->envCtx.screenFillColor[2] = 255; globalCtx->envCtx.screenFillColor[3] = 24; globalCtx->envCtx.fillScreen = true; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); - Gameplay_CameraSetFov(globalCtx, this->subCamId, 30.0f); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetFov(globalCtx, this->subCamId, 30.0f); ShrinkWindow_SetVal(0x20); Interface_ChangeAlpha(2); player->actor.world.pos = playerPos; @@ -232,8 +232,8 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) { case 1: if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) { globalCtx->envCtx.fillScreen = false; - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); - Gameplay_CameraSetFov(globalCtx, this->subCamId, 25.0f); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetFov(globalCtx, this->subCamId, 25.0f); player->actor.world.pos = sp58; this->actor.textId = 0x702F; Message_ContinueTextbox(globalCtx, this->actor.textId); @@ -411,8 +411,8 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) { this->actor.velocity.z = (sp68.z - sp74.z) / actionLength; } func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); - Gameplay_CameraSetFov(globalCtx, this->subCamId, 70.0f); + Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye); + Play_CameraSetFov(globalCtx, this->subCamId, 70.0f); } } @@ -520,9 +520,9 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) { } case 2: if (Actor_HasParent(&this->actor, globalCtx)) { - Gameplay_CopyCamera(globalCtx, CAM_ID_MAIN, this->subCamId); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); - Gameplay_ClearCamera(globalCtx, this->subCamId); + Play_CopyCamera(globalCtx, CAM_ID_MAIN, this->subCamId); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE); + Play_ClearCamera(globalCtx, this->subCamId); this->actor.parent = NULL; this->unk_1E2++; } else { diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index cef02d2fcf..dd9db387fb 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -1786,7 +1786,7 @@ void func_80B5764C(EnZl3* this, GlobalContext* globalCtx) { if ((sceneNum == SCENE_GANON_SONOGO) && (func_80B54DB4(this) == 0x26)) { s32 unk_314 = this->unk_314 + 1; - if ((unk_314 == 1) && !Gameplay_InCsMode(globalCtx)) { + if ((unk_314 == 1) && !Play_InCsMode(globalCtx)) { OnePointCutscene_Init(globalCtx, 1000, 40, &this->actor, CAM_ID_MAIN); } } @@ -2019,7 +2019,7 @@ void func_80B57F1C(EnZl3* this, GlobalContext* globalCtx) { } s32 func_80B57F84(EnZl3* this, GlobalContext* globalCtx) { - if (func_80B575D0(this, globalCtx) && func_80B57C7C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) { + if (func_80B575D0(this, globalCtx) && func_80B57C7C(this, globalCtx) && !Play_InCsMode(globalCtx)) { func_80B54E14(this, &gZelda2Anime2Anim_009FBC, 0, -8.0f, 0); this->action = 36; this->unk_2EC = 0.0f; @@ -2041,7 +2041,7 @@ void func_80B58014(EnZl3* this, GlobalContext* globalCtx) { } else if (func_80B57C8C(this) && func_80B57F84(this, globalCtx)) { OnePointCutscene_Init(globalCtx, 4000, -99, &this->actor, CAM_ID_MAIN); this->unk_3D0 = 0; - } else if (func_80B576C8(this, globalCtx) && func_80B575B0(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) { + } else if (func_80B576C8(this, globalCtx) && func_80B575B0(this, globalCtx) && !Play_InCsMode(globalCtx)) { this->action = 0x1F; this->unk_3CC = 0.0f; func_80B537E8(this); @@ -2116,7 +2116,7 @@ void func_80B584B4(EnZl3* this, GlobalContext* globalCtx) { Actor* nearbyEnTest = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f); if (D_80B5A4BC == 0) { - if ((nearbyEnTest == NULL) && (!Gameplay_InCsMode(globalCtx))) { + if ((nearbyEnTest == NULL) && (!Play_InCsMode(globalCtx))) { this->action = 33; OnePointCutscene_Init(globalCtx, 4011, -99, &this->actor, CAM_ID_MAIN); } else if (invincibilityTimer > 0) { @@ -2125,7 +2125,7 @@ void func_80B584B4(EnZl3* this, GlobalContext* globalCtx) { func_80B56DC8(this); } } else { - if ((nearbyEnTest == NULL) && (!Gameplay_InCsMode(globalCtx))) { + if ((nearbyEnTest == NULL) && (!Play_InCsMode(globalCtx))) { func_80B54E14(this, &gZelda2Anime2Anim_007664, 0, -12.0f, 0); D_80B5A4BC = 0; this->action = 33; diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index baea6e6b5c..e72378ee4a 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -152,9 +152,9 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) { } func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); - this->subCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); + this->subCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, this->subCamId, CAM_STAT_ACTIVE); this->cutsceneState = INTRO_FENCE; this->timers[0] = 60; this->actor.world.pos.y = GND_BOSSROOM_CENTER_Y - 7.0f; @@ -391,7 +391,7 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) { Math_ApproachF(&this->subCamAt.y, (this->actor.world.pos.y + 70.0f) - 20.0f, 0.1f, this->subCamVelFactor * 10.0f); if (this->timers[1] == 0) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; @@ -405,7 +405,7 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) { break; } if (this->subCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); + Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye); } } @@ -723,6 +723,6 @@ void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx) { (u32)this->warpColorFilterB, 0, (s32)this->warpColorFilterUnk1 + 995, (s32)this->warpColorFilterUnk2 + 1000); func_800A6330(&this->actor, globalCtx, &this->skin, EnfHG_PostDraw, SKIN_TRANSFORM_IS_FHG); - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_fhg.c", 2480); } diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 337c554224..5d07edc003 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -5235,10 +5235,10 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { case 1: { Camera* mainCam; - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); sSubCamEye.x = mainCam->eye.x; sSubCamEye.y = mainCam->eye.y; sSubCamEye.z = mainCam->eye.z; @@ -5346,7 +5346,7 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { break; case 3: { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = sSubCamEye; mainCam->eyeNext = sSubCamEye; @@ -5366,11 +5366,11 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { Camera* mainCam; func_80064520(globalCtx, &globalCtx->csCtx); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, &this->actor, 5); - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); sSubCamEye.x = mainCam->eye.x; sSubCamEye.y = mainCam->eye.y; sSubCamEye.z = mainCam->eye.z; @@ -5388,7 +5388,7 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { player->actor.speedXZ = 0.0f; if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); mainCam->eye = sSubCamEye; mainCam->eyeNext = sSubCamEye; @@ -5408,11 +5408,11 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { Camera* mainCam; func_80064520(globalCtx, &globalCtx->csCtx); - sSubCamId = Gameplay_CreateSubCamera(globalCtx); - Gameplay_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); - Gameplay_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); + sSubCamId = Play_CreateSubCamera(globalCtx); + Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_WAIT); + Play_ChangeCameraStatus(globalCtx, sSubCamId, CAM_STAT_ACTIVE); func_8002DF54(globalCtx, &this->actor, 5); - mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); sSubCamEye.x = mainCam->eye.x; sSubCamEye.y = mainCam->eye.y; sSubCamEye.z = mainCam->eye.z; @@ -5486,7 +5486,7 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE) || (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE)) { if (Message_ShouldAdvance(globalCtx)) { - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); Message_CloseTextbox(globalCtx); if (globalCtx->msgCtx.choiceIndex == 0) { @@ -5518,7 +5518,7 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { } if (sSubCamId != SUB_CAM_ID_DONE) { - Gameplay_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); + Play_CameraSetAtEye(globalCtx, sSubCamId, &sSubCamAt, &sSubCamEye); Math_ApproachF(&sSubCamVelFactor, 1.0f, 1.0f, 0.02f); if (sSubCamEye.y <= (WATER_SURFACE_Y(globalCtx) + 1.0f)) { @@ -5646,7 +5646,7 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { if ((u8)D_80B7A650 > 0) { s32 pad; - Camera* mainCam = Gameplay_GetCamera(globalCtx, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN); s16 i; s32 pad1; Vec3f pos; diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 99f1729197..aacb2362e6 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -76,7 +76,7 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) { if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) { Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 59a3c72b77..7ab775688c 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1390,7 +1390,7 @@ void func_80832440(GlobalContext* globalCtx, Player* this) { this->unk_6AD = 0; func_80832340(globalCtx, this); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21); this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_18); @@ -2428,7 +2428,7 @@ s32 func_80834E7C(GlobalContext* globalCtx) { s32 func_80834EB8(Player* this, GlobalContext* globalCtx) { if ((this->unk_6AD == 0) || (this->unk_6AD == 2)) { if (func_80833BCC(this) || - (Camera_CheckValidMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_BOWARROW) == 0)) { + (Camera_CheckValidMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_BOWARROW) == 0)) { return 1; } this->unk_6AD = 2; @@ -2838,13 +2838,13 @@ void func_80835E44(GlobalContext* globalCtx, s16 camSetting) { Interface_ChangeAlpha(2); } } else { - Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), camSetting); + Camera_ChangeSetting(Play_GetCamera(globalCtx, CAM_ID_MAIN), camSetting); } } void func_80835EA4(GlobalContext* globalCtx, s32 arg1) { func_80835E44(globalCtx, CAM_SET_TURN_AROUND); - Camera_SetCameraData(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 4, 0, 0, arg1, 0, 0); + Camera_SetCameraData(Play_GetCamera(globalCtx, CAM_ID_MAIN), 4, 0, 0, arg1, 0, 0); } void func_80835EFC(Player* this) { @@ -3786,7 +3786,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { func_80832698(this, NA_SE_VO_LI_DAMAGE_S); if (sp68) { - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); Scene_SetTransitionForNextEntrance(globalCtx); } else { // Special case for getting crushed in Forest Temple's Checkboard Ceiling Hall or Shadow Temple's @@ -3803,12 +3803,12 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { respawnInfo = &fallingSpikeTrapRespawn; } - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); gSaveContext.respawn[RESPAWN_MODE_DOWN].pos = respawnInfo->pos; gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw = respawnInfo->yaw; } - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); } func_80832698(this, NA_SE_VO_LI_TAKEN_AWAY); @@ -4066,7 +4066,7 @@ void func_80838F5C(GlobalContext* globalCtx, Player* this) { this->stateFlags1 |= PLAYER_STATE1_29 | PLAYER_STATE1_31; - Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_FREE0); + Camera_ChangeSetting(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_FREE0); } s32 func_80838FB8(GlobalContext* globalCtx, Player* this) { @@ -4158,7 +4158,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u } if (exitIndex == 0) { - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); Scene_SetTransitionForNextEntrance(globalCtx); } else { globalCtx->nextEntranceIndex = globalCtx->setupExitList[exitIndex - 1]; @@ -4176,7 +4176,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u } else { if (SurfaceType_GetSlope(&globalCtx->colCtx, poly, bgId) == 2) { gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = globalCtx->nextEntranceIndex; - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); gSaveContext.respawnFlag = -2; } gSaveContext.unk_13C3 = 1; @@ -4238,9 +4238,9 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->unk_A7A == 5) { - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); } else { - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); } globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST; func_80078884(NA_SE_OC_ABYSS); @@ -4444,7 +4444,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { gSaveContext.entranceSound = NA_SE_OC_DOOR_OPEN; } } else { - Camera_ChangeDoorCam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), doorActor, + Camera_ChangeDoorCam(Play_GetCamera(globalCtx, CAM_ID_MAIN), doorActor, globalCtx->transiActorCtx.list[(u16)doorActor->params >> 10] .sides[(doorDirection > 0) ? 0 : 1] .effects, @@ -4834,7 +4834,7 @@ s32 func_8083AD4C(GlobalContext* globalCtx, Player* this) { cameraMode = CAM_MODE_FIRSTPERSON; } - return Camera_ChangeMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), cameraMode); + return Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), cameraMode); } s32 func_8083ADD4(GlobalContext* globalCtx, Player* this) { @@ -5019,7 +5019,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { func_80835EA4(globalCtx, (this->unk_6A8 != NULL) ? 0x5B : 0x5A); if (this->unk_6A8 != NULL) { this->stateFlags2 |= PLAYER_STATE2_25; - Camera_SetParam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->unk_6A8); + Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->unk_6A8); } } } else if (func_8083AD4C(globalCtx, this)) { @@ -5126,7 +5126,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { s32 func_8083B8F4(Player* this, GlobalContext* globalCtx) { if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) && - Camera_CheckValidMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_FIRSTPERSON)) { + Camera_CheckValidMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_FIRSTPERSON)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) { this->unk_6AD = 1; @@ -6168,7 +6168,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_808322D0(globalCtx, this, this->ageProperties->unk_98); func_80832F54(globalCtx, this, 0x28F); chest->unk_1F4 = 1; - Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_SLOW_CHEST_CS); + Camera_ChangeSetting(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_SLOW_CHEST_CS); } else { func_80832264(globalCtx, this, &gPlayerAnim_002DF8); chest->unk_1F4 = -1; @@ -7621,7 +7621,7 @@ void func_8084279C(Player* this, GlobalContext* globalCtx) { } this->actor.flags &= ~ACTOR_FLAG_8; - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } } @@ -7652,7 +7652,7 @@ s32 func_80842964(Player* this, GlobalContext* globalCtx) { } void func_808429B4(GlobalContext* globalCtx, s32 speed, s32 y, s32 countdown) { - s32 quakeIdx = Quake_Add(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 3); + s32 quakeIdx = Quake_Add(Play_GetCamera(globalCtx, CAM_ID_MAIN), 3); Quake_SetSpeed(quakeIdx, speed); Quake_SetQuakeValues(quakeIdx, y, 0, 0, 0); @@ -8824,7 +8824,7 @@ s32 func_80845BA0(GlobalContext* arg0, Player* arg1, f32* arg2, s32 arg3) { s32 func_80845C68(GlobalContext* globalCtx, s32 arg1) { if (arg1 == 0) { - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); } gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 0; return arg1; @@ -8876,9 +8876,9 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { temp = func_80845BA0(globalCtx, this, &sp34, sp30); if ((this->unk_850 == 0) || ((temp == 0) && (this->linearVelocity == 0.0f) && - (Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)->unk_14C & 0x10))) { + (Play_GetCamera(globalCtx, CAM_ID_MAIN)->unk_14C & 0x10))) { - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); func_80845C68(globalCtx, gSaveContext.respawn[RESPAWN_MODE_DOWN].data); if (!func_8083B644(this, globalCtx)) { @@ -8912,8 +8912,8 @@ void func_80845EF8(Player* this, GlobalContext* globalCtx) { if (globalCtx->roomCtx.prevRoom.num >= 0) { func_80097534(globalCtx, &globalCtx->roomCtx); } - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); } return; } @@ -9897,11 +9897,11 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) { seqMode = SEQ_MODE_DEFAULT; if (this->csMode != 0) { - Camera_ChangeMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_NORMAL); + Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_NORMAL); } else if (!(this->stateFlags1 & PLAYER_STATE1_20)) { if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) { camMode = CAM_MODE_HOOKSHOT; - Camera_SetParam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->actor.parent); + Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->actor.parent); } else if (func_8084377C == this->func_674) { camMode = CAM_MODE_STILL; } else if (this->stateFlags2 & PLAYER_STATE2_8) { @@ -9918,12 +9918,12 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) { } else { camMode = CAM_MODE_BATTLE; } - Camera_SetParam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 8, unk_664); + Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, unk_664); } else if (this->stateFlags1 & PLAYER_STATE1_12) { camMode = CAM_MODE_CHARGE; } else if (this->stateFlags1 & PLAYER_STATE1_25) { camMode = CAM_MODE_FOLLOWBOOMERANG; - Camera_SetParam(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->boomerangActor); + Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, this->boomerangActor); } else if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) { if (func_80833B2C(this)) { camMode = CAM_MODE_HANGZ; @@ -9958,7 +9958,7 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) { } } - Camera_ChangeMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), camMode); + Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), camMode); } else { // First person mode seqMode = SEQ_MODE_STILL; @@ -10736,7 +10736,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) { Player_DrawGameplay(globalCtx, this, lod, gCullBackDList, overrideLimbDraw); if (this->invincibilityTimer > 0) { - POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); + POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP); } if (this->stateFlags2 & PLAYER_STATE2_14) { @@ -10977,7 +10977,7 @@ void func_8084B530(Player* this, GlobalContext* globalCtx) { this->stateFlags2 &= ~PLAYER_STATE2_13; } - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); if (!func_8084B4D4(globalCtx, this) && !func_8084B3CC(globalCtx, this) && !func_8083ADD4(globalCtx, this)) { if ((this->targetActor != this->interactRangeActor) || !func_8083E5A8(this, globalCtx)) { @@ -11798,7 +11798,7 @@ void func_8084D3E4(Player* this, GlobalContext* globalCtx) { gSaveContext.horseData.angle = rideActor->actor.shape.rot.y; } } else { - Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_NORMAL0); + Camera_ChangeSetting(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_SET_NORMAL0); if (this->mountSide < 0) { D_808549C4[0].field = 0x2828; @@ -12047,7 +12047,7 @@ void func_8084DF6C(GlobalContext* globalCtx, Player* this) { this->unk_862 = 0; this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); this->getItemId = GI_NONE; - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } void func_8084DFAC(GlobalContext* globalCtx, Player* this) { @@ -12170,7 +12170,7 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) { } if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_04) { - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); if ((this->targetActor != NULL) && (this->targetActor == this->unk_6A8)) { func_80853148(globalCtx, this->targetActor); @@ -12380,7 +12380,7 @@ void func_8084EAC0(Player* this, GlobalContext* globalCtx) { } func_8083C0E8(this, globalCtx); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } else if (this->unk_850 == 1) { if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.unk_13F0 != 9)) { func_80832B78(globalCtx, this, &gPlayerAnim_002660); @@ -12417,7 +12417,7 @@ void func_8084ECA4(Player* this, GlobalContext* globalCtx) { this->unk_850 = 1; } else if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) { this->unk_84F = 0; - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } } else { func_8083C0E8(this, globalCtx); @@ -12467,7 +12467,7 @@ static Vec3f D_80854A1C = { 0.0f, 0.0f, 5.0f }; void func_8084EED8(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_8083C0E8(this, globalCtx); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); return; } @@ -12497,7 +12497,7 @@ void func_8084EFC0(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_8083C0E8(this, globalCtx); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); return; } @@ -12565,7 +12565,7 @@ void func_8084F104(Player* this, GlobalContext* globalCtx) { func_8083C0E8(this, globalCtx); } - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } } } else if (this->unk_850 >= 0) { @@ -12709,12 +12709,12 @@ void func_8084F88C(Player* this, GlobalContext* globalCtx) { if (this->unk_84F != 0) { if (globalCtx->sceneNum == 9) { - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); globalCtx->nextEntranceIndex = ENTR_ICE_DOUKUTO_0; } else if (this->unk_84F < 0) { - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); } else { - Gameplay_TriggerVoidOut(globalCtx); + Play_TriggerVoidOut(globalCtx); } globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST; @@ -12813,7 +12813,7 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { D_808535D0 ^= 1; if (D_808535D0) { - Camera_ChangeMode(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_BOWARROWZ); + Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_BOWARROWZ); } } @@ -13059,7 +13059,7 @@ void func_8085063C(Player* this, GlobalContext* globalCtx) { } func_80853080(this, globalCtx); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } } @@ -13125,7 +13125,7 @@ void func_808507F4(Player* this, GlobalContext* globalCtx) { if (this->unk_84F < 0) { if ((this->itemActionParam == PLAYER_AP_NAYRUS_LOVE) || (gSaveContext.unk_13F0 == 0)) { func_80839FFC(this, globalCtx); - func_8005B1A4(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + func_8005B1A4(Play_GetCamera(globalCtx, CAM_ID_MAIN)); } } else { if (this->unk_850 == 0) { @@ -13155,7 +13155,7 @@ void func_808507F4(Player* this, GlobalContext* globalCtx) { if (this->unk_850 == 0) { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 1; - Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_TOP, 0x6FF); + Play_SetupRespawnPoint(globalCtx, RESPAWN_MODE_TOP, 0x6FF); gSaveContext.fw.set = 1; gSaveContext.fw.pos.x = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x; gSaveContext.fw.pos.y = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index 1cd208be4a..6379fd2111 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -92,7 +92,7 @@ void EffectSsSibuki_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) this->rMoveDelay--; if (this->rMoveDelay == 0) { - yaw = Camera_GetInputDirYaw(Gameplay_GetCamera(globalCtx, CAM_ID_MAIN)); + yaw = Camera_GetInputDirYaw(Play_GetCamera(globalCtx, CAM_ID_MAIN)); xzVelScale = ((200.0f + KREG(20)) * 0.01f) + ((0.1f * Rand_ZeroOne()) * (KREG(23) + 20.0f)); if (this->rDirection != 0) { diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index b855b1a17d..01efdabac8 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1454,7 +1454,7 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.fileNum = this->buttonIndex; Sram_OpenSave(&this->sramCtx); gSaveContext.gameMode = 0; - SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); this->state.running = false; } diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index a4afdd6a19..389e3fa2fd 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -13,7 +13,7 @@ void Opening_SetupTitleScreen(OpeningContext* this) { Sram_InitDebugSave(); gSaveContext.cutsceneIndex = 0xFFF3; gSaveContext.sceneSetupIndex = 7; - SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); } void func_80803C5C(OpeningContext* this) { diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index bd2cb5886e..d312ac9d38 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -37,7 +37,7 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { gSaveContext.showTitleCard = true; gWeatherMode = 0; this->state.running = false; - SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); + SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext); } // "Translation" (Actual name) diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index cbee122c4a..67b9e84dbb 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3056,7 +3056,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Gameplay_SaveSceneFlags(globalCtx); + Play_SaveSceneFlags(globalCtx); gSaveContext.savedSceneNum = globalCtx->sceneNum; Sram_WriteSave(&globalCtx->sramCtx); pauseCtx->unk_1EC = 4; @@ -3294,7 +3294,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->promptChoice = 0; - Gameplay_SaveSceneFlags(globalCtx); + Play_SaveSceneFlags(globalCtx); gSaveContext.savedSceneNum = globalCtx->sceneNum; Sram_WriteSave(&globalCtx->sramCtx); pauseCtx->state = 0xF; @@ -3321,7 +3321,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) { if (pauseCtx->promptChoice == 0) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Gameplay_SaveSceneFlags(globalCtx); + Play_SaveSceneFlags(globalCtx); switch (gSaveContext.entranceIndex) { case ENTR_YDAN_0: @@ -3397,7 +3397,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) { func_800981B8(&globalCtx->objectCtx); func_800418D0(&globalCtx->colCtx, globalCtx); if (pauseCtx->promptChoice == 0) { - Gameplay_TriggerRespawn(globalCtx); + Play_TriggerRespawn(globalCtx); gSaveContext.respawnFlag = -2; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; gSaveContext.health = 0x30;