Skip to content

Commit

Permalink
navi.cpp progress, piki overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
intns committed Dec 27, 2024
1 parent 2ec4c2f commit 60f8e20
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 179 deletions.
41 changes: 38 additions & 3 deletions include/CPlate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "types.h"
#include "Traversable.h"
#include "Parameters.h"
#include "Node.h"

struct MapMgr;
Expand All @@ -20,7 +21,12 @@ struct CPlate : public Traversable, public Node {
struct Slot {
Slot();

// TODO: members
Vector3f _00; // _00
float _0C; // _0C
float _10; // _10
float _14; // _14
u32 _18; // _18
u32 _1C; // _1C
};

CPlate(MapMgr*);
Expand Down Expand Up @@ -55,8 +61,37 @@ struct CPlate : public Traversable, public Node {
// _08 = VTBL 2
// _00-_08 = Traversable
// _08-_28 = Node
u8 _28[0x78 - 0x28]; // _28, unknown
int _78; // _78, number of pikis?
u32 _28; // _28
Parm<f32> _2C; // _2C
Parm<f32> _3C; // _3C
Parm<f32> _4C; // _4C
u32 _54; // _54
f32 _58; // _58
Vector3f _5C; // _5C, denoted by a markerShape in debug mode
f32 _68; // _68
f32 _6C; // _6C
f32 _70; // _70
u32 _74; // _74
u32 _78; // _78
u32 _7C; // _7C
CPlate::Slot* mSlotList; // _80
u32 mSlotCount; // _84
f32 _88; // _88
f32 _8C; // _8C
f32 _90; // _90
Vector3f _94; // _94, denoted by a markerShape in debug mode
f32 _A0; // _A0
f32 _A4; // _A4
f32 _A8; // _A8
f32 _AC; // _AC
f32 _B0; // _B0
f32 _B4; // _B4
f32 _B8; // _B8
u32 _BC; // _BC
u32 _C0; // _C0
u32 _C4; // _C4
u8 _C8; // _C8
u8 _C9; // _C9
};

#endif
64 changes: 63 additions & 1 deletion include/Piki.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,73 @@ struct Piki : public Creature, public PaniAnimKeyListener {
// defined in PikiMgr.h to avoid include looping
inline PikiProp* getPikiProp();

// 100AEBD0 in plugPiki
inline void setPositionA(Vector3f* other)
{
_33C = other;

_340 = 0;
_330 = 0;

// _338 is a counter
if (_338) {
subCnt();
_338 = 0;
}
}

inline void resetVariables()
{
_33C = 0;
_348 = 0.0f;
_344 = 0.0f;
_340 = 0;
_330 = 0;

if (_338) {
subCnt();
_338 = 0;
}
}

// _00 = VTBL
// _00-_2B8 = Creature
// _2B8 = PaniAnimKeyListener
OdoMeter mOdometer; // _2BC
u8 _2CC[0x354 - 0x2CC]; // _2CC, TODO: work out members
u32 _2C0; // _2C0
u32 _2C4; // _2C4
u32 _2C8; // _2C8
u32 _2CC; // _2CC
u32 _2D0; // _2D0
u32 _2D4; // _2D4
u32 _2D8; // _2D8
u32 _2DC; // _2DC
u32 _2E0; // _2E0
u32 _2E4; // _2E4
u32 _2E8; // _2E8
u32 _2EC; // _2EC
u32 _2F0; // _2F0
u32 _2F4; // _2F4
u32 _2F8; // _2F8
u32 _308; // _308
u32 _30C; // _30C
u32 _310; // _310
u32 _314; // _314
u32 _318; // _318
u32 _31C; // _31C
u32 _320; // _320
u32 _324; // _324
u32 _328; // _328
u32 _32C; // _32C
u8 _330; // _330
u32 _334; // _334
u32 _338; // _338
Vector3f* _33C; // _33C
u8 _340; // _340
f32 _344; // _344
f32 _348; // _348
u32 _34C; // _34C
u32 _350; // _350
PaniPikiAnimMgr mPikiAnimMgr; // _354
u8 _400; // _400
u8 _401[0x408 - 0x401]; // _401, unknown
Expand Down
11 changes: 10 additions & 1 deletion include/PikiAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ struct Action : public Receiver<Piki> {
void setChildren(int, ...);

inline Child* getChild(int idx) { return &mChildActions[idx]; }
inline Child* getCurrentChild()
{
if (mChildActionIdx == -1) {
return nullptr;
} else {
return &mChildActions[mChildActionIdx];
}
}

inline void initialiseChildAction(Creature* creature) { getChild(mChildActionIdx)->initialise(creature); }

Expand Down Expand Up @@ -1544,7 +1552,8 @@ struct ActTransport : public Action, virtual PaniAnimKeyListener {
u8 _3C[0x4C - 0x3C]; // _3C, unknown
Vector3f _4C[4]; // _4C, probably CR spline points
Vector3f _7C; // _7C
u8 _88[0x8]; // _88, unknown
u32 _88; // _88
int mSlotIndex; // _8C
Vector3f _90; // _90
u8 _9C[0xA8 - 0x9C]; // _9C, unknown
int _A8; // _A8
Expand Down
Loading

0 comments on commit 60f8e20

Please sign in to comment.