Added more actor types and some defines (#194)

* Added more actor types and some defines

Also adjusted the generic Actor struct to have some of its members
 have names that are generally reasonable for all types of actors

Added a union to the BananActor struct, makes accessing the `rot`
 member and the overlapping id/index members more sensible

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-05-11 23:07:18 -04:00
committed by GitHub
parent 92ad254c24
commit 49845b1fe9
5 changed files with 2283 additions and 2137 deletions
+140 -26
View File
@@ -5,7 +5,121 @@
// Made this because there will likely be a lot of structs in this file that will be compiled into one eventually.
// This keeps the other files cleaner.
struct piranha_plant {
#define ACTOR_FALLING_ROCK 0x05
#define ACTOR_BANANA 0x06
#define ACTOR_GREEN_SHELL 0x07
#define ACTOR_RED_SHELL 0x08
#define ACTOR_YOSHI_VALLEY_EGG 0x09
#define ACTOR_PIRANHA_PLANT 0x0A
#define ACTOR_ITEM_BOX 0x0C
#define ACTOR_FAKE_ITEM_BOX 0x0D
#define ACTOR_BANANA_BUNCH 0x0E
#define ACTOR_TRAIN_ENGINE 0x0F
#define ACTOR_TRAIN_TENDER 0x10
#define ACTOR_TRAIN_PASSENGER_CAR 0x11
#define ACTOR_TRIPLE_GREEN_SHELL 0x15
#define ACTOR_TRIPLE_RED_SHELL 0x16
#define ACTOR_MARIO_RACEWAY_SIGN 0x17
#define ACTOR_WARIO_STADIUM_SIGN 0x23
#define ACTOR_PADDLE_WHEEL_BOAT 0x26
#define ACTOR_RAILROAD_CROSSING 0x27
#define ACTOR_BLUE_SPINY_SHELL 0x2A
#define ACTOR_HOT_AIR_BALLOON_ITEM_BOX 0x2B
#define ACTOR_KIWANO_FRUIT 0x2D
/*
Used by the locomotive, tender, and passenger car
*/
struct TrainCar {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 wheelRot;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ Vec3s rot;
/* 0x10 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct RailroadCrossing {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 someTimer;
/* 0x06 */ s16 crossingId;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ Vec4s unk_10;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct FallingRock {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 respawnTimer;
/* 0x06 */ s16 unk_06;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 boundingBoxSize;
/* 0x10 */ Vec3s rot;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct YoshiValleyEgg {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ f32 pathRadius;
/* 0x0C */ f32 boundingBoxSize;
/* 0x10 */ s16 pathRot;
/* 0x12 */ s16 eggRot;
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
// Note, pathCenter[1] should be understood to be the Y velocity of the egg
// pathCenter[0] and pathCenter[2] are the X,Z coordinates of the center of the path
/* 0x24 */ Vec3f pathCenter;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct KiwanoFruit {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 targetPlayer; // Id of the player this actor tracks. Each player has their own kiwano actor just for them
/* 0x06 */ s16 state;
/* 0x08 */ f32 bonkTimer; // bonkState? Not sure what this is tracking, but its some form of count down that starts after the fruit hits you
/* 0x0C */ f32 boundingBoxSize;
/* 0x10 */ s16 animState;
/* 0x12 */ s16 animTimer;
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct PaddleWheelBoat {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 wheelRot;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ Vec3s boatRot;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct PiranhaPlant {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ Vec4s visibilityStates; // A per-camera visibilty state tracker
@@ -15,9 +129,9 @@ struct piranha_plant {
/* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state
/* 0x2C */ f32 unk_02C;
/* 0x30 */ UnkActorInner unk30;
};
}; // size = 0x70
struct triple_shell_parent {
struct TripleShellParent {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 shellsAvailable;
@@ -33,7 +147,7 @@ struct triple_shell_parent {
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct shell_actor {
struct ShellActor {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
// Index in D_8015F9B8 for the parent actor of this shell
@@ -51,7 +165,7 @@ struct shell_actor {
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct item_box {
struct ItemBox {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 someTimer;
@@ -69,7 +183,7 @@ struct item_box {
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct fake_item_box {
struct FakeItemBox {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 someTimer;
@@ -85,7 +199,7 @@ struct fake_item_box {
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct banana_bunch_parent {
struct BananaBunchParent {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
@@ -100,7 +214,7 @@ struct banana_bunch_parent {
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct banana_actor {
struct BananaActor {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
@@ -108,28 +222,28 @@ struct banana_actor {
/* 0x08 */ s16 parentIndex;
/* 0x0A */ s16 bananaId; // ? Appears to indiciate which banana of the bunch this one is
/* 0x0C */ f32 boundingBoxSize;
/* 0x10 */ s16 playerId; // Player that owns this particular banana
/* 0x12 */ s16 elderIndex; // Index of the next-oldest banana in the bunch
/* 0x14 */ s16 youngerIndex; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest
/* 0x16 */ s16 unk_16; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest
union {
/* 0x10 */ Vec3s rot;
/* 0x10 */ s16 playerId; // Id of the player that owns this banana
/* 0x12 */ s16 elderIndex; // Index in D_8015F9B8 of the next-oldest banana in the bunch
/* 0x14 */ s16 youngerIndex; // Index in D_8015F9B8 of the next-youngest banana in the bunch
};
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
}; // size = 0x70
struct Actor {
/* 0x00 */ s16 unk0; // 0xC, 0xD, or 0x2B
#ifdef AVOID_UB
/* 0x02 */ u16 unk2;
#else
s16 unk2; // bitflags
#endif
/* 0x04 */ s16 unk4; // Timer?
/* 0x06 */ s16 unk6; // 1 // train wheel rot?
/* 0x08 */ f32 unk8;
f32 unkC;
/* 0x0C */ Vec3s unk10; // Actor rotation
/* 0x18 */ Vec3f unk18;
/* 0x24 */ Vec3f unk24;
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 state;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 boundingBoxSize;
/* 0x10 */ Vec3s rot;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ UnkActorInner unk30;
};
}; // size = 0x70