Remove memory allocation in pathfinding

This commit is contained in:
2023-12-07 10:42:53 +01:00
parent 0d156f515e
commit 9800b5576e
6 changed files with 19 additions and 15 deletions

View File

@@ -23,11 +23,12 @@ typedef struct PathNodeRecord {
typedef struct PathfindingDesc {
Position start;
Position target;
BzObjectPool *pool;
BzTileMap *map;
PathNode *openSet; // heap (size: width * height)
PathNodeRecord *closedSet; // size: width * height
Path *outPath;
Path *outPath;
BzObjectPool *pool;
BzStackAlloc *alloc;
} PathfindingDesc;
bool pathfindAStar(const PathfindingDesc *desc);