Skip to content

Commit

Permalink
Tidy loads, DynParticle/DynCreature annotated
Browse files Browse the repository at this point in the history
  • Loading branch information
intns committed Jan 13, 2025
1 parent 0f8f13e commit 8088249
Show file tree
Hide file tree
Showing 61 changed files with 565 additions and 530 deletions.
4 changes: 1 addition & 3 deletions include/AIPerf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
struct Menu;

/*
* @brief TODO
* @brief A static class that contains various settings.
*/
struct AIPerf {
void clearCounts();
Expand Down Expand Up @@ -73,8 +73,6 @@ struct AIPerf {
static bool useASync;
static bool insQuick;
static bool useCollSort;

// TODO: members
};

#endif
3 changes: 2 additions & 1 deletion include/ANode.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "types.h"

/**
* @brief TODO
* @brief A base class for nodes. Shorthand for Age Node.
* @note 'Age' is the system used for debugging in the Windows version.
*/
struct ANode {
virtual int getAgeNodeType() { return 0; } // _08 (weak)
Expand Down
20 changes: 10 additions & 10 deletions include/Animator.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct AnimCacheInfo : public CacheInfo {
};

/**
* @brief TODO
* @brief Animation parameter structure.
*/
struct AnimParam {
int mEntryNum; // _00
Expand All @@ -109,7 +109,7 @@ struct AnimParam {
};

/**
* @brief TODO
* @brief Information about animation data, read in from a file.
*/
struct AnimDataInfo {
AnimDataInfo();
Expand Down Expand Up @@ -325,14 +325,14 @@ struct AnimContext {
AnimContext()
: mData(0)
, mCurrentFrame(0.0f)
, _08(30.0f)
, mFrameRate(30.0f)
{
}

// _0C = VTBL
AnimData* mData; // _00
f32 mCurrentFrame; // _04
f32 _08; // _08
f32 mFrameRate; // _08

virtual void animate(f32 time); // _08
};
Expand All @@ -357,8 +357,8 @@ struct Animator {
int _14; // _14
int _18; // _18
int mCurrentAnimID; // _1C
int mStartKeyIndex; // _20
int mNextKeyInfoIndex; // _24
int mFirstFrameIndex; // _20
int mLastFrameIndex; // _24
AnimInfo* mAnimInfo; // _28
f32 mAnimationCounter; // _2C

Expand All @@ -381,13 +381,13 @@ struct AnimMgr : public CoreNode {
struct AnimMgrParams : public Parameters {
inline AnimMgrParams()
: _18(this, 2, 0, 0, "a00", nullptr)
, _28(this, String("base dir", 0), String("", 0), String("", 0), "a01", nullptr)
, mBasePath(this, String("base dir", 0), String("", 0), String("", 0), "a01", nullptr)
{
}

// _14-_18 = Parameters
Parm<int> _18; // _18
Parm<String> _28; // _28
Parm<int> _18; // _18
Parm<String> mBasePath; // _28
};

AnimMgr(Shape*, char*, int, char*);
Expand All @@ -404,7 +404,7 @@ struct AnimMgr : public CoreNode {
// _00 = VTBL
// _00-_14 = CoreNode
AnimMgrParams mParams; // _14
Shape* _3C; // _3C
Shape* mParent; // _3C
AnimInfo mAnimList; // _40, parent of list of animations
u32 _B4; // _B4
};
Expand Down
21 changes: 11 additions & 10 deletions include/BaseInf.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ struct BPikiInf : public BaseInf {

// _00 = VTBL
// _00-_2C = BaseInf
u8 _2C; // _2C
u8 _2D; // _2D
// TODO: pick a side, is it first key index or colour?
u8 mPikiColour; // _2C
u8 mNextKeyIndex; // _2D
};

/**
Expand All @@ -66,14 +67,14 @@ struct CreatureInf : public BaseInf {

// _00 = VTBL
// _00-_2C = BaseInf
EObjType mObjType; // _2C
int mCurrentDay; // _30, or something related to it, maybe last seen day etc
int _34; // _34
int _38; // _38
int mTekiType; // _3C
int _40; // _40
f32 _44; // _44
f32 _48; // _48
EObjType mObjType; // _2C
int mCurrentDay; // _30, or something related to it, maybe last seen day etc
int mRebirthDay; // _34
int mAdjustFaceDirection; // _38
int mStartAnimId; // _3C
int mEndAnimId; // _40
f32 mHealth; // _44
f32 mMaxHealth; // _48
};

/**
Expand Down
31 changes: 9 additions & 22 deletions include/Boss.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,26 +255,13 @@ struct Boss : public Creature {
f32 getMaxLife() { return mMaxLife; }
void subCurrentLife(f32 damage) { mCurrentLife -= damage; }

// attack timer??
inline f32 get2D0() { return _2D0; } // name these better later
inline void set2D0(f32 val) { _2D0 = val; } // name these better later
inline void add2D0(f32 val) { _2D0 += val; } // name these better later

// walk timer??
inline f32 get2D4() { return _2D4; } // name these better later
inline void set2D4(f32 val) { _2D4 = val; } // name these better later
inline void add2D4(f32 val) { _2D4 += val; } // name these better later

/*
list of inlines to create/assign:
f32 getAttackTimer();
void addAttackTimer(f32);
void setAttackTimer(f32);
f32 getWalkTimer();
void addWalkTimer(f32);
void setWalkTimer(f32);
*/
inline f32 getWalkTimer() { return mWalkTimer; }
inline void setWalkTimer(f32 val) { mWalkTimer = val; }
inline void addWalkTimer(f32 val) { mWalkTimer += val; }

inline f32 getAttackTimer() { return mAttackTimer; }
inline void setAttackTimer(f32 val) { mAttackTimer = val; }
inline void addAttackTimer(f32 val) { mAttackTimer += val; }

// _00 = VTBL
// _00-_2B8 = Creature
Expand All @@ -290,8 +277,8 @@ struct Boss : public Creature {
f32 mCurrentLife; // _2C4, current health (but there's a creature variable for that too)
f32 mMaxLife; // _2C8, max health (but there's a creature variable for that too)
f32 mLifeRecoveryTimer; // _2CC
f32 _2D0; // _2D0, either mAttackTimer or mWalkTimer, unsure
f32 _2D4; // _2D4, either mAttackTimer or mWalkTimer, unsure
f32 mWalkTimer; // _2D0, walk timer
f32 mAttackTimer; // _2D4, either mAttackTimer or mWalkTimer, unsure
f32 mAnimTimer; // _2D8
f32 mSearchAngle; // _2DC
f32 mShadowSize; // _2E0
Expand Down
8 changes: 4 additions & 4 deletions include/BuildingItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct BuildingItem : public ItemCreature {
virtual f32 getBoundingSphereRadius(); // _64
virtual bool isAlive() // _88
{
return _440 > _444;
return mEndAnimId > mStartAnimId;
}
virtual bool needShadow(); // _90 (weak)
virtual void update(); // _E0
Expand All @@ -55,7 +55,7 @@ struct BuildingItem : public ItemCreature {
virtual void playEffect(int); // _12C
virtual bool isCompleted() // _15C
{
return _444 >= _440;
return mStartAnimId >= mEndAnimId;
}

void startBreakEffect();
Expand All @@ -69,8 +69,8 @@ struct BuildingItem : public ItemCreature {
u32 _3D4; // _3D4, unknown
PermanentEffect _3D8; // _3D8
PermanentEffect _3E8; // _3E8
int _440; // _440
int _444; // _444
int mEndAnimId; // _440
int mStartAnimId; // _444
Vector3f _448; // _448
WayPoint* mWayPoint; // _454
CollInfo mBuildCollision; // _458
Expand Down
12 changes: 6 additions & 6 deletions include/CPlate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ struct CPlate : public Traversable, public Node {
struct Slot {
Slot();

Vector3f _00; // _00
float _0C; // _0C
float _10; // _10
float _14; // _14
u32 _18; // _18
u32 _1C; // _1C
Vector3f mPosition; // _00
float _0C; // _0C
float _10; // _10
float _14; // _14
u32 _18; // _18
u32 _1C; // _1C
};

CPlate(MapMgr*);
Expand Down
16 changes: 8 additions & 8 deletions include/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct CullFrustum {
projVec.z = vec.dot(mViewZAxis);
}

int mNumActivePlanes; // _00
int _00; // _00
int _04; // _04
int mViewPlaneIdx; // _08
CullingPlane mCullPlanes[6]; // _0C
Expand Down Expand Up @@ -108,13 +108,13 @@ struct Camera : public CullFrustum {
void projectCamPoint(Vector3f&);

// _00-_260 = CullFrustum
Matrix4f _260; // _260
Matrix4f mProjectionMatrix; // _2A0
Matrix4f _2E0; // _2E0
Vector3f mRotation; // _320
Vector3f _32C; // _32C
Vector3f _338; // _338
f32 _344; // _344
Matrix4f mPerspectiveMatrix; // _260, used for perspective projection
Matrix4f mProjectionMatrix; // _2A0
Matrix4f _2E0; // _2E0
Vector3f mRotation; // _320
Vector3f _32C; // _32C
Vector3f _338; // _338
f32 _344; // _344
};

/**
Expand Down
10 changes: 5 additions & 5 deletions include/ChannelMgr.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "types.h"
#ifndef _CHANNELMGR_H
#define _CHANNELMGR_H
typedef class ChannelMgr;

class ChannelMgr {
#include "types.h"

struct ChannelMgr {
ChannelMgr();

f32 _00; // _00
f32 _04; // _04
f32 _08; // _08
s32 _0C; // _0C
s32 _10; // _10

ChannelMgr();
};

#endif
14 changes: 7 additions & 7 deletions include/Collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ struct CollPart {
Matrix4f mMatrix; // _10
u8 _50; // _50
bool mIsStickEnabled; // _51
s16 _52; // _52
s16 _54; // _54
s16 mNextIndex; // _52, index of next sibling
s16 mFirstIndex; // _54, index of first child
ObjCollInfo* mCollInfo; // _58
u8 mPartType; // _5C
CollInfo* mParentInfo; // _60
Expand Down Expand Up @@ -264,11 +264,11 @@ struct CollTriInfo {
void init(RoomInfo*, Vector3f*);
void behindEdge(Vector3f&);

u32 mMapCode; // _00
u8 _04[0x14]; // _04, unknown
Vector3f _18; // _18
u8 _24[0x4]; // _24, unknown
Plane _28[3]; // _28
u32 mMapCode; // _00
u8 _04[0x14]; // _04, unknown
Vector3f mTriangleNormal; // _18
u32 _24; // _24
Plane _28[3]; // _28
};

/**
Expand Down
2 changes: 1 addition & 1 deletion include/CoreNucleus.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct CoreNucleusAi : public PaniAnimKeyListener {

// _00 = VTBL
// _00-_04 = PaniAnimKeyListener
bool _04; // _04
bool mIsHit; // _04
CoreNucleus* mCore; // _08
};

Expand Down
2 changes: 1 addition & 1 deletion include/CourseDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "types.h"

namespace CourseDebug {
// Global debug objects - these are all size 0x4, maybe BOOL? or u32?

extern int collision;
extern int pikiNoAttack;
extern int noCarryover;
Expand Down
20 changes: 11 additions & 9 deletions include/Creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ struct SeContext;
*/
enum CreatureFlags {
CF_Unk1 = 1 << 0, // 0x1
CF_Unk2 = 1 << 1, // 0x2
CF_GravityEnabled = 1 << 1, // 0x2
CF_IsOnGround = 1 << 2, // 0x4
CF_Unk4 = 1 << 3, // 0x8
CF_Unk5 = 1 << 4, // 0x10
CF_Unk6 = 1 << 5, // 0x20
CF_Unk7 = 1 << 6, // 0x40
CF_IsFlying = 1 << 6, // 0x40
CF_Unk8 = 1 << 7, // 0x80
CF_GroundOffsetEnabled = 1 << 8, // 0x100
CF_Unk10 = 1 << 9, // 0x200
Expand All @@ -49,7 +49,7 @@ enum CreatureFlags {
CF_IsClimbing = 1 << 13, // 0x2000
CF_StuckToObject = 1 << 14, // 0x4000, stuck to an object
CF_StuckToMouth = 1 << 15, // 0x8000, stuck to mouth of some enemy
CF_Unk16 = 1 << 16, // 0x10000
CF_FaceDirAdjust = 1 << 16, // 0x10000
CF_Unk17 = 1 << 17, // 0x20000
CF_Unk18 = 1 << 18, // 0x40000
CF_IsAICullingActive = 1 << 19, // 0x80000, creature is off camera
Expand Down Expand Up @@ -223,12 +223,12 @@ struct Creature : public RefCountable, public EventTalker {

Vector3f& getPosition() { return mPosition; }

inline void disableFlag10000() { resetCreatureFlag(CF_Unk16); } // this should be one of the disable inlines
inline void disableFaceDirAdjust() { resetCreatureFlag(CF_FaceDirAdjust); } // this should be one of the disable inlines

inline void setFlag40UnsetFlag2() // name this better later PLEASE - definitely a DLL inline
inline void startFlying()
{
setCreatureFlag(CF_Unk7);
resetCreatureFlag(CF_Unk2);
setCreatureFlag(CF_IsFlying);
resetCreatureFlag(CF_GravityEnabled);
}

void disableAICulling() { resetCreatureFlag(CF_IsAICullingActive); }
Expand All @@ -250,6 +250,7 @@ struct Creature : public RefCountable, public EventTalker {
Creature* getStickObject() { return mStickTarget; }
bool isStickTo() { return mStickTarget != nullptr; }

// AKA: is this a gate?
bool isSluice()
{
return mObjType == OBJTYPE_SluiceSoft || mObjType == OBJTYPE_SluiceHard || mObjType == OBJTYPE_SluiceBomb
Expand Down Expand Up @@ -289,6 +290,7 @@ struct Creature : public RefCountable, public EventTalker {
void disableFaceDirAdjust();
void disableFixPos();
void disableGravity();
void enableAirResist(f32);
void enableFaceDirAdjust();
void enableFixPos();
Expand Down Expand Up @@ -338,8 +340,8 @@ struct Creature : public RefCountable, public EventTalker {
u32 mCreatureFlags; // _C8, bitflag
u32 _CC; // _CC
f32 mGroundOffset; // _D0
Vector3f _D4; // _D4
Quat _E0; // _E0
Vector3f mPrevAngularVelocity; // _D4
Quat mRotationQuat; // _E0
Quat mPreGrabRotation; // _F0
Quat _100; // _100
f32 _110; // _110
Expand Down
Loading

0 comments on commit 8088249

Please sign in to comment.