Skip to content

Commit

Permalink
Finish matching pelletMgr.cpp (bar one stack issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartPiece44 committed Jan 16, 2025
1 parent 874131b commit 7f6d9b9
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 1,603 deletions.
4 changes: 3 additions & 1 deletion include/Collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ struct CollPart {

bool isPlatformType() { return mPartType == PART_Platform; }

Matrix4f getJointMatrix() { return mJointMatrix; }

/*
DLL inlines to make:
bool isBouncySphereType();
Expand All @@ -156,7 +158,7 @@ struct CollPart {

f32 mRadius; // _00
Vector3f mCentre; // _04
Matrix4f mMatrix; // _10
Matrix4f mJointMatrix; // _10
u8 _50; // _50
bool mIsStickEnabled; // _51
s16 mNextIndex; // _52, index of next sibling
Expand Down
34 changes: 26 additions & 8 deletions include/Pellet.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,23 @@ enum PelletBounceSoundID {
/**
* @brief TODO
*/
enum PelletMgrMovieFlags {
PELMOVIE_Unk1 = 1 << 0, // 0x1
PELMOVIE_Unk2 = 1 << 1, // 0x2
PELMOVIE_Unk3 = 1 << 2, // 0x4
PELMOVIE_Unk4 = 1 << 3, // 0x8
};

/**
* @brief TODO
*
* @note Size: 0x58.
*/
struct PelletProp : public CreatureProp {
PelletProp() { mCreatureProps.mFriction(0.1f); }

// _54 = VTBL
// _00-_58 = CreatureProp
// TODO: members
};

/**
Expand Down Expand Up @@ -158,7 +170,7 @@ struct PelletConfig : public Parameters, public CoreNode {
Parm<f32> mCarryInfoHeight; // _100, p11
Parm<int> mAnimSoundID; // _110, p12 - see PelletAnimSoundID enum
Parm<int> mBounceSoundID; // _120, p13
u32 _130; // _130, maybe int?
int _130; // _130

// this has to be down here or the second VTBL spawns at 0x18 (should spawn at 0x134)

Expand Down Expand Up @@ -261,7 +273,7 @@ struct Pellet : public DualCreature, public PaniAnimKeyListener {
u8 mMotionFlag; // _452
RippleEffect* mRippleEffect; // _454
u32 _458; // _458, unknown
u32 _45C; // _45C, unknown
CollPart* mStuckMouthPart; // _45C
f32 _460; // _460
Vector3f _464; // _464
PelletStateMachine* mStateMachine; // _470
Expand Down Expand Up @@ -300,9 +312,11 @@ struct PelletMgr : public MonoObjectMgr {
* @brief TODO
*/
struct UseNode : public CoreNode {
UseNode() { initCore("useNode"); }

// _00 = VTBL
// _00-_14 = CoreNode
// TODO: members
u32 mPelletID; // _14
};

PelletMgr(MapMgr*);
Expand Down Expand Up @@ -347,11 +361,15 @@ struct PelletMgr : public MonoObjectMgr {
// _00 = VTBL 1
// _08 = VTBL 2
// _00-_3C = MonoObjectMgr
// TODO: members
u8 _3C[0x1F8 - 0x3C]; // _3C, unknown
UseNode mUseList; // _3C
int mConfigNum; // _54
PelletConfig mConfigList; // _58
int mAnimInfoNum; // _190
PelletAnimInfo mAnimInfoList; // _194
PelletProp* mPelletProps; // _1F4
PaniMotionTable* mUfoMotionTable; // _1F8
u8 _1FC[0x200 - 0x1FC]; // _1FC, unknown
u16 mMovieFlags; // _200
int mReadStage; // _1FC, 0:read in configs, 1:read in animinfos
u16 mMovieFlags; // _200, see PelletMgrMovieFlags enum
};

extern PelletMgr* pelletMgr;
Expand Down
16 changes: 12 additions & 4 deletions include/PelletAnimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,33 @@
struct PaniAnimKeyListener;
struct PaniMotionInfo;
struct PaniMotionTable;
struct PelletShapeObject;

/**
* @brief TODO
*
* @note Size: 0x5C.
* @note Size: 0x60.
*/
struct PelletAnimInfo : public Parameters, public CoreNode {
PelletAnimInfo();

void createShapeObject();
PelletShapeObject* createShapeObject();

// _04 = VTBL 1
// _58 = VTBL 2
// _00-_04 = Parameters
// _04-_18 = CoreNode
ID32 mID; // _18
u8 _24[0x58 - 0x24]; // _24, unknown
ID32 mID; // _18
int _24; // _24
int mTekiType; // _28, for corpses
Parm<String> _2C; // _2C
Parm<String> _40; // _40
int _54; // _54

// why is this split like this.
virtual void read(RandomAccessStream&); // _18

PelletShapeObject* mPelletShapeObject; // _5C
};

/**
Expand Down
11 changes: 10 additions & 1 deletion src/plugPikiKando/animPellet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ static void _Print(char*, ...)
* Size: 000180
*/
PelletAnimInfo::PelletAnimInfo()
: _2C(this, String("pellets", 0), String("", 0), String("", 0), "x00", nullptr)
, _40(this, String("noname", 0), String("", 0), String("", 0), "x01", nullptr)
{
mID.setID('none');
_24 = 0;
mTekiType = -1;
_54 = -1;

initCore("pelletAnimInfo");
mPelletShapeObject = nullptr;
/*
.loc_0x0:
mflr r0
Expand Down Expand Up @@ -135,7 +144,7 @@ PelletAnimInfo::PelletAnimInfo()
* Address: 800996C8
* Size: 0000D4
*/
void PelletAnimInfo::createShapeObject()
PelletShapeObject* PelletAnimInfo::createShapeObject()
{
/*
.loc_0x0:
Expand Down
2 changes: 1 addition & 1 deletion src/plugPikiKando/collInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ ID32 CollPart::getCode()
*/
Matrix4f CollPart::getMatrix()
{
Matrix4f collMat = mMatrix;
Matrix4f collMat = mJointMatrix;
Matrix4f outMat;
invCamMat.multiplyTo(collMat, outMat);
outMat.mMtx[0][3] = mCentre.x;
Expand Down
Loading

0 comments on commit 7f6d9b9

Please sign in to comment.