Skip to content

Commit fc4282d

Browse files
committed
camera_class rtti fix
1 parent 2111bb8 commit fc4282d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+403
-402
lines changed

include/f_op/f_op_camera_mng.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ struct fopCamM_prm_class {
1010
/* 0x00 */ fopAcM_prmBase_class base;
1111
}; // Size: 0x18
1212

13-
class camera_class : public view_class {
13+
class camera_class {
1414
public:
15+
/* 0x000 */ view_class view;
1516
/* 0x210 */ create_tag_class create_tag;
1617
/* 0x224 */ leafdraw_method_class* submethod;
1718
/* 0x228 */ u8 field_0x228[4];
@@ -39,35 +40,35 @@ inline void fopCamM_SetAngleY(camera_class* i_camera, s16 angle) {
3940
}
4041

4142
inline void fopCamM_SetNear(camera_class* i_this, f32 near) {
42-
i_this->near = near;
43+
i_this->view.near = near;
4344
}
4445

4546
inline void fopCamM_SetFar(camera_class* i_this, f32 far) {
46-
i_this->far = far;
47+
i_this->view.far = far;
4748
}
4849

4950
inline void fopCamM_SetFovy(camera_class* i_this, f32 fovy) {
50-
i_this->fovy = fovy;
51+
i_this->view.fovy = fovy;
5152
}
5253

5354
inline void fopCamM_SetAspect(camera_class* i_this, f32 aspect) {
54-
i_this->aspect = aspect;
55+
i_this->view.aspect = aspect;
5556
}
5657

5758
inline void fopCamM_SetEye(camera_class* i_this, f32 x, f32 y, f32 z) {
58-
i_this->lookat.eye.set(x, y, z);
59+
i_this->view.lookat.eye.set(x, y, z);
5960
}
6061

6162
inline void fopCamM_SetCenter(camera_class* i_this, f32 x, f32 y, f32 z) {
62-
i_this->lookat.center.set(x, y, z);
63+
i_this->view.lookat.center.set(x, y, z);
6364
}
6465

6566
inline void fopCamM_SetUp(camera_class* i_this, f32 x, f32 y, f32 z) {
66-
i_this->lookat.up.set(x, y, z);
67+
i_this->view.lookat.up.set(x, y, z);
6768
}
6869

6970
inline void fopCamM_SetBank(camera_class* i_this, s16 bank) {
70-
i_this->bank = bank;
71+
i_this->view.bank = bank;
7172
}
7273

7374
inline void fopCamM_SetPrm1(camera_class* i_this, int prm1) {
@@ -95,23 +96,23 @@ inline s16 fopCamM_GetAngleZ(camera_class* i_camera) {
9596
}
9697

9798
inline f32 fopCamM_GetFovy(camera_class* i_camera) {
98-
return i_camera->fovy;
99+
return i_camera->view.fovy;
99100
}
100101

101102
inline cXyz* fopCamM_GetEye_p(camera_class* i_camera) {
102-
return &i_camera->lookat.eye;
103+
return &i_camera->view.lookat.eye;
103104
}
104105

105106
inline cXyz* fopCamM_GetCenter_p(camera_class* i_camera) {
106-
return &i_camera->lookat.center;
107+
return &i_camera->view.lookat.center;
107108
}
108109

109110
inline cXyz* fopCamM_GetUp_p(camera_class* i_camera) {
110-
return &i_camera->lookat.up;
111+
return &i_camera->view.lookat.up;
111112
}
112113

113114
inline s16 fopCamM_GetBank(camera_class* i_camera) {
114-
return i_camera->bank;
115+
return i_camera->view.bank;
115116
}
116117

117118
fpc_ProcID fopCamM_Create(int i_cameraIdx, s16 i_procName, void* i_append);

src/d/actor/d_a_L7demo_dr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ void daDr_c::wait() {
8686
fopAcM_orderPotentialEvent(this, 2, 0xFFFF, 0);
8787
eventInfo.onCondition(2);
8888

89-
mDemoCamEye = camera0->lookat.eye;
90-
mDemoCamCenter = camera0->lookat.center;
89+
mDemoCamEye = camera0->view.lookat.eye;
90+
mDemoCamCenter = camera0->view.lookat.center;
9191
}
9292
}
9393
}

src/d/actor/d_a_L7op_demo_dr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ void daL7ODR_c::wait() {
9999
if (check_start()) {
100100
fopAcM_orderPotentialEvent(this, 2, 0xFFFF, 0);
101101
eventInfo.onCondition(2);
102-
mDemoCamEye = camera0->lookat.eye;
103-
mDemoCamCenter = camera0->lookat.center;
102+
mDemoCamEye = camera0->view.lookat.eye;
103+
mDemoCamCenter = camera0->view.lookat.center;
104104
}
105105
}
106106
}

src/d/actor/d_a_b_bq.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,8 @@ static void demo_camera(b_bq_class* i_this) {
14201420

14211421
daPy_getPlayerActorClass()->changeOriginalDemo();
14221422

1423-
i_this->mDemoCamEye = camera0->lookat.eye;
1424-
i_this->mDemoCamCenter = camera0->lookat.center;
1423+
i_this->mDemoCamEye = camera0->view.lookat.eye;
1424+
i_this->mDemoCamCenter = camera0->view.lookat.center;
14251425

14261426
dComIfGp_getEvent()->startCheckSkipEdge(a_this);
14271427
// fallthrough

src/d/actor/d_a_b_dr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,8 +3031,8 @@ bool daB_DR_c::startDemoCheck() {
30313031
if (!eventInfo.checkCommandDemoAccrpt()) {
30323032
fopAcM_orderPotentialEvent(this, 2, 0xFFFF, 0);
30333033
eventInfo.onCondition(2);
3034-
mDemoCamEye = camera0->lookat.eye;
3035-
mDemoCamCenter = camera0->lookat.center;
3034+
mDemoCamEye = camera0->view.lookat.eye;
3035+
mDemoCamCenter = camera0->view.lookat.center;
30363036
return false;
30373037
} else {
30383038
camera->mCamera.Stop();
@@ -3399,7 +3399,7 @@ void daB_DR_c::executeParts() {
33993399
mTimer[0] = 50;
34003400
ANGLE_ADD(current.angle.x, cM_rndFX(16384.0f));
34013401

3402-
mae = camera->lookat.center - current.pos;
3402+
mae = camera->view.lookat.center - current.pos;
34033403
current.angle.y = mae.atan2sX_Z();
34043404
ANGLE_ADD(current.angle.y, cM_rndFX(16384.0f));
34053405

src/d/actor/d_a_b_ds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,8 +2961,8 @@ bool daB_DS_c::mChkScreenIn() {
29612961
camera_process_class* camera = dComIfGp_getCamera(0);
29622962
cXyz vec1, vec2;
29632963

2964-
vec2 = camera->lookat.eye - camera->lookat.center;
2965-
vec1 = camera->lookat.eye - current.pos;
2964+
vec2 = camera->view.lookat.eye - camera->view.lookat.center;
2965+
vec1 = camera->view.lookat.eye - current.pos;
29662966
return abs((s16)(vec1.atan2sX_Z() - vec2.atan2sX_Z())) < 0x3000;
29672967
}
29682968

src/d/actor/d_a_b_ob.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int daB_OB_Draw(b_ob_class* i_this) {
286286

287287
for (int i = 0; i < 19; i++) {
288288
if (!i_this->mBodyParts[i].mHide) {
289-
if ((i_this->mBodyParts[i].mPos - camera->lookat.eye).abs() >
289+
if ((i_this->mBodyParts[i].mPos - camera->view.lookat.eye).abs() >
290290
i_this->mBodyParts[i].mSize * (JREG_F(17) + 500.0f))
291291
{
292292
g_env_light.setLightTevColorType_MAJI(i_this->mBodyParts[i].mpMorf->getModel(),
@@ -1946,7 +1946,7 @@ static void fish_move(b_ob_class* i_this) {
19461946
a_this->attention_info.position.y += 50.0f;
19471947

19481948
if (i_this->mDemoAction == 21 || i_this->mDemoAction == 22) {
1949-
sp84 = dComIfGp_getCamera(0)->lookat.eye - sp90;
1949+
sp84 = dComIfGp_getCamera(0)->view.lookat.eye - sp90;
19501950
} else {
19511951
sp84 = player->eyePos - sp90;
19521952
}
@@ -2027,8 +2027,8 @@ static void demo_camera(b_ob_class* i_this) {
20272027
daPy_getPlayerActorClass()->changeOriginalDemo();
20282028
daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0);
20292029

2030-
i_this->mDemoCamEye = camera0->lookat.eye;
2031-
i_this->mDemoCamCenter = camera0->lookat.center;
2030+
i_this->mDemoCamEye = camera0->view.lookat.eye;
2031+
i_this->mDemoCamCenter = camera0->view.lookat.center;
20322032
sp58 = i_this->mDemoCamEye - tentacle->current.pos;
20332033

20342034
i_this->field_0x5ce0 = cM_atan2s(sp58.x, sp58.z);

src/d/actor/d_a_bd.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int land_check(bd_class* i_this) {
215215
fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this;
216216
camera_process_class* camera = dComIfGp_getCamera(0);
217217
cXyz sp30;
218-
sp30 = camera->lookat.center - camera->lookat.eye;
218+
sp30 = camera->view.lookat.center - camera->view.lookat.eye;
219219
s16 spA = cM_atan2s(sp30.x, sp30.z);
220220

221221
if (strcmp(dComIfGp_getStartStageName(), "F_SP103") == 0) {
@@ -238,15 +238,15 @@ static int land_check(bd_class* i_this) {
238238
if (temp_r1[j] != 0) {
239239
continue;
240240
}
241-
sp30.x = land_pos[j].x - camera->lookat.eye.x;
242-
sp30.z = land_pos[j].z - camera->lookat.eye.z;
241+
sp30.x = land_pos[j].x - camera->view.lookat.eye.x;
242+
sp30.z = land_pos[j].z - camera->view.lookat.eye.z;
243243
s16 sVar2 = cM_atan2s(sp30.x, sp30.z) - spA;
244244
if (sVar2 >= 0x2000 || sVar2 <= -0x2000) {
245245
continue;
246246
}
247247

248-
sp30.x = camera->lookat.eye.x - land_pos[j].x;
249-
sp30.z = camera->lookat.eye.z - land_pos[j].z;
248+
sp30.x = camera->view.lookat.eye.x - land_pos[j].x;
249+
sp30.z = camera->view.lookat.eye.z - land_pos[j].z;
250250

251251
f32 temp_f1 = JMAFastSqrt((sp30.x * sp30.x) + (sp30.z * sp30.z));
252252
if (!(temp_f1 >= 600.0f) || !(temp_f1 < var_f31)) {

src/d/actor/d_a_e_bee.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ static void bee_control(e_bee_class* i_this) {
543543
bee->mNoDraw = false;
544544

545545
if (dComIfGp_checkPlayerStatus0(0, 0x200000)) {
546-
vec3.x = bee->mPos.x - camera->lookat.eye.x;
547-
vec3.z = bee->mPos.z - camera->lookat.eye.z;
546+
vec3.x = bee->mPos.x - camera->view.lookat.eye.x;
547+
vec3.z = bee->mPos.z - camera->view.lookat.eye.z;
548548
if (JMAFastSqrt(vec3.x * vec3.x + vec3.z * vec3.z) > NREG_F(0) + 2500.0f) {
549549
bee->mNoDraw = true;
550550
}

src/d/actor/d_a_e_bg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ void daE_BG_c::action() {
10991099
mCreatureSound.setLinkSearch(isAttacking);
11001100
if (mActionMode != 0 && mActionMode != 3) {
11011101
dBgS_LinChk linChk;
1102-
linChk.Set(&dComIfGp_getCamera(0)->lookat.eye, &attention_info.position, this);
1102+
linChk.Set(&dComIfGp_getCamera(0)->view.lookat.eye, &attention_info.position, this);
11031103
if (dComIfG_Bgsp().LineCross(&linChk)) {
11041104
attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
11051105
} else {

0 commit comments

Comments
 (0)