Switch inheritance->composition for more C-style actors

This commit is contained in:
LagoLunatic
2026-04-01 23:40:08 -04:00
parent be11af87c5
commit 0342876722
17 changed files with 78 additions and 73 deletions
+3 -2
View File
@@ -4,9 +4,10 @@
#include "f_op/f_op_actor.h"
#include "f_op/f_op_actor_mng.h"
class bossitem_class : public fopAc_ac_c {
struct bossitem_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ u8 m290[0x298 - 0x290];
};
}; // Size: 0x298
namespace daBossItem_prm {
inline int getStage(bossitem_class* actor) { return fopAcM_GetParam(actor) & 0xFF; }
+2 -2
View File
@@ -3,8 +3,8 @@
#include "f_op/f_op_actor.h"
class kytag00_class : public fopAc_ac_c {
public:
struct kytag00_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ u32 field_0x290;
/* 0x294 */ u8 mbEfSet;
/* 0x295 */ u8 mbPselSet;
+2 -2
View File
@@ -4,8 +4,8 @@
#include "f_op/f_op_actor.h"
#include "d/d_kankyo.h"
class kytag01_class : public fopAc_ac_c {
public:
struct kytag01_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ WAVE_INFO mWaveInfo;
};
+2 -2
View File
@@ -4,8 +4,8 @@
#include "f_op/f_op_actor.h"
#include "d/d_path.h"
class kytag02_class : public fopAc_ac_c {
public:
struct kytag02_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ dPath* mpPath;
/* 0x294 */ cXyz mWindVec;
};
+2 -2
View File
@@ -6,8 +6,8 @@
class mDoExt_McaMorf;
class kytag03_class : public fopAc_ac_c {
public:
struct kytag03_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ request_of_phase_process_class mPhs;
/* 0x298 */ mDoExt_McaMorf* mpModel;
/* 0x29C */ u8 m29C[0x2A0 - 0x29C];
+2 -2
View File
@@ -3,8 +3,8 @@
#include "f_op/f_op_actor.h"
class kytag04_class : public fopAc_ac_c {
public:
struct kytag04_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ u8 mState;
/* 0x291 */ u8 mOffColPat;
/* 0x292 */ u8 mOnColPat;
+2 -2
View File
@@ -3,8 +3,8 @@
#include "f_op/f_op_actor.h"
class kytag05_class : public fopAc_ac_c {
public:
struct kytag05_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ u8 mIndex;
/* 0x294 */ int mTimer;
/* 0x298 */ int mUnknownParam;
+3 -3
View File
@@ -3,10 +3,10 @@
#include "f_op/f_op_actor.h"
class kytag06_class : public fopAc_ac_c {
public:
struct kytag06_class {
/* 0x000 */ fopAc_ac_c actor;
/* 0x290 */ int field_0x290;
/* 0x294 */ float field_0x294;
/* 0x294 */ f32 field_0x294;
};
#endif /* D_A_KYTAG06_H */
+2 -3
View File
@@ -3,9 +3,8 @@
#include "f_op/f_op_actor.h"
class kytag07_class : public fopAc_ac_c {
public:
/* Place member variables here */
struct kytag07_class {
/* 0x000 */ fopAc_ac_c actor;
};
#endif /* D_A_KYTAG07_H */
+28 -25
View File
@@ -15,13 +15,14 @@
/* 00000078-0000024C .text get_check_pos__FP13kytag00_class */
cXyz get_check_pos(kytag00_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
cXyz ret;
camera_class * pCamera = (camera_class*)dComIfGp_getCamera(0);
fopAc_ac_c * pPlayer = dComIfGp_getPlayer(0);
f32 cameraDist = i_this->current.pos.abs(pCamera->mLookat.mEye);
f32 playerDist = i_this->current.pos.abs(pPlayer->current.pos);
f32 cameraDist = actor->current.pos.abs(pCamera->mLookat.mEye);
f32 playerDist = actor->current.pos.abs(pPlayer->current.pos);
if (dComIfGp_event_runCheck() && i_this->mMode == 0) {
if (cameraDist < playerDist) {
@@ -38,17 +39,18 @@ cXyz get_check_pos(kytag00_class* i_this) {
/* 0000024C-000005E4 .text wether_tag_move__FP13kytag00_class */
void wether_tag_move(kytag00_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
cXyz chk_pos_xz;
cXyz chk_pos = get_check_pos(i_this);
f32 fade_y = i_this->mInnerFadeY * 100.0f;
chk_pos_xz.x = chk_pos.x;
chk_pos_xz.y = i_this->current.pos.y;
chk_pos_xz.y = actor->current.pos.y;
chk_pos_xz.z = chk_pos.z;
f32 dist_xz = i_this->current.pos.abs(chk_pos_xz);
f32 dist_xz = actor->current.pos.abs(chk_pos_xz);
if (dist_xz < i_this->mOuterRadius &&
(chk_pos.y >= (i_this->current.pos.y - fade_y) &&
chk_pos.y < (i_this->current.pos.y + i_this->scale.y * 5000.0f + fade_y)) &&
(chk_pos.y >= (actor->current.pos.y - fade_y) &&
chk_pos.y < (actor->current.pos.y + actor->scale.y * 5000.0f + fade_y)) &&
i_this->mTarget > 0.0f)
{
f32 blend = 1.0f;
@@ -62,9 +64,9 @@ void wether_tag_move(kytag00_class* i_this) {
}
}
if (chk_pos.y <= i_this->current.pos.y) {
if (chk_pos.y <= actor->current.pos.y) {
if (fade_y != 0.0f) {
f9 = (i_this->current.pos.y - chk_pos.y) / fade_y;
f9 = (actor->current.pos.y - chk_pos.y) / fade_y;
if (f9 < 0.0f) {
f9 = 0.0f;
}
@@ -72,7 +74,7 @@ void wether_tag_move(kytag00_class* i_this) {
}
} else {
if (fade_y != 0.0f) {
f9 = (chk_pos.y - (i_this->current.pos.y + i_this->scale.y * 5000.0f)) / fade_y;
f9 = (chk_pos.y - (actor->current.pos.y + actor->scale.y * 5000.0f)) / fade_y;
if (f9 < 0.0f) {
f9 = 0.0f;
}
@@ -171,17 +173,18 @@ void raincnt_cut() {
/* 000006D8-00000C0C .text wether_tag_efect_move__FP13kytag00_class */
void wether_tag_efect_move(kytag00_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
cXyz chk_pos_xz;
cXyz chk_pos = get_check_pos(i_this);
f32 fade_y = i_this->mInnerFadeY * 100.0f;
chk_pos_xz.x = chk_pos.x;
chk_pos_xz.y = i_this->current.pos.y;
chk_pos_xz.y = actor->current.pos.y;
chk_pos_xz.z = chk_pos.z;
f32 dist_xz = i_this->current.pos.abs(chk_pos_xz);
f32 dist_xz = actor->current.pos.abs(chk_pos_xz);
if (dist_xz < i_this->mOuterRadius &&
(chk_pos.y >= (i_this->current.pos.y - fade_y) &&
chk_pos.y < (i_this->current.pos.y + i_this->scale.y * 5000.0f + fade_y)) &&
(chk_pos.y >= (actor->current.pos.y - fade_y) &&
chk_pos.y < (actor->current.pos.y + actor->scale.y * 5000.0f + fade_y)) &&
i_this->mTarget > 0.0f)
{
f32 blend = 1.0f;
@@ -198,9 +201,9 @@ void wether_tag_efect_move(kytag00_class* i_this) {
}
}
if (chk_pos.y <= i_this->current.pos.y) {
if (chk_pos.y <= actor->current.pos.y) {
if (fade_y != 0.0f) {
f9 = (i_this->current.pos.y - chk_pos.y) / fade_y;
f9 = (actor->current.pos.y - chk_pos.y) / fade_y;
if (f9 < 0.0f) {
f9 = 0.0f;
}
@@ -208,7 +211,7 @@ void wether_tag_efect_move(kytag00_class* i_this) {
}
} else {
if (fade_y != 0.0f) {
f9 = (chk_pos.y - (i_this->current.pos.y + i_this->scale.y * 5000.0f)) / fade_y;
f9 = (chk_pos.y - (actor->current.pos.y + actor->scale.y * 5000.0f)) / fade_y;
if (f9 < 0.0f) {
f9 = 0.0f;
}
@@ -240,7 +243,7 @@ void wether_tag_efect_move(kytag00_class* i_this) {
g_env_light.mMoyaCount = 100.0f * blend;
break;
case 0x6:
if (i_this->home.roomNo == dComIfGp_roomControl_getStayNo()) {
if (actor->home.roomNo == dComIfGp_roomControl_getStayNo()) {
g_env_light.mHousiCount = 300.0f * blend;
} else {
g_env_light.mHousiCount = 0;
@@ -352,16 +355,16 @@ static BOOL daKytag00_Delete(kytag00_class* i_this) {
static cPhs_State daKytag00_Create(fopAc_ac_c* i_ac) {
kytag00_class * i_this = (kytag00_class *)i_ac;
fopAcM_SetupActor(i_this, kytag00_class);
fopAcM_SetupActor(i_ac, kytag00_class);
i_this->field_0x296 = 0;
i_this->mPselIdx = (fopAcM_GetParam(i_ac) >> 0) & 0xFF;
i_this->mEfMode = (fopAcM_GetParam(i_ac) >> 8) & 0xFF;
i_this->mThickness = (fopAcM_GetParam(i_ac) >> 16) & 0xFF;
i_this->mInnerFadeY = (fopAcM_GetParam(i_ac) >> 24) & 0xFF;
i_this->mSwitchNo = (i_this->current.angle.x >> 0) & 0xFF;
i_this->mbInvert = (i_this->current.angle.x >> 8) & 0xFF;
i_this->mMode = (i_this->current.angle.z >> 0) & 0xFF;
i_this->mSwitchNo = (i_ac->current.angle.x >> 0) & 0xFF;
i_this->mbInvert = (i_ac->current.angle.x >> 8) & 0xFF;
i_this->mMode = (i_ac->current.angle.z >> 0) & 0xFF;
if (!i_this->mbInvert) {
if (i_this->mSwitchNo != 0xFF && dComIfGs_isSwitch(i_this->mSwitchNo, dComIfGp_roomControl_getStayNo())) {
@@ -384,11 +387,11 @@ static cPhs_State daKytag00_Create(fopAc_ac_c* i_ac) {
i_this->mInnerFadeY = 10;
if (i_this->mMode == 0) {
i_this->mInnerRadius = i_this->scale.x * 5000.0f;
i_this->mOuterRadius = i_this->scale.x * 5000.0f + i_this->mThickness * 100.0f;
i_this->mInnerRadius = i_ac->scale.x * 5000.0f;
i_this->mOuterRadius = i_ac->scale.x * 5000.0f + i_this->mThickness * 100.0f;
} else {
i_this->mInnerRadius = i_this->scale.x * 500.0f;
i_this->mOuterRadius = i_this->scale.x * 500.0f + i_this->mThickness * 10.0f;
i_this->mInnerRadius = i_ac->scale.x * 500.0f;
i_this->mOuterRadius = i_ac->scale.x * 500.0f + i_this->mThickness * 10.0f;
}
i_this->mbEfSet = false;
+4 -4
View File
@@ -84,11 +84,11 @@ void wave_make() {
static cPhs_State daKytag01_Create(fopAc_ac_c* i_ac) {
dScnKy_env_light_c& env_light = dKy_getEnvlight();
kytag01_class* i_this = (kytag01_class*)i_ac;
fopAcM_SetupActor(i_this, kytag01_class);
fopAcM_SetupActor(i_ac, kytag01_class);
i_this->mWaveInfo.mPos = i_this->current.pos;
i_this->mWaveInfo.mInnerRadius = i_this->scale.x * 5000.0f;
i_this->mWaveInfo.mOuterRadius = i_this->scale.z * 5000.0f;
i_this->mWaveInfo.mPos = i_ac->current.pos;
i_this->mWaveInfo.mInnerRadius = i_ac->scale.x * 5000.0f;
i_this->mWaveInfo.mOuterRadius = i_ac->scale.z * 5000.0f;
f32 defaultOuter = i_this->mWaveInfo.mInnerRadius + 500.0f;
if (defaultOuter >= i_this->mWaveInfo.mOuterRadius)
+4 -3
View File
@@ -21,7 +21,8 @@ dPath* set_path_info(fopAc_ac_c* i_this) {
/* 000000C0-000000F0 .text set_next_path_info__FP13kytag02_classP5dPath */
dPath* set_next_path_info(kytag02_class* i_this, dPath* path) {
return dPath_GetNextRoomPath(path, fopAcM_GetRoomNo(i_this));
fopAc_ac_c* actor = &i_this->actor;
return dPath_GetNextRoomPath(path, fopAcM_GetRoomNo(actor));
}
/* 000000F0-0000017C .text get_railwind_vec__FP5dPathi */
@@ -113,8 +114,8 @@ static BOOL daKytag02_Delete(kytag02_class* i_this) {
/* 00000420-0000047C .text daKytag02_Create__FP10fopAc_ac_c */
static cPhs_State daKytag02_Create(fopAc_ac_c* i_this) {
kytag02_class* a_this = (kytag02_class*)i_this;
fopAcM_SetupActor(a_this, kytag02_class);
a_this->mpPath = set_path_info(a_this);
fopAcM_SetupActor(i_this, kytag02_class);
a_this->mpPath = set_path_info(i_this);
return cPhs_COMPLEATE_e;
}
+14 -12
View File
@@ -27,9 +27,10 @@ static BOOL useHeapInit(fopAc_ac_c* i_ac) {
/* 0000015C-000001D8 .text daKytag03_Draw__FP13kytag03_class */
static BOOL daKytag03_Draw(kytag03_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
J3DModel* model = i_this->mpModel->getModel();
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType(model, &i_this->tevStr);
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &actor->current.pos, &actor->tevStr);
g_env_light.setLightTevColorType(model, &actor->tevStr);
if (i_this->mbVisible)
i_this->mpModel->updateDL();
return TRUE;
@@ -37,18 +38,19 @@ static BOOL daKytag03_Draw(kytag03_class* i_this) {
/* 000001D8-00000280 .text draw_SUB__FP13kytag03_class */
void draw_SUB(kytag03_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
J3DModel* model = i_this->mpModel->getModel();
model->setBaseScale(i_this->scale);
mDoMtx_stack_c::transS(i_this->current.pos);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
mDoMtx_stack_c::XrotM(i_this->shape_angle.x);
mDoMtx_stack_c::ZrotM(i_this->shape_angle.z);
model->setBaseScale(actor->scale);
mDoMtx_stack_c::transS(actor->current.pos);
mDoMtx_stack_c::YrotM(actor->shape_angle.y);
mDoMtx_stack_c::XrotM(actor->shape_angle.x);
mDoMtx_stack_c::ZrotM(actor->shape_angle.z);
model->setBaseTRMtx(mDoMtx_stack_c::get());
}
/* 00000280-0000050C .text daKytag03_Execute__FP13kytag03_class */
static BOOL daKytag03_Execute(kytag03_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAc_ac_c* actor = &i_this->actor;
if (dComIfGp_event_runCheck() == FALSE || !dComIfGp_event_chkEventFlag(dEvtFlag_STAFF_ALL_e)) {
if (actor->tevStr.mRoomNo == dComIfGp_roomControl_getStayNo()) {
i_this->mbRoomActive = true;
@@ -127,22 +129,22 @@ static cPhs_State daKytag03_Create(fopAc_ac_c* i_ac) {
kytag03_class* i_this = (kytag03_class*)i_ac;
#if VERSION > VERSION_DEMO
fopAcM_SetupActor(i_this, kytag03_class);
fopAcM_SetupActor(i_ac, kytag03_class);
#endif
cPhs_State ret = dComIfG_resLoad(&i_this->mPhs, "M_DOOR");
if (ret == cPhs_COMPLEATE_e) {
#if VERSION == VERSION_DEMO
fopAcM_SetupActor(i_this, kytag03_class);
fopAcM_SetupActor(i_ac, kytag03_class);
#endif
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x4c30)) {
if (!fopAcM_entrySolidHeap(&i_this->actor, useHeapInit, 0x4c30)) {
return cPhs_ERROR_e;
}
i_this->field_0x2a0 = 0;
i_this->field_0x2a8 = 0.0f;
i_this->mSwitchNo = fopAcM_GetParam(i_this);
i_this->mSwitchNo = fopAcM_GetParam(i_ac) & 0xFF;
i_this->mbRoomActive = false;
i_this->mbIsActive = false;
i_this->mbVisible = false;
+3 -3
View File
@@ -53,9 +53,9 @@ static cPhs_State daKytag04_Create(fopAc_ac_c* i_this) {
a_this->mState = 0;
a_this->mOffColPat = fopAcM_GetParam(a_this) & 0xFF;
a_this->mOnColPat = (fopAcM_GetParam(a_this) >> 8) & 0xFF;
a_this->mSwitchNo = a_this->current.angle.x;
a_this->mScaleX = a_this->scale.x * 100.0f;
a_this->mScaleY = a_this->scale.y * 100.0f;
a_this->mSwitchNo = i_this->current.angle.x;
a_this->mScaleX = i_this->scale.x * 100.0f;
a_this->mScaleY = i_this->scale.y * 100.0f;
a_this->mTimer = 0;
a_this->mTimerThreshold = 5;
return cPhs_COMPLEATE_e;
+3 -3
View File
@@ -10,7 +10,7 @@
#include "d/d_priority.h"
/* 00000078-00000080 .text daKytag07_Draw__FP13kytag07_class */
static BOOL daKytag07_Draw(kytag07_class*) {
static BOOL daKytag07_Draw(kytag07_class* i_this) {
return TRUE;
}
@@ -87,14 +87,14 @@ static cPhs_State daKytag07_Create(fopAc_ac_c* i_this) {
dScnKy_env_light_c& env_light = dKy_getEnvlight();
#if VERSION > VERSION_DEMO
fopAcM_SetupActor(a_this, kytag07_class);
fopAcM_SetupActor(i_this, kytag07_class);
#endif
if (strcmp(dComIfGp_getStartStageName(), "GTower") != 0)
env_light.mbDayNightTactStop = true;
#if VERSION == VERSION_DEMO
fopAcM_SetupActor(a_this, kytag07_class);
fopAcM_SetupActor(i_this, kytag07_class);
#endif
return cPhs_COMPLEATE_e;
+1 -1
View File
@@ -250,7 +250,7 @@ bool daObjAuzu::Act_c::_execute() {
} else if (mScaleAnimFactor == 0.0f && fpcM_IsErrorID(mKytagPcId) == FALSE) {
kytag01_class* kytag01_p = (kytag01_class *) fopAcM_SearchByID(mKytagPcId);
if (kytag01_p){
fopAcM_delete(kytag01_p);
fopAcM_delete(&kytag01_p->actor);
}
}
+1 -2
View File
@@ -148,8 +148,7 @@ BOOL daWindMill_c::CreateHeap() {
if (m_dzbidx[mType] != -1) {
mpBgW = new dBgW();
if (mpBgW != NULL) {
cBgD_t* res = (cBgD_t*) dComIfG_getObjectRes(
m_arcname[mType], m_dzbidx[mType]);
cBgD_t* res = (cBgD_t*) dComIfG_getObjectRes(m_arcname[mType], m_dzbidx[mType]);
if (mpBgW->Set(res, cBgW::MOVE_BG_e, &mMtx) == TRUE) {
return FALSE;
}