diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2024-03-04 17:02:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-04 09:02:45 -0700 |
| commit | f99e242d97602a67ddcb107627f56effc4afd065 (patch) | |
| tree | 0859f2747159d82cc57f79495d6df30198819715 /include/actor_types.h | |
| parent | 1aa6824d3340fc6fb6eca917f8c3ed7c9259af06 (diff) | |
Document render/update objects (#565)
* Document objects related code.
* Including render/update objects code
* Various renamings
Diffstat (limited to 'include/actor_types.h')
| -rw-r--r-- | include/actor_types.h | 167 |
1 files changed, 87 insertions, 80 deletions
diff --git a/include/actor_types.h b/include/actor_types.h index ccf405c72..1579a5300 100644 --- a/include/actor_types.h +++ b/include/actor_types.h @@ -9,70 +9,71 @@ //#pragma GCC diagnostic ignored "-Wmicrosoft-extension" //#pragma GCC diagnostic ignored "-Wmissing-member-name-in-structure-/-union" -/* -gActorList should be understood to be populated by generic Actor structs. -However, for human readability, many functions interacting with actor list elements expect one of the many -specialized types found in this file. - -Note that specialized types must be the same size as a plain Actor. Don't be mislead into thinking that -because its a separate type that it can modified separately from plain Actor. If you modify/add an actor type -and its size is different from plain Actor's, you WILL run into buggy (potentially crash inducing) behaviour. - -Specialized structs are customizable so long as the following member specifications are met: - -In general: - 0x00 -> s16 type - 0x02 -> s16 flags - 0x30 -> Collision unk30 - -If player can collide with the actor: - 0x0C -> f32 boundingBoxSize - -If the actor makes sound (necessary for doppler/volume stuff): - 0x18 -> Vec3f pos - 0x24 -> Vec3f velocity - -Other members are more flexible, and even the non-general specifications can be ignored IF AND ONLY IF you know -exactly what you're doing. -*/ - -#define ACTOR_TREE_MARIO_RACEWAY 0x02 -#define ACTOR_TREE_YOSHI_VALLEY 0x03 -#define ACTOR_TREE_ROYAL_RACEWAY 0x04 -#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_COW 0x12 -#define ACTOR_TREE_MOO_MOO_FARM 0x13 -#define ACTOR_TRIPLE_GREEN_SHELL 0x15 -#define ACTOR_TRIPLE_RED_SHELL 0x16 -#define ACTOR_MARIO_RACEWAY_SIGN 0x17 -#define ACTOR_PALM_TREE 0x19 -#define ACTOR_TREE_BOWSERS_CASTLE 0x1C -#define ACTOR_TREE_FRAPPE_SNOWLAND 0x1D -#define ACTOR_CACTUS1_KALAMARI_DESERT 0x1E -#define ACTOR_CACTUS2_KALAMARI_DESERT 0x1F -#define ACTOR_CACTUS3_KALAMARI_DESERT 0x20 -#define ACTOR_BUSH_BOWSERS_CASTLE 0x21 -#define ACTOR_WARIO_STADIUM_SIGN 0x23 -#define ACTOR_BOX_TRUCK 0x25 -#define ACTOR_PADDLE_WHEEL_BOAT 0x26 -#define ACTOR_RAILROAD_CROSSING 0x27 -#define ACTOR_SCHOOL_BUS 0x28 -#define ACTOR_TANKER_TRUCK 0x29 -#define ACTOR_BLUE_SPINY_SHELL 0x2A -#define ACTOR_HOT_AIR_BALLOON_ITEM_BOX 0x2B -#define ACTOR_CAR 0x2C -#define ACTOR_KIWANO_FRUIT 0x2D +/** + * gActorList should be understood to be populated by generic Actor structs. + * However, for human readability, many functions interacting with actor list elements expect one of the many + * specialized types found in this file. + * + * Note that specialized types must be the same size as a plain Actor. Don't be mislead into thinking that + * because its a separate type that it can modified separately from plain Actor. If you modify/add an actor type + * and its size is different from plain Actor's, you WILL run into buggy (potentially crash inducing) behaviour. + * + * Specialized structs are customizable so long as the following member specifications are met: + * + * In general: + * 0x00 -> s16 type + * 0x02 -> s16 flags + * 0x30 -> Collision unk30 + * + * If player can collide with the actor: + * 0x0C -> f32 boundingBoxSize + * + * If the actor makes sound (necessary for doppler/volume stuff): + * 0x18 -> Vec3f pos + * 0x24 -> Vec3f velocity + * + * Other members are more flexible, and even the non-general specifications can be ignored IF AND ONLY IF you know + * exactly what you're doing. + */ +enum ActorType { + ACTOR_TREE_MARIO_RACEWAY = 0x02, + ACTOR_TREE_YOSHI_VALLEY, + ACTOR_TREE_ROYAL_RACEWAY, + ACTOR_FALLING_ROCK, + ACTOR_BANANA, + ACTOR_GREEN_SHELL, + ACTOR_RED_SHELL, + ACTOR_YOSHI_VALLEY_EGG, + ACTOR_PIRANHA_PLANT, + ACTOR_ITEM_BOX = 0x0C, + ACTOR_FAKE_ITEM_BOX, + ACTOR_BANANA_BUNCH, + ACTOR_TRAIN_ENGINE, + ACTOR_TRAIN_TENDER, + ACTOR_TRAIN_PASSENGER_CAR, + ACTOR_COW, + ACTOR_TREE_MOO_MOO_FARM, + ACTOR_TRIPLE_GREEN_SHELL = 0x15, + ACTOR_TRIPLE_RED_SHELL, + ACTOR_MARIO_SIGN, + ACTOR_PALM_TREE = 0x19, + ACTOR_TREE_BOWSERS_CASTLE = 0x1C, + ACTOR_TREE_FRAPPE_SNOWLAND, + ACTOR_CACTUS1_KALAMARI_DESERT, + ACTOR_CACTUS2_KALAMARI_DESERT, + ACTOR_CACTUS3_KALAMARI_DESERT, + ACTOR_BUSH_BOWSERS_CASTLE, + ACTOR_WARIO_SIGN = 0x23, + ACTOR_BOX_TRUCK = 0x25, + ACTOR_PADDLE_BOAT, + ACTOR_RAILROAD_CROSSING, + ACTOR_SCHOOL_BUS, + ACTOR_TANKER_TRUCK, + ACTOR_BLUE_SPINY_SHELL, + ACTOR_HOT_AIR_BALLOON_ITEM_BOX, + ACTOR_CAR, + ACTOR_KIWANO_FRUIT, +}; #define ACTOR_LIST_SIZE 100 @@ -80,23 +81,29 @@ exactly what you're doing. #define ACTOR_IS_NOT_EXPIRED 0xF // The actor possesses some kind of collision and can be removed // Actor shell->state (green, red and blue) -#define HELD_SHELL 0 // Single shell that has not been dropped. (probably holding Z). -#define RELEASED_SHELL 1 // This is the short window where single shells aren't being held or launched. -#define MOVING_SHELL 2 // Moving towards its target after being shot. -#define RED_SHELL_LOCK_ON 3 // Red shell is targeting. -#define TRIPLE_GREEN_SHELL 4 // Loses triple shell state when shot. -#define GREEN_SHELL_HIT_A_RACER 5 // A racer has been hit by a green shell. -#define TRIPLE_RED_SHELL 6 // Loses triple shell state when shot. -#define DESTROYED_SHELL 7 // Collision with the shell. -#define BLUE_SHELL_LOCK_ON 8 // A blue shell has found a target and is hastily approaching it. -#define BLUE_SHELL_TARGET_ELIMINATED 9 // Mission completed, well done boss. +enum ShellState { + HELD_SHELL, // Single shell that has not been dropped. (probably holding Z). + RELEASED_SHELL, // This is the short window where single shells aren't being held or launched. + MOVING_SHELL, // Moving towards its target after being shot. + RED_SHELL_LOCK_ON, // Red shell is targeting. + TRIPLE_GREEN_SHELL, // Loses triple shell state when shot. + GREEN_SHELL_HIT_A_RACER, // A racer has been hit by a green shell. + TRIPLE_RED_SHELL, // Loses triple shell state when shot. + DESTROYED_SHELL, // Collision with the shell. + BLUE_SHELL_LOCK_ON, // A blue shell has found a target and is hastily approaching it. + BLUE_SHELL_TARGET_ELIMINATED, // Mission completed, well done boss. +}; + // Actor banana->state -#define HELD_BANANA 0 // Single banana that has not been dropped. -#define DROPPED_BANANA 1 // A banana in the state of being dropped on the ground (it only last for a few frames). -#define FIRST_BANANA_BUNCH_BANANA 2 // The first banana of the banana bunch -#define BANANA_BUNCH_BANANA 3 // Every banana of the banana bunch except the first one. -#define BANANA_ON_GROUND 4 // A banana sitting on the ground. -#define DESTROYED_BANANA 5 // Collision with the banana. +enum BananaState { + HELD_BANANA, // Single banana that has not been dropped. + DROPPED_BANANA, // A banana in the state of being dropped on the ground (it only last for a few frames). + FIRST_BANANA_BUNCH_BANANA, // The first banana of the banana bunch + BANANA_BUNCH_BANANA, // Every banana of the banana bunch except the first one. + BANANA_ON_GROUND, // A banana sitting on the ground. + DESTROYED_BANANA, // Collision with the banana. +}; + // Actor fakeItemBox->state #define HELD_FAKE_ITEM_BOX 0 // Item box is being held be Z. #define FAKE_ITEM_BOX_ON_GROUND 1 // Item box is on the ground. |
