From 75fac702a71aeb03b42133c7bce7cf9df6433663 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Wed, 13 May 2026 19:06:48 -0400 Subject: [PATCH] d_a_bgn OK closes #266 --- configure.py | 4 ++-- include/d/actor/d_a_bgn.h | 29 +++++++++++++++++++++++++---- include/d/actor/d_a_bgn2.h | 1 + include/d/actor/d_a_bgn3.h | 1 + include/d/actor/d_a_cc.h | 1 + include/d/actor/d_a_ki.h | 1 + include/m_Do/m_Do_ext.h | 17 ----------------- src/d/actor/d_a_bgn.cpp | 10 +++++----- src/d/actor/d_a_bgn2.cpp | 6 +++--- 9 files changed, 39 insertions(+), 31 deletions(-) diff --git a/configure.py b/configure.py index 2bbc2d6a5..9fd60e80c 100755 --- a/configure.py +++ b/configure.py @@ -1569,9 +1569,9 @@ config.libs = [ ActorRel(Matching, "d_a_bb"), ActorRel(Matching, "d_a_bdk"), ActorRel(Matching, "d_a_bdkobj"), - ActorRel(NonMatching, "d_a_bgn"), + ActorRel(Matching, "d_a_bgn"), ActorRel(MatchingFor("D44J01"), "d_a_bgn2"), - ActorRel(Matching, "d_a_bgn3"), + ActorRel(Matching, "d_a_bgn3"), ActorRel(NonMatching, "d_a_bigelf"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_bk"), ActorRel(NonMatching, "d_a_bl"), diff --git a/include/d/actor/d_a_bgn.h b/include/d/actor/d_a_bgn.h index 96a060e41..dd6651898 100644 --- a/include/d/actor/d_a_bgn.h +++ b/include/d/actor/d_a_bgn.h @@ -6,6 +6,26 @@ #include "d/d_cc_d.h" #include "d/d_particle.h" +extern J3DDrawBuffer* dComIfGd_getOpaListSky(); + +// This class seems like it would be defined in m_Do_ext.h, but the weak function ordering indicates it's from a different header. +// Strangely, mDoExt_J3DModelPacketS::setMaterial is defined inside of the d_a_bgn.cpp REL, indicating the class may be from this header. +// It's unclear why the developers would do it this way. +class mDoExt_J3DModelPacketS : public J3DPacket { +public: + mDoExt_J3DModelPacketS() {} + ~mDoExt_J3DModelPacketS() {} + + void setModel(J3DModel* model) { mpModel = model; } + void update() { dComIfGd_getOpaListSky()->entryImm(this, 0); } + + void draw(); + void setMaterial(); + +public: + /* 0x10 */ J3DModel* mpModel; +}; // Size: 0x14 + struct part_s { /* 0x000 */ J3DModel* mpPartModel; /* 0x004 */ mDoExt_J3DModelPacketS m004; @@ -30,11 +50,12 @@ struct part_s { #endif }; // Size: 0x23C +struct bgn_himo_s { + /* 0x000 */ cXyz m000[60]; +}; + struct move_s { - struct bgn_himo_s { - /* 0x000 */ cXyz m000[60]; - }; - bgn_himo_s mHimo; + /* 0x000 */ bgn_himo_s mHimo; /* 0x2D0 */ u8 m2D0; /* 0x2D1 */ u8 m2D1[0x2D4 - 0x2D1]; /* 0x2D4 */ cXyz m2D4; diff --git a/include/d/actor/d_a_bgn2.h b/include/d/actor/d_a_bgn2.h index c7a7adef5..8ac0b424e 100644 --- a/include/d/actor/d_a_bgn2.h +++ b/include/d/actor/d_a_bgn2.h @@ -2,6 +2,7 @@ #define D_A_BGN2_H #include "JSystem/JParticle/JPAEmitter.h" +#include "d/actor/d_a_bgn.h" #include "d/d_bg_s_acch.h" #include "d/d_cc_d.h" #include "f_op/f_op_actor.h" diff --git a/include/d/actor/d_a_bgn3.h b/include/d/actor/d_a_bgn3.h index fd5f4571c..f6c41d45f 100644 --- a/include/d/actor/d_a_bgn3.h +++ b/include/d/actor/d_a_bgn3.h @@ -2,6 +2,7 @@ #define D_A_BGN3_H #include "f_op/f_op_actor.h" +#include "d/actor/d_a_bgn.h" #include "d/d_cc_d.h" #include "m_Do/m_Do_ext.h" diff --git a/include/d/actor/d_a_cc.h b/include/d/actor/d_a_cc.h index 1586488a6..8444e8aaa 100644 --- a/include/d/actor/d_a_cc.h +++ b/include/d/actor/d_a_cc.h @@ -2,6 +2,7 @@ #define D_A_CC_H #include "f_op/f_op_actor.h" +#include "d/actor/d_a_bgn.h" #include "d/d_cc_d.h" #include "d/d_bg_s_acch.h" #include "d/d_particle.h" diff --git a/include/d/actor/d_a_ki.h b/include/d/actor/d_a_ki.h index 68e97d456..2139d7d26 100644 --- a/include/d/actor/d_a_ki.h +++ b/include/d/actor/d_a_ki.h @@ -2,6 +2,7 @@ #define D_A_KI_H #include "f_op/f_op_actor.h" +#include "d/actor/d_a_bgn.h" #include "c/c_damagereaction.h" #include "d/d_particle.h" diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 14a7dee1f..01bd0b122 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -562,23 +562,6 @@ public: void entryOpa() { j3dSys.getDrawBuffer(0)->entryImm(this, 0); } }; -extern J3DDrawBuffer* dComIfGd_getOpaListSky(); - -class mDoExt_J3DModelPacketS : public J3DPacket { -public: - mDoExt_J3DModelPacketS() {} - ~mDoExt_J3DModelPacketS() {} - - void setModel(J3DModel* model) { mpModel = model; } - void update() { dComIfGd_getOpaListSky()->entryImm(this, 0); } - - void draw(); - void setMaterial(); - -public: - /* 0x10 */ J3DModel* mpModel; -}; // Size: 0x14 - class mDoExt_3Dline_c { public: mDoExt_3Dline_c(); diff --git a/src/d/actor/d_a_bgn.cpp b/src/d/actor/d_a_bgn.cpp index 738302e4e..15d3e73af 100644 --- a/src/d/actor/d_a_bgn.cpp +++ b/src/d/actor/d_a_bgn.cpp @@ -1468,7 +1468,6 @@ static void part_mtx_set(bgn_class* i_this, int param_2, part_s* param_3, int pa /* 00003FD0-000044DC .text damage_check__FP9bgn_class */ static void damage_check(bgn_class* i_this) { - /* Nonmatching - retail-only regalloc */ fopAc_ac_c* actor = &i_this->actor; JPABaseEmitter* emitter; char cVar5; @@ -1539,9 +1538,11 @@ static void damage_check(bgn_class* i_this) { atInfo.mpObj = i_this->mHeadParts[0].mPartSph.GetTgHitObj(); cVar5 = 2; } - if (i_this->mPelvisParts[0].mPartSph.ChkTgHit()) { - atInfo.mpObj = i_this->mPelvisParts[0].mPartSph.GetTgHitObj(); - cVar5 = 3; + for (int i = 0; i < 1; i++) { + if (i_this->mPelvisParts[i].mPartSph.ChkTgHit()) { + atInfo.mpObj = i_this->mPelvisParts[i].mPartSph.GetTgHitObj(); + cVar5 = 3; + } } for (s32 i = 0; i < 20; i++) { if (i_this->mLeftArmParts[i].mPartSph.ChkTgHit()) { @@ -3552,7 +3553,6 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { /* 0000B9DC-0000CA80 .text daBgn_Create__FP10fopAc_ac_c */ static cPhs_State daBgn_Create(fopAc_ac_c* a_this) { - /* Nonmatching */ static dCcD_SrcSph cc_sph_src = { // dCcD_SrcGObjInf { diff --git a/src/d/actor/d_a_bgn2.cpp b/src/d/actor/d_a_bgn2.cpp index 7b69f52c7..608190fe6 100644 --- a/src/d/actor/d_a_bgn2.cpp +++ b/src/d/actor/d_a_bgn2.cpp @@ -183,7 +183,7 @@ static void asi_hamon_set(bgn2_class* i_this) { /* 00000D88-00000FA8 .text attack_eff_set__FP10bgn2_class4cXyz */ static void attack_eff_set(bgn2_class* i_this, cXyz param_2) { - /* Nonmatching */ + /* Nonmatching - retail-only regalloc */ #if VERSION == VERSION_DEMO fopAc_ac_c* actor = &i_this->actor; #endif @@ -191,7 +191,7 @@ static void attack_eff_set(bgn2_class* i_this, cXyz param_2) { J3DModel* model; cXyz local_28; - daPy_py_c* player = daPy_getPlayerActorClass(); + fopAc_ac_c* player = dComIfGp_getPlayer(0); if (!gr_check(i_this, ¶m_2)) { model = i_this->mpBodyMorf->getModel(); emitter = dComIfGp_particle_set(dPa_name::ID_AK_SN_KGTT2CHESTSPLASH00, ¶m_2); @@ -682,7 +682,7 @@ static void damage_check(bgn2_class* i_this) { cXyz local_58; CcAtInfo atInfo; #if VERSION == VERSION_DEMO - daPy_py_c* player = daPy_getPlayerActorClass(); + fopAc_ac_c* player = dComIfGp_getPlayer(0); #endif if (i_this->m033A == 0) {