summaryrefslogtreecommitdiff
path: root/src/d/actor/d_a_himo2.cpp
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2026-05-24 15:34:41 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2026-05-24 15:34:41 -0400
commitf578b6d34a4b7c248e4922bd7a52b2fd2d586425 (patch)
tree57aec95c50a8d85328559418b5a5cb1beae0f359 /src/d/actor/d_a_himo2.cpp
parentb95a623434c556fdf4ceb6342105748c57253628 (diff)
d_a_himo2 almost matches for retail
Diffstat (limited to 'src/d/actor/d_a_himo2.cpp')
-rw-r--r--src/d/actor/d_a_himo2.cpp252
1 files changed, 118 insertions, 134 deletions
diff --git a/src/d/actor/d_a_himo2.cpp b/src/d/actor/d_a_himo2.cpp
index 3852bdf3..2483877e 100644
--- a/src/d/actor/d_a_himo2.cpp
+++ b/src/d/actor/d_a_himo2.cpp
@@ -209,7 +209,7 @@ void himo2_control(himo2_class* i_this, himo2_s* param_2) {
s16 r30;
int r29;
r29 = cM_atan2s(fVar1, fVar2);
- r30 = -cM_atan2s(dVar8, std::sqrtf((fVar1 * fVar1) + (fVar2 * fVar2)));
+ r30 = -cM_atan2s(dVar8, std::sqrtf(SQUARE(fVar1) + SQUARE(fVar2)));
cMtx_YrotS(*calc_mtx, r29);
cMtx_XrotM(*calc_mtx, r30);
MtxPosition(&local_68, &local_74);
@@ -271,8 +271,7 @@ void himo2_control2(himo2_class* i_this, himo2_s* param_2) {
f32 fVar2 = f28 + (param_2->m10.z - param_2[1].m10.z);
f32 dVar6 = fVar2;
r26 = cM_atan2s(fVar1, fVar2);
- dVar6 = std::sqrtf((dVar7 * dVar7) + (dVar6 * dVar6));
- r27 = -cM_atan2s(f30, dVar6);
+ r27 = -cM_atan2s(f30, std::sqrtf(SQUARE(dVar7) + SQUARE(dVar6)));
param_2[1].m1E = r26;
param_2[1].m1C = r27;
cMtx_YrotS(*calc_mtx, r26);
@@ -372,7 +371,6 @@ void himo2_disp(himo2_class* i_this) {
/* 800EC338-800ECBE8 .text daHimo2_Draw__FP11himo2_class */
static BOOL daHimo2_Draw(himo2_class* i_this) {
- /* Nonmatching */
fopAc_ac_c* actor = &i_this->actor;
cXyz* r19;
int r6;
@@ -457,8 +455,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) {
sp44.y = (15.0f * i_this->m1F70[i]);
cMtx_YrotS(*calc_mtx, apdVar2->shape_angle.y);
r6 = ((1.0f - i_this->m1F70[i]) * (-20000.0f + REG0_F(13)));
- int r4 = REG0_S(0) + i_this->m1F94;
- cMtx_ZrotM(*calc_mtx, i_this->m1F92 + i * (r4 - 2000) + r6);
+ cMtx_ZrotM(*calc_mtx, i_this->m1F92 + i * (REG0_S(0) - 2000 + i_this->m1F94) + r6);
cMtx_XrotM(*calc_mtx, i_this->m1F90);
MtxTrans(0.0f, -sp44.y, 0.0f, true);
for (int j = 0; j < 32; j++, r19++) {
@@ -483,9 +480,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) {
}
cLib_addCalc2(&i_this->m1FD4, f1_2, 1.0f, REG0_F(15) + 4.0f);
sp2C = i_this->m02EC[0] - i_this->m02EC[1];
- s16 r3 = cM_atan2s(sp2C.x, sp2C.z);
- r3 += REG0_S(0) - 0x4000;
- cMtx_YrotS(*calc_mtx, r3);
+ cMtx_YrotS(*calc_mtx, cM_atan2s(sp2C.x, sp2C.z) - 0x4000 + REG0_S(0));
sp44.x = 0.0f;
sp44.y = (REG0_F(7) + -10.0f - i_this->m1FD4);
sp44.z = (REG0_F(8) + 10.0f + i_this->m1FD4);
@@ -575,7 +570,7 @@ fopAc_ac_c* search_target(himo2_class* i_this, cXyz param_2) {
sp3C.z = r28->current.pos.z - player->current.pos.z;
MtxPosition(&sp3C, &sp30);
if ((sp30.z > 100.0f) && (r24 || (std::fabsf(sp30.y) < l_himo2HIO.m14))) {
- f4 = std::sqrtf(sp30.x * sp30.x + sp30.z * sp30.z);
+ f4 = std::sqrtf(SQUARE(sp30.x) + SQUARE(sp30.z));
if (f4 < f31) {
cXyz sp24;
camera_class* camera = dComIfGp_getCamera(0);
@@ -636,13 +631,12 @@ fopAc_ac_c* search_target(himo2_class* i_this, cXyz param_2) {
/* 800ED19C-800ED2E0 .text setTargetPos__11himo2_classFP4cXyzPfPf */
BOOL himo2_class::setTargetPos(cXyz* param_1, f32* param_2, f32* param_3) {
- /* Nonmatching - pfVar1 != NULL comparison */
*param_2 = -1.0f;
*param_3 = -1.0f;
m2524 = *param_1;
- fopAc_ac_c* pfVar1 = search_target(this, m2524);
- m217C = pfVar1;
- if (pfVar1 != NULL) {
+
+ // Fakematch?
+ if ((m217C = search_target(this, m2524)) != NULL) {
if ((fopAcM_GetParam(m217C) & 0xF0) != 0) {
*param_2 = 700.0f;
*param_3 = 100.0f;
@@ -681,7 +675,7 @@ void* b_a_sub(void* param_1, void* param_2) {
}
/* 800ED378-800ED688 .text himo2_bg_check__FP11himo2_class */
-int himo2_bg_check(himo2_class* i_this) {
+BOOL himo2_bg_check(himo2_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
u8 flag;
u32 uVar3;
@@ -755,42 +749,55 @@ void pl_pos_add(himo2_class* i_this) {
/* 800ED6F4-800F0038 .text new_himo2_move__FP11himo2_class */
void new_himo2_move(himo2_class* i_this) {
- /* Nonmatching - regalloc, retail-only inlining issues */
- fopAc_ac_c* actor = &i_this->actor;
- daPy_py_c* link;
+ /* Nonmatching - regalloc */
+ fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor;
+ fopAc_ac_c* player_actor;
+ daPy_py_c* player;
+ camera_class* camera; // r29
+ camera_class* camera2; // r23
+ dAttention_c* attention; // r23
+ u32 r30;
bool r27;
bool r26;
bool r25;
+ int r24_2;
fopAc_ac_c* r24;
- dAttention_c* attention; // r23
- u32 r30;
- int r23;
+ fopAc_ac_c* r4_r27;
+ s16 r4;
+ int r3;
s16 r22;
+
f32 f31;
- f32 f30;
- f32 f28;
- f32 f27;
+ f32 f27_4;
+ f32 f28_2;
+ f32 f26_2;
+ f32 f27_2;
+
f32 f26;
- f32 dVar25;
- f32 fVar26;
+
+ f32 f26_3;
+ f32 f27;
+ f32 f28;
+
+ f32 f27_3;
+
cXyz sp130;
cXyz sp124;
- cXyz sp118;
+ cXyz sp118; // unused
cXyz sp10C;
#if VERSION == VERSION_DEMO
btd_class* btd;
dr2_class* dr;
#endif
- daPy_py_c* player;
- camera_class* camera;
- player = (daPy_py_c*)dComIfGp_getPlayer(0);
+ player_actor = dComIfGp_getPlayer(0);
+ player = (daPy_py_c*)player_actor;
camera = (camera_class*)dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
cXyz sp100 = i_this->m02EC[0];
- cXyz spF4 = i_this->m02EC[1];
- cXyz spE8;
+ cXyz spF4 = i_this->m02EC[1]; // unused
+ cXyz spE8; // unused
f32 f3 = actor->current.pos.x - sp100.x;
- f32 f4 = (actor->current.pos.y - sp100.y);
+ f32 f4 = actor->current.pos.y - sp100.y;
f32 f0 = actor->current.pos.z - sp100.z;
i_this->m2188 = std::sqrtf(SQUARE(f3) + SQUARE(f4) + SQUARE(f0));
if (i_this->m0308 != 0) {
@@ -822,14 +829,13 @@ void new_himo2_move(himo2_class* i_this) {
r24 = NULL;
if (attention->LockonTruth()) {
r24 = attention->LockonTarget(0);
- if (r24) {
+ if (r24 != NULL) {
i_this->m2524 = r24->eyePos;
r27 = true;
}
}
if ((i_this->m02DC != 0) && (i_this->m24D9 < 3)) {
- link = (daPy_py_c*)daPy_getPlayerLinkActorClass();
- if ((link->checkRopeForceEnd()) && (!actor->eventInfo.checkCommandDemoAccrpt())) {
+ if ((daPy_getPlayerLinkActorClass()->checkRopeForceEnd()) && (!actor->eventInfo.checkCommandDemoAccrpt())) {
i_this->m24D9 = 0;
i_this->m24D8 = 0;
fopAcM_SetParam(actor, 0);
@@ -856,7 +862,7 @@ void new_himo2_move(himo2_class* i_this) {
case 0: {
actor->speedF = 0.0f;
if ((r30 == 0) && player->checkRopeReadyAnime()) {
- cMtx_YrotS(*calc_mtx, player->shape_angle.y);
+ cMtx_YrotS(*calc_mtx, player_actor->shape_angle.y);
cMtx_ZrotM(*calc_mtx, REG0_S(2) + -12000);
cMtx_YrotM(*calc_mtx, i_this->m02D8 * (REG0_S(3) + 0x2000));
sp130.x = 0.0f;
@@ -869,15 +875,14 @@ void new_himo2_move(himo2_class* i_this) {
fopAcM_seStart(actor, JA_SE_LK_ROPE_COIL_1, 0);
}
} else {
- r23 = (i_this->m2188 * (REG0_F(3) + 0.060000002f));
- i_this->m02CC = 97 - r23;
+ i_this->m02CC = 97 - (int)(i_this->m2188 * (REG0_F(3) + 0.060000002f));
cLib_addCalc2(&actor->current.pos.x, sp100.x, 1.0f, i_this->m2500 * 200.0f);
cLib_addCalc2(&actor->current.pos.y, sp100.y, 1.0f, i_this->m2500 * 200.0f);
cLib_addCalc2(&actor->current.pos.z, sp100.z, 1.0f, i_this->m2500 * 200.0f);
cLib_addCalc2(&i_this->m2500, 1.0f, 1.0f, 0.005f);
sp130 = actor->current.pos - sp100;
if (sp130.abs() > 5.0f) {
- fopAcM_seStart(player, JA_SE_LK_ROPE_UNWIND, 0);
+ fopAcM_seStart(player_actor, JA_SE_LK_ROPE_UNWIND, 0);
}
}
if (fopAcM_GetParam(actor) == 1) {
@@ -887,24 +892,22 @@ void new_himo2_move(himo2_class* i_this) {
i_this->m029E = 0;
i_this->m02A0 = REG0_S(9) + 10;
i_this->m02A2 = 3;
- camera = (camera_class*)dComIfGp_getCamera(0);
- f28 = i_this->m2524.x - camera->mLookat.mEye.x;
- f27 = i_this->m2524.y - camera->mLookat.mEye.y;
- f32 f26 = i_this->m2524.z - camera->mLookat.mEye.z;
+ camera2 = (camera_class*)dComIfGp_getCamera(0);
+ f28 = i_this->m2524.x - camera2->mLookat.mEye.x;
+ f27 = i_this->m2524.y - camera2->mLookat.mEye.y;
+ f26_3 = i_this->m2524.z - camera2->mLookat.mEye.z;
sp130.z = REG0_F(15) * 100.0f + 1000.0f;
- f30 = SQUARE(f26);
- f31 = SQUARE(f28);
- if (std::sqrtf(f31 + SQUARE(f27) + f30) > sp130.z) {
- int r24 = cM_atan2s(f28, f26);
- r22 = -cM_atan2s(f27, std::sqrtf(f31 + f30));
- cMtx_YrotS(*calc_mtx, r24);
+ if (std::sqrtf(SQUARE(f28) + SQUARE(f27) + SQUARE(f26_3)) > sp130.z) {
+ r24_2 = cM_atan2s(f28, f26_3);
+ r22 = -cM_atan2s(f27, std::sqrtf(SQUARE(f28) + SQUARE(f26_3)));
+ cMtx_YrotS(*calc_mtx, r24_2);
cMtx_XrotM(*calc_mtx, r22);
sp130.x = 0.0f;
sp130.y = 0.0f;
MtxPosition(&sp130, &sp124);
- i_this->m2524.x = camera->mLookat.mEye.x + sp124.x;
- i_this->m2524.y = camera->mLookat.mEye.y + sp124.y;
- i_this->m2524.z = camera->mLookat.mEye.z + sp124.z;
+ i_this->m2524.x = camera2->mLookat.mEye.x + sp124.x;
+ i_this->m2524.y = camera2->mLookat.mEye.y + sp124.y;
+ i_this->m2524.z = camera2->mLookat.mEye.z + sp124.z;
}
himo2_s* phVar18 = i_this->m0310;
if (r30 != 0) {
@@ -931,7 +934,7 @@ void new_himo2_move(himo2_class* i_this) {
break;
}
case 1: {
- cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
+ cMtx_YrotS(*calc_mtx, player_actor->shape_angle.y);
cMtx_ZrotM(*calc_mtx, REG0_S(2) + -12000);
cMtx_YrotM(*calc_mtx, i_this->m02D8 * (REG0_S(3) + 0x2000));
sp130.x = 0.0f;
@@ -952,16 +955,14 @@ void new_himo2_move(himo2_class* i_this) {
if (r27) {
i_this->m0308 = REG0_S(4) + 70;
i_this->m217C = r24;
- fpc_ProcID fVar10 = fopAcM_GetID(r24);
- i_this->m2180 = fVar10;
+ i_this->m2180 = fopAcM_GetID(r24);
} else {
i_this->m0308 = REG0_S(2) + 20;
i_this->m2180 = fpcM_ERROR_PROCESS_ID_e;
}
sp130 = i_this->m2524 - actor->current.pos;
actor->current.angle.y = cM_atan2s(sp130.x, sp130.z);
- f32 f2 = std::sqrtf(sp130.x * sp130.x + sp130.z * sp130.z);
- actor->current.angle.x = -cM_atan2s(sp130.y, f2);
+ actor->current.angle.x = -cM_atan2s(sp130.y, std::sqrtf(SQUARE(sp130.x) + SQUARE(sp130.z)));
fopAcM_seStart(actor, JA_SE_LK_ROPE_LAUNCH, 0);
}
break;
@@ -986,24 +987,22 @@ void new_himo2_move(himo2_class* i_this) {
} else {
sp10C = i_this->m2524;
}
- dVar25 = (sp10C.x - actor->current.pos.x);
- f30 = (sp10C.y - actor->current.pos.y);
- f28 = (sp10C.z - actor->current.pos.z);
- f31 = (f28 * f28);
- f27 = (dVar25 * dVar25);
- f32 f26 = std::sqrtf(f31 + (f27 + (f30 * f30)));
- f27 = std::sqrtf(f27 + f31);
- r23 = (s16)(f26 * (REG0_F(3) + -5.0f));
- if (r23 < (s16)(REG0_S(2) + -3000)) {
- r23 = REG0_S(2) + -3000;
- }
- if ((i_this->m217C != NULL) || (f26 > (actor->speedF * 10.0f))) {
- actor->current.angle.y = cM_atan2s(dVar25, f28);
- actor->current.angle.x = -cM_atan2s(f30, f27);
+ f31 = sp10C.x - actor->current.pos.x;
+ f27_4 = sp10C.y - actor->current.pos.y;
+ f28_2 = sp10C.z - actor->current.pos.z;
+ f26_2 = std::sqrtf(SQUARE(f31) + SQUARE(f27_4) + SQUARE(f28_2));
+ f27_2 = std::sqrtf(SQUARE(f31) + SQUARE(f28_2));
+ r4 = (s16)(f26_2 * (REG0_F(3) + -5.0f));
+ if (r4 < (s16)(REG0_S(2) + -3000)) {
+ r4 = REG0_S(2) + -3000;
+ }
+ if ((i_this->m217C != NULL) || (f26_2 > (actor->speedF * 10.0f))) {
+ actor->current.angle.y = cM_atan2s(f31, f28_2);
+ actor->current.angle.x = -cM_atan2s(f27_4, f27_2);
}
actor->speedF = 20.0f;
cMtx_YrotS(*calc_mtx, actor->current.angle.y);
- cMtx_XrotM(*calc_mtx, actor->current.angle.x + r23);
+ cMtx_XrotM(*calc_mtx, actor->current.angle.x + r4);
sp130.y = 0.0f;
sp130.x = 0.0f;
sp130.z = actor->speedF;
@@ -1011,7 +1010,7 @@ void new_himo2_move(himo2_class* i_this) {
actor->current.pos += actor->speed;
pl_pos_add(i_this);
if (i_this->m217C != NULL) {
- if ((f30 < (actor->speedF * 10.0f)) || (i_this->m0308 == 0)) {
+ if ((f27_4 < (actor->speedF * 10.0f)) || (i_this->m0308 == 0)) {
i_this->m02DC = 10;
i_this->m24D9 = 0xFF;
i_this->m24D8 = 1;
@@ -1055,15 +1054,11 @@ void new_himo2_move(himo2_class* i_this) {
}
case 3: {
i_this->m02CC = REG0_S(0);
- // fakematch - why is this not getting inlined?
- // r24 = fopAcM_SearchByID(i_this->m2180);
- fpc_ProcID sp08 = i_this->m2180;
- r24 = (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)fpcSch_JudgeByID, &sp08);
- if (r24 != NULL) {
- sp130 = r24->eyePos - actor->current.pos;
+ r4_r27 = fopAcM_SearchByID(i_this->m2180);
+ if (r4_r27 != NULL) {
+ sp130 = r4_r27->eyePos - actor->current.pos;
cLib_addCalcAngleS2(&actor->current.angle.y, cM_atan2s(sp130.x, sp130.z), 2, REG0_S(1) + 0x800);
- f32 f2 = std::sqrtf(sp130.x * sp130.x + sp130.z * sp130.z);
- cLib_addCalcAngleS2(&actor->current.angle.x, -cM_atan2s(sp130.y, f2), 2, REG0_S(1) + 0x800);
+ cLib_addCalcAngleS2(&actor->current.angle.x, -cM_atan2s(sp130.y, std::sqrtf(SQUARE(sp130.x) + SQUARE(sp130.z))), 2, REG0_S(1) + 0x800);
if (sp130.abs() < (REG0_F(3) + 50.0f)) {
r26 = true;
}
@@ -1077,8 +1072,7 @@ void new_himo2_move(himo2_class* i_this) {
MtxPosition(&sp130, &actor->speed);
actor->current.pos += actor->speed;
pl_pos_add(i_this);
- r23 = himo2_bg_check(i_this);
- if (r23 != 0) {
+ if (himo2_bg_check(i_this)) {
r26 = true;
i_this->m2500 = 0.1f;
}
@@ -1096,11 +1090,8 @@ void new_himo2_move(himo2_class* i_this) {
break;
}
case 4: {
- // fakematch - why is this not getting inlined?
- // r24 = fopAcM_SearchByID(i_this->m2180);
- fpc_ProcID sp08 = i_this->m2180;
- r24 = (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)fpcSch_JudgeByID, &sp08);
- if (r24 == NULL) {
+ r4_r27 = fopAcM_SearchByID(i_this->m2180);
+ if (r4_r27 == NULL) {
i_this->m02DC = 5;
} else {
cMtx_YrotS(*calc_mtx, (i_this->m02D8 << 13));
@@ -1108,20 +1099,19 @@ void new_himo2_move(himo2_class* i_this) {
sp130.y = 0.0f;
sp130.z = i_this->m2184;
MtxPosition(&sp130, &sp124);
- actor->current.pos = r24->eyePos + sp124;
+ actor->current.pos = r4_r27->eyePos + sp124;
cLib_addCalc0(&i_this->m2184, 1.0f, 5.0f);
if (i_this->m2184 < 0.1f) {
fopAcM_SetParam(actor, 0);
}
- r23 = (i_this->m2188 * (REG0_F(5) + 0.060000002f));
- r23 = 97 - r23;
- if ((r23 < i_this->m02CC) || (i_this->m2184 < 0.1f)) {
- i_this->m02CC = r23;
+ r3 = 97 - (int)(i_this->m2188 * (REG0_F(5) + 0.060000002f));
+ if ((r3 < i_this->m02CC) || (i_this->m2184 < 0.1f)) {
+ i_this->m02CC = r3;
}
if ((CPad_CHECK_TRIG_X(0) || CPad_CHECK_TRIG_Y(0)) || CPad_CHECK_TRIG_Z(0)) {
i_this->m02DC = 5;
- if (fopAcM_GetName(r24) == PROC_BK) {
- bk_class* bk = (bk_class*)r24;
+ if (fopAcM_GetName(r4_r27) == PROC_BK) {
+ bk_class* bk = (bk_class*)r4_r27;
bk->dr.mAction = 0;
bk->dr.mMode = 0;
}
@@ -1138,9 +1128,8 @@ void new_himo2_move(himo2_class* i_this) {
cLib_addCalc2(&i_this->m2500, 1.0f, 1.0f, 0.01f);
pl_pos_add(i_this);
sp130 = actor->current.pos - sp100;
- r23 = -1;
if (sp130.abs() > 5.0f) {
- fopAcM_seStart(player, JA_SE_LK_ROPE_UNWIND, 0);
+ fopAcM_seStart(player_actor, JA_SE_LK_ROPE_UNWIND, 0);
} else {
fopAcM_SetParam(actor, 0);
fopAcM_seStart(actor, JA_SE_LK_ROPE_UNCOIL, 0);
@@ -1160,9 +1149,8 @@ void new_himo2_move(himo2_class* i_this) {
cLib_addCalc2(&i_this->m2500, 1.0f, 1.0f, 0.01f);
pl_pos_add(i_this);
sp130 = actor->current.pos - sp100;
- r23 = -1;
if (sp130.abs() > 5.0f) {
- fopAcM_seStart(player, JA_SE_LK_ROPE_UNWIND, 0);
+ fopAcM_seStart(player_actor, JA_SE_LK_ROPE_UNWIND, 0);
} else {
fopAcM_SetParam(actor, 0);
i_this->m02DC = 0;
@@ -1173,8 +1161,7 @@ void new_himo2_move(himo2_class* i_this) {
break;
}
case 10: {
- r23 = (i_this->m2188 * (REG0_F(1) + 0.060000002f));
- i_this->m02CC = 100 - r23;
+ i_this->m02CC = 100 - (int)(i_this->m2188 * (REG0_F(1) + 0.060000002f));
actor->current.pos = i_this->m2504;
cLib_addCalc2(&i_this->m02E4, -6.25f, 1.0f, 0.375f);
if (fopAcM_GetParam(actor) == 3) {
@@ -1190,8 +1177,7 @@ void new_himo2_move(himo2_class* i_this) {
}
case 11: {
actor->current.pos = i_this->m2504;
- r23 = (i_this->m2188 * (REG0_F(2) + 0.060000002f));
- i_this->m02CC = 100 - r23;
+ i_this->m02CC = 100 - (int)(i_this->m2188 * (REG0_F(2) + 0.060000002f));
i_this->m217C->health = 3;
label_1260:
if (fopAcM_GetParam(actor) == 4) {
@@ -1287,11 +1273,11 @@ void new_himo2_move(himo2_class* i_this) {
cLib_addCalc2(&i_this->m24B4, -144.0f, 1.0f, 10.0f);
if (i_this->m24B4 > -145.0f) {
if (i_this->m24BC < 400) {
- fVar26 = 20.0f - (i_this->m217C->scale.y - 1.0f) * 17.0f;
- if (fVar26 < 0.5f) {
- fVar26 = 0.5f;
+ f32 f1 = 20.0f - (i_this->m217C->scale.y - 1.0f) * 17.0f;
+ if (f1 < 0.5f) {
+ f1 = 0.5f;
}
- int r3 = (i_this->m24C4 / fVar26);
+ int r3 = (i_this->m24C4 / f1);
int r5 = r3 + 1;
i_this->m24C0 = i_this->m24BC;
i_this->m24BC += r5;
@@ -1426,12 +1412,12 @@ void new_himo2_move(himo2_class* i_this) {
i_this->m24F8 = 65.0f;
cMtx_YrotS(*calc_mtx, i_this->m2510);
sp130.x = REG0_F(7) + 100.0f + 200.0f;
- sp130.y = player->current.pos.y + 700.0f + REG0_F(8);
+ sp130.y = player_actor->current.pos.y + 700.0f + REG0_F(8);
sp130.z = REG0_F(9) + -500.0f;
MtxPosition(&sp130, &i_this->m24DC);
- i_this->m24DC.x = i_this->m24DC.x + player->current.pos.x * (REG0_F(15) + 0.55f);
- i_this->m24DC.z = i_this->m24DC.z + player->current.pos.z * (REG0_F(15) + 0.55f);
- i_this->m24E8 = player->current.pos;
+ i_this->m24DC.x = i_this->m24DC.x + player_actor->current.pos.x * (REG0_F(15) + 0.55f);
+ i_this->m24DC.z = i_this->m24DC.z + player_actor->current.pos.z * (REG0_F(15) + 0.55f);
+ i_this->m24E8 = player_actor->current.pos;
i_this->m24E8.y = i_this->m24E8.y - 50.0f;
daYkgr_c::show();
} else {
@@ -1472,14 +1458,14 @@ void new_himo2_move(himo2_class* i_this) {
cLib_addCalc2(&i_this->m24F4, i_this->m24F8, 0.1f, 10.0f);
cMtx_YrotS(*calc_mtx, i_this->m2510);
sp130.x = REG0_F(7) + 100.0f + 200.0f;
- sp130.y = player->current.pos.y + 700.0f + REG0_F(8);
+ sp130.y = player_actor->current.pos.y + 700.0f + REG0_F(8);
sp130.z = REG0_F(9) + -500.0f;
MtxPosition(&sp130, &i_this->m24DC);
- i_this->m24DC.x = i_this->m24DC.x + player->current.pos.x * (REG0_F(15) + 0.55f);
- i_this->m24DC.z = i_this->m24DC.z + player->current.pos.z * (REG0_F(15) + 0.55f);
- cLib_addCalc2(&i_this->m24E8.x, player->current.pos.x, 0.3f, 100.0f);
- cLib_addCalc2(&i_this->m24E8.y, (player->current.pos.y - 50.0f) + REG0_F(10), 0.3f, 100.0f);
- cLib_addCalc2(&i_this->m24E8.z, player->current.pos.z, 0.3f, 100.0f);
+ i_this->m24DC.x = i_this->m24DC.x + player_actor->current.pos.x * (REG0_F(15) + 0.55f);
+ i_this->m24DC.z = i_this->m24DC.z + player_actor->current.pos.z * (REG0_F(15) + 0.55f);
+ cLib_addCalc2(&i_this->m24E8.x, player_actor->current.pos.x, 0.3f, 100.0f);
+ cLib_addCalc2(&i_this->m24E8.y, (player_actor->current.pos.y - 50.0f) + REG0_F(10), 0.3f, 100.0f);
+ cLib_addCalc2(&i_this->m24E8.z, player_actor->current.pos.z, 0.3f, 100.0f);
#if VERSION > VERSION_DEMO
if ((i_this->m02A4 == 0) && (!player->checkPlayerFly())) {
camera->mCamera.Start();
@@ -1548,12 +1534,13 @@ void new_himo2_move(himo2_class* i_this) {
if (i_this->m029C == 170) {
fopAcM_seStartCurrent((fopAc_ac_c*)dr, JA_SE_CM_BTD_BEF_ROCK_FALL, 0);
}
+ f32 f1;
if (i_this->m029C > 150) {
- fVar26 = 2000.0f;
+ f1 = 2000.0f;
} else {
- fVar26 = 100.0f;
+ f1 = 100.0f;
}
- cLib_addCalc2(&dr->unk_414, fVar26, 0.5f, 100.0f);
+ cLib_addCalc2(&dr->unk_414, f1, 0.5f, 100.0f);
if (i_this->m029C <= 120) {
cLib_addCalc2(&i_this->m24E8.y, REG0_F(5) * 0.1f + 650.0f, 1.0f, 100.0f);
cLib_addCalc2(&i_this->m24DC.y, 0.0f, 0.5f, 100.0f);
@@ -1583,10 +1570,10 @@ void new_himo2_move(himo2_class* i_this) {
i_this->m029C = 220;
} else {
i_this->m24D9 = 0;
- cXyz spDC = player->eyePos;
+ cXyz spDC = player_actor->eyePos;
spDC.x *= 0.9f;
spDC.z *= 0.9f;
- camera->mCamera.Reset(player->eyePos, spDC);
+ camera->mCamera.Reset(player_actor->eyePos, spDC);
camera->mCamera.Start();
camera->mCamera.SetTrimSize(0);
fopAcM_OffStatus(&btd->actor, fopAcStts_UNK4000_e);
@@ -1624,10 +1611,10 @@ void new_himo2_move(himo2_class* i_this) {
}
if (i_this->m029C == 0) {
i_this->m24D9 = 0;
- cXyz spD0 = player->eyePos;
+ cXyz spD0 = player_actor->eyePos;
spD0.x *= 0.9f;
spD0.z *= 0.9f;
- camera->mCamera.Reset(player->eyePos, spD0);
+ camera->mCamera.Reset(player_actor->eyePos, spD0);
camera->mCamera.Start();
camera->mCamera.SetTrimSize(0);
fopAcM_OffStatus(&btd->actor, fopAcStts_UNK4000_e);
@@ -1638,21 +1625,17 @@ void new_himo2_move(himo2_class* i_this) {
}
if (i_this->m24D9 > 0) {
- f32 f26 = cM_ssin(i_this->m02D8 * 0x3300);
- f27 = (i_this->m2520 * f26);
- f26 = cM_scos(i_this->m02D8 * 0x3000);
cXyz spC4;
cXyz spB8;
- f32 f1 = (i_this->m2520 * f26);
- spC4.x = (i_this->m24DC.x + f27);
+ f27_3 = (i_this->m2520 * cM_ssin(i_this->m02D8 * 0x3300));
+ f32 f1 = (i_this->m2520 * cM_scos(i_this->m02D8 * 0x3000));
+ spC4.x = (i_this->m24DC.x + f27_3);
spC4.y = i_this->m24DC.y + f1;
spC4.z = i_this->m24DC.z;
- spB8.x = (i_this->m24E8.x + f27);
+ spB8.x = (i_this->m24E8.x + f27_3);
spB8.y = i_this->m24E8.y + f1;
spB8.z = i_this->m24E8.z;
- f32 f1_3 = cM_scos(i_this->m02D8 * 0x1C00);
- f32 f1_2 = (i_this->m2520 * f1_3);
- s16 r23 = 7.5f * f1_2;
+ s16 r23 = 7.5f * (i_this->m2520 * cM_scos(i_this->m02D8 * 0x1C00));
camera->mCamera.Set(spB8, spC4, r23, i_this->m24F4);
cLib_addCalc0(&i_this->m2520, 1.0f, (REG0_F(16) + 2.0f));
s16 r23_2 = 0;
@@ -1686,6 +1669,7 @@ void new_himo2_move(himo2_class* i_this) {
}
}
}
+
if (i_this->m02CC < 2) {
i_this->m02CC = 2;
}