Remove memory allocation in pathfinding
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user