Files
PixelDefense/game/game_tileset.h

316 lines
17 KiB
C

#ifndef GAME_TILESET_H
#define GAME_TILESET_H
// This file was generated by: extract_tileset.py
#include <breeze.h>
#include <string.h>
typedef struct AnimationSequence {
BzTile startFrame;
i32 frameCount;
} AnimationSequence;
typedef struct AnimationFrame {
BzTile frame;
f32 duration;
} AnimationFrame;
typedef enum TerrainType {
TERRAIN_COUNT,
TERRAIN_NONE,
} TerrainType;
static bool terrainHasAnimation(BzTile tile) {
switch (tile) {
case 1792:
case 1793:
case 1794:
case 1795:
case 1797:
case 1799:
case 1800:
case 1801:
case 1802:
case 1803:
case 1804:
case 1805:
case 1806:
case 1807:
case 1808:
case 1809:
case 1810:
case 1811:
case 1812:
case 1813:
case 1814:
case 1815:
case 1816:
case 1817:
case 1818:
case 2048:
case 2049:
case 2050:
case 2051:
case 2052:
case 2053:
case 2054:
case 2055:
case 2057:
case 2058:
case 2059:
case 2060:
case 2062:
case 2063:
case 2064:
case 2065:
case 2067:
case 2068:
case 2069:
case 2070:
case 2072:
case 2073:
case 2074:
case 2304:
case 2305:
case 2306:
case 2307:
case 2309:
case 2311:
case 2312:
case 2313:
case 2316:
case 2317:
case 2318:
case 2321:
case 2322:
case 2323:
case 2326:
case 2327:
case 2328:
case 2560:
case 2561:
case 2562:
case 2563:
case 4868:
return true;
default:
return false;
}
}
static AnimationSequence terrainGetAnimationSequence(BzTile tile) {
switch (tile) {
case 1792: return (AnimationSequence) {.startFrame = 1792, .frameCount = 4};
case 1793: return (AnimationSequence) {.startFrame = 1793, .frameCount = 4};
case 1794: return (AnimationSequence) {.startFrame = 1794, .frameCount = 4};
case 1795: return (AnimationSequence) {.startFrame = 1795, .frameCount = 4};
case 1797: return (AnimationSequence) {.startFrame = 1797, .frameCount = 4};
case 1799: return (AnimationSequence) {.startFrame = 1799, .frameCount = 4};
case 1800: return (AnimationSequence) {.startFrame = 1800, .frameCount = 4};
case 1801: return (AnimationSequence) {.startFrame = 1801, .frameCount = 4};
case 1802: return (AnimationSequence) {.startFrame = 1802, .frameCount = 4};
case 1803: return (AnimationSequence) {.startFrame = 1803, .frameCount = 4};
case 1804: return (AnimationSequence) {.startFrame = 1804, .frameCount = 4};
case 1805: return (AnimationSequence) {.startFrame = 1805, .frameCount = 4};
case 1806: return (AnimationSequence) {.startFrame = 1806, .frameCount = 4};
case 1807: return (AnimationSequence) {.startFrame = 1807, .frameCount = 4};
case 1808: return (AnimationSequence) {.startFrame = 1808, .frameCount = 4};
case 1809: return (AnimationSequence) {.startFrame = 1809, .frameCount = 4};
case 1810: return (AnimationSequence) {.startFrame = 1810, .frameCount = 4};
case 1811: return (AnimationSequence) {.startFrame = 1811, .frameCount = 4};
case 1812: return (AnimationSequence) {.startFrame = 1812, .frameCount = 4};
case 1813: return (AnimationSequence) {.startFrame = 1813, .frameCount = 4};
case 1814: return (AnimationSequence) {.startFrame = 1814, .frameCount = 4};
case 1815: return (AnimationSequence) {.startFrame = 1815, .frameCount = 4};
case 1816: return (AnimationSequence) {.startFrame = 1816, .frameCount = 4};
case 1817: return (AnimationSequence) {.startFrame = 1817, .frameCount = 4};
case 1818: return (AnimationSequence) {.startFrame = 1818, .frameCount = 4};
case 2048: return (AnimationSequence) {.startFrame = 2048, .frameCount = 4};
case 2049: return (AnimationSequence) {.startFrame = 2049, .frameCount = 4};
case 2050: return (AnimationSequence) {.startFrame = 2050, .frameCount = 4};
case 2051: return (AnimationSequence) {.startFrame = 2051, .frameCount = 4};
case 2052: return (AnimationSequence) {.startFrame = 2052, .frameCount = 4};
case 2053: return (AnimationSequence) {.startFrame = 2053, .frameCount = 4};
case 2054: return (AnimationSequence) {.startFrame = 2054, .frameCount = 4};
case 2055: return (AnimationSequence) {.startFrame = 2055, .frameCount = 4};
case 2057: return (AnimationSequence) {.startFrame = 2057, .frameCount = 4};
case 2058: return (AnimationSequence) {.startFrame = 2058, .frameCount = 4};
case 2059: return (AnimationSequence) {.startFrame = 2059, .frameCount = 4};
case 2060: return (AnimationSequence) {.startFrame = 2060, .frameCount = 4};
case 2062: return (AnimationSequence) {.startFrame = 2062, .frameCount = 4};
case 2063: return (AnimationSequence) {.startFrame = 2063, .frameCount = 4};
case 2064: return (AnimationSequence) {.startFrame = 2064, .frameCount = 4};
case 2065: return (AnimationSequence) {.startFrame = 2065, .frameCount = 4};
case 2067: return (AnimationSequence) {.startFrame = 2067, .frameCount = 4};
case 2068: return (AnimationSequence) {.startFrame = 2068, .frameCount = 4};
case 2069: return (AnimationSequence) {.startFrame = 2069, .frameCount = 4};
case 2070: return (AnimationSequence) {.startFrame = 2070, .frameCount = 4};
case 2072: return (AnimationSequence) {.startFrame = 2072, .frameCount = 4};
case 2073: return (AnimationSequence) {.startFrame = 2073, .frameCount = 4};
case 2074: return (AnimationSequence) {.startFrame = 2074, .frameCount = 4};
case 2304: return (AnimationSequence) {.startFrame = 2304, .frameCount = 4};
case 2305: return (AnimationSequence) {.startFrame = 2305, .frameCount = 4};
case 2306: return (AnimationSequence) {.startFrame = 2306, .frameCount = 4};
case 2307: return (AnimationSequence) {.startFrame = 2307, .frameCount = 4};
case 2309: return (AnimationSequence) {.startFrame = 2309, .frameCount = 4};
case 2311: return (AnimationSequence) {.startFrame = 2311, .frameCount = 4};
case 2312: return (AnimationSequence) {.startFrame = 2312, .frameCount = 4};
case 2313: return (AnimationSequence) {.startFrame = 2313, .frameCount = 4};
case 2316: return (AnimationSequence) {.startFrame = 2316, .frameCount = 4};
case 2317: return (AnimationSequence) {.startFrame = 2317, .frameCount = 4};
case 2318: return (AnimationSequence) {.startFrame = 2318, .frameCount = 4};
case 2321: return (AnimationSequence) {.startFrame = 2321, .frameCount = 4};
case 2322: return (AnimationSequence) {.startFrame = 2322, .frameCount = 4};
case 2323: return (AnimationSequence) {.startFrame = 2323, .frameCount = 4};
case 2326: return (AnimationSequence) {.startFrame = 2326, .frameCount = 4};
case 2327: return (AnimationSequence) {.startFrame = 2327, .frameCount = 4};
case 2328: return (AnimationSequence) {.startFrame = 2328, .frameCount = 4};
case 2560: return (AnimationSequence) {.startFrame = 2560, .frameCount = 4};
case 2561: return (AnimationSequence) {.startFrame = 2561, .frameCount = 4};
case 2562: return (AnimationSequence) {.startFrame = 2562, .frameCount = 4};
case 2563: return (AnimationSequence) {.startFrame = 2563, .frameCount = 4};
case 4868: return (AnimationSequence) {.startFrame = 4868, .frameCount = 4};
default:
BZ_ASSERT(0);
return (AnimationSequence) {0, 0};
}
}
static AnimationFrame terrainGetAnimationFrame(BzTile 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];
case 1794: return ((AnimationFrame []) {{1794, 100}, {2818, 100}, {3842, 100}, {4866, 100}}) [frameIdx];
case 1795: return ((AnimationFrame []) {{1795, 100}, {2819, 100}, {3843, 100}, {4867, 100}}) [frameIdx];
case 1797: return ((AnimationFrame []) {{1797, 100}, {2565, 100}, {3333, 100}, {4101, 100}}) [frameIdx];
case 1799: return ((AnimationFrame []) {{1799, 100}, {2567, 100}, {3335, 100}, {4103, 100}}) [frameIdx];
case 1800: return ((AnimationFrame []) {{1800, 100}, {2568, 100}, {3336, 100}, {4104, 100}}) [frameIdx];
case 1801: return ((AnimationFrame []) {{1801, 100}, {2569, 100}, {3337, 100}, {4105, 100}}) [frameIdx];
case 1802: return ((AnimationFrame []) {{1802, 100}, {2314, 100}, {2826, 100}, {3338, 100}}) [frameIdx];
case 1803: return ((AnimationFrame []) {{1803, 100}, {2315, 100}, {2827, 100}, {3339, 100}}) [frameIdx];
case 1804: return ((AnimationFrame []) {{1804, 400}, {2572, 400}, {3340, 400}, {4108, 400}}) [frameIdx];
case 1805: return ((AnimationFrame []) {{1805, 400}, {2573, 400}, {3341, 400}, {4109, 400}}) [frameIdx];
case 1806: return ((AnimationFrame []) {{1806, 400}, {2574, 400}, {3342, 400}, {4110, 400}}) [frameIdx];
case 1807: return ((AnimationFrame []) {{1807, 400}, {2319, 400}, {2831, 400}, {3343, 400}}) [frameIdx];
case 1808: return ((AnimationFrame []) {{1808, 400}, {2320, 400}, {2832, 400}, {3344, 400}}) [frameIdx];
case 1809: return ((AnimationFrame []) {{1809, 200}, {2577, 200}, {3345, 200}, {4113, 200}}) [frameIdx];
case 1810: return ((AnimationFrame []) {{1810, 200}, {2578, 200}, {3346, 200}, {4114, 200}}) [frameIdx];
case 1811: return ((AnimationFrame []) {{1811, 200}, {2579, 200}, {3347, 200}, {4115, 200}}) [frameIdx];
case 1812: return ((AnimationFrame []) {{1812, 200}, {2580, 200}, {3348, 200}, {4116, 200}}) [frameIdx];
case 1813: return ((AnimationFrame []) {{1813, 200}, {2581, 200}, {3349, 200}, {4117, 200}}) [frameIdx];
case 1814: return ((AnimationFrame []) {{1814, 200}, {2582, 200}, {3350, 200}, {4118, 200}}) [frameIdx];
case 1815: return ((AnimationFrame []) {{1815, 200}, {2583, 200}, {3351, 200}, {4119, 200}}) [frameIdx];
case 1816: return ((AnimationFrame []) {{1816, 200}, {2584, 200}, {3352, 200}, {4120, 200}}) [frameIdx];
case 1817: return ((AnimationFrame []) {{1817, 200}, {2585, 200}, {3353, 200}, {4121, 200}}) [frameIdx];
case 1818: return ((AnimationFrame []) {{1818, 200}, {2586, 200}, {3354, 200}, {4122, 200}}) [frameIdx];
case 2048: return ((AnimationFrame []) {{2048, 100}, {3072, 100}, {4096, 100}, {5120, 100}}) [frameIdx];
case 2049: return ((AnimationFrame []) {{2049, 100}, {3073, 100}, {4097, 100}, {5121, 100}}) [frameIdx];
case 2050: return ((AnimationFrame []) {{2050, 100}, {3074, 100}, {4098, 100}, {5122, 100}}) [frameIdx];
case 2051: return ((AnimationFrame []) {{2051, 100}, {3075, 100}, {4099, 100}, {5123, 100}}) [frameIdx];
case 2052: return ((AnimationFrame []) {{2052, 100}, {2820, 100}, {3588, 100}, {4356, 100}}) [frameIdx];
case 2053: return ((AnimationFrame []) {{2053, 100}, {2821, 100}, {3589, 100}, {4357, 100}}) [frameIdx];
case 2054: return ((AnimationFrame []) {{2054, 100}, {2822, 100}, {3590, 100}, {4358, 100}}) [frameIdx];
case 2055: return ((AnimationFrame []) {{2055, 100}, {2823, 100}, {3591, 100}, {4359, 100}}) [frameIdx];
case 2057: return ((AnimationFrame []) {{2057, 100}, {2825, 100}, {3593, 100}, {4361, 100}}) [frameIdx];
case 2058: return ((AnimationFrame []) {{2058, 100}, {2570, 100}, {3082, 100}, {3594, 100}}) [frameIdx];
case 2059: return ((AnimationFrame []) {{2059, 100}, {2571, 100}, {3083, 100}, {3595, 100}}) [frameIdx];
case 2060: return ((AnimationFrame []) {{2060, 400}, {2828, 400}, {3596, 400}, {4364, 400}}) [frameIdx];
case 2062: return ((AnimationFrame []) {{2062, 400}, {2830, 400}, {3598, 400}, {4366, 400}}) [frameIdx];
case 2063: return ((AnimationFrame []) {{2063, 400}, {2575, 400}, {3087, 400}, {3599, 400}}) [frameIdx];
case 2064: return ((AnimationFrame []) {{2064, 400}, {2576, 400}, {3088, 400}, {3600, 400}}) [frameIdx];
case 2065: return ((AnimationFrame []) {{2065, 200}, {2833, 200}, {3601, 200}, {4369, 200}}) [frameIdx];
case 2067: return ((AnimationFrame []) {{2067, 200}, {2835, 200}, {3603, 200}, {4371, 200}}) [frameIdx];
case 2068: return ((AnimationFrame []) {{2068, 200}, {2836, 200}, {3604, 200}, {4372, 200}}) [frameIdx];
case 2069: return ((AnimationFrame []) {{2069, 200}, {2837, 200}, {3605, 200}, {4373, 200}}) [frameIdx];
case 2070: return ((AnimationFrame []) {{2070, 200}, {2838, 200}, {3606, 200}, {4374, 200}}) [frameIdx];
case 2072: return ((AnimationFrame []) {{2072, 200}, {2840, 200}, {3608, 200}, {4376, 200}}) [frameIdx];
case 2073: return ((AnimationFrame []) {{2073, 200}, {2841, 200}, {3609, 200}, {4377, 200}}) [frameIdx];
case 2074: return ((AnimationFrame []) {{2074, 200}, {2842, 200}, {3610, 200}, {4378, 200}}) [frameIdx];
case 2304: return ((AnimationFrame []) {{2304, 100}, {3328, 100}, {4352, 100}, {5376, 100}}) [frameIdx];
case 2305: return ((AnimationFrame []) {{2305, 100}, {3329, 100}, {4353, 100}, {5377, 100}}) [frameIdx];
case 2306: return ((AnimationFrame []) {{2306, 100}, {3330, 100}, {4354, 100}, {5378, 100}}) [frameIdx];
case 2307: return ((AnimationFrame []) {{2307, 100}, {3331, 100}, {4355, 100}, {5379, 100}}) [frameIdx];
case 2309: return ((AnimationFrame []) {{2309, 100}, {3077, 100}, {3845, 100}, {4613, 100}}) [frameIdx];
case 2311: return ((AnimationFrame []) {{2311, 100}, {3079, 100}, {3847, 100}, {4615, 100}}) [frameIdx];
case 2312: return ((AnimationFrame []) {{2312, 100}, {3080, 100}, {3848, 100}, {4616, 100}}) [frameIdx];
case 2313: return ((AnimationFrame []) {{2313, 100}, {3081, 100}, {3849, 100}, {4617, 100}}) [frameIdx];
case 2316: return ((AnimationFrame []) {{2316, 400}, {3084, 400}, {3852, 400}, {4620, 400}}) [frameIdx];
case 2317: return ((AnimationFrame []) {{2317, 400}, {3085, 400}, {3853, 400}, {4621, 400}}) [frameIdx];
case 2318: return ((AnimationFrame []) {{2318, 400}, {3086, 400}, {3854, 400}, {4622, 400}}) [frameIdx];
case 2321: return ((AnimationFrame []) {{2321, 200}, {3089, 200}, {3857, 200}, {4625, 200}}) [frameIdx];
case 2322: return ((AnimationFrame []) {{2322, 200}, {3090, 200}, {3858, 200}, {4626, 200}}) [frameIdx];
case 2323: return ((AnimationFrame []) {{2323, 200}, {3091, 200}, {3859, 200}, {4627, 200}}) [frameIdx];
case 2326: return ((AnimationFrame []) {{2326, 200}, {3094, 200}, {3862, 200}, {4630, 200}}) [frameIdx];
case 2327: return ((AnimationFrame []) {{2327, 200}, {3095, 200}, {3863, 200}, {4631, 200}}) [frameIdx];
case 2328: return ((AnimationFrame []) {{2328, 200}, {3096, 200}, {3864, 200}, {4632, 200}}) [frameIdx];
case 2560: return ((AnimationFrame []) {{2560, 100}, {3584, 100}, {4608, 100}, {5632, 100}}) [frameIdx];
case 2561: return ((AnimationFrame []) {{2561, 100}, {3585, 100}, {4609, 100}, {5633, 100}}) [frameIdx];
case 2562: return ((AnimationFrame []) {{2562, 100}, {3586, 100}, {4610, 100}, {5634, 100}}) [frameIdx];
case 2563: return ((AnimationFrame []) {{2563, 100}, {3587, 100}, {4611, 100}, {5635, 100}}) [frameIdx];
case 4868: return ((AnimationFrame []) {{4868, 100}, {4869, 100}, {4870, 100}, {4871, 100}}) [frameIdx];
default:
BZ_ASSERT(0);
return (AnimationFrame) {0, 0};
}
}
typedef enum BuildingType {
BUILDING_KEEP,
BUILDING_COUNT,
BUILDING_NONE,
} BuildingType;
static BuildingType getTileBuilding(BzTile tile) {
switch (tile) {
case 5892:
case 5893:
case 5894:
case 6148:
case 6149:
case 6150:
case 6404:
case 6405:
case 6406:
return BUILDING_KEEP;
default:
return BUILDING_NONE;
}
}
static BuildingType getBuildingTile(BuildingType type) {
switch (type) {
case BUILDING_KEEP: return 5892;
default: return -1;
}
}
static BuildingType getBuildingFromStr(const char *str) {
if (strncmp("keep", str, 4) == 0) return BUILDING_KEEP;
return BUILDING_NONE;
}
static const char *getBuildingStr(BuildingType type) {
switch (type) {
case BUILDING_KEEP: return "keep";
default: return NULL;
}
}
static BuildingType getBuildingSize(BuildingType type, BzTile *outWidth, BzTile *outHeight) {
switch (type) {
case BUILDING_KEEP:
if (outWidth) *outWidth = 3;
if (outHeight) *outHeight = 3;
break;
default:
if (outWidth) *outWidth = 0;
if (outHeight) *outHeight = 0;
break;
}
}
#endif // GAME_TILESET_H