Stage BSP partitioning written. Changes to actors to keep track of their BSP node. Actors traverse the BSP as they move. Miscellanious error code def/usage updates. WIP
This commit is contained in:
@@ -59,6 +59,7 @@ extern char *AKGL_ACTOR_STATE_STRING_NAMES[AKGL_ACTOR_MAX_STATES+1];
|
||||
#define AKGL_MAX_HEAP_ACTOR 64
|
||||
|
||||
typedef struct akgl_Actor {
|
||||
uint8_t type;
|
||||
uint8_t refcount;
|
||||
char name[AKGL_ACTOR_MAX_NAME_LENGTH];
|
||||
akgl_Character *basechar;
|
||||
@@ -70,7 +71,10 @@ typedef struct akgl_Actor {
|
||||
bool movement_controls_face;
|
||||
void *actorData;
|
||||
bool visible;
|
||||
bool simulating;
|
||||
SDL_Time movetimer;
|
||||
// Bounding box accounting for the actor's current real position plus physics delta
|
||||
SDL_FRect bbox;
|
||||
// Velocity. Combined effect of all forces acting on the actor resulting
|
||||
// in energy along an axis.
|
||||
float32_t vx;
|
||||
@@ -100,13 +104,24 @@ typedef struct akgl_Actor {
|
||||
float32_t y;
|
||||
float32_t z;
|
||||
float32_t scale;
|
||||
// Reference to the BSP Node currently containing this actor
|
||||
aksl_TreeNode *bsphome;
|
||||
// Reference to the BSP linked list node currently holding this actor
|
||||
aksl_ListNode *bsplistnode;
|
||||
struct akgl_Actor *children[AKGL_ACTOR_MAX_CHILDREN];
|
||||
struct akgl_Actor *parent;
|
||||
|
||||
// method that controls logic update functions
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*updatefunc)(struct akgl_Actor *obj);
|
||||
// method that renders the actor to the currently active renderer
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*renderfunc)(struct akgl_Actor *obj);
|
||||
// method that changes the actor's face flags based on other state
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*facefunc)(struct akgl_Actor *obj);
|
||||
// method that performs movement logic on the actor based on state flags
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*movementlogicfunc)(struct akgl_Actor *obj, float32_t dt);
|
||||
// method that calculates the correct sprite frame for the actor's current state
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*changeframefunc)(struct akgl_Actor *obj, akgl_Sprite *curSprite, SDL_Time curtimems);
|
||||
// method to add a child to this actor
|
||||
akerr_ErrorContext AKERR_NOIGNORE *(*addchild)(struct akgl_Actor *obj, struct akgl_Actor *child);
|
||||
} akgl_Actor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user