mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-12 11:22:00 -04:00
Clean up HIO for TUs using HIOParam/Param_c/HIO_c pattern (#3043)
This commit is contained in:
@@ -106,20 +106,7 @@ char* daNpc_Seira2_c::mCutNameList[1] = {""};
|
||||
|
||||
daNpc_Seira2_c::cutFunc daNpc_Seira2_c::mCutList[1] = { NULL };
|
||||
|
||||
static daNpc_Seira2_Param_c l_HIO;
|
||||
|
||||
daNpc_Seira2_c::~daNpc_Seira2_c() {
|
||||
deleteObject();
|
||||
if (mpMorf[0] != 0) {
|
||||
mpMorf[0]->stopZelAnime();
|
||||
}
|
||||
|
||||
if (mpSeiraMorf != NULL) {
|
||||
mpSeiraMorf->stopZelAnime();
|
||||
}
|
||||
|
||||
deleteRes(l_loadResPtrnList[mType], (char const**)l_resNameList);
|
||||
}
|
||||
static NPC_SEIRA2_HIO_CLASS l_HIO;
|
||||
|
||||
const daNpc_Seira2_HIOParam daNpc_Seira2_Param_c::m = {
|
||||
210.0f,
|
||||
@@ -165,6 +152,39 @@ const daNpc_Seira2_HIOParam daNpc_Seira2_Param_c::m = {
|
||||
0.0f,
|
||||
};
|
||||
|
||||
#if DEBUG
|
||||
daNpc_Seira2_HIO_c::daNpc_Seira2_HIO_c() {
|
||||
m = daNpc_Seira2_Param_c::m;
|
||||
}
|
||||
|
||||
void daNpc_Seira2_HIO_c::listenPropertyEvent(const JORPropertyEvent* event) {
|
||||
// NONMATCHING
|
||||
}
|
||||
|
||||
void daNpc_Seira2_HIO_c::genMessage(JORMContext* ctx) {
|
||||
// NONMATCHING
|
||||
}
|
||||
#endif
|
||||
|
||||
daNpc_Seira2_c::~daNpc_Seira2_c() {
|
||||
deleteObject();
|
||||
if (mpMorf[0] != 0) {
|
||||
mpMorf[0]->stopZelAnime();
|
||||
}
|
||||
|
||||
if (mpSeiraMorf != NULL) {
|
||||
mpSeiraMorf->stopZelAnime();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if (mpHIO != NULL) {
|
||||
mpHIO->removeHIO();
|
||||
}
|
||||
#endif
|
||||
|
||||
deleteRes(l_loadResPtrnList[mType], (char const**)l_resNameList);
|
||||
}
|
||||
|
||||
int daNpc_Seira2_c::create() {
|
||||
daNpcT_ct(this, daNpc_Seira2_c, l_faceMotionAnmData, l_motionAnmData,
|
||||
l_faceMotionSequenceData, 4, l_motionSequenceData, 4,
|
||||
@@ -191,6 +211,12 @@ int daNpc_Seira2_c::create() {
|
||||
fopAcM_SetMtx(this, mpMorf[0]->getModel()->getBaseTRMtx());
|
||||
fopAcM_setCullSizeBox(this, -300.0f, -50.0f, -300.0f, 300.0f, 450.0f, 300.0f);
|
||||
mSound.init(¤t.pos, &eyePos, 3, 1);
|
||||
|
||||
#if DEBUG
|
||||
mpHIO = &l_HIO;
|
||||
mpHIO->entryHIO("セ-ラ2");
|
||||
#endif
|
||||
|
||||
mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1,
|
||||
&mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this),
|
||||
fopAcM_GetShapeAngle_p(this));
|
||||
@@ -199,7 +225,7 @@ int daNpc_Seira2_c::create() {
|
||||
mGroundH = mAcch.GetGroundH();
|
||||
setEnvTevColor();
|
||||
setRoomNo();
|
||||
mCcStts.Init(daNpc_Seira2_Param_c::m.common.weight, 0, this);
|
||||
mCcStts.Init(mpHIO->m.common.weight, 0, this);
|
||||
mCyl1.Set(mCcDCyl);
|
||||
mCyl1.SetStts(&mCcStts);
|
||||
mCyl1.SetTgHitCallback(tgHitCallBack);
|
||||
@@ -398,10 +424,10 @@ void daNpc_Seira2_c::setParam() {
|
||||
srchActors();
|
||||
|
||||
u32 att_flags = (fopAc_AttnFlag_SPEAK_e | fopAc_AttnFlag_TALK_e);
|
||||
s16 talk_dist = daNpc_Seira2_Param_c::m.common.talk_distance;
|
||||
s16 talk_ang = daNpc_Seira2_Param_c::m.common.talk_angle;
|
||||
s16 att_dist = daNpc_Seira2_Param_c::m.common.attention_distance;
|
||||
s16 att_ang = daNpc_Seira2_Param_c::m.common.attention_angle;
|
||||
s16 talk_dist = mpHIO->m.common.talk_distance;
|
||||
s16 talk_ang = mpHIO->m.common.talk_angle;
|
||||
s16 att_dist = mpHIO->m.common.attention_distance;
|
||||
s16 att_ang = mpHIO->m.common.attention_angle;
|
||||
|
||||
if (checkStageIsSeira2sShop()) {
|
||||
talk_dist = 4;
|
||||
@@ -413,19 +439,19 @@ void daNpc_Seira2_c::setParam() {
|
||||
attention_info.distances[fopAc_attn_SPEAK_e] = daNpcT_getDistTableIdx(talk_dist, talk_ang);
|
||||
attention_info.flags = att_flags;
|
||||
|
||||
scale.set(daNpc_Seira2_Param_c::m.common.scale, daNpc_Seira2_Param_c::m.common.scale,
|
||||
daNpc_Seira2_Param_c::m.common.scale);
|
||||
mCcStts.SetWeight(daNpc_Seira2_Param_c::m.common.weight);
|
||||
mCylH = daNpc_Seira2_Param_c::m.common.height;
|
||||
mWallR = daNpc_Seira2_Param_c::m.common.width;
|
||||
scale.set(mpHIO->m.common.scale, mpHIO->m.common.scale,
|
||||
mpHIO->m.common.scale);
|
||||
mCcStts.SetWeight(mpHIO->m.common.weight);
|
||||
mCylH = mpHIO->m.common.height;
|
||||
mWallR = mpHIO->m.common.width;
|
||||
|
||||
mAcchCir.SetWallR(mWallR);
|
||||
mAcchCir.SetWallH(daNpc_Seira2_Param_c::m.common.knee_length);
|
||||
mAcchCir.SetWallH(mpHIO->m.common.knee_length);
|
||||
|
||||
mRealShadowSize = daNpc_Seira2_Param_c::m.common.real_shadow_size;
|
||||
gravity = daNpc_Seira2_Param_c::m.common.gravity;
|
||||
mExpressionMorfFrame = daNpc_Seira2_Param_c::m.common.expression_morf_frame;
|
||||
mMorfFrames = daNpc_Seira2_Param_c::m.common.morf_frame;
|
||||
mRealShadowSize = mpHIO->m.common.real_shadow_size;
|
||||
gravity = mpHIO->m.common.gravity;
|
||||
mExpressionMorfFrame = mpHIO->m.common.expression_morf_frame;
|
||||
mMorfFrames = mpHIO->m.common.morf_frame;
|
||||
}
|
||||
|
||||
void daNpc_Seira2_c::setAfterTalkMotion() {
|
||||
@@ -539,11 +565,11 @@ void daNpc_Seira2_c::setAttnPos() {
|
||||
mStagger.calc(0);
|
||||
mJntAnm.setParam(
|
||||
this, mpMorf[0]->getModel(), &eyeOffset, getBackboneJointNo(), getNeckJointNo(), getHeadJointNo(),
|
||||
daNpc_Seira2_Param_c::m.common.body_angleX_min, daNpc_Seira2_Param_c::m.common.body_angleX_max,
|
||||
daNpc_Seira2_Param_c::m.common.body_angleY_min, daNpc_Seira2_Param_c::m.common.body_angleY_max,
|
||||
daNpc_Seira2_Param_c::m.common.head_angleX_min, daNpc_Seira2_Param_c::m.common.head_angleX_max,
|
||||
daNpc_Seira2_Param_c::m.common.head_angleY_min, daNpc_Seira2_Param_c::m.common.head_angleY_max,
|
||||
daNpc_Seira2_Param_c::m.common.neck_rotation_ratio, 0.0f, NULL);
|
||||
mpHIO->m.common.body_angleX_min, mpHIO->m.common.body_angleX_max,
|
||||
mpHIO->m.common.body_angleY_min, mpHIO->m.common.body_angleY_max,
|
||||
mpHIO->m.common.head_angleX_min, mpHIO->m.common.head_angleX_max,
|
||||
mpHIO->m.common.head_angleY_min, mpHIO->m.common.head_angleY_max,
|
||||
mpHIO->m.common.neck_rotation_ratio, 0.0f, NULL);
|
||||
|
||||
f32 rad_val = cM_s2rad(mCurAngle.y - field_0xd7e.y);
|
||||
mJntAnm.calcJntRad(0.2f, 1.0f, rad_val);
|
||||
@@ -571,7 +597,7 @@ void daNpc_Seira2_c::setAttnPos() {
|
||||
mDoMtx_stack_c::multVec(&eyeOffset, &attention_info.position);
|
||||
} else {
|
||||
attention_info.position = current.pos;
|
||||
attention_info.position.y += daNpc_Seira2_Param_c::m.common.attention_offset;
|
||||
attention_info.position.y += mpHIO->m.common.attention_offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user