mirror of
https://github.com/zeldaret/oot
synced 2026-07-11 15:18:59 -04:00
Actor struct cleanup (#208)
* cleanup a few things * fix mistake * yawTowardsLink * run format * pr suggestion
This commit is contained in:
+27
-37
@@ -107,16 +107,15 @@ typedef struct {
|
||||
typedef struct Actor {
|
||||
/* 0x000 */ s16 id; // Actor Id
|
||||
/* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values
|
||||
/* 0x003 */ s8 room; // Room number the actor is part of. FF denotes that the actor won't despawn on a room change
|
||||
/* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change
|
||||
/* 0x004 */ u32 flags; // Flags used for various purposes
|
||||
/* 0x008 */ PosRot initPosRot; // Contains Initial Rotation when Object is Spawned
|
||||
/* 0x008 */ PosRot initPosRot; // Initial position/rotation when spawned. Is sometimes used for other purposes
|
||||
/* 0x01C */ s16 params; // original name: "args_data"; Configurable variable set by an actor's spawn data
|
||||
/* 0x01E */ s8 objBankIndex; // original name: "bank"; Object bank index of this actor's object dependency
|
||||
/* 0x01F */ s8 unk_1F;
|
||||
/* 0x020 */ u16 soundEffect; // Plays sound effect relative to actor's location (if within range of camera?)
|
||||
/* 0x022 */ u16 unk_22;
|
||||
/* 0x024 */ PosRot posRot; // Current coordinates
|
||||
/* 0x038 */ PosRot posRot2; // Related to camera
|
||||
/* 0x020 */ u16 sfx; // Plays sound effect relative to actor's location (if within range of camera?)
|
||||
/* 0x024 */ PosRot posRot; // position/rotation in the world
|
||||
/* 0x038 */ PosRot posRot2;
|
||||
/* 0x04C */ f32 unk_4C;
|
||||
/* 0x050 */ Vec3f scale; // Sets x,y,z scaling factor. Typically, a factor of 0.01 is used for each axis
|
||||
/* 0x05C */ Vec3f velocity;
|
||||
@@ -127,52 +126,42 @@ typedef struct Actor {
|
||||
/* 0x078 */ CollisionPoly* floorPoly; // Floor polygon an actor is over/touching
|
||||
/* 0x07C */ u8 wallPolySource; // Complex Poly Surface Source. 0x32 = Scene
|
||||
/* 0x07D */ u8 floorPolySource; // Complex Poly Surface Source. 0x32 = Scene. related to 0x80/88
|
||||
/* 0x07E */ s16 wallPolyRot; // Rotation of the wall poly
|
||||
/* 0x080 */ f32 unk_80; // Floor poly height?
|
||||
/* 0x084 */ f32 unk_84;
|
||||
/* 0x07E */ s16 wallPolyRot; // Rotation of the wall poly an actor is touching
|
||||
/* 0x080 */ f32 groundY;
|
||||
/* 0x084 */ f32 waterY;
|
||||
/* 0x088 */ u16 bgCheckFlags;
|
||||
/* 0x08A */ s16 rotTowardsLinkY; // Rotation y (give item, possibly next facing dir?/face toward link?)
|
||||
/* 0x08C */ f32 waterSurfaceDist;
|
||||
/* 0x090 */ f32 xzDistanceFromLink;
|
||||
/* 0x094 */ f32 yDistanceFromLink;
|
||||
/* 0x08A */ s16 yawTowardsLink;
|
||||
/* 0x08C */ f32 xyzDistFromLinkSq;
|
||||
/* 0x090 */ f32 xzDistFromLink;
|
||||
/* 0x094 */ f32 yDistFromLink;
|
||||
/* 0x098 */ CollisionCheckInfo colChkInfo;
|
||||
/* 0x0B4 */ ActorShape shape;
|
||||
/* 0x0CC */ Vec3f unk_CC[2];
|
||||
/* 0x0E4 */ Vec3f unk_E4; // Stores result of some vector transformation involving actor xyz vector, and a matrix at Global Context + 11D60
|
||||
/* 0x0E4 */ Vec3f unk_E4; // Stores result of some vector transformation involving actor xyz vector and mf_11D60
|
||||
/* 0x0F0 */ f32 unk_F0; // Related to above
|
||||
/* 0x0F4 */ f32 unk_F4;
|
||||
/* 0x0F8 */ f32 unk_F8;
|
||||
/* 0x0FC */ f32 unk_FC;
|
||||
/* 0x100 */ Vec3f pos4; // Final Coordinates last frame (collision, NTSC 1.0 f 8002F8E0)
|
||||
/* 0x100 */ Vec3f pos4;
|
||||
/* 0x10C */ u8 unk_10C; // Z-Target related
|
||||
/* 0x10D */ u8 unk_10D; // Z-Target related
|
||||
/* 0x10E */ u16 textId; // Text id to pass to link/display when interacting with an actor (navi text, probably others)
|
||||
/* 0x110 */ u16 freeze; // Used for the "Redead Freeze" attack. Also used in func_80059EC8
|
||||
/* 0x112 */ u16 unk_112; // Damage color effect, first 12 bits controls color which can only be blue red and white, last 4 bits unknown, can't be 0
|
||||
/* 0x114 */ u8 unk_114; // Damage color effect timer, decremented toward 0 every frame
|
||||
/* 0x115 */ u8 activelyDrawn; // Indicates whether the actor is currently being drawn (but not through lens). 01 for yes, 00 for no
|
||||
/* 0x116 */ u8 unk_116; // Set within a routine that deals with collision
|
||||
/* 0x10E */ u16 textId; // Text id to pass to link/display when interacting with an actor
|
||||
/* 0x110 */ u16 freeze;
|
||||
/* 0x112 */ u16 dmgEffectParams; // Specifies damage effect color (white/red/blue) and if opaque or translucent
|
||||
/* 0x114 */ u8 dmgEffectTimer;
|
||||
/* 0x115 */ u8 activelyDrawn; // Indicates whether the actor is currently being drawn (but not through lens)
|
||||
/* 0x116 */ u8 unk_116;
|
||||
/* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF
|
||||
|
||||
/* 0x118 */ struct Actor* attachedA; // Interfacing Actor?
|
||||
// e.g. Link holding chu, Chu instance stores ptr to Link instance here;
|
||||
// Anju having Link's ptr when giving an item
|
||||
// Volvagia Hole stores Volvagia Flying here
|
||||
|
||||
/* 0x11C */ struct Actor* attachedB; // Attached to Actor
|
||||
// e.g. Link holding chu, Link instance stores ptr to Bombchu instance here
|
||||
|
||||
/* 0x118 */ struct Actor* attachedA; // Attached By?
|
||||
/* 0x11C */ struct Actor* attachedB; // Attached To?
|
||||
/* 0x120 */ struct Actor* prev; // Previous Actor of this type
|
||||
/* 0x124 */ struct Actor* next; // Next Actor of this type
|
||||
|
||||
/* 0x128 */ ActorFunc init; // Initialization Routine. Mandatory
|
||||
/* 0x12C */ ActorFunc destroy; // Destruction Routine
|
||||
/* 0x130 */ ActorFunc update; // Main Update Routine, called every frame the actor is to be updated
|
||||
/* 0x134 */ ActorFunc draw; // Draw Routine, writes necessary display lists
|
||||
|
||||
/* 0x128 */ ActorFunc init; // Initialization Routine. Called by Actor_Init or Actor_UpdateAll
|
||||
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by Actor_Destroy
|
||||
/* 0x130 */ ActorFunc update; // Update Routine. Called by Actor_UpdateAll
|
||||
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by Actor_Draw
|
||||
/* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
|
||||
/* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom
|
||||
/* From here on, the structure and size varies for each actor */
|
||||
} Actor; // size = 0x14C
|
||||
|
||||
typedef struct {
|
||||
@@ -218,6 +207,7 @@ typedef struct {
|
||||
} struct_80032E24;
|
||||
|
||||
struct Player;
|
||||
|
||||
typedef void (*PlayerActionFunc)(struct Player*, struct GlobalContext*);
|
||||
|
||||
typedef struct Player {
|
||||
|
||||
Reference in New Issue
Block a user