intial progress

This commit is contained in:
elijah-thomas774
2025-05-26 22:12:25 -04:00
parent 01839e716f
commit 00a4d0a166
15 changed files with 421 additions and 60 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ struct SoundSource {
SOUNDSOURCE_VIRTUAL(0x34);
SOUNDSOURCE_VIRTUAL(0x38);
SOUNDSOURCE_VIRTUAL(0x3C);
SOUNDSOURCE_VIRTUAL(0x40);
virtual void vt_0x40(s32);
SOUNDSOURCE_VIRTUAL(0x44);
virtual bool shutdown(); // 0x48
SOUNDSOURCE_VIRTUAL(0x4C);
+11 -1
View File
@@ -5,6 +5,7 @@
#include "d/a/d_a_item.h"
#include "d/col/c/c_bg_s_poly_info.h"
#include "d/d_player_mdl.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/minigame_mgr.h"
@@ -29,9 +30,15 @@ public:
/* vt 0x318 */ virtual void vt_0x318();
protected:
/* 0x137C */ u8 _0x137C[0x4564 - 0x137C];
/* 0x137C */ u8 _0x137C[0x16F0 - 0x137C];
/* 0x16F0 */ nw4r::g3d::ResFile mHeldResFile;
/* 0x16F4 */ u8 _0x16F4[0x4564 - 0x16F4];
/* 0x4564 */ f32 field_0x4564;
public:
// Beetle Functions [0x8021AA70 - 0x8021BE20]
f32 getBeetleRadius();
public:
f32 getField_0x4564() const {
return field_0x4564;
@@ -44,6 +51,9 @@ public:
nw4r::g3d::ResFile getSwordResFile() const {
return mSwordRes;
}
nw4r::g3d::ResFile getHeldResFile() const {
return mHeldResFile;
}
inline bool hasvt_0x1C0() const {
return vt_0x1C0() != nullptr;
+74 -10
View File
@@ -5,30 +5,35 @@
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
#include "d/col/bg/d_bg_s_lin_chk.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "d/lyt/d_lyt_fader.h"
#include "m/m3d/m_anmchr.h"
#include "m/m3d/m_anmchrblend.h"
#include "m/m3d/m_mdl.h"
#include "m/m3d/m_proc.h"
#include "m/m_color.h"
#include "m/m_fader.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "rvl/GX/GXTypes.h"
#include "s/s_State.hpp"
#include "toBeSorted/actor_event.h"
#include "toBeSorted/d_emitter.h"
class dAcBoomerangProcBase_c : public m3d::proc_c {
public:
~dAcBoomerangProcBase_c() {}
};
class dAcBoomerangProc_c : public dAcBoomerangProcBase_c {
class dAcBoomerangProc_c : public d3d::UnkProc {
public:
dAcBoomerangProc_c() : mColor0(0), mColor1(0xFFFFFFFF) {}
~dAcBoomerangProc_c() {}
bool create(m3d::mdl_c *mdl, mColor clr, int prioOpa, mAllocator_c *alloc);
bool create2(m3d::mdl_c *mdl, mColor clr, int prioOpa, mAllocator_c *alloc) {
return create(mdl, clr, prioOpa, alloc);
}
virtual void drawOpa() override;
private:
mColor mColor0;
mColor mColor1;
};
@@ -60,6 +65,14 @@ public:
STATE_FUNC_DECLARE(dAcBoomerang_c, EventReturnWait);
public: // TYPES
enum Variant_e {
NONE,
BEETLE,
HOOK_BEETLE,
QUICK_BEETLE,
TOUGH_BEETLE,
};
struct ChrAnimation_t {
const char *mName;
f32 mRate;
@@ -75,22 +88,66 @@ public: // TYPES
};
static const ChrAnimation_t sChrAnims[RB_MAX];
enum ModelType_e {
MDL_WINGS_BASIC = 0,
MDL_BODY_BASIC = 1,
MDL_MOUTH_BASIC = 2,
MDL_MOUTH_HOOK = 3,
MDL_MOTTH_ADV = MDL_MOUTH_HOOK, // Just for naming :P
MDL_BODY_ADV = 4,
MDL_WINGS_ADV = 5,
};
// Macros until enum is solidified
#define FLAG_BOOMERANG_CANCEL (0x3)
#define FLAG_BOOMERANG_RUMBLE_ACTIVE (0x4000)
public: // INLINES
bool checkField_0x8CC(u32 mask) {
bool checkField_0x8CC(u32 mask) const {
return field_0x8CC & mask;
}
void onField_0x8CC(u32 mask) {
field_0x8CC |= mask;
}
bool isMoving() {
return mStateMgr.isState(StateID_Move);
}
public: // FUNCTIONS
void areaCallback(mVec3_c *param1, u32 param2);
void atHitCallback(cCcD_Obj *i_objInfA, dAcObjBase_c *i_actorB, cCcD_Obj *i_objInfB);
/** hides the given shape within the resfile. Ref Brawlcrate's 'polygon#' in the mdl0/Object folder */
void hideModel(ModelType_e type);
/** ?? */
void deleteCheck();
/** ?? Retrieve Beetle */
void retrieve();
/** Attempts to grab ahold of the object upon collision. Called from atHitCallback if type > Hook beetle */
bool tryGrabObject(dAcObjBase_c *pObject);
/** Sets the room id of the beetle. Sets to links room id or the room id of the collision its around */
void setRoomId();
/** Updates the position based on where links wrist is */
void placeOnArm();
/** Sets the assuming bonk flag and plays the rumble feedback */
void bonk();
/** Applies the selected animation to the beetle */
void setChrAnimation(ChrAnimation_e requestedAnimation);
private:
/* 0x0330 */ nw4r::g3d::ResFile mResFile;
/* 0x0334 */ m3d::mdl_c mMdl;
/* 0x0358 */ m3d::anmChrBlend_c mAnmChrBlend;
/* 0x0380 */ m3d::anmChr_c mAnmChr[2];
#define BOOMERANG_ANIM_PINCERS (0)
#define BOOMERANG_ANIM_WINGS (1)
/* 0x0380 */ m3d::anmChr_c mAnmChr[2]; /* 0 - Pincers, 1 - Wings*/
/* 0x03F0 */ dAcBoomerangProc_c mProc;
/* 0x0410 */ dShadowCircle_c mShadow;
/* 0x0418 */ dAcRef_c<dAcObjBase_c> mGrabbedActor;
@@ -105,7 +162,9 @@ private:
/* 0x08B7 */ u8 mRightWingNodeID;
/* 0x08B8 */ u8 _0x8B8[0x8CC - 0x8B8];
/* 0x08B8 */ u32 field_0x8CC;
/* 0x08D0 */ u8 _0x8D0[0x8FC - 0x8D0];
/* 0x08D0 */ u8 _0x8D0[0x8D8 - 0x8D0];
/* 0x08D8 */ mVec3_c field_0x8D8;
/* 0x08E4 */ u8 _0x8E4[0x8FC - 0x8E4];
/* 0x08FC */ dCcD_Sph mSph0;
/* 0x0A4C */ dCcD_Sph mSph1;
/* 0x0B9C */ EffectsStruct mEff0;
@@ -113,8 +172,13 @@ private:
/* 0x0C04 */ EffectsStruct mEff2;
/* 0x0C38 */ EffectsStruct mEff3;
/* 0x0C6C */ dLytFader_c mLytFader;
/* 0x114C */ u8 _0x114C[0x115C - 0x114C];
/* 0x114C */ mFader_c mFader;
/* 0x1150 */ u8 _0x1150[0x115C - 0x1150];
/* 0x115C */ STATE_MGR_DECLARE(dAcBoomerang_c);
static dCcD_SrcSph sSphSrc;
static dBgS_BeetleLinChk sLinChk;
static const u32 sSrcAtType;
};
#endif
+24
View File
@@ -146,6 +146,7 @@ public:
/* 0x 0800 0000 */ ACCH_FLAG_0x8000000 = (1 << 27),
/* 0x 1000 0000 */ ACCH_FLAG_0x10000000 = (1 << 28),
/* 0x 2000 0000 */ ACCH_FLAG_0x20000000 = (1 << 29),
/* 0x 4000 0000 */ ACCH_FLAG_0x40000000 = (1 << 30),
/* 0x 8000 0000 */ ACCH_FLAG_0x80000000 = (1 << 31),
};
@@ -314,6 +315,12 @@ public:
return mFlags & ACCH_FLAG_0x10000000;
}
void ClrLineDown() {
mFlags &= ~LINE_DOWN;
}
void SetLineDown() {
mFlags |= LINE_DOWN;
}
void Clr_0x20000() {
mFlags &= ~ACCH_FLAG_0x20000;
}
@@ -323,6 +330,15 @@ public:
bool Chk_0x20000() {
return mFlags & ACCH_FLAG_0x20000;
}
void Clr_0x40000000() {
mFlags &= ~ACCH_FLAG_0x40000000;
}
void Set_0x40000000() {
mFlags |= ACCH_FLAG_0x40000000;
}
bool Chk_0x40000000() {
return mFlags & ACCH_FLAG_0x40000000;
}
void Clr_0x80000000() {
mFlags &= ~ACCH_FLAG_0x80000000;
}
@@ -506,6 +522,14 @@ public:
return mGnd;
}
dBgS_RoofChk &GetRoof() {
return mRoof;
}
void SetField_0xD4(f32 v) {
mField_0x0D4 = v;
}
public:
/* 0x040 */ u32 mFlags;
/* 0x044 */ mVec3_c *mpPos;
+4
View File
@@ -23,6 +23,10 @@ public:
void SetPos(mVec3_c const *);
void SetField_0x7C(u8 param0) {
mField_0x7C = param0;
}
void SetNowY(f32 y) {
mNowY = y;
}
+3
View File
@@ -50,6 +50,9 @@ public:
bool GetPreGroundChk() const {
return mPreGroundChk;
}
void SetPreRoofChk(bool b) {
mPreRoofChk = b;
}
bool GetPreRoofChk() const {
return mPreRoofChk;
}
+16 -2
View File
@@ -338,7 +338,7 @@ enum dCcD_ObjAtType {
/* 0x 0000 0008 */ AT_TYPE_PHYSICS = (1 << 3),
/* 0x 0000 0010 */ AT_TYPE_0x10 = (1 << 4),
/* 0x 0000 0020 */ AT_TYPE_BOMB = (1 << 5),
/* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6),
/* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6), // Used in Beetle
/* 0x 0000 0080 */ AT_TYPE_SLINGSHOT = (1 << 7),
/* 0x 0000 0100 */ AT_TYPE_0x100 = (1 << 8),
/* 0x 0000 0200 */ AT_TYPE_WIND = (1 << 9),
@@ -686,7 +686,7 @@ public:
cCcD_ObjCo();
virtual ~cCcD_ObjCo();
void Set(const cCcD_SrcGObjCo &);
void SetCoFlag(u32);
void SetGrp(u32);
void AdjustHitPos(f32, f32);
void ClrSet() {
@@ -815,6 +815,9 @@ public:
mCo.OnSPrm(f);
}
void SetAtType(u32 type) {
mAt.SetType(type);
}
void SetTgType(u32 type) {
mTg.SetType(type);
}
@@ -932,6 +935,11 @@ public:
void OnAt_0x40() {
mAt.OnSPrm(0x40);
}
// Related to Beetle (no hook)
void OnAt_0x4000() {
mAt.OnSPrm(0x4000);
}
void SetAtDamage(u8 amount) {
@@ -967,6 +975,9 @@ public:
void ClrTgElectric() {
return mTg.OffSPrm(0x40000);
}
u32 ChkTgBonk() const {
return mTg.MskSPrm(0x200000);
}
void OnTg_0x200000() {
mTg.OnSPrm(0x200000);
@@ -990,6 +1001,9 @@ public:
// Co
void SetCoGrp(u32 grp) {
mCo.SetGrp(grp << 4);
}
void OnCoSet() {
mCo.OnSPrm(1);
}
+7
View File
@@ -584,6 +584,13 @@ public:
return mCurrentAction == 0xAD || mCurrentAction == 0xAE;
}
void onModelUpdateFlag(u32 mask) {
mModelUpdateFlags |= mask;
}
void offModelUpdateFlag(u32 mask) {
mModelUpdateFlags &= ~mask;
}
inline bool checkActionFlags(u32 mask) const {
return (mActionFlags & mask) != 0;
}
+1
View File
@@ -4,6 +4,7 @@
#include "common.h"
#include "m/m3d/m_bmdl.h"
#include "m/m3d/m_fanm.h"
#include "nw4r/g3d/g3d_anmchr.h"
#include "nw4r/g3d/res/g3d_resanmchr.h"
namespace m3d {
+4
View File
@@ -1,6 +1,7 @@
#ifndef M3D_M_MDL_H
#define M3D_M_MDL_H
#include "common.h"
#include "m/m3d/m_banm.h"
#include "m/m3d/m_calc_ratio.h"
#include "m/m3d/m_smdl.h"
@@ -59,6 +60,9 @@ public:
virtual ~mdl_c();
bool create(nw4r::g3d::ResMdl, mAllocator_c *, u32, int, u32 *);
bool create(nw4r::g3d::ResMdl mdl, mAllocator_c *alloc, u32 flag, int num) {
return create(mdl, alloc, flag, num, nullptr);
}
bool create(nw4r::g3d::ResMdl, mdlCallback_c *cb, mAllocator_c *, u32, int, u32 *);
virtual void remove() override;
+7
View File
@@ -28,9 +28,16 @@ public:
mpFader->setStatus(status);
}
void fadeIn() {
mpFader->fadeIn();
}
bool calc() {
return mpFader->calc();
}
void setFrame(u16 frame) {
mpFader->setFrame(frame);
}
protected:
mFaderBase_c *mpFader;
};
+1 -1
View File
@@ -216,7 +216,7 @@ public:
return x != v.x || y != v.y || z != v.z;
}
void normalize();
f32 normalize();
bool normalizeRS();
static mVec3_c createProjectionXZ(const mAng3_c &ang, f32 scalar);