Allocate path with object pool for pathfinding

This commit is contained in:
2023-11-16 07:23:56 +01:00
parent 9e6c836207
commit af99504370
9 changed files with 110 additions and 64 deletions

View File

@@ -62,10 +62,15 @@ typedef struct Animation {
} Animation;
extern ECS_COMPONENT_DECLARE(Animation);
#define PATH_DATA_SIZE 8
typedef struct PathData {
Position waypoints[PATH_DATA_SIZE];
size_t numWaypoints;
struct PathData *next;
} PathData;
typedef struct Path {
Position *waypoints;
i32 maxWaypoints;
i32 numWaypoints;
PathData *paths;
i32 curWaypoint;
} Path;
extern ECS_COMPONENT_DECLARE(Path);