Buildings as entities instead of map layer
This commit is contained in:
@@ -17,8 +17,8 @@ typedef struct AnimationFrame {
|
||||
} AnimationFrame;
|
||||
|
||||
typedef enum TerrainType {
|
||||
TERRAIN_NONE = -1,
|
||||
TERRAIN_COUNT,
|
||||
TERRAIN_NONE,
|
||||
} TerrainType;
|
||||
|
||||
static bool terrainHasAnimation(BzTileID tile) {
|
||||
@@ -257,9 +257,9 @@ static AnimationFrame terrainGetAnimationFrame(BzTileID tile, i32 frameIdx) {
|
||||
|
||||
|
||||
typedef enum BuildingType {
|
||||
BUILDING_NONE = -1,
|
||||
BUILDING_KEEP,
|
||||
BUILDING_COUNT,
|
||||
BUILDING_NONE,
|
||||
} BuildingType;
|
||||
|
||||
static BuildingType getTileBuilding(BzTileID tile) {
|
||||
@@ -275,7 +275,7 @@ static BuildingType getTileBuilding(BzTileID tile) {
|
||||
case 6406:
|
||||
return BUILDING_KEEP;
|
||||
default:
|
||||
return BUILDING_NONE;
|
||||
return BUILDING_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ static BzTileID getBuildingTile(BuildingType type) {
|
||||
|
||||
static BuildingType getBuildingFromStr(const char *str) {
|
||||
if (strncmp("keep", str, 4) == 0) return BUILDING_KEEP;
|
||||
return BUILDING_NONE;
|
||||
return BUILDING_COUNT;
|
||||
}
|
||||
|
||||
static const char *getBuildingStr(BuildingType type) {
|
||||
@@ -313,6 +313,7 @@ static BuildingType getBuildingSize(BuildingType type, BzTileID *outWidth, BzTil
|
||||
|
||||
|
||||
typedef enum EntityType {
|
||||
ENTITY_NONE = -1,
|
||||
ENTITY_WORKER,
|
||||
ENTITY_WOOD,
|
||||
ENTITY_STONE,
|
||||
@@ -320,7 +321,6 @@ typedef enum EntityType {
|
||||
ENTITY_GOLD,
|
||||
ENTITY_POP,
|
||||
ENTITY_COUNT,
|
||||
ENTITY_NONE,
|
||||
} EntityType;
|
||||
|
||||
typedef enum AnimType {
|
||||
@@ -329,7 +329,7 @@ typedef enum AnimType {
|
||||
ANIM_HURT,
|
||||
ANIM_DIE,
|
||||
ANIM_COUNT,
|
||||
ANIM_NONE,
|
||||
ANIM_NONE = -1,
|
||||
} AnimType;
|
||||
|
||||
static BzTileID getEntityTile(EntityType type) {
|
||||
@@ -394,6 +394,7 @@ static AnimationFrame entityGetAnimationFrame(EntityType entity, AnimType type,
|
||||
}
|
||||
|
||||
typedef enum ItemType {
|
||||
ITEM_NONE = -1,
|
||||
ITEM_STAFF,
|
||||
ITEM_PICKAXE,
|
||||
ITEM_AXE,
|
||||
@@ -415,7 +416,6 @@ typedef enum ItemType {
|
||||
ITEM_SPEAR,
|
||||
ITEM_TRIDENT,
|
||||
ITEM_COUNT,
|
||||
ITEM_NONE,
|
||||
} ItemType;
|
||||
|
||||
static BzTileID getItemTile(ItemType type) {
|
||||
|
||||
Reference in New Issue
Block a user