Buildings as entities instead of map layer

This commit is contained in:
2024-01-08 14:41:26 +01:00
parent 03dc3774e7
commit c08fca9670
17 changed files with 168 additions and 186 deletions

View File

@@ -288,9 +288,11 @@ void bzTileMapDestroy(BzTileMap *map) {
}
void bzTileMapPosToTile(BzTileMap *map, Vector2 pos, BzTile *x, BzTile *y) {
if (x) *x = (BzTile) (pos.x / (f32) map->tileWidth);
if (y) *y = (BzTile) (pos.y / (f32) map->tileHeight);
Vec2i bzTileMapPosToTile(BzTileMap *map, Vector2 pos) {
return (Vec2i) {
.x = (i32) (pos.x / (f32) map->tileWidth),
.y = (i32) (pos.y / (f32) map->tileHeight)
};
}
void bzTileMapOverrideLayer(BzTileMap *map, i32 slotID, BzTileLayerFunc func) {