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

@@ -79,6 +79,7 @@ bool init(void *userData) {
input->unitPositions = bzArrayCreate(Position, 16);
game->stackAlloc = bzStackAllocCreate(10 * 1000 * 1000); // 10 MB
// init pools
game->pools.pathData = bzObjectPoolCreate(&(BzObjectPoolDesc) {
.objectSize=sizeof(PathData),
@@ -189,6 +190,7 @@ void deinit(void *userData) {
ECS = NULL;
bzArrayDestroy(inputCopy.unitPositions);
bzStackAllocDestroy(&gameCopy.stackAlloc);
bzObjectPoolDestroy(gameCopy.pools.pathData);
bzSpatialGridDestroy(gameCopy.entityGrid);
}