Change collisionMap to boolean value
This commit is contained in:
12
game/main.c
12
game/main.c
@@ -91,7 +91,7 @@ bool init(void *userData) {
|
||||
|
||||
game->map = bzTileMapCreate(&(BzTileMapDesc) {
|
||||
.path="assets/maps/test.tmj",
|
||||
.generateColliderMap=true,
|
||||
.generateCollisionMap=true,
|
||||
.tilesets[0]=game->terrainTileset,
|
||||
.tilesets[1]=game->buildingsTileset,
|
||||
.tilesets[2]=game->entitiesTileset,
|
||||
@@ -140,6 +140,8 @@ bool init(void *userData) {
|
||||
renderDebugPathSystem = renderDebugPath;
|
||||
renderCollidersSystem = renderColliders;
|
||||
|
||||
game->debugDraw.mapColliders = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
void deinit(void *userData) {
|
||||
@@ -151,11 +153,13 @@ void deinit(void *userData) {
|
||||
bzTilesetDestroy(&game->buildingsTileset);
|
||||
bzTilesetDestroy(&game->entitiesTileset);
|
||||
|
||||
Game gameCopy = *game;
|
||||
|
||||
ecs_fini(ECS);
|
||||
ECS = NULL;
|
||||
|
||||
bzObjectPoolDestroy(game->pools.pathData);
|
||||
bzSpatialGridDestroy(game->entityGrid);
|
||||
bzObjectPoolDestroy(gameCopy.pools.pathData);
|
||||
bzSpatialGridDestroy(gameCopy.entityGrid);
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +292,7 @@ void render(float dt, void *userData) {
|
||||
ecs_enable(ECS, renderDebugPathSystem, game->debugDraw.path);
|
||||
ecs_enable(ECS, renderCollidersSystem, game->debugDraw.entityColliders);
|
||||
if (game->debugDraw.mapColliders)
|
||||
bzTileMapDrawColliders(&game->map);
|
||||
bzTileMapDrawCollisions(&game->map);
|
||||
if (game->debugDraw.spatialGrid)
|
||||
bzSpatialGridDrawDebugGrid(game->entityGrid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user