1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 15:04:31 +00:00

Good Camera Mode Names (#1455)

* better camera mode names

* cleanup

* improve aiming modes

* follow boomerang comment

* more mode docs

* cleanup

* hookshotFly, revert to still
This commit is contained in:
engineer124 2022-12-11 04:46:03 -05:00 committed by GitHub
parent 85a4d23fc6
commit 2e9e895bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 784 additions and 780 deletions

View file

@ -203,26 +203,26 @@ typedef enum {
typedef enum { typedef enum {
/* 0x00 */ CAM_MODE_NORMAL, /* 0x00 */ CAM_MODE_NORMAL,
/* 0x01 */ CAM_MODE_TARGET, // "PARALLEL" /* 0x01 */ CAM_MODE_Z_PARALLEL, // Holding Z but with no target, keeps the camera aligned
/* 0x02 */ CAM_MODE_FOLLOWTARGET, // "KEEPON" /* 0x02 */ CAM_MODE_Z_TARGET_FRIENDLY,
/* 0x03 */ CAM_MODE_TALK, /* 0x03 */ CAM_MODE_TALK,
/* 0x04 */ CAM_MODE_BATTLE, /* 0x04 */ CAM_MODE_Z_TARGET_UNFRIENDLY,
/* 0x05 */ CAM_MODE_CLIMB, /* 0x05 */ CAM_MODE_WALL_CLIMB, // Climbing a wall: ladders and vines
/* 0x06 */ CAM_MODE_FIRSTPERSON, // "SUBJECT" /* 0x06 */ CAM_MODE_FIRST_PERSON,
/* 0x07 */ CAM_MODE_BOWARROW, /* 0x07 */ CAM_MODE_AIM_ADULT, // First person aiming as adult: bow and hookshot
/* 0x08 */ CAM_MODE_BOWARROWZ, /* 0x08 */ CAM_MODE_Z_AIM, // Third person aiming for all items, child and adult
/* 0x09 */ CAM_MODE_HOOKSHOT, // "FOOKSHOT" /* 0x09 */ CAM_MODE_HOOKSHOT_FLY, // Player being pulled by the hookshot to a target
/* 0x0A */ CAM_MODE_BOOMERANG, /* 0x0A */ CAM_MODE_AIM_BOOMERANG, // Aiming the boomerang
/* 0x0B */ CAM_MODE_SLINGSHOT, // "PACHINCO" /* 0x0B */ CAM_MODE_AIM_CHILD, // First person aiming as child: slingshot
/* 0x0C */ CAM_MODE_CLIMBZ, /* 0x0C */ CAM_MODE_Z_WALL_CLIMB, // Climbing a wall with Z pressed: ladders and vines
/* 0x0D */ CAM_MODE_JUMP, /* 0x0D */ CAM_MODE_JUMP, // Falling in air from a ledge jump
/* 0x0E */ CAM_MODE_HANG, /* 0x0E */ CAM_MODE_LEDGE_HANG, // Hanging from and climbing a ledge
/* 0x0F */ CAM_MODE_HANGZ, /* 0x0F */ CAM_MODE_Z_LEDGE_HANG, // Hanging from and climbing a ledge with Z pressed
/* 0x10 */ CAM_MODE_FREEFALL, /* 0x10 */ CAM_MODE_FREE_FALL, // Falling in air except for a ledge jump or knockback
/* 0x11 */ CAM_MODE_CHARGE, /* 0x11 */ CAM_MODE_CHARGE, // Charging a spin attack
/* 0x12 */ CAM_MODE_STILL, /* 0x12 */ CAM_MODE_STILL, // Attacks without Z pressed, falling in air from knockback
/* 0x13 */ CAM_MODE_PUSHPULL, /* 0x13 */ CAM_MODE_PUSH_PULL,
/* 0x14 */ CAM_MODE_FOLLOWBOOMERANG, // "BOOKEEPON" /* 0x14 */ CAM_MODE_FOLLOW_BOOMERANG, // Boomerang has been thrown, force-target the boomerang as it flies
/* 0x15 */ CAM_MODE_MAX /* 0x15 */ CAM_MODE_MAX
} CameraModeType; } CameraModeType;

View file

@ -2589,8 +2589,8 @@ s32 Camera_Jump3(Camera* camera) {
rwData->mode = CAM_MODE_NORMAL; rwData->mode = CAM_MODE_NORMAL;
modeSwitch = true; modeSwitch = true;
} }
} else if (((camera->waterYPos - eye->y) > OREG(45)) && (rwData->mode != CAM_MODE_BOOMERANG)) { } else if (((camera->waterYPos - eye->y) > OREG(45)) && (rwData->mode != CAM_MODE_AIM_BOOMERANG)) {
rwData->mode = CAM_MODE_BOOMERANG; rwData->mode = CAM_MODE_AIM_BOOMERANG;
modeSwitch = true; modeSwitch = true;
} }
@ -2864,7 +2864,7 @@ s32 Camera_Battle1(Camera* camera) {
VT_COL(YELLOW, BLACK) "camera: warning: battle: target is not valid, change parallel\n" VT_RST); VT_COL(YELLOW, BLACK) "camera: warning: battle: target is not valid, change parallel\n" VT_RST);
} }
camera->target = NULL; camera->target = NULL;
Camera_ChangeMode(camera, CAM_MODE_TARGET); Camera_ChangeMode(camera, CAM_MODE_Z_PARALLEL);
return true; return true;
} }
@ -2880,7 +2880,7 @@ s32 Camera_Battle1(Camera* camera) {
} else { } else {
osSyncPrintf("camera: battle: target actor name " VT_COL(RED, WHITE) "%d" VT_RST "\n", rwData->target->id); osSyncPrintf("camera: battle: target actor name " VT_COL(RED, WHITE) "%d" VT_RST "\n", rwData->target->id);
camera->target = NULL; camera->target = NULL;
Camera_ChangeMode(camera, CAM_MODE_TARGET); Camera_ChangeMode(camera, CAM_MODE_Z_PARALLEL);
return true; return true;
} }
rwData->animTimer = R_CAM_DEFAULT_ANIM_TIME + OREG(24); rwData->animTimer = R_CAM_DEFAULT_ANIM_TIME + OREG(24);
@ -3147,7 +3147,7 @@ s32 Camera_KeepOn1(Camera* camera) {
VT_COL(YELLOW, BLACK) "camera: warning: keepon: target is not valid, change parallel\n" VT_RST); VT_COL(YELLOW, BLACK) "camera: warning: keepon: target is not valid, change parallel\n" VT_RST);
} }
camera->target = NULL; camera->target = NULL;
Camera_ChangeMode(camera, CAM_MODE_TARGET); Camera_ChangeMode(camera, CAM_MODE_Z_PARALLEL);
return 1; return 1;
} }
@ -3385,7 +3385,7 @@ s32 Camera_KeepOn3(Camera* camera) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: talk: target is not valid, change parallel\n" VT_RST); osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: talk: target is not valid, change parallel\n" VT_RST);
} }
camera->target = NULL; camera->target = NULL;
Camera_ChangeMode(camera, CAM_MODE_TARGET); Camera_ChangeMode(camera, CAM_MODE_Z_PARALLEL);
return 1; return 1;
} }
if (RELOAD_PARAMS(camera)) { if (RELOAD_PARAMS(camera)) {
@ -7860,7 +7860,7 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
} }
if (!((sCameraSettings[camera->setting].unk_00 & 0x3FFFFFFF) & (1 << mode))) { if (!((sCameraSettings[camera->setting].unk_00 & 0x3FFFFFFF) & (1 << mode))) {
if (mode == CAM_MODE_FIRSTPERSON) { if (mode == CAM_MODE_FIRST_PERSON) {
osSyncPrintf("camera: error sound\n"); osSyncPrintf("camera: error sound\n");
func_80078884(NA_SE_SY_ERROR); func_80078884(NA_SE_SY_ERROR);
} }
@ -7888,33 +7888,33 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
Camera_CopyDataToRegs(camera, mode); Camera_CopyDataToRegs(camera, mode);
modeChangeFlags = 0; modeChangeFlags = 0;
switch (mode) { switch (mode) {
case CAM_MODE_FIRSTPERSON: case CAM_MODE_FIRST_PERSON:
modeChangeFlags = 0x20; modeChangeFlags = 0x20;
break; break;
case CAM_MODE_BATTLE: case CAM_MODE_Z_TARGET_UNFRIENDLY:
modeChangeFlags = 4; modeChangeFlags = 4;
break; break;
case CAM_MODE_FOLLOWTARGET: case CAM_MODE_Z_TARGET_FRIENDLY:
if (camera->target != NULL && camera->target->id != ACTOR_EN_BOOM) { if (camera->target != NULL && camera->target->id != ACTOR_EN_BOOM) {
modeChangeFlags = 8; modeChangeFlags = 8;
} }
break; break;
case CAM_MODE_TARGET: case CAM_MODE_Z_PARALLEL:
case CAM_MODE_TALK: case CAM_MODE_TALK:
case CAM_MODE_BOWARROWZ: case CAM_MODE_Z_AIM:
case CAM_MODE_HANGZ: case CAM_MODE_Z_LEDGE_HANG:
case CAM_MODE_PUSHPULL: case CAM_MODE_PUSH_PULL:
modeChangeFlags = 2; modeChangeFlags = 2;
break; break;
} }
switch (camera->mode) { switch (camera->mode) {
case CAM_MODE_FIRSTPERSON: case CAM_MODE_FIRST_PERSON:
if (modeChangeFlags & 0x20) { if (modeChangeFlags & 0x20) {
camera->animState = 10; camera->animState = 10;
} }
break; break;
case CAM_MODE_TARGET: case CAM_MODE_Z_PARALLEL:
if (modeChangeFlags & 0x10) { if (modeChangeFlags & 0x10) {
camera->animState = 10; camera->animState = 10;
} }
@ -7923,21 +7923,21 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
case CAM_MODE_CHARGE: case CAM_MODE_CHARGE:
modeChangeFlags |= 1; modeChangeFlags |= 1;
break; break;
case CAM_MODE_FOLLOWTARGET: case CAM_MODE_Z_TARGET_FRIENDLY:
if (modeChangeFlags & 8) { if (modeChangeFlags & 8) {
camera->animState = 10; camera->animState = 10;
} }
modeChangeFlags |= 1; modeChangeFlags |= 1;
break; break;
case CAM_MODE_BATTLE: case CAM_MODE_Z_TARGET_UNFRIENDLY:
if (modeChangeFlags & 4) { if (modeChangeFlags & 4) {
camera->animState = 10; camera->animState = 10;
} }
modeChangeFlags |= 1; modeChangeFlags |= 1;
break; break;
case CAM_MODE_BOWARROWZ: case CAM_MODE_Z_AIM:
case CAM_MODE_HANGZ: case CAM_MODE_Z_LEDGE_HANG:
case CAM_MODE_PUSHPULL: case CAM_MODE_PUSH_PULL:
modeChangeFlags |= 1; modeChangeFlags |= 1;
break; break;
case CAM_MODE_NORMAL: case CAM_MODE_NORMAL:

File diff suppressed because it is too large Load diff

View file

@ -1266,7 +1266,7 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) {
sUnused = -1; sUnused = -1;
parentCam = play->cameraPtrs[CAM_ID_MAIN]; parentCam = play->cameraPtrs[CAM_ID_MAIN];
if (parentCam->mode == CAM_MODE_FOLLOWBOOMERANG) { 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_ChangeMode(parentCam, CAM_MODE_NORMAL);
} }

View file

@ -625,7 +625,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_FOLLOWTARGET); Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY);
} }
s32 func_8008EF30(PlayState* play) { s32 func_8008EF30(PlayState* play) {

View file

@ -1238,7 +1238,8 @@ void EnIk_CsAction5(EnIk* this, PlayState* play) {
} }
s32 EnIk_OverrideLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { s32 EnIk_OverrideLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
if ((limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_HELMET_ARMOR) || (limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_CHEST_ARMOR_FRONT) || if ((limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_HELMET_ARMOR) ||
(limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_CHEST_ARMOR_FRONT) ||
(limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_CHEST_ARMOR_BACK)) { (limbIndex == IRON_KNUCKLE_DEFEAT_LIMB_CHEST_ARMOR_BACK)) {
if (EnIk_GetAnimCurFrame(thisx) >= 30.0f) { if (EnIk_GetAnimCurFrame(thisx) >= 30.0f) {
*dList = NULL; *dList = NULL;

View file

@ -2701,7 +2701,8 @@ s32 func_80834E7C(PlayState* play) {
s32 func_80834EB8(Player* this, PlayState* play) { s32 func_80834EB8(Player* this, PlayState* play) {
if ((this->unk_6AD == 0) || (this->unk_6AD == 2)) { if ((this->unk_6AD == 0) || (this->unk_6AD == 2)) {
if (func_80833BCC(this) || (Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_BOWARROW) == 0)) { if (func_80833BCC(this) ||
(Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_AIM_ADULT) == 0)) {
return 1; return 1;
} }
this->unk_6AD = 2; this->unk_6AD = 2;
@ -5100,15 +5101,15 @@ s32 func_8083AD4C(PlayState* play, Player* this) {
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_BOWARROW; cameraMode = CAM_MODE_AIM_ADULT;
} else { } else {
cameraMode = CAM_MODE_SLINGSHOT; cameraMode = CAM_MODE_AIM_CHILD;
} }
} else { } else {
cameraMode = CAM_MODE_BOOMERANG; cameraMode = CAM_MODE_AIM_BOOMERANG;
} }
} else { } else {
cameraMode = CAM_MODE_FIRSTPERSON; cameraMode = CAM_MODE_FIRST_PERSON;
} }
return Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), cameraMode); return Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), cameraMode);
@ -5424,7 +5425,7 @@ s32 func_8083B644(Player* this, PlayState* play) {
s32 func_8083B8F4(Player* this, PlayState* play) { s32 func_8083B8F4(Player* this, PlayState* play) {
if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) && if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) &&
Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FIRSTPERSON)) { Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FIRST_PERSON)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) { (func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) {
this->unk_6AD = 1; this->unk_6AD = 1;
@ -10229,52 +10230,52 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_NORMAL); Camera_ChangeMode(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; camMode = CAM_MODE_HOOKSHOT_FLY;
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->actor.parent); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->actor.parent);
} else if (func_8084377C == this->func_674) { } else if (func_8084377C == this->func_674) {
camMode = CAM_MODE_STILL; camMode = CAM_MODE_STILL;
} else if (this->stateFlags2 & PLAYER_STATE2_8) { } else if (this->stateFlags2 & PLAYER_STATE2_8) {
camMode = CAM_MODE_PUSHPULL; camMode = CAM_MODE_PUSH_PULL;
} else if ((unk_664 = this->unk_664) != NULL) { } else if ((unk_664 = this->unk_664) != NULL) {
if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_8)) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_8)) {
camMode = CAM_MODE_TALK; camMode = CAM_MODE_TALK;
} else if (this->stateFlags1 & PLAYER_STATE1_16) { } else if (this->stateFlags1 & PLAYER_STATE1_16) {
if (this->stateFlags1 & PLAYER_STATE1_25) { if (this->stateFlags1 & PLAYER_STATE1_25) {
camMode = CAM_MODE_FOLLOWBOOMERANG; camMode = CAM_MODE_FOLLOW_BOOMERANG;
} else { } else {
camMode = CAM_MODE_FOLLOWTARGET; camMode = CAM_MODE_Z_TARGET_FRIENDLY;
} }
} else { } else {
camMode = CAM_MODE_BATTLE; camMode = CAM_MODE_Z_TARGET_UNFRIENDLY;
} }
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, unk_664); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, unk_664);
} else if (this->stateFlags1 & PLAYER_STATE1_12) { } else if (this->stateFlags1 & PLAYER_STATE1_12) {
camMode = CAM_MODE_CHARGE; camMode = CAM_MODE_CHARGE;
} else if (this->stateFlags1 & PLAYER_STATE1_25) { } else if (this->stateFlags1 & PLAYER_STATE1_25) {
camMode = CAM_MODE_FOLLOWBOOMERANG; camMode = CAM_MODE_FOLLOW_BOOMERANG;
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, 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)) { } else if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) {
if (func_80833B2C(this)) { if (func_80833B2C(this)) {
camMode = CAM_MODE_HANGZ; camMode = CAM_MODE_Z_LEDGE_HANG;
} else { } else {
camMode = CAM_MODE_HANG; camMode = CAM_MODE_LEDGE_HANG;
} }
} else if (this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30)) { } else if (this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30)) {
if (func_8002DD78(this) || func_808334B4(this)) { if (func_8002DD78(this) || func_808334B4(this)) {
camMode = CAM_MODE_BOWARROWZ; camMode = CAM_MODE_Z_AIM;
} else if (this->stateFlags1 & PLAYER_STATE1_21) { } else if (this->stateFlags1 & PLAYER_STATE1_21) {
camMode = CAM_MODE_CLIMBZ; camMode = CAM_MODE_Z_WALL_CLIMB;
} else { } else {
camMode = CAM_MODE_TARGET; camMode = CAM_MODE_Z_PARALLEL;
} }
} else if (this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_21)) { } else if (this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_21)) {
if ((func_80845668 == this->func_674) || (this->stateFlags1 & PLAYER_STATE1_21)) { if ((func_80845668 == this->func_674) || (this->stateFlags1 & PLAYER_STATE1_21)) {
camMode = CAM_MODE_CLIMB; camMode = CAM_MODE_WALL_CLIMB;
} else { } else {
camMode = CAM_MODE_JUMP; camMode = CAM_MODE_JUMP;
} }
} else if (this->stateFlags1 & PLAYER_STATE1_19) { } else if (this->stateFlags1 & PLAYER_STATE1_19) {
camMode = CAM_MODE_FREEFALL; camMode = CAM_MODE_FREE_FALL;
} else if ((this->meleeWeaponState != 0) && (this->meleeWeaponAnimation >= PLAYER_MWA_FORWARD_SLASH_1H) && } else if ((this->meleeWeaponState != 0) && (this->meleeWeaponAnimation >= PLAYER_MWA_FORWARD_SLASH_1H) &&
(this->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H)) { (this->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H)) {
camMode = CAM_MODE_STILL; camMode = CAM_MODE_STILL;
@ -13169,7 +13170,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_BOWARROWZ); Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_AIM);
} }
} }