Buildings as entities instead of map layer
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define BREEZE_MAP_H
|
||||
|
||||
#include "tileset.h"
|
||||
#include "../math/vec2i.h"
|
||||
#include "../util/string.h"
|
||||
|
||||
#define BZ_MAP_MAX_LAYERS 8
|
||||
@@ -116,7 +117,7 @@ BzTileset *bzTileObjectGroupGetTileset(BzTileMap *map, BzTileObjectGroup *object
|
||||
BzTileMap bzTileMapCreate(const BzTileMapDesc *desc);
|
||||
void bzTileMapDestroy(BzTileMap *map);
|
||||
|
||||
void bzTileMapPosToTile(BzTileMap *map, Vector2 pos, BzTile *x, BzTile *y);
|
||||
Vec2i bzTileMapPosToTile(BzTileMap *map, Vector2 pos);
|
||||
|
||||
void bzTileMapOverrideLayer(BzTileMap *map, i32 slotID, BzTileLayerFunc func);
|
||||
void bzTileMapOverrideObjectGroup(BzTileMap *map, i32 slotID, BzTileObjectsFunc func);
|
||||
|
||||
Reference in New Issue
Block a user