Update tileset to use BzTileID

This commit is contained in:
2023-12-13 16:32:54 +01:00
parent 3cfdce9d96
commit 9949b09101
2 changed files with 14 additions and 14 deletions

View File

@@ -7,12 +7,12 @@
#include <string.h>
typedef struct AnimationSequence {
BzTile startFrame;
BzTileID startFrame;
i32 frameCount;
} AnimationSequence;
typedef struct AnimationFrame {
BzTile frame;
BzTileID frame;
f32 duration;
} AnimationFrame;
@@ -21,7 +21,7 @@ typedef enum TerrainType {
TERRAIN_NONE,
} TerrainType;
static bool terrainHasAnimation(BzTile tile) {
static bool terrainHasAnimation(BzTileID tile) {
switch (tile) {
case 1792:
case 1793:
@@ -99,7 +99,7 @@ static bool terrainHasAnimation(BzTile tile) {
}
}
static AnimationSequence terrainGetAnimationSequence(BzTile tile) {
static AnimationSequence terrainGetAnimationSequence(BzTileID tile) {
switch (tile) {
case 1792: return (AnimationSequence) {.startFrame = 1792, .frameCount = 4};
case 1793: return (AnimationSequence) {.startFrame = 1793, .frameCount = 4};
@@ -177,7 +177,7 @@ static AnimationSequence terrainGetAnimationSequence(BzTile tile) {
}
}
static AnimationFrame terrainGetAnimationFrame(BzTile tile, i32 frameIdx) {
static AnimationFrame terrainGetAnimationFrame(BzTileID tile, i32 frameIdx) {
switch (tile) {
case 1792: return ((AnimationFrame []) {{1792, 100}, {2816, 100}, {3840, 100}, {4864, 100}}) [frameIdx];
case 1793: return ((AnimationFrame []) {{1793, 100}, {2817, 100}, {3841, 100}, {4865, 100}}) [frameIdx];
@@ -262,7 +262,7 @@ typedef enum BuildingType {
BUILDING_NONE,
} BuildingType;
static BuildingType getTileBuilding(BzTile tile) {
static BuildingType getTileBuilding(BzTileID tile) {
switch (tile) {
case 5892:
case 5893:
@@ -298,7 +298,7 @@ static const char *getBuildingStr(BuildingType type) {
}
}
static BuildingType getBuildingSize(BuildingType type, BzTile *outWidth, BzTile *outHeight) {
static BuildingType getBuildingSize(BuildingType type, BzTileID *outWidth, BzTileID *outHeight) {
switch (type) {
case BUILDING_KEEP:
if (outWidth) *outWidth = 3;