diff --git a/include/d/actor/d_a_kamome.h b/include/d/actor/d_a_kamome.h index bef262278..da9c2ac62 100644 --- a/include/d/actor/d_a_kamome.h +++ b/include/d/actor/d_a_kamome.h @@ -52,9 +52,8 @@ struct kamome_class { /* 0x304 */ dPath* mpPath; /* 0x308 */ u8 m308; /* 0x309 */ u8 m309[0x30A - 0x309]; - /* 0x30A */ s16 mRotX; - /* 0x30C */ s16 mRotY; - /* 0x30E */ u8 m30E[0x31C - 0x30E]; + /* 0x30A */ csXyz mRot; + /* 0x310 */ u8 m310[0x31C - 0x310]; /* 0x31C */ dBgS_AcchCir mAcchCir; /* 0x35C */ dBgS_ObjAcch mAcch; /* 0x520 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_npc_md.h b/include/d/actor/d_a_npc_md.h index 5b6d43cbb..daa33a428 100644 --- a/include/d/actor/d_a_npc_md.h +++ b/include/d/actor/d_a_npc_md.h @@ -124,6 +124,8 @@ public: s8 getArmRlocJntNum() { return m_armRloc_jnt_num; } s8 getArmLJntNum() { return m_armL_jnt_num; } s8 getArmLlocJntNum() { return m_armLloc_jnt_num; } + s8 getWingRlocJntNum() { return m_wingRloc_jnt_num; } + s8 getWingLlocJntNum() { return m_wingLloc_jnt_num; } s8 getHairJntNum(int i) { return m_hair_jnt_nums[i]; } J3DModel* getModel() { return mpMorf->getModel(); } diff --git a/include/d/actor/d_a_obj_swhammer.h b/include/d/actor/d_a_obj_swhammer.h index de1b559fa..fa6edfd66 100644 --- a/include/d/actor/d_a_obj_swhammer.h +++ b/include/d/actor/d_a_obj_swhammer.h @@ -32,7 +32,7 @@ namespace daObjSwhammer { void set_mtx(); void init_mtx(); void set_damage(); - void vib_start(short, float); + void vib_start(s16, f32); void vib_proc(); void crush_start(); void crush_proc(); @@ -53,7 +53,7 @@ namespace daObjSwhammer { virtual ~Act_c() {} static int M_damage; - static short M_damage_dir; + static s16 M_damage_dir; static Mtx M_tmp_mtx; static const char M_arcname[7]; @@ -68,18 +68,18 @@ namespace daObjSwhammer { /* 0x440 */ dCcD_Cyl mCylTg; /* 0x570 */ dCcD_Stts mSttsTg; /* 0x5AC */ int mMode; - /* 0x5B0 */ short mCrushTimer; + /* 0x5B0 */ s16 mCrushTimer; /* 0x5B2 */ u8 mCrushState; - /* 0x5B4 */ float mScaleYSpeed; - /* 0x5B8 */ float mScaleY; - /* 0x5BC */ float mAngleZ; - /* 0x5C0 */ float mAngleX; - /* 0x5C4 */ float mAngleSpeedZ; - /* 0x5C8 */ float mAngleSpeedX; - /* 0x5CC */ float mTargetHFrac; - /* 0x5D0 */ float mCurHFrac; - /* 0x5D4 */ float mVSpeed; - /* 0x5D8 */ float mTopPos; + /* 0x5B4 */ f32 mScaleYSpeed; + /* 0x5B8 */ f32 mScaleY; + /* 0x5BC */ f32 mAngleZ; + /* 0x5C0 */ f32 mAngleX; + /* 0x5C4 */ f32 mAngleSpeedZ; + /* 0x5C8 */ f32 mAngleSpeedX; + /* 0x5CC */ f32 mTargetHFrac; + /* 0x5D0 */ f32 mCurHFrac; + /* 0x5D4 */ f32 mVSpeed; + /* 0x5D8 */ f32 mTopPos; /* 0x5DC */ dPa_smokeEcallBack mSmokeCb; /* 0x5FC */ bool m5FC; }; /* Size: 0x600 */ diff --git a/src/d/actor/d_a_kamome.cpp b/src/d/actor/d_a_kamome.cpp index b46ff0ef5..ca445204b 100644 --- a/src/d/actor/d_a_kamome.cpp +++ b/src/d/actor/d_a_kamome.cpp @@ -44,7 +44,7 @@ static s32 esa_check_count; static s32 ko_count; /* 000000EC-000001E4 .text anm_init__FP12kamome_classifUcfi */ -void anm_init(kamome_class* i_this, int anmResIdx, float morf, unsigned char loopMode, float speed, int soundAnmResIdx) { +static void anm_init(kamome_class* i_this, int anmResIdx, float morf, unsigned char loopMode, float speed, int soundAnmResIdx) { if (REG0_S(3) == 0x23) { anmResIdx = dRes_INDEX_KAMOME_BCK_KA_LAND1_e; } else if (REG0_S(3) == 0x24) { @@ -81,7 +81,7 @@ static void* s_a_d_sub(void* ac1, void* ac2) { } /* 000008F0-00000A44 .text search_esa__FP12kamome_class */ -fopAc_ac_c* search_esa(kamome_class* i_this) { +static fopAc_ac_c* search_esa(kamome_class* i_this) { esa_check_count = 0; fpcM_Search(s_a_d_sub, &i_this->actor); @@ -111,7 +111,7 @@ fopAc_ac_c* search_esa(kamome_class* i_this) { } /* 00000A44-00000A90 .text s_a_i_sub__FPvPv */ -void* s_a_i_sub(void* ac1, void* ac2) { +static void* s_a_i_sub(void* ac1, void* ac2) { UNUSED(ac2); if (fopAc_IsActor(ac1) && fpcM_GetName(ac1) == fpcNm_NPC_LS1_e) { return ac1; @@ -120,7 +120,7 @@ void* s_a_i_sub(void* ac1, void* ac2) { } /* 00000A90-00000ABC .text search_imouto__FP12kamome_class */ -fopAc_ac_c* search_imouto(kamome_class* i_this) { +static fopAc_ac_c* search_imouto(kamome_class* i_this) { return (fopAc_ac_c*)fpcM_Search(s_a_i_sub, &i_this->actor); } @@ -175,7 +175,7 @@ static BOOL daKamome_Draw(kamome_class* i_this) { } /* 00000CAC-00000F70 .text kamome_pos_move__FP12kamome_class */ -void kamome_pos_move(kamome_class* i_this) { +static void kamome_pos_move(kamome_class* i_this) { f32 fVar4 = i_this->mTargetPos.x - i_this->actor.current.pos.x; f32 fVar1 = i_this->mTargetPos.y - i_this->actor.current.pos.y; f32 fVar5 = i_this->mTargetPos.z - i_this->actor.current.pos.z; @@ -214,7 +214,7 @@ void kamome_pos_move(kamome_class* i_this) { } /* 00000F70-00000FFC .text kamome_bgcheck__FP12kamome_class */ -void kamome_bgcheck(kamome_class* i_this) { +static void kamome_bgcheck(kamome_class* i_this) { f32 fVar1 = i_this->mScale * 40.0f; i_this->actor.current.pos.y = i_this->actor.current.pos.y - fVar1; i_this->actor.old.pos.y = i_this->actor.old.pos.y - fVar1; @@ -224,7 +224,7 @@ void kamome_bgcheck(kamome_class* i_this) { } /* 00000FFC-00001150 .text kamome_ground_pos_move__FP12kamome_class */ -void kamome_ground_pos_move(kamome_class* i_this) { +static void kamome_ground_pos_move(kamome_class* i_this) { s16 iVar2 = cM_atan2s(i_this->mTargetPos.x - i_this->actor.current.pos.x, i_this->mTargetPos.z - i_this->actor.current.pos.z); cLib_addCalcAngleS2(&i_this->actor.current.angle.y, iVar2, REG0_S(3) + 2, i_this->mRotVel * i_this->mRotVelFade); @@ -255,7 +255,7 @@ void kamome_ground_pos_move(kamome_class* i_this) { } /* 00001150-000011B8 .text ko_s_sub__FPvPv */ -void* ko_s_sub(void* ac1, void* ac2) { +static void* ko_s_sub(void* ac1, void* ac2) { UNUSED(ac2); kamome_class* i_this = (kamome_class*)ac1; if (fopAcM_IsActor(&i_this->actor) && fopAcM_GetName(&i_this->actor) == fpcNm_KAMOME_e && (fopAcM_GetParam(&i_this->actor) & 0xf) == 7) { @@ -265,14 +265,14 @@ void* ko_s_sub(void* ac1, void* ac2) { } /* 000011B8-000011FC .text ko_check__FP12kamome_class */ -s32 ko_check(kamome_class* i_this) { +static s32 ko_check(kamome_class* i_this) { ko_count = 0; fpcM_Search(ko_s_sub, &i_this->actor); return ko_count; } /* 000011FC-00001304 .text heisou_control__FP12kamome_class */ -void heisou_control(kamome_class* i_this) { +static void heisou_control(kamome_class* i_this) { fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->mbNoDraw = 1; #if VERSION > VERSION_DEMO @@ -291,7 +291,7 @@ void heisou_control(kamome_class* i_this) { } /* 00001304-00001360 .text h_s_sub__FPvPv */ -void* h_s_sub(void* ac1, void* ac2) { +static void* h_s_sub(void* ac1, void* ac2) { UNUSED(ac2); kamome_class* i_this = (kamome_class*)ac1; if (fopAcM_IsActor(&i_this->actor) && fopAcM_GetName(&i_this->actor) == fpcNm_KAMOME_e && (fopAcM_GetParam(&i_this->actor) & 0xf) == 6) { @@ -301,7 +301,7 @@ void* h_s_sub(void* ac1, void* ac2) { } /* 00001360-000013BC .text search_master__FP12kamome_class */ -BOOL search_master(kamome_class* i_this) { +static BOOL search_master(kamome_class* i_this) { kamome_class* pvVar1 = (kamome_class*)fpcM_Search(h_s_sub, &i_this->actor); if (pvVar1 != NULL && (s32)i_this->mKoMaxCount < pvVar1->mKoMaxCount) { return TRUE; @@ -310,7 +310,7 @@ BOOL search_master(kamome_class* i_this) { } /* 000013BC-00001A0C .text kamome_heisou_move__FP12kamome_class */ -void kamome_heisou_move(kamome_class* i_this) { +static void kamome_heisou_move(kamome_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); s32 frame; @@ -420,7 +420,7 @@ void kamome_heisou_move(kamome_class* i_this) { } /* 00001A0C-00002740 .text kamome_path_move__FP12kamome_class */ -void kamome_path_move(kamome_class* i_this) { +static void kamome_path_move(kamome_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; s8 moveType = 0; s32 frame; @@ -705,7 +705,7 @@ void kamome_path_move(kamome_class* i_this) { } /* 00002740-00003628 .text kamome_auto_move__FP12kamome_class */ -void kamome_auto_move(kamome_class* i_this) { +static void kamome_auto_move(kamome_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); fopAc_ac_c* pfVar4; @@ -1017,7 +1017,7 @@ void kamome_auto_move(kamome_class* i_this) { } /* 00003628-00004574 .text kamome_imouto_move__FP12kamome_class */ -void kamome_imouto_move(kamome_class* i_this) { +static void kamome_imouto_move(kamome_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); s8 cVar8 = 0; @@ -1306,7 +1306,7 @@ void kamome_imouto_move(kamome_class* i_this) { } /* 00004574-00004680 .text kamome_imouto2_move__FP12kamome_class */ -void kamome_imouto2_move(kamome_class* i_this) { +static void kamome_imouto2_move(kamome_class* i_this) { switch (i_this->mMoveState) { case 0: i_this->m2AB = 1; @@ -1327,11 +1327,11 @@ void kamome_imouto2_move(kamome_class* i_this) { } /* 00004680-00004768 .text daKamome_setMtx__FP12kamome_class */ -void daKamome_setMtx(kamome_class* i_this) { +static void daKamome_setMtx(kamome_class* i_this) { MtxTrans(i_this->actor.current.pos.x, i_this->actor.current.pos.y, i_this->actor.current.pos.z, 0); - cMtx_YrotM(*calc_mtx, i_this->actor.current.angle.y + i_this->mRotY); - cMtx_XrotM(*calc_mtx, i_this->actor.current.angle.x + i_this->mRotX); + cMtx_YrotM(*calc_mtx, i_this->actor.current.angle.y + i_this->mRot.y); + cMtx_XrotM(*calc_mtx, i_this->actor.current.angle.x + i_this->mRot.x); cMtx_ZrotM(*calc_mtx, i_this->actor.current.angle.z); J3DModel* pJVar1 = i_this->mpMorf->getModel(); diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index 0e6c2c016..aad63a943 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -1321,7 +1321,7 @@ BOOL daNpc_Md_c::lightHitCheck() { if (mCps.ChkAtHit()) { fopAc_ac_c* hitActor = mCps.GetAtHitAc(); - if (fopAcM_CheckStatus(this, fopAcStts_CARRY_e) && !isNoCarryAction()) { + if (fopAcM_checkCarryNow(this) && !isNoCarryAction()) { if (hitActor != dComIfGp_getLinkPlayer() && m3058.getEmitter() == NULL) { dComIfGp_particle_set(dPa_name::ID_AK_SN_HITSHIELDLIGHT00, ¤t.pos, NULL, NULL, 0xFF, &m3058); } @@ -2038,7 +2038,7 @@ BOOL daNpc_Md_c::carryNpcAction(void*) { } else { m3131 = 0; bVar1 = false; - if (fopAcM_CheckStatus(this, fopAcStts_CARRY_e)) { + if (fopAcM_checkCarryNow(this)) { setRestart(2); } if (!isNoCarryAction()) { @@ -2095,7 +2095,7 @@ BOOL daNpc_Md_c::carryNpcAction(void*) { fopAcM_monsSeStart(this, JA_SE_CV_MD_FLY_END, ¤t.pos, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); } } - if (!fopAcM_CheckStatus(this, fopAcStts_CARRY_e)) { + if (!fopAcM_checkCarryNow(this)) { if (isNoCarryAction()) { if (speedF > 0.0f) { setNpcAction(&daNpc_Md_c::throwNpcAction); @@ -5404,7 +5404,7 @@ void daNpc_Md_c::setCollision() { local_20.setall(0.0f); local_2c = current.pos; f32 radius = 30.0f; - if ((!isShipRide()) && (!fopAcM_CheckStatus(this, fopAcStts_CARRY_e))) { + if ((!isShipRide()) && (!fopAcM_checkCarryNow(this))) { mCyl1.SetC(local_2c); mCyl1.SetR(radius); mCyl1.SetH(m30F8); @@ -5549,7 +5549,7 @@ void daNpc_Md_c::setBaseMtx() { J3DModel* model; model = getModel(); - if (fopAcM_CheckStatus(this, fopAcStts_CARRY_e)) { + if (fopAcM_checkCarryNow(this)) { if (isNoCarryAction()) { mDoMtx_stack_c::transS(current.pos); mDoMtx_stack_c::ZXYrotM(shape_angle); @@ -5772,9 +5772,9 @@ BOOL daNpc_Md_c::draw() { } #if VERSION == VERSION_DEMO - if (!isShipRide() && !fopAcM_CheckStatus(this, fopAcStts_CARRY_e)) + if (!isShipRide() && !fopAcM_checkCarryNow(this)) #else - if (!isShipRide() && !fopAcM_CheckStatus(this, fopAcStts_CARRY_e) && checkStatus(daMdStts_UNK20000)) + if (!isShipRide() && !fopAcM_checkCarryNow(this) && checkStatus(daMdStts_UNK20000)) #endif { cXyz shadowPos(current.pos.x, current.pos.y + 150.0f, current.pos.z); @@ -5971,7 +5971,7 @@ BOOL daNpc_Md_c::execute() { mStts.SetRoomId(roomNo); mPolyInfo.SetPolyInfo(mAcch.m_gnd); } - } else if (((!isShipRide()) && (!isReturnLink())) && (!fopAcM_CheckStatus(this, fopAcStts_CARRY_e))) { + } else if (((!isShipRide()) && (!isReturnLink())) && (!fopAcM_checkCarryNow(this))) { if (checkNowPosMove(l_staff_name)) { fVar1 = maxFallSpeed; fVar2 = speed.y; diff --git a/src/d/actor/d_a_obj_stair.cpp b/src/d/actor/d_a_obj_stair.cpp index c3013490d..3ba468230 100644 --- a/src/d/actor/d_a_obj_stair.cpp +++ b/src/d/actor/d_a_obj_stair.cpp @@ -154,14 +154,15 @@ cPhs_State daObj_Stair_c::_create() { if (phase_state == cPhs_COMPLEATE_e) { Quaternion quat = {0.0f, 0.0f, 0.0f, 1.0f}; + f32 f29 = 0.0f; f32 sin = cM_ssin(current.angle.y >> 1); f32 cos = cM_scos(current.angle.y >> 1); phase_state = MoveBGCreate(M_arcname, dRes_INDEX_MKDAN_DZB_MKDAN1_e, NULL, 0x8A0); JUT_ASSERT(0x10f, (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e)); - field_0x4A0.x = 0.0f; + field_0x4A0.x = f29; field_0x4A0.y = sin; - field_0x4A0.z = 0.0f; + field_0x4A0.z = f29; field_0x4A0.w = cos; field_0x4B0 = quat; @@ -176,15 +177,11 @@ cPhs_State daObj_Stair_c::_create() { cXyz end; start = end = current.pos; - cos = cM_scos(current.angle.y); - start.x += cos * 125.0f; - - sin = cM_ssin(current.angle.y); - - start.z += sin * -125.0f; - end.x += cos * -125.0f; - end.z += sin * 125.0f; + start.x += cM_scos(current.angle.y) * 125.0f; + start.z += cM_ssin(current.angle.y) * -125.0f; + end.x += cM_scos(current.angle.y) * -125.0f; + end.z += cM_ssin(current.angle.y) * 125.0f; mCps.SetStartEnd(start, end); mCps.SetR(50.0f); @@ -217,8 +214,6 @@ static BOOL daObj_StairExecute(void* i_this) { /* 00000B20-00001364 .text _execute__13daObj_Stair_cFv */ bool daObj_Stair_c::_execute() { - f32 sin; - f32 cos; if (field_0x2E4 == 1) { if (field_0x2E0 == l_HIO.m18) { cXyz temp = field_0x2C8.normZP(); @@ -226,9 +221,9 @@ bool daObj_Stair_c::_execute() { if(temp2.abs() > 8e-11f){ cXyz temp3 = temp2.normZP(); - f32 temp4 = l_HIO.m10 * 0.5f * field_0x2C8.abs() * 0.01f * field_0x2EC; - sin = cM_ssin(DEG2S(temp4)); - cos = cM_scos(DEG2S(temp4)); + f32 temp4 = l_HIO.m10 * 0.5f * field_0x2C8.abs() * 0.01f * field_0x2EC; + f32 sin = cM_ssin(DEG2S(temp4)); + f32 cos = cM_scos(DEG2S(temp4)); // misses inline cM_deg2s? field_0x4B0.x = sin * temp3.x; @@ -269,8 +264,8 @@ bool daObj_Stair_c::_execute() { fopAc_ac_c* ac = mCps.GetTgHitAc(); if(ac) { if(fopAcM_IsActor(ac) && fopAcM_GetProfName(ac) == fpcNm_BOMB_e){ - sin = cM_ssin(current.angle.y); - cos = cM_scos(current.angle.y); + f32 sin = cM_ssin(current.angle.y); + f32 cos = cM_scos(current.angle.y); field_0x2E4 = 1; field_0x2C8 = ac->current.pos - current.pos; field_0x2D4 = current.pos - ac->current.pos; diff --git a/src/d/actor/d_a_obj_swhammer.cpp b/src/d/actor/d_a_obj_swhammer.cpp index 42211864f..92a541466 100644 --- a/src/d/actor/d_a_obj_swhammer.cpp +++ b/src/d/actor/d_a_obj_swhammer.cpp @@ -12,16 +12,16 @@ namespace daObjSwhammer { namespace { struct Attr_c { - /* 0x00 */ float mVSpring; - /* 0x04 */ float mIntVSpeedDecay; - /* 0x08 */ float mExtVSpeedDecay; - /* 0x0C */ float mVibMag0Mult; - /* 0x10 */ float mVibSpring; - /* 0x14 */ float mAngleSpeedDecay; - /* 0x18 */ short mCrushDuration; - /* 0x1C */ float mUncrushSpeed0; - /* 0x20 */ float mUncrushSpring; - /* 0x24 */ float mUncrushSpeedDecay; + /* 0x00 */ f32 mVSpring; + /* 0x04 */ f32 mIntVSpeedDecay; + /* 0x08 */ f32 mExtVSpeedDecay; + /* 0x0C */ f32 mVibMag0Mult; + /* 0x10 */ f32 mVibSpring; + /* 0x14 */ f32 mAngleSpeedDecay; + /* 0x18 */ s16 mCrushDuration; + /* 0x1C */ f32 mUncrushSpeed0; + /* 0x20 */ f32 mUncrushSpring; + /* 0x24 */ f32 mUncrushSpeedDecay; }; static const Attr_c L_attr = { @@ -42,7 +42,7 @@ namespace daObjSwhammer { } int daObjSwhammer::Act_c::M_damage; -short daObjSwhammer::Act_c::M_damage_dir; +s16 daObjSwhammer::Act_c::M_damage_dir; Mtx daObjSwhammer::Act_c::M_tmp_mtx; const char daObjSwhammer::Act_c::M_arcname[] = "MhmrSW"; @@ -104,10 +104,10 @@ const dCcD_SrcCyl daObjSwhammer::Act_c::M_cyl_src_tg = { /* Height */ 112.5f, }}, }; -const GXColor color = {0xA0, 0xA0, 0x80, 0xFF}; /* 000000EC-00000260 .text __ct__Q213daObjSwhammer5Act_cFv */ daObjSwhammer::Act_c::Act_c() { + static const GXColor color = {0xA0, 0xA0, 0x80, 0xFF}; mSmokeCb.setColor(color); } @@ -170,8 +170,8 @@ cPhs_State daObjSwhammer::Act_c::_create() { cPhs_State phase_state = dComIfG_resLoad(&mPhs, M_arcname); if (phase_state == cPhs_COMPLEATE_e) { - phase_state = MoveBGCreate(M_arcname, dRes_INDEX_MHMRSW_DZB_MHMRSW_e, NULL, 0xa80); - JUT_ASSERT(0x1e9, (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e)); + phase_state = MoveBGCreate(M_arcname, dRes_INDEX_MHMRSW_DZB_MHMRSW_e, NULL, DEMO_SELECT(-1, 0xa80)); + JUT_ASSERT(DEMO_SELECT(488, 489), (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e)); } return phase_state; } @@ -185,7 +185,7 @@ BOOL daObjSwhammer::Act_c::Delete() { /* 00000828-0000087C .text _delete__Q213daObjSwhammer5Act_cFv */ bool daObjSwhammer::Act_c::_delete() { BOOL ret = MoveBGDelete(); - dComIfG_resDelete(&mPhs, M_arcname); + dComIfG_resDeleteDemo(&mPhs, M_arcname); return ret; } @@ -227,15 +227,16 @@ void daObjSwhammer::Act_c::set_damage() { } /* 00000A58-00000ABC .text vib_start__Q213daObjSwhammer5Act_cFsf */ -void daObjSwhammer::Act_c::vib_start(short dir, float mag) { - mAngleSpeedZ = mag * attr().mVibMag0Mult * cM_scos(dir); - mAngleSpeedX = mag * attr().mVibMag0Mult * cM_ssin(dir); +void daObjSwhammer::Act_c::vib_start(s16 dir, f32 mag) { + f32 f1 = mag * attr().mVibMag0Mult; + mAngleSpeedZ = f1 * cM_scos(dir); + mAngleSpeedX = f1 * cM_ssin(dir); } /* 00000ABC-00000B34 .text vib_proc__Q213daObjSwhammer5Act_cFv */ void daObjSwhammer::Act_c::vib_proc() { - float angleAccelX = -(mAngleX * attr().mVibSpring) - mAngleSpeedX * attr().mAngleSpeedDecay; - float angleAccelZ = -(mAngleZ * attr().mVibSpring) - mAngleSpeedZ * attr().mAngleSpeedDecay; + f32 angleAccelZ = -(mAngleZ * attr().mVibSpring) - mAngleSpeedZ * attr().mAngleSpeedDecay; + f32 angleAccelX = -(mAngleX * attr().mVibSpring) - mAngleSpeedX * attr().mAngleSpeedDecay; mAngleSpeedZ += angleAccelZ; mAngleSpeedX += angleAccelX; @@ -264,7 +265,8 @@ void daObjSwhammer::Act_c::crush_proc() { mScaleYSpeed = attr().mUncrushSpeed0; return; } - mScaleYSpeed += -((mScaleY - 1.0f) * attr().mUncrushSpring) - mScaleYSpeed * attr().mUncrushSpeedDecay; + f32 f1 = -((mScaleY - 1.0f) * attr().mUncrushSpring); + mScaleYSpeed += f1 - mScaleYSpeed * attr().mUncrushSpeedDecay; mScaleY += mScaleYSpeed; } @@ -289,8 +291,8 @@ void daObjSwhammer::Act_c::eff_crush() { /* 00000DB8-00000E74 .text calc_top_pos__Q213daObjSwhammer5Act_cFv */ void daObjSwhammer::Act_c::calc_top_pos() { - float diff = mCurHFrac - mTargetHFrac; - float decay = mCurHFrac > 0.0f && mCurHFrac < 1.0f + f32 diff = mCurHFrac - mTargetHFrac; + f32 decay = mCurHFrac > 0.0f && mCurHFrac < 1.0f ? attr().mIntVSpeedDecay : attr().mExtVSpeedDecay; @@ -307,10 +309,11 @@ BOOL daObjSwhammer::Act_c::jnodeCB(J3DNode* node, int calcTiming) { J3DModel* model = (J3DModel*) j3dSys.getModel(); daObjSwhammer::Act_c *i_this = (daObjSwhammer::Act_c*) model->getUserArea(); J3DJoint* joint = (J3DJoint*) node; - s32 jntNo = joint->getJntNo(); + u16 jntNo = joint->getJntNo(); mDoMtx_stack_c::copy(model->getAnmMtx(jntNo)); - mDoMtx_stack_c::transM(0.0f, (1.0f - i_this->mScaleY) * 20.0f, 0.0f); + f32 y = (1.0f - i_this->mScaleY) * 20.0f; + mDoMtx_stack_c::transM(0.0f, y, 0.0f); mDoMtx_stack_c::scaleM(1.0f, i_this->mScaleY, 1.0f); mDoMtx_stack_c::transM(0.0f, i_this->mTopPos, 0.0f); @@ -430,7 +433,7 @@ BOOL daObjSwhammer::Act_c::Execute(Mtx** mtx) { /* 00001504-00001564 .text Draw__Q213daObjSwhammer5Act_cFv */ BOOL daObjSwhammer::Act_c::Draw() { - g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); + g_env_light.settingTevStruct(DEMO_SELECT(TEV_TYPE_BG0, TEV_TYPE_ACTOR), ¤t.pos, &tevStr); g_env_light.setLightTevColorType(mpModel, &tevStr); mDoExt_modelUpdateDL(mpModel); return TRUE;