mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 22:44:30 +00:00
Camera Flags (#1225)
* 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 * PR Suggestions * More flag style change * Small cleanup * 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 * fix macro arg * fix func declaration
This commit is contained in:
parent
da2e8a8f2c
commit
8ff58118b3
15 changed files with 1091 additions and 673 deletions
|
@ -355,7 +355,7 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
|
|||
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
|
||||
this->cameraSetting = play->cameraPtrs[CAM_ID_MAIN]->setting;
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2);
|
||||
func_8005AD1C(play->cameraPtrs[CAM_ID_MAIN], 4);
|
||||
Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2);
|
||||
this->switchFlag = 10;
|
||||
}
|
||||
} else {
|
||||
|
@ -368,7 +368,7 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
|
|||
if (this->switchFlag == 0) {
|
||||
if (1) {}
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], this->cameraSetting);
|
||||
func_8005ACFC(play->cameraPtrs[CAM_ID_MAIN], 4);
|
||||
Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2);
|
||||
}
|
||||
}
|
||||
this->dyna.actor.world.pos.y =
|
||||
|
|
|
@ -641,7 +641,7 @@ void func_809BE26C(EnBigokuta* this, PlayState* play) {
|
|||
if (this->unk_198 == 0 && Math_StepToF(&this->actor.scale.y, 0.0f, 0.001f)) {
|
||||
Flags_SetClear(play, this->actor.room);
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
|
||||
func_8005ACFC(play->cameraPtrs[CAM_ID_MAIN], 4);
|
||||
Camera_SetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2);
|
||||
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE);
|
||||
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0);
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -778,7 +778,7 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play2) {
|
|||
func_809BD2E4(this);
|
||||
func_809BE568(this);
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO);
|
||||
func_8005AD1C(play->cameraPtrs[CAM_ID_MAIN], 4);
|
||||
Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_2);
|
||||
|
||||
if (this->cylinder[0].base.atFlags & AT_ON) {
|
||||
if (this->actionFunc != func_809BE058) {
|
||||
|
|
|
@ -1163,10 +1163,10 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) {
|
|||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (EnGo2_IsWakingUp(this)) {
|
||||
Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW);
|
||||
func_8005AD1C(mainCam, 4);
|
||||
Camera_UnsetStateFlag(mainCam, CAM_STATE_2);
|
||||
} else if (!EnGo2_IsWakingUp(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) {
|
||||
Camera_ChangeSetting(mainCam, CAM_SET_DUNGEON1);
|
||||
func_8005ACFC(mainCam, 4);
|
||||
Camera_SetStateFlag(mainCam, CAM_STATE_2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1752,7 +1752,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
|
|||
gSaveContext.horseData.sceneId = play->sceneId;
|
||||
|
||||
// Focus the camera on Epona
|
||||
Camera_SetParam(play->cameraPtrs[CAM_ID_MAIN], 8, this);
|
||||
Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor);
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND);
|
||||
Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0);
|
||||
}
|
||||
|
@ -1826,7 +1826,7 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) {
|
|||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
this->followTimer = 0;
|
||||
EnHorse_SetFollowAnimation(this, play);
|
||||
Camera_SetParam(play->cameraPtrs[CAM_ID_MAIN], 8, this);
|
||||
Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor);
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_TURN_AROUND);
|
||||
Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 4, NULL, NULL, 0x51, 0, 0);
|
||||
}
|
||||
|
|
|
@ -501,7 +501,7 @@ void ObjectKankyo_DrawFairies(Actor* thisx, PlayState* play2) {
|
|||
Vec3f vec2 = { 0.0f, 0.0f, 0.0f };
|
||||
s16 i;
|
||||
|
||||
if (!(play->cameraPtrs[CAM_ID_MAIN]->unk_14C & 0x100)) {
|
||||
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8)) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 807);
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex));
|
||||
|
@ -596,7 +596,7 @@ void ObjectKankyo_DrawSnow(Actor* thisx, PlayState* play2) {
|
|||
s32 pad;
|
||||
s32 pad2;
|
||||
|
||||
if (!(play->cameraPtrs[CAM_ID_MAIN]->unk_14C & 0x100)) {
|
||||
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8)) {
|
||||
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->state.frames % 16 == 0) {
|
||||
|
|
|
@ -5321,7 +5321,7 @@ s32 func_8083B040(Player* this, PlayState* play) {
|
|||
func_80835EA4(play, (this->unk_6A8 != NULL) ? 0x5B : 0x5A);
|
||||
if (this->unk_6A8 != NULL) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_25;
|
||||
Camera_SetParam(Play_GetCamera(play, CAM_ID_MAIN), 8, this->unk_6A8);
|
||||
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->unk_6A8);
|
||||
}
|
||||
}
|
||||
} else if (func_8083AD4C(play, this)) {
|
||||
|
@ -9206,7 +9206,7 @@ void func_80845CA4(Player* this, PlayState* play) {
|
|||
temp = func_80845BA0(play, this, &sp34, sp30);
|
||||
|
||||
if ((this->unk_850 == 0) || ((temp == 0) && (this->linearVelocity == 0.0f) &&
|
||||
(Play_GetCamera(play, CAM_ID_MAIN)->unk_14C & 0x10))) {
|
||||
(Play_GetCamera(play, CAM_ID_MAIN)->stateFlags & CAM_STATE_4))) {
|
||||
|
||||
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN));
|
||||
func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data);
|
||||
|
@ -10230,7 +10230,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
|
|||
} else if (!(this->stateFlags1 & PLAYER_STATE1_20)) {
|
||||
if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) {
|
||||
camMode = CAM_MODE_HOOKSHOT;
|
||||
Camera_SetParam(Play_GetCamera(play, CAM_ID_MAIN), 8, this->actor.parent);
|
||||
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->actor.parent);
|
||||
} else if (func_8084377C == this->func_674) {
|
||||
camMode = CAM_MODE_STILL;
|
||||
} else if (this->stateFlags2 & PLAYER_STATE2_8) {
|
||||
|
@ -10247,12 +10247,12 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
|
|||
} else {
|
||||
camMode = CAM_MODE_BATTLE;
|
||||
}
|
||||
Camera_SetParam(Play_GetCamera(play, CAM_ID_MAIN), 8, unk_664);
|
||||
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, 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(Play_GetCamera(play, CAM_ID_MAIN), 8, this->boomerangActor);
|
||||
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->boomerangActor);
|
||||
} else if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) {
|
||||
if (func_80833B2C(this)) {
|
||||
camMode = CAM_MODE_HANGZ;
|
||||
|
@ -12549,7 +12549,7 @@ void func_8084E3C4(Player* this, PlayState* play) {
|
|||
this->stateFlags1 &= ~PLAYER_STATE1_29;
|
||||
|
||||
func_80852FFC(play, NULL, 8);
|
||||
play->mainCamera.unk_14C &= ~8;
|
||||
play->mainCamera.stateFlags &= ~CAM_STATE_3;
|
||||
|
||||
this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29;
|
||||
this->stateFlags2 |= PLAYER_STATE2_27;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue