Add entity map
This commit is contained in:
@@ -48,7 +48,6 @@ bool initEntityObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
|
||||
|
||||
bool initBuildingsLayer(BzTileMap *map, BzTileLayer *layer) {
|
||||
Game *game = ecs_singleton_get_mut(ECS, Game);
|
||||
game->entityMap = bzCalloc(sizeof(*game->entityMap), layer->width * layer->height);
|
||||
|
||||
BzTileLayer *ownershipLayer = layer;
|
||||
BzTileLayer *buildingLayer = bzTileMapGetLayer(map, LAYER_BUILDINGS);
|
||||
@@ -76,12 +75,6 @@ bool initBuildingsLayer(BzTileMap *map, BzTileLayer *layer) {
|
||||
ownerTile = getTileBuilding(ownerTile);
|
||||
ecs_set(ECS, e, Owner, {.playerID=ownerTile});
|
||||
|
||||
for (i32 yIdx = y; yIdx < y + size.sizeY; yIdx++) {
|
||||
for (i32 xIdx = x; xIdx < x + size.sizeX; xIdx++) {
|
||||
game->entityMap[yIdx * layer->width + xIdx] = e;
|
||||
}
|
||||
}
|
||||
|
||||
//bzTileMapUpdateCollider(&GAME.map, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user