1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

More Camera Flags (#1453)

* Generic Camera Flags

* New flag names

* Add flags to functions

* Finish flag docs

* More docs

* More cleanup

* More clarity

* Better shrinkwindow flag docs

* Improve name

* CAM_INTERFACE_FLAGS

* Better approach to edge cases

* Change ordering for consistency

* Oops

* Add masks to macro

* PR/Discord discussions

* cleanup comment

* Oops

* PR Suggestions

* More PR Feedback

* More PR Suggestions

* More Camera Flags

* PR Suggestions

* More flag style change

* Small cleanup

* More flag docs

* Another flag

* Fix flags

* sync names with other PRs

* more fixes

* fix comments

* update with hud visibility mode docs

* missed one

* fix comments

* Roman PR Suggestions

* interfaceField

* small fix

* letterbox cleanup

* cleanup

* fix macro arg

* fix func declaration

* many more docs

* better docs?

* missed some

* oops, revert

* add flags to name

* cleanup

* flag

* double signal

* simplify cam func name

* more suggestions

* PR Suggestion
This commit is contained in:
engineer124 2023-11-19 12:17:32 +11:00 committed by GitHub
parent d1df4e4c7e
commit 81a3c3da32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 531 additions and 461 deletions

View File

@ -380,7 +380,7 @@ void func_80A87CEC(EnJj *this, PlayState *play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = (u8)1U; gSaveContext.cutsceneTrigger = (u8)1U;
func_8003EBF8(play, &play->colCtx.dyna, (s32) temp_v1->bgId); func_8003EBF8(play, &play->colCtx.dyna, (s32) temp_v1->bgId);
func_8005B1A4(play->cameraPtrs[play->activeCamId]); Camera_SetFinishedFlag(play->cameraPtrs[play->activeCamId]);
gSaveContext.unkEDA = (u16) (gSaveContext.unkEDA | 0x400); gSaveContext.unkEDA = (u16) (gSaveContext.unkEDA | 0x400);
Sfx_PlaySfxCentered((u16)0x4802U); Sfx_PlaySfxCentered((u16)0x4802U);
} }
@ -396,7 +396,7 @@ Easy things to sort out:
- `play->cameraPtrs[play->activeCamId]` has a macro: it is `GET_ACTIVE_CAM(play)`, so this line can be written as - `play->cameraPtrs[play->activeCamId]` has a macro: it is `GET_ACTIVE_CAM(play)`, so this line can be written as
```C ```C
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
``` ```
- `gSaveContext.unkEDA` we have dealt with before: it is `gSaveContext.save.info.eventChkInf[3]`. This is a flag-setting function; it can be written more compactly as - `gSaveContext.unkEDA` we have dealt with before: it is `gSaveContext.save.info.eventChkInf[3]`. This is a flag-setting function; it can be written more compactly as
@ -418,13 +418,13 @@ void func_80A87CEC(EnJj *this, PlayState *play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
func_8003EBF8(play, &play->colCtx.dyna, child->bgId); func_8003EBF8(play, &play->colCtx.dyna, child->bgId);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
gSaveContext.save.info.eventChkInf[3] |= 0x400; gSaveContext.save.info.eventChkInf[3] |= 0x400;
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} }
``` ```
matches, but generates a complier warning for `func_8005B1A4`, which it can't find. To fix this, add it to `functions.h`, in as near as possible the correct position in numerical order. Some detective work with VSCode's Search shows that this function lives in `z_camera.c`, and its prototype is `s16 func_8005B1A4(Camera* camera)`, so add this line to `functions.h` at the bottom of the camera functions part. matches, but generates a complier warning for `Camera_SetFinishedFlag`, which it can't find. To fix this, add it to `functions.h`, in as near as possible the correct position in numerical order. Some detective work with VSCode's Search shows that this function lives in `z_camera.c`, and its prototype is `s16 Camera_SetFinishedFlag(Camera* camera)`, so add this line to `functions.h` at the bottom of the camera functions part.
Lastly, we prefer to limit use of early `return`s, and use `else`s instead if possible. That applies here: the function can be rewritten as Lastly, we prefer to limit use of early `return`s, and use `else`s instead if possible. That applies here: the function can be rewritten as
```C ```C
@ -437,7 +437,7 @@ void func_80A87CEC(EnJj* this, PlayState* play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
func_8003EBF8(play, &play->colCtx.dyna, child->bgId); func_8003EBF8(play, &play->colCtx.dyna, child->bgId);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
gSaveContext.save.info.eventChkInf[3] |= 0x400; gSaveContext.save.info.eventChkInf[3] |= 0x400;
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} }

View File

@ -634,10 +634,10 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player);
s16 Camera_ChangeStatus(Camera* camera, s16 status); s16 Camera_ChangeStatus(Camera* camera, s16 status);
Vec3s Camera_Update(Camera* camera); Vec3s Camera_Update(Camera* camera);
void Camera_Finish(Camera* camera); void Camera_Finish(Camera* camera);
s32 Camera_ChangeMode(Camera* camera, s16 mode); s32 Camera_RequestMode(Camera* camera, s16 mode);
s32 Camera_CheckValidMode(Camera* camera, s16 mode); s32 Camera_CheckValidMode(Camera* camera, s16 mode);
s32 Camera_ChangeSetting(Camera* camera, s16 setting); s32 Camera_RequestSetting(Camera* camera, s16 setting);
s32 Camera_ChangeBgCamIndex(Camera* camera, s32 bgCamIndex); s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex);
s16 Camera_GetInputDirYaw(Camera* camera); s16 Camera_GetInputDirYaw(Camera* camera);
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera); Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera);
s16 Camera_GetCamDirPitch(Camera* camera); s16 Camera_GetCamDirPitch(Camera* camera);
@ -657,7 +657,7 @@ Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera);
void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3,
UNK_TYPE arg6); UNK_TYPE arg6);
s32 func_8005B198(void); s32 func_8005B198(void);
s16 func_8005B1A4(Camera* camera); s16 Camera_SetFinishedFlag(Camera* camera);
DamageTable* DamageTable_Get(s32 index); DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* table); void DamageTable_Clear(DamageTable* table);
void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
@ -1271,7 +1271,7 @@ s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov);
s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll);
void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId); void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId);
s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s16 setting); s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s16 setting);
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting); s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting);
void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration); void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration);
void Play_SaveSceneFlags(PlayState* this); void Play_SaveSceneFlags(PlayState* this);
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams); void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams);

View File

@ -84,33 +84,33 @@
#define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \ #define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \
(((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF)) (((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF))
// Camera behaviorFlags. Flags specifically for settings, modes, and bgCam // Camera behaviorFlags. Flags specifically for settings, modes, and bgCam. Reset every frame.
// Used to store current state, only CAM_BEHAVIOR_SETTING_1 and CAM_BEHAVIOR_BG_2 are read from and used in logic // Used to store current state, only CAM_BEHAVIOR_SETTING_CHECK_PRIORITY and CAM_BEHAVIOR_BG_PROCESSED are read from and used in logic
// Setting (0x1, 0x10) // Setting (0x1, 0x10)
#define CAM_BEHAVIOR_SETTING_1 (1 << 0) #define CAM_BEHAVIOR_SETTING_CHECK_PRIORITY (1 << 0)
#define CAM_BEHAVIOR_SETTING_2 (1 << 4) #define CAM_BEHAVIOR_SETTING_VALID (1 << 4) // Set when a valid camera setting is requested
// Mode (0x2, 0x20) // Mode (0x2, 0x20)
#define CAM_BEHAVIOR_MODE_1 (1 << 1) #define CAM_BEHAVIOR_MODE_SUCCESS (1 << 1) // Set when the camera mode is the requested mode
#define CAM_BEHAVIOR_MODE_2 (1 << 5) #define CAM_BEHAVIOR_MODE_VALID (1 << 5) // Set when a valid camera mode is requested
// bgCam (0x4, 0x40) // bgCam (0x4, 0x40)
#define CAM_BEHAVIOR_BG_1 (1 << 2) #define CAM_BEHAVIOR_BG_SUCCESS (1 << 2)
#define CAM_BEHAVIOR_BG_2 (1 << 6) #define CAM_BEHAVIOR_BG_PROCESSED (1 << 6)
// Camera stateFlags. Variety of generic flags // Camera stateFlags. Variety of generic flags
#define CAM_STATE_0 (1 << 0) // Must be set for the camera to change settings based on the bg surface #define CAM_STATE_CHECK_BG_ALT (1 << 0) // Must be set for the camera to change settings based on the bg surface
#define CAM_STATE_1 (1 << 1) // Must be set for Camera_UpdateWater to run #define CAM_STATE_CHECK_WATER (1 << 1) // Must be set for Camera_UpdateWater to run
#define CAM_STATE_2 (1 << 2) #define CAM_STATE_CHECK_BG (1 << 2) // Must be set for the camera to change settings based on the bg surface
#define CAM_STATE_3 (1 << 3) // Customizable flag for different functions #define CAM_STATE_EXTERNAL_FINISHED (1 << 3) // Signal from the external systems to camera that the current cam-update function is no longer needed
#define CAM_STATE_4 (1 << 4) #define CAM_STATE_CAM_FUNC_FINISH (1 << 4) // Signal from camera to player that the cam-update function is finished its primary purpose
#define CAM_STATE_5 (1 << 5) #define CAM_STATE_LOCK_MODE (1 << 5) // Prevents camera from changing mode, unless overriden by `forceModeChange` passed to `Camera_RequestModeImpl`
#define CAM_STATE_6 (1 << 6) #define CAM_STATE_DISTORTION (1 << 6) // Set when camera distortion is on
#define CAM_STATE_7 (1 << 7) // Set in play, unused #define CAM_STATE_PLAY_INIT (1 << 7) // Set in Play_Init, never used or changed
#define CAM_STATE_8 (1 << 8) // Camera (eye) is underwater #define CAM_STATE_CAMERA_IN_WATER (1 << 8) // Camera (eye) is underwater
#define CAM_STATE_9 (1 << 9) #define CAM_STATE_PLAYER_IN_WATER (1 << 9) // Player is swimming in water
#define CAM_STATE_10 (1 << 10) // Prevents the camera from changing settings based on the bg surface #define CAM_STATE_BLOCK_BG (1 << 10) // Prevents the camera from changing settings based on the bg surface for 1 frame
#define CAM_STATE_12 (1 << 12) // Set in Camera_Demo7, but Camera_Demo7 is never called #define CAM_STATE_DEMO7 (1 << 12) // Set in Camera_Demo7, but this function is never called
#define CAM_STATE_14 (1 << 14) // isInitialized. Turned on in Camera Init, never used or changed #define CAM_STATE_CAM_INIT (1 << 14) // Set in Camera_Init, never used or changed
#define CAM_STATE_15 ((s16)(1 << 15)) #define CAM_STATE_PLAYER_DIVING ((s16)(1 << 15)) // Diving from the surface of the water down
// Camera viewFlags. Set params related to view // Camera viewFlags. Set params related to view
#define CAM_VIEW_AT (1 << 0) // camera->at #define CAM_VIEW_AT (1 << 0) // camera->at

View File

@ -1039,7 +1039,7 @@ void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB) {
void func_8002DE74(PlayState* play, Player* player) { void func_8002DE74(PlayState* play, Player* player) {
if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) { if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE);
} }
} }
@ -2985,7 +2985,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
if ((player != NULL) && (actor == player->unk_664)) { if ((player != NULL) && (actor == player->unk_664)) {
func_8008EDF0(player); func_8008EDF0(player);
Camera_ChangeMode(Play_GetCamera(play, Play_GetActiveCamId(play)), 0); Camera_RequestMode(Play_GetCamera(play, Play_GetActiveCamId(play)), CAM_MODE_NORMAL);
} }
if (actor == actorCtx->targetCtx.arrowPointedActor) { if (actor == actorCtx->targetCtx.arrowPointedActor) {

File diff suppressed because it is too large Load Diff

View File

@ -1530,7 +1530,7 @@ s32 CutsceneCmd_UpdateCamEyeSpline(PlayState* play, CutsceneContext* csCtx, u8*
csCtx->camEyeSplinePointsAppliedFrame = cmd->startFrame; csCtx->camEyeSplinePointsAppliedFrame = cmd->startFrame;
if (gUseCutsceneCam) { if (gUseCutsceneCam) {
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0);
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId)); Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
@ -1569,7 +1569,7 @@ s32 CutsceneCmd_UpdateCamAtSpline(PlayState* play, CutsceneContext* csCtx, u8* s
gCamAtSplinePointsAppliedFrame = cmd->startFrame; gCamAtSplinePointsAppliedFrame = cmd->startFrame;
if (gUseCutsceneCam) { if (gUseCutsceneCam) {
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0);
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId)); Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
@ -1616,7 +1616,7 @@ s32 CutsceneCmd_SetCamEye(PlayState* play, CutsceneContext* csCtx, u8* script, u
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0);
roll = csCtx->camAtPoints->cameraRoll * 1.40625f; roll = csCtx->camAtPoints->cameraRoll * 1.40625f;
Camera_SetViewParam(subCam, CAM_VIEW_ROLL, &roll); Camera_SetViewParam(subCam, CAM_VIEW_ROLL, &roll);
@ -1664,7 +1664,7 @@ s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0);
at.x = csCtx->camAtPoints->pos.x; at.x = csCtx->camAtPoints->pos.x;
at.y = csCtx->camAtPoints->pos.y; at.y = csCtx->camAtPoints->pos.y;
@ -2254,7 +2254,7 @@ void CutsceneHandler_StopScript(PlayState* play, CutsceneContext* csCtx) {
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_ACTIVE);
Play_ClearCamera(play, csCtx->subCamId); Play_ClearCamera(play, csCtx->subCamId);
func_8005B1A4(play->cameraPtrs[sReturnToCamId]); Camera_SetFinishedFlag(play->cameraPtrs[sReturnToCamId]);
} }
Audio_SetCutsceneFlag(0); Audio_SetCutsceneFlag(0);

View File

@ -1703,7 +1703,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx)
Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Vec3f windDirection = { 0.0f, 0.0f, 0.0f };
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8) && if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER) &&
(play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) { (play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) {
OPEN_DISPS(gfxCtx, "../z_kankyo.c", 2799); OPEN_DISPS(gfxCtx, "../z_kankyo.c", 2799);

View File

@ -318,7 +318,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.pitch = 0x3E8; spD0.pitch = 0x3E8;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
subCam->roll = 0; subCam->roll = 0;
@ -344,22 +344,22 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 1010: case 1010:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &childCam->at, &childCam->eye); Play_SetCameraAtEye(play, subCamId, &childCam->at, &childCam->eye);
Play_SetCameraFov(play, subCamId, childCam->fov); Play_SetCameraFov(play, subCamId, childCam->fov);
Play_SetCameraRoll(play, subCamId, childCam->roll); Play_SetCameraRoll(play, subCamId, childCam->roll);
break; break;
case 9601: // Leaving a crawlspace forwards case 9601: // Leaving a crawlspace forwards
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Play_ChangeCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting); Play_RequestCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer, OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
sCrawlspaceAtPoints, sCrawlspaceForwardsEyePoints); sCrawlspaceAtPoints, sCrawlspaceForwardsEyePoints);
break; break;
case 9602: // Leaving a crawlspace backwards case 9602: // Leaving a crawlspace backwards
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Play_ChangeCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting); Play_RequestCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer, OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints); sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints);
break; break;
@ -378,7 +378,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = -1979.0f; spB4.x = -1979.0f;
spB4.y = 703.0f; spB4.y = 703.0f;
spB4.z = -269.0f; spB4.z = -269.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 6; subCam->roll = 6;
subCam->fov = 75.0f; subCam->fov = 75.0f;
@ -486,7 +486,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3050: case 3050:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5); Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5);
OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C);
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
@ -514,7 +514,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
case 3120: case 3120:
csInfo->keyFrames = D_80121954[-(timer + 101)]; csInfo->keyFrames = D_80121954[-(timer + 101)];
subCam->timer = 100; subCam->timer = 100;
subCam->stateFlags |= CAM_STATE_1; subCam->stateFlags |= CAM_STATE_CHECK_WATER;
csInfo->keyFrameCount = ARRAY_COUNT(D_80121954[0]); csInfo->keyFrameCount = ARRAY_COUNT(D_80121954[0]);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
@ -527,7 +527,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
subCam->stateFlags |= CAM_STATE_1; subCam->stateFlags |= CAM_STATE_CHECK_WATER;
break; break;
case 3140: case 3140:
@ -548,7 +548,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = 1729.0f; spB4.x = 1729.0f;
spB4.y = 995.0f; spB4.y = 995.0f;
spB4.z = -1405.0f; spB4.z = -1405.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0x50; subCam->roll = 0x50;
subCam->fov = 55.0f; subCam->fov = 55.0f;
@ -564,7 +564,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
Actor_GetWorld(&spA0, &player->actor); Actor_GetWorld(&spA0, &player->actor);
spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0; spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Play_CopyCamera(play, CAM_ID_MAIN, subCamId); Play_CopyCamera(play, CAM_ID_MAIN, subCamId);
subCam->roll = -1; subCam->roll = -1;
@ -579,7 +579,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.r = 150.0f; spD0.r = 150.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 55.0f; subCam->fov = 55.0f;
@ -594,7 +594,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.pitch = -0xAF0; spD0.pitch = -0xAF0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 60.0f; subCam->fov = 60.0f;
@ -602,8 +602,8 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3190: case 3190:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FOREST_DEFEAT_POE); Play_RequestCameraSetting(play, subCamId, CAM_SET_FOREST_DEFEAT_POE);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Player_SetCsAction(play, actor, PLAYER_CSACTION_12); Player_SetCsAction(play, actor, PLAYER_CSACTION_12);
break; break;
@ -614,7 +614,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = 80.0f; spB4.x = 80.0f;
spB4.y = 445.0f; spB4.y = 445.0f;
spB4.z = -1425.0f; spB4.z = -1425.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0x1E; subCam->roll = 0x1E;
subCam->fov = 75.0f; subCam->fov = 75.0f;
@ -644,7 +644,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.yaw = spA0.rot.y + 0x7FFF; spD0.yaw = spA0.rot.y + 0x7FFF;
spD0.r = 300.0f; spD0.r = 300.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 45.0f; subCam->fov = 45.0f;
@ -679,7 +679,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 6001: case 6001:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Actor_GetWorld(&spA0, actor); Actor_GetWorld(&spA0, actor);
if (spA0.pos.z > -750.0f) { if (spA0.pos.z > -750.0f) {
@ -695,7 +695,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3400: case 3400:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
OnePointCutscene_SetCsCamPoints(subCam, D_8012069C | 0x2000, D_80120698, D_801204D4, D_801205B4); OnePointCutscene_SetCsCamPoints(subCam, D_8012069C | 0x2000, D_80120698, D_801204D4, D_801205B4);
OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos);
@ -718,7 +718,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3310: case 3310:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FIRE_STAIRCASE); Play_RequestCameraSetting(play, subCamId, CAM_SET_FIRE_STAIRCASE);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Play_CopyCamera(play, subCamId, CAM_ID_MAIN); Play_CopyCamera(play, subCamId, CAM_ID_MAIN);
@ -884,7 +884,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_801227B4); csInfo->keyFrameCount = ARRAY_COUNT(D_801227B4);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
break; break;
case 4150: case 4150:
@ -892,7 +892,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_801228A4); csInfo->keyFrameCount = ARRAY_COUNT(D_801228A4);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -901,7 +901,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_8012296C); csInfo->keyFrameCount = ARRAY_COUNT(D_8012296C);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -910,7 +910,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122A0C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122A0C);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -919,7 +919,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122A5C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122A5C);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -928,7 +928,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122B9C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122B9C);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -1041,7 +1041,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
subCam->data2 = 0xC; subCam->data2 = 0xC;
} else { } else {
Play_CopyCamera(play, subCamId, CAM_ID_MAIN); Play_CopyCamera(play, subCamId, CAM_ID_MAIN);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
} }
break; break;
@ -1358,7 +1358,7 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) {
parentCam = play->cameraPtrs[CAM_ID_MAIN]; parentCam = play->cameraPtrs[CAM_ID_MAIN];
if (parentCam->mode == CAM_MODE_FOLLOW_BOOMERANG) { if (parentCam->mode == CAM_MODE_FOLLOW_BOOMERANG) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "actor attention demo camera: change mode BOOKEEPON -> NORMAL\n" VT_RST); osSyncPrintf(VT_COL(YELLOW, BLACK) "actor attention demo camera: change mode BOOKEEPON -> NORMAL\n" VT_RST);
Camera_ChangeMode(parentCam, CAM_MODE_NORMAL); Camera_RequestMode(parentCam, CAM_MODE_NORMAL);
} }
// Finds the camera of the first actor attention demo with a lower category actor, or the first non-attention demo // Finds the camera of the first actor attention demo with a lower category actor, or the first non-attention demo

View File

@ -25,8 +25,8 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
} \ } \
} while (0) } while (0)
void Play_ChangeViewpointBgCamIndex(PlayState* this) { void Play_RequestViewpointBgCam(PlayState* this) {
Camera_ChangeBgCamIndex(GET_ACTIVE_CAM(this), this->viewpoint - 1); Camera_RequestBgCam(GET_ACTIVE_CAM(this), this->viewpoint - 1);
} }
void Play_SetViewpoint(PlayState* this, s16 viewpoint) { void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
@ -42,7 +42,7 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
Play_ChangeViewpointBgCamIndex(this); Play_RequestViewpointBgCam(this);
} }
/** /**
@ -255,8 +255,9 @@ void Play_Init(GameState* thisx) {
this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera; this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera;
this->cameraPtrs[CAM_ID_MAIN]->uid = 0; this->cameraPtrs[CAM_ID_MAIN]->uid = 0;
this->activeCamId = CAM_ID_MAIN; this->activeCamId = CAM_ID_MAIN;
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_0 | CAM_STATE_1 | CAM_STATE_2 | CAM_STATE_3 | CAM_STATE_4 | Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
CAM_STATE_5 | CAM_STATE_6 | CAM_STATE_7); CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
Sram_Init(this, &this->sramCtx); Sram_Init(this, &this->sramCtx);
Regs_InitData(this); Regs_InitData(this);
Message_Init(this); Message_Init(this);
@ -412,12 +413,12 @@ void Play_Init(GameState* thisx) {
player = GET_PLAYER(this); player = GET_PLAYER(this);
Camera_InitDataUsingPlayer(&this->mainCamera, player); Camera_InitDataUsingPlayer(&this->mainCamera, player);
Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL); Camera_RequestMode(&this->mainCamera, CAM_MODE_NORMAL);
playerStartBgCamIndex = player->actor.params & 0xFF; playerStartBgCamIndex = player->actor.params & 0xFF;
if (playerStartBgCamIndex != 0xFF) { if (playerStartBgCamIndex != 0xFF) {
osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex);
Camera_ChangeBgCamIndex(&this->mainCamera, playerStartBgCamIndex); Camera_RequestBgCam(&this->mainCamera, playerStartBgCamIndex);
} }
if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) { if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) {
@ -943,7 +944,7 @@ void Play_Update(PlayState* this) {
} }
} }
Play_ChangeViewpointBgCamIndex(this); Play_RequestViewpointBgCam(this);
} }
PLAY_LOG(3708); PLAY_LOG(3708);
@ -1643,11 +1644,11 @@ s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s
camera = this->cameraPtrs[camIdx]; camera = this->cameraPtrs[camIdx];
Camera_InitDataUsingPlayer(camera, player); Camera_InitDataUsingPlayer(camera, player);
return Camera_ChangeSetting(camera, setting); return Camera_RequestSetting(camera, setting);
} }
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting) { s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting) {
return Camera_ChangeSetting(Play_GetCamera(this, camId), setting); return Camera_RequestSetting(Play_GetCamera(this, camId), setting);
} }
/** /**

View File

@ -626,7 +626,7 @@ void func_8008EEAC(PlayState* play, Actor* actor) {
this->unk_684 = actor; this->unk_684 = actor;
this->stateFlags1 |= PLAYER_STATE1_16; this->stateFlags1 |= PLAYER_STATE1_16;
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor);
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY);
} }
s32 func_8008EF30(PlayState* play) { s32 func_8008EF30(PlayState* play) {

View File

@ -241,7 +241,7 @@ void func_8086C29C(BgBdanObjects* this, PlayState* play) {
BgBdanObjects_SetContactRu1(this, 4); BgBdanObjects_SetContactRu1(this, 4);
this->timer = 10; this->timer = 10;
this->actionFunc = func_8086C55C; this->actionFunc = func_8086C55C;
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
} }
} }
@ -354,12 +354,12 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
if (this->switchFlag == 0) { if (this->switchFlag == 0) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->cameraSetting = play->cameraPtrs[CAM_ID_MAIN]->setting; this->cameraSetting = play->cameraPtrs[CAM_ID_MAIN]->setting;
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2);
Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2); Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG);
this->switchFlag = 10; this->switchFlag = 10;
} }
} else { } else {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2);
if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->switchFlag != 0) { if (this->switchFlag != 0) {
this->switchFlag--; this->switchFlag--;
@ -367,8 +367,8 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
} }
if (this->switchFlag == 0) { if (this->switchFlag == 0) {
if (1) {} if (1) {}
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], this->cameraSetting); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], this->cameraSetting);
Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2); Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG);
} }
} }
this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y =

View File

@ -501,7 +501,7 @@ void BgDyYoseizo_SayFarewell_NoReward(BgDyYoseizo* this, PlayState* play) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
this->mouthState = 0; this->mouthState = 0;
this->actionFunc = BgDyYoseizo_SetupSpinShrink; this->actionFunc = BgDyYoseizo_SetupSpinShrink;
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
} }
BgDyYoseizo_Bob(this, play); BgDyYoseizo_Bob(this, play);

View File

@ -129,10 +129,10 @@ void BgHidanFslift_Update(Actor* thisx, PlayState* play) {
if (this->unk_16A == 0) { if (this->unk_16A == 0) {
this->unk_16A = 3; this->unk_16A = 3;
} }
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM);
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_16A != 0) { if (this->unk_16A != 0) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
this->unk_16A = 0; this->unk_16A = 0;
} }

View File

@ -264,10 +264,10 @@ void func_8088B79C(BgHidanRock* this, PlayState* play) {
if (this->unk_169 == 0) { if (this->unk_169 == 0) {
this->unk_169 = 3; this->unk_169 = 3;
} }
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM);
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 != 0) { if (this->unk_169 != 0) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
this->unk_169 = 0; this->unk_169 = 0;
} }
@ -317,10 +317,10 @@ void func_8088B990(BgHidanRock* this, PlayState* play) {
if (this->unk_169 == 0) { if (this->unk_169 == 0) {
this->unk_169 = 3; this->unk_169 = 3;
} }
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM);
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 != 0) { if (this->unk_169 != 0) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
this->unk_169 = 0; this->unk_169 = 0;
} }

View File

@ -112,10 +112,10 @@ void BgHidanSyoku_Update(Actor* thisx, PlayState* play) {
if (this->unk_168 == 0) { if (this->unk_168 == 0) {
this->unk_168 = 3; this->unk_168 = 3;
} }
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM);
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_168 != 0) { if (this->unk_168 != 0) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
this->unk_168 = 0; this->unk_168 = 0;
} }

View File

@ -189,9 +189,9 @@ void BgJya1flift_Update(Actor* thisx, PlayState* play2) {
tempIsRiding = DynaPolyActor_IsPlayerOnTop(&this->dyna) ? true : false; tempIsRiding = DynaPolyActor_IsPlayerOnTop(&this->dyna) ? true : false;
if ((this->actionFunc == BgJya1flift_Move) || (this->actionFunc == BgJya1flift_DelayMove)) { if ((this->actionFunc == BgJya1flift_Move) || (this->actionFunc == BgJya1flift_DelayMove)) {
if (tempIsRiding) { if (tempIsRiding) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_ELEVATOR_PLATFORM);
} else if (!tempIsRiding && this->isLinkRiding) { } else if (!tempIsRiding && this->isLinkRiding) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
} }
this->isLinkRiding = tempIsRiding; this->isLinkRiding = tempIsRiding;

View File

@ -113,7 +113,7 @@ void BgJyaLift_Move(BgJyaLift* this, PlayState* play) {
tempVelocity = (this->dyna.actor.velocity.y < 0.2f) ? 0.2f : this->dyna.actor.velocity.y; tempVelocity = (this->dyna.actor.velocity.y < 0.2f) ? 0.2f : this->dyna.actor.velocity.y;
distFromBottom = Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f); distFromBottom = Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f);
if ((this->dyna.actor.world.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.prevPos.y)) { if ((this->dyna.actor.world.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.prevPos.y)) {
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
} }
if (fabsf(distFromBottom) < 0.001f) { if (fabsf(distFromBottom) < 0.001f) {
BgJyaLift_SetFinalPosY(this); BgJyaLift_SetFinalPosY(this);
@ -136,11 +136,11 @@ void BgJyaLift_Update(Actor* thisx, PlayState* play2) {
this->actionFunc(this, play); this->actionFunc(this, play);
} }
if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) && !(this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE)) { if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) && !(this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE)) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DIRECTED_YAW); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DIRECTED_YAW);
} else if (!(this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) && } else if (!(this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) &&
(this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE) && (this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE) &&
(play->cameraPtrs[CAM_ID_MAIN]->setting == CAM_SET_DIRECTED_YAW)) { (play->cameraPtrs[CAM_ID_MAIN]->setting == CAM_SET_DIRECTED_YAW)) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
this->unk_16B = this->dyna.interactFlags; this->unk_16B = this->dyna.interactFlags;

View File

@ -169,7 +169,7 @@ void func_808A3C8C(BgMoriHineri* this, PlayState* play) {
f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z); f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z);
this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f; this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f;
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1);
if (this->dyna.actor.params != 0) { if (this->dyna.actor.params != 0) {
this->dyna.actor.shape.rot.z = -this->dyna.actor.shape.rot.z; this->dyna.actor.shape.rot.z = -this->dyna.actor.shape.rot.z;
} }

View File

@ -210,11 +210,11 @@ void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play) {
osSyncPrintf("camera changed (mori rakka tenjyo) ... \n"); osSyncPrintf("camera changed (mori rakka tenjyo) ... \n");
sCamSetting = play->cameraPtrs[CAM_ID_MAIN]->setting; sCamSetting = play->cameraPtrs[CAM_ID_MAIN]->setting;
Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 1, &this->dyna.actor, NULL, 0, 0, 0); Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 1, &this->dyna.actor, NULL, 0, 0, 0);
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FOREST_BIRDS_EYE); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FOREST_BIRDS_EYE);
} }
} else if (sCamSetting != CAM_SET_NONE) { } else if (sCamSetting != CAM_SET_NONE) {
osSyncPrintf("camera changed (previous) ... \n"); osSyncPrintf("camera changed (previous) ... \n");
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1);
sCamSetting = CAM_SET_NONE; sCamSetting = CAM_SET_NONE;
} }
} }

View File

@ -61,9 +61,9 @@ void BgSstFloor_Update(Actor* thisx, PlayState* play) {
if (1) {} if (1) {}
if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (this->dyna.actor.yDistToPlayer < 1000.0f)) { if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (this->dyna.actor.yDistToPlayer < 1000.0f)) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BOSS_BONGO); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BOSS_BONGO);
} else { } else {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
} }
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && (player->fallDistance > 1000.0f)) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && (player->fallDistance > 1000.0f)) {

View File

@ -640,8 +640,8 @@ void func_809BE26C(EnBigokuta* this, PlayState* play) {
} }
if (this->unk_198 == 0 && Math_StepToF(&this->actor.scale.y, 0.0f, 0.001f)) { if (this->unk_198 == 0 && Math_StepToF(&this->actor.scale.y, 0.0f, 0.001f)) {
Flags_SetClear(play, this->actor.room); Flags_SetClear(play, this->actor.room);
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2); Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
@ -777,8 +777,8 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play2) {
this->actionFunc(this, play); this->actionFunc(this, play);
func_809BD2E4(this); func_809BD2E4(this);
func_809BE568(this); func_809BE568(this);
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO);
Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2); Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG);
if (this->cylinder[0].base.atFlags & AT_ON) { if (this->cylinder[0].base.atFlags & AT_ON) {
if (this->actionFunc != func_809BE058) { if (this->actionFunc != func_809BE058) {

View File

@ -449,7 +449,7 @@ void EnBomBowlMan_BeginPlayGame(EnBomBowlMan* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == this->dialogState) && Message_ShouldAdvance(play)) { if ((Message_GetState(&play->msgCtx) == this->dialogState) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
this->startedPlaying = true; this->startedPlaying = true;
if (BREG(2)) { if (BREG(2)) {

View File

@ -251,7 +251,7 @@ void EnDntJiji_Talk(EnDntJiji* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x1388, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x1388, 0);
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
Message_CloseTextbox(play); Message_CloseTextbox(play);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7);
this->actor.parent = NULL; this->actor.parent = NULL;

View File

@ -337,7 +337,7 @@ void EnDntNomal_TargetTalk(EnDntNomal* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
GET_ACTIVE_CAM(play)->csId = 0; GET_ACTIVE_CAM(play)->csId = 0;
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
this->actionFunc = EnDntNomal_SetupTargetGivePrize; this->actionFunc = EnDntNomal_SetupTargetGivePrize;

View File

@ -384,7 +384,7 @@ void func_809FE6CC(EnDu* this, PlayState* play) {
void func_809FE740(EnDu* this, PlayState* play) { void func_809FE740(EnDu* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
this->unk_1E2 = 0x5A; this->unk_1E2 = 0x5A;
EnDu_SetupAction(this, func_809FE798); EnDu_SetupAction(this, func_809FE798);
} }

View File

@ -429,13 +429,13 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) {
xyzDistSq = (this->actor.scale.x / 0.01f) * SQ(100.0f); xyzDistSq = (this->actor.scale.x / 0.01f) * SQ(100.0f);
if ((this->actor.params & 0xF0) == 0x90) { if ((this->actor.params & 0xF0) == 0x90) {
Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW);
xyzDistSq *= 4.8f; xyzDistSq *= 4.8f;
} }
if (fabsf(this->actor.xyzDistToPlayerSq) > xyzDistSq) { if (fabsf(this->actor.xyzDistToPlayerSq) > xyzDistSq) {
if (mainCam->setting == CAM_SET_DIRECTED_YAW) { if (mainCam->setting == CAM_SET_DIRECTED_YAW) {
Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); Camera_RequestSetting(mainCam, CAM_SET_NORMAL0);
} }
return 0; return 0;
} else { } else {

View File

@ -1163,11 +1163,11 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) {
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
if (EnGo2_IsWakingUp(this)) { if (EnGo2_IsWakingUp(this)) {
Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW);
Camera_UnsetStateFlag(mainCam, CAM_STATE_2); Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG);
} else if (!EnGo2_IsWakingUp(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) { } else if (!EnGo2_IsWakingUp(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) {
Camera_ChangeSetting(mainCam, CAM_SET_DUNGEON1); Camera_RequestSetting(mainCam, CAM_SET_DUNGEON1);
Camera_SetStateFlag(mainCam, CAM_STATE_2); Camera_SetStateFlag(mainCam, CAM_STATE_CHECK_BG);
} }
} }
@ -1839,7 +1839,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) {
case 1: case 1:
if (DECR(this->animTimer)) { if (DECR(this->animTimer)) {
if (this->animTimer == 60 || this->animTimer == 120) { if (this->animTimer == 60 || this->animTimer == 120) {
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
func_800F4524(&gSfxDefaultPos, NA_SE_EV_GORON_WATER_DROP, 60); func_800F4524(&gSfxDefaultPos, NA_SE_EV_GORON_WATER_DROP, 60);
} }
} else { } else {

View File

@ -1747,7 +1747,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
// Focus the camera on Epona // Focus the camera on Epona
Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor); Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor);
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND);
Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0); Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0);
} }
} }
@ -1821,7 +1821,7 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) {
this->followTimer = 0; this->followTimer = 0;
EnHorse_SetFollowAnimation(this, play); EnHorse_SetFollowAnimation(this, play);
Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor); Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor);
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND);
Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0); Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0);
} }
} else { } else {

View File

@ -218,7 +218,7 @@ void EnJj_BeginCutscene(EnJj* this, PlayState* play) {
play->csCtx.script = D_80A88164; play->csCtx.script = D_80A88164;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
DynaPoly_DisableCollision(play, &play->colCtx.dyna, bodyCollisionActor->bgId); DynaPoly_DisableCollision(play, &play->colCtx.dyna, bodyCollisionActor->bgId);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
SET_EVENTCHKINF(EVENTCHKINF_3A); SET_EVENTCHKINF(EVENTCHKINF_3A);
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} }

View File

@ -264,7 +264,7 @@ void func_80A8F9C8(EnKakasi* this, PlayState* play) {
if (this->unk_196 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { if (this->unk_196 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
if (this->subCamId != CAM_ID_NONE) { if (this->subCamId != CAM_ID_NONE) {
func_8005B1A4(play->cameraPtrs[this->subCamId]); Camera_SetFinishedFlag(play->cameraPtrs[this->subCamId]);
} }
this->subCamId = OnePointCutscene_Init(play, 2270, -99, &this->actor, CAM_ID_MAIN); this->subCamId = OnePointCutscene_Init(play, 2270, -99, &this->actor, CAM_ID_MAIN);
play->msgCtx.msgMode = MSGMODE_PAUSED; play->msgCtx.msgMode = MSGMODE_PAUSED;
@ -296,7 +296,7 @@ void func_80A8FAA4(EnKakasi* this, PlayState* play) {
OnePointCutscene_EndCutscene(play, this->subCamId); OnePointCutscene_EndCutscene(play, this->subCamId);
this->subCamId = CAM_ID_NONE; this->subCamId = CAM_ID_NONE;
this->subCamId = OnePointCutscene_Init(play, 2260, -99, &this->actor, CAM_ID_MAIN); this->subCamId = OnePointCutscene_Init(play, 2260, -99, &this->actor, CAM_ID_MAIN);
func_8005B1A4(play->cameraPtrs[this->subCamId]); Camera_SetFinishedFlag(play->cameraPtrs[this->subCamId]);
} }
} }
@ -305,7 +305,7 @@ void func_80A8FBB8(EnKakasi* this, PlayState* play) {
SkelAnime_Update(&this->skelanime); SkelAnime_Update(&this->skelanime);
if (this->unk_196 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { if (this->unk_196 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
func_8005B1A4(play->cameraPtrs[this->subCamId]); Camera_SetFinishedFlag(play->cameraPtrs[this->subCamId]);
Message_CloseTextbox(play); Message_CloseTextbox(play);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7);
this->actionFunc = func_80A8F660; this->actionFunc = func_80A8F660;

View File

@ -286,7 +286,7 @@ void func_80A91620(EnKakasi3* this, PlayState* play) {
this->subCamId = CAM_ID_NONE; this->subCamId = CAM_ID_NONE;
} }
if (this->subCamId != CAM_ID_NONE) { if (this->subCamId != CAM_ID_NONE) {
func_8005B1A4(play->cameraPtrs[this->subCamId]); Camera_SetFinishedFlag(play->cameraPtrs[this->subCamId]);
} }
this->actionFunc = func_80A911F0; this->actionFunc = func_80A911F0;
return; return;
@ -394,7 +394,7 @@ void func_80A91A90(EnKakasi3* this, PlayState* play) {
this->subCamId = CAM_ID_NONE; this->subCamId = CAM_ID_NONE;
} }
if (this->subCamId != CAM_ID_NONE) { if (this->subCamId != CAM_ID_NONE) {
func_8005B1A4(play->cameraPtrs[this->subCamId]); Camera_SetFinishedFlag(play->cameraPtrs[this->subCamId]);
} }
Message_CloseTextbox(play); Message_CloseTextbox(play);
play->msgCtx.ocarinaMode = OCARINA_MODE_04; play->msgCtx.ocarinaMode = OCARINA_MODE_04;

View File

@ -677,7 +677,7 @@ void func_80AF39DC(EnRu2* this, PlayState* play) {
player = GET_PLAYER(play); player = GET_PLAYER(play);
// "uorya-!" (screeming sound) // "uorya-!" (screeming sound)
osSyncPrintf("うおりゃー! \n"); osSyncPrintf("うおりゃー! \n");
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
player->actor.world.pos.x = 820.0f; player->actor.world.pos.x = 820.0f;
player->actor.world.pos.y = 0.0f; player->actor.world.pos.y = 0.0f;
player->actor.world.pos.z = 180.0f; player->actor.world.pos.z = 180.0f;
@ -688,7 +688,7 @@ void func_80AF39DC(EnRu2* this, PlayState* play) {
this->unk_2C3 = dialogState; this->unk_2C3 = dialogState;
if (Message_GetState(msgCtx) == TEXT_STATE_CLOSING) { if (Message_GetState(msgCtx) == TEXT_STATE_CLOSING) {
this->action = 18; this->action = 18;
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
} }
} }

View File

@ -2088,7 +2088,7 @@ void func_80B582C8(EnZl3* this, PlayState* play) {
*unk_3CC += 1.0f; *unk_3CC += 1.0f;
func_80B57858(play); func_80B57858(play);
} else if (*unk_3CC == kREG(17) + 40.0f) { } else if (*unk_3CC == kREG(17) + 40.0f) {
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
*unk_3CC += 1.0f; *unk_3CC += 1.0f;
} else if (*unk_3CC >= ((kREG(17) + 40.0f) + 1.0f)) { } else if (*unk_3CC >= ((kREG(17) + 40.0f) + 1.0f)) {
this->action = 32; this->action = 32;
@ -2153,7 +2153,7 @@ void func_80B58624(EnZl3* this, PlayState* play) {
} else { } else {
if (*unk_3CC >= kREG(20) + 30.0f) { if (*unk_3CC >= kREG(20) + 30.0f) {
this->action = 28; this->action = 28;
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
func_80B54E14(this, &gZelda2Anime2Anim_009FBC, 0, -12.0f, 0); func_80B54E14(this, &gZelda2Anime2Anim_009FBC, 0, -12.0f, 0);
*unk_3CC = 0.0f; *unk_3CC = 0.0f;
} else { } else {

View File

@ -181,7 +181,7 @@ static AnimationInfo sAnimationInfo[] = {
void EnZl4_SetActiveCamDir(PlayState* play, s16 index) { void EnZl4_SetActiveCamDir(PlayState* play, s16 index) {
Camera* activeCam = GET_ACTIVE_CAM(play); Camera* activeCam = GET_ACTIVE_CAM(play);
Camera_ChangeSetting(activeCam, CAM_SET_FREE0); Camera_RequestSetting(activeCam, CAM_SET_FREE0);
activeCam->at = sCamDirections[index].at; activeCam->at = sCamDirections[index].at;
activeCam->eye = activeCam->eyeNext = sCamDirections[index].eye; activeCam->eye = activeCam->eyeNext = sCamDirections[index].eye;
activeCam->roll = sCamDirections[index].roll; activeCam->roll = sCamDirections[index].roll;
@ -192,7 +192,7 @@ void EnZl4_SetActiveCamMove(PlayState* play, s16 index) {
Camera* activeCam = GET_ACTIVE_CAM(play); Camera* activeCam = GET_ACTIVE_CAM(play);
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Camera_ChangeSetting(activeCam, CAM_SET_CS_0); Camera_RequestSetting(activeCam, CAM_SET_CS_0);
Camera_ResetAnim(activeCam); Camera_ResetAnim(activeCam);
Camera_SetCSParams(activeCam, sCamMove[index].atPoints, sCamMove[index].eyePoints, player, Camera_SetCSParams(activeCam, sCamMove[index].atPoints, sCamMove[index].eyePoints, player,
sCamMove[index].relativeToPlayer); sCamMove[index].relativeToPlayer);
@ -1111,7 +1111,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) {
if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play))) { if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play))) {
break; break;
} else { } else {
Camera_ChangeSetting(GET_ACTIVE_CAM(play), CAM_SET_NORMAL0); Camera_RequestSetting(GET_ACTIVE_CAM(play), CAM_SET_NORMAL0);
this->talkState = 7; this->talkState = 7;
play->talkWithPlayer(play, &this->actor); play->talkWithPlayer(play, &this->actor);
Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f, Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f,

View File

@ -753,9 +753,9 @@ void ObjBean_WaitForPlayer(ObjBean* this, PlayState* play) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
ObjBean_SetupFly(this); ObjBean_SetupFly(this);
if (play->sceneId == SCENE_LOST_WOODS) { if (play->sceneId == SCENE_LOST_WOODS) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS);
} else { } else {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC);
} }
} }
ObjBean_UpdatePosition(this); ObjBean_UpdatePosition(this);
@ -781,7 +781,7 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) {
mainCam = play->cameraPtrs[CAM_ID_MAIN]; mainCam = play->cameraPtrs[CAM_ID_MAIN];
if ((mainCam->setting == CAM_SET_BEAN_LOST_WOODS) || (mainCam->setting == CAM_SET_BEAN_GENERIC)) { if ((mainCam->setting == CAM_SET_BEAN_LOST_WOODS) || (mainCam->setting == CAM_SET_BEAN_GENERIC)) {
Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); Camera_RequestSetting(mainCam, CAM_SET_NORMAL0);
} }
} else if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { } else if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
@ -789,15 +789,15 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) {
func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG);
if (play->sceneId == SCENE_LOST_WOODS) { if (play->sceneId == SCENE_LOST_WOODS) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS);
} else { } else {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC);
} }
} else if (this->stateFlags & BEAN_STATE_PLAYER_ON_TOP) { } else if (this->stateFlags & BEAN_STATE_PLAYER_ON_TOP) {
mainCam = play->cameraPtrs[CAM_ID_MAIN]; mainCam = play->cameraPtrs[CAM_ID_MAIN];
if ((mainCam->setting == CAM_SET_BEAN_LOST_WOODS) || (mainCam->setting == CAM_SET_BEAN_GENERIC)) { if ((mainCam->setting == CAM_SET_BEAN_LOST_WOODS) || (mainCam->setting == CAM_SET_BEAN_GENERIC)) {
Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); Camera_RequestSetting(mainCam, CAM_SET_NORMAL0);
} }
} }

View File

@ -501,7 +501,7 @@ void ObjectKankyo_DrawFairies(Actor* thisx, PlayState* play2) {
Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; Vec3f vec2 = { 0.0f, 0.0f, 0.0f };
s16 i; s16 i;
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8)) { if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER)) {
OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 807); OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 807);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex)); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex));
@ -596,7 +596,7 @@ void ObjectKankyo_DrawSnow(Actor* thisx, PlayState* play2) {
s32 pad; s32 pad;
s32 pad2; s32 pad2;
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8)) { if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER)) {
OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 958); OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 958);
if (play->envCtx.precipitation[PRECIP_SNOW_CUR] < play->envCtx.precipitation[PRECIP_SNOW_MAX]) { if (play->envCtx.precipitation[PRECIP_SNOW_CUR] < play->envCtx.precipitation[PRECIP_SNOW_MAX]) {
if (play->state.frames % 16 == 0) { if (play->state.frames % 16 == 0) {

View File

@ -1694,7 +1694,7 @@ void func_80832440(PlayState* play, Player* this) {
this->unk_6AD = 0; this->unk_6AD = 0;
func_80832340(play, this); func_80832340(play, this);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21); this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21);
this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_CRAWLING); this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_CRAWLING);
@ -3184,7 +3184,7 @@ void func_80835E44(PlayState* play, s16 camSetting) {
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
} }
} else { } else {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), camSetting); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), camSetting);
} }
} }
@ -4588,7 +4588,7 @@ void func_80838F5C(PlayState* play, Player* this) {
this->stateFlags1 |= PLAYER_STATE1_29 | PLAYER_STATE1_31; this->stateFlags1 |= PLAYER_STATE1_29 | PLAYER_STATE1_31;
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_FREE0); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_FREE0);
} }
s32 func_80838FB8(PlayState* play, Player* this) { s32 func_80838FB8(PlayState* play, Player* this) {
@ -5368,23 +5368,23 @@ void func_8083AA10(Player* this, PlayState* play) {
} }
s32 func_8083AD4C(PlayState* play, Player* this) { s32 func_8083AD4C(PlayState* play, Player* this) {
s32 cameraMode; s32 camMode;
if (this->unk_6AD == 2) { if (this->unk_6AD == 2) {
if (func_8002DD6C(this)) { if (func_8002DD6C(this)) {
if (LINK_IS_ADULT) { if (LINK_IS_ADULT) {
cameraMode = CAM_MODE_AIM_ADULT; camMode = CAM_MODE_AIM_ADULT;
} else { } else {
cameraMode = CAM_MODE_AIM_CHILD; camMode = CAM_MODE_AIM_CHILD;
} }
} else { } else {
cameraMode = CAM_MODE_AIM_BOOMERANG; camMode = CAM_MODE_AIM_BOOMERANG;
} }
} else { } else {
cameraMode = CAM_MODE_FIRST_PERSON; camMode = CAM_MODE_FIRST_PERSON;
} }
return Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), cameraMode); return Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), camMode);
} }
/** /**
@ -5615,7 +5615,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) {
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->unk_6A8); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->unk_6A8);
} }
} }
} else if (func_8083AD4C(play, this)) { } else if (func_8083AD4C(play, this) != CAM_MODE_NORMAL) {
if (!(this->stateFlags1 & PLAYER_STATE1_23)) { if (!(this->stateFlags1 & PLAYER_STATE1_23)) {
Player_SetupAction(play, this, Player_Action_8084B1D8, 1); Player_SetupAction(play, this, Player_Action_8084B1D8, 1);
this->av2.actionVar2 = 13; this->av2.actionVar2 = 13;
@ -6770,7 +6770,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) {
ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE |
ANIM_FLAG_PLAYER_7); ANIM_FLAG_PLAYER_7);
chest->unk_1F4 = 1; chest->unk_1F4 = 1;
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_SLOW_CHEST_CS); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_SLOW_CHEST_CS);
} else { } else {
Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_box_kick); Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_box_kick);
chest->unk_1F4 = -1; chest->unk_1F4 = -1;
@ -8256,7 +8256,7 @@ void Player_Action_8084279C(Player* this, PlayState* play) {
} }
this->actor.flags &= ~ACTOR_FLAG_8; this->actor.flags &= ~ACTOR_FLAG_8;
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
} }
@ -9515,10 +9515,11 @@ void Player_Action_80845CA4(Player* this, PlayState* play) {
temp = func_80845BA0(play, this, &sp34, sp30); temp = func_80845BA0(play, this, &sp34, sp30);
if ((this->av2.actionVar2 == 0) || ((temp == 0) && (this->speedXZ == 0.0f) && if ((this->av2.actionVar2 == 0) ||
(Play_GetCamera(play, CAM_ID_MAIN)->stateFlags & CAM_STATE_4))) { ((temp == 0) && (this->speedXZ == 0.0f) &&
(Play_GetCamera(play, CAM_ID_MAIN)->stateFlags & CAM_STATE_CAM_FUNC_FINISH))) {
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data); func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data);
if (!Player_ActionChange_4(this, play)) { if (!Player_ActionChange_4(this, play)) {
@ -9552,7 +9553,7 @@ void Player_Action_80845EF8(Player* this, PlayState* play) {
if (play->roomCtx.prevRoom.num >= 0) { if (play->roomCtx.prevRoom.num >= 0) {
func_80097534(play, &play->roomCtx); func_80097534(play, &play->roomCtx);
} }
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, 0xDFF); Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, 0xDFF);
} }
return; return;
@ -10592,7 +10593,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
seqMode = SEQ_MODE_DEFAULT; seqMode = SEQ_MODE_DEFAULT;
if (this->csAction != PLAYER_CSACTION_NONE) { if (this->csAction != PLAYER_CSACTION_NONE) {
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_NORMAL); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_NORMAL);
} else if (!(this->stateFlags1 & PLAYER_STATE1_20)) { } else if (!(this->stateFlags1 & PLAYER_STATE1_20)) {
if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) { if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) {
camMode = CAM_MODE_HOOKSHOT_FLY; camMode = CAM_MODE_HOOKSHOT_FLY;
@ -10653,7 +10654,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
} }
} }
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), camMode); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), camMode);
} else { } else {
// First person mode // First person mode
seqMode = SEQ_MODE_STILL; seqMode = SEQ_MODE_STILL;
@ -11701,7 +11702,7 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) {
} }
if ((this->csAction != PLAYER_CSACTION_NONE) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || if ((this->csAction != PLAYER_CSACTION_NONE) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) ||
func_80833B54(this) || (this->unk_664 != NULL) || !func_8083AD4C(play, this) || func_80833B54(this) || (this->unk_664 != NULL) || (func_8083AD4C(play, this) == CAM_MODE_NORMAL) ||
(((this->unk_6AD == 2) && (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) || (((this->unk_6AD == 2) && (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) ||
func_80833B2C(this) || (!func_8002DD78(this) && !func_808334B4(this)))) || func_80833B2C(this) || (!func_8002DD78(this) && !func_808334B4(this)))) ||
((this->unk_6AD == 1) && ((this->unk_6AD == 1) &&
@ -11767,7 +11768,7 @@ void Player_Action_8084B530(Player* this, PlayState* play) {
this->stateFlags2 &= ~PLAYER_STATE2_13; this->stateFlags2 &= ~PLAYER_STATE2_13;
} }
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
if (!func_8084B4D4(play, this) && !func_8084B3CC(play, this) && !Player_StartCsAction(play, this)) { if (!func_8084B4D4(play, this) && !func_8084B3CC(play, this) && !Player_StartCsAction(play, this)) {
if ((this->targetActor != this->interactRangeActor) || !Player_ActionChange_2(this, play)) { if ((this->targetActor != this->interactRangeActor) || !Player_ActionChange_2(this, play)) {
@ -12553,7 +12554,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) {
} }
if (this->stateFlags1 & PLAYER_STATE1_20) { if (this->stateFlags1 & PLAYER_STATE1_20) {
if (!func_8083AD4C(play, this) || CHECK_BTN_ANY(sControlInput->press.button, BTN_A) || if ((func_8083AD4C(play, this) == CAM_MODE_NORMAL) || CHECK_BTN_ANY(sControlInput->press.button, BTN_A) ||
func_80833BCC(this)) { func_80833BCC(this)) {
this->unk_6AD = 0; this->unk_6AD = 0;
this->stateFlags1 &= ~PLAYER_STATE1_20; this->stateFlags1 &= ~PLAYER_STATE1_20;
@ -12613,7 +12614,7 @@ void Player_Action_8084D3E4(Player* this, PlayState* play) {
gSaveContext.save.info.horseData.angle = rideActor->actor.shape.rot.y; gSaveContext.save.info.horseData.angle = rideActor->actor.shape.rot.y;
} }
} else { } else {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_NORMAL0); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_NORMAL0);
if (this->mountSide < 0) { if (this->mountSide < 0) {
D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_5, 40); D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_5, 40);
@ -12864,7 +12865,7 @@ void func_8084DF6C(PlayState* play, Player* this) {
this->unk_862 = 0; this->unk_862 = 0;
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
this->getItemId = GI_NONE; this->getItemId = GI_NONE;
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
void func_8084DFAC(PlayState* play, Player* this) { void func_8084DFAC(PlayState* play, Player* this) {
@ -12992,7 +12993,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) {
} }
if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) {
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
if ((this->targetActor != NULL) && (this->targetActor == this->unk_6A8)) { if ((this->targetActor != NULL) && (this->targetActor == this->unk_6A8)) {
func_80853148(play, this->targetActor); func_80853148(play, this->targetActor);
@ -13015,7 +13016,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) {
this->stateFlags1 &= ~PLAYER_STATE1_29; this->stateFlags1 &= ~PLAYER_STATE1_29;
Player_TryCsAction(play, NULL, PLAYER_CSACTION_8); Player_TryCsAction(play, NULL, PLAYER_CSACTION_8);
play->mainCamera.stateFlags &= ~CAM_STATE_3; play->mainCamera.stateFlags &= ~CAM_STATE_EXTERNAL_FINISHED;
this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29;
this->stateFlags2 |= PLAYER_STATE2_27; this->stateFlags2 |= PLAYER_STATE2_27;
@ -13203,7 +13204,7 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) {
} }
func_8083C0E8(this, play); func_8083C0E8(this, play);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} else if (this->av2.actionVar2 == 1) { } else if (this->av2.actionVar2 == 1) {
if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) {
Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_end); Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_end);
@ -13240,7 +13241,7 @@ void Player_Action_8084ECA4(Player* this, PlayState* play) {
this->av2.actionVar2 = 1; this->av2.actionVar2 = 1;
} else if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { } else if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
this->av1.actionVar1 = 0; this->av1.actionVar1 = 0;
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
} else { } else {
func_8083C0E8(this, play); func_8083C0E8(this, play);
@ -13293,7 +13294,7 @@ static Vec3f D_80854A1C = { 0.0f, 0.0f, 5.0f };
void Player_Action_8084EED8(Player* this, PlayState* play) { void Player_Action_8084EED8(Player* this, PlayState* play) {
if (LinkAnimation_Update(play, &this->skelAnime)) { if (LinkAnimation_Update(play, &this->skelAnime)) {
func_8083C0E8(this, play); func_8083C0E8(this, play);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
return; return;
} }
@ -13323,7 +13324,7 @@ void Player_Action_8084EFC0(Player* this, PlayState* play) {
if (LinkAnimation_Update(play, &this->skelAnime)) { if (LinkAnimation_Update(play, &this->skelAnime)) {
func_8083C0E8(this, play); func_8083C0E8(this, play);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
return; return;
} }
@ -13387,7 +13388,7 @@ void Player_Action_8084F104(Player* this, PlayState* play) {
func_8083C0E8(this, play); func_8083C0E8(this, play);
} }
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
} }
} else if (this->av2.actionVar2 >= 0) { } else if (this->av2.actionVar2 >= 0) {
@ -13635,7 +13636,7 @@ s32 func_8084FCAC(Player* this, PlayState* play) {
D_808535D0 ^= 1; D_808535D0 ^= 1;
if (D_808535D0) { if (D_808535D0) {
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_AIM); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_AIM);
} }
} }
@ -13888,7 +13889,7 @@ void Player_Action_8085063C(Player* this, PlayState* play) {
} }
func_80853080(this, play); func_80853080(this, play);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
} }
@ -13954,7 +13955,7 @@ void Player_Action_808507F4(Player* this, PlayState* play) {
if (this->av1.actionVar1 < 0) { if (this->av1.actionVar1 < 0) {
if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || (gSaveContext.magicState == MAGIC_STATE_IDLE)) { if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || (gSaveContext.magicState == MAGIC_STATE_IDLE)) {
func_80839FFC(this, play); func_80839FFC(this, play);
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
} }
} else { } else {
if (this->av2.actionVar2 == 0) { if (this->av2.actionVar2 == 0) {