Add page support to object pool
This commit is contained in:
@@ -79,7 +79,7 @@ bool init(void *userData) {
|
||||
// init pools
|
||||
game->pools.pathData = bzObjectPoolCreate(&(BzObjectPoolDesc) {
|
||||
.objectSize=sizeof(PathData),
|
||||
.numObjects=512
|
||||
.objectsPerPage=512
|
||||
});
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ void imguiRender(float dt, void *userData) {
|
||||
createWorker((Position) {1100, 400}, (Size) {10, 10}, game->entityGrid,
|
||||
&game->map.tilesets[2], 1322);
|
||||
}
|
||||
igText("Num paths from pool available: %llu", bzObjectPoolCalcNumFree(game->pools.pathData));
|
||||
igText("Num paths from pool available: %llu", bzObjectPoolGetNumFree(game->pools.pathData));
|
||||
const char *inputState = "NONE";
|
||||
switch (input->state) {
|
||||
case INPUT_NONE:
|
||||
|
||||
@@ -107,7 +107,7 @@ bool initTreesLayer(BzTileMap *map, BzTileLayer *layer) {
|
||||
f32 posX = layer->offsetX + x * sizeX;
|
||||
f32 posY = layer->offsetY + y * sizeY;
|
||||
ecs_entity_t e = ecs_new_id(ECS);
|
||||
//bzSpatialGridInsert(game->entityGrid, &e, posX, posY, sizeX, sizeY);;
|
||||
bzSpatialGridInsert(game->entityGrid, &e, posX, posY, sizeX, sizeY);
|
||||
posX += sizeX * 0.5f;
|
||||
posY += sizeY * 0.5f;
|
||||
ecs_add(ECS, e, TextureTerrain);
|
||||
|
||||
Reference in New Issue
Block a user