80 lines
1.9 KiB
C
80 lines
1.9 KiB
C
#define P_CellsPerMeter 32.0
|
|
#define P_CellsPerSqMeter (P_CellsPerMeter * P_CellsPerMeter)
|
|
|
|
#define P_TilesPerMeter 2.0
|
|
#define P_TilesPerSqMeter (V_TilesPerMeter * V_TilesPerMeter)
|
|
|
|
#define P_WorldPitch 64.0
|
|
#define P_TilesPitch (P_WorldPitch * P_TilesPerMeter)
|
|
#define P_CellsPitch (P_WorldPitch * P_CellsPerMeter)
|
|
|
|
#define P_TilesCount (P_TilesPitch * P_TilesPitch)
|
|
#define P_CellsCount (P_CellsPitch * P_TilesPitch)
|
|
|
|
#define P_WorldTilesDims VEC2(P_TilesPitch, P_TilesPitch)
|
|
#define P_WorldCellsDims VEC2(P_CellsPitch, P_CellsPitch)
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Material types
|
|
|
|
Enum(P_MaterialKind)
|
|
{
|
|
P_MaterialKind_Wall,
|
|
P_MaterialKind_Flesh,
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Tile types
|
|
|
|
#define P_TilesXList(X) \
|
|
X(Empty) \
|
|
X(Wall) \
|
|
X(Tile) \
|
|
X(Carpet) \
|
|
/* -------------------- */
|
|
|
|
//- Tile kinds
|
|
Enum(P_TileKind)
|
|
{
|
|
#define X(name, ...) P_TileKind_##name,
|
|
P_TilesXList(X)
|
|
#undef X
|
|
P_TileKind_COUNT
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Prefab types
|
|
|
|
#define P_PrefabsXList(X) \
|
|
X(None, P_PrefabFlag_HideFromEditor) \
|
|
X(Bot, P_PrefabFlag_None) \
|
|
X(GuySpawn, P_PrefabFlag_None) \
|
|
X(HealthSpawn, P_PrefabFlag_None) \
|
|
/* --------------------------------------------------- */
|
|
|
|
//- Prefab flags
|
|
Enum(P_PrefabFlag)
|
|
{
|
|
P_PrefabFlag_None = 0,
|
|
P_PrefabFlag_HideFromEditor = (1 << 0),
|
|
};
|
|
|
|
//- Prefab kinds
|
|
Enum(P_PrefabKind)
|
|
{
|
|
#define X(name, ...) P_PrefabKind_##name,
|
|
P_PrefabsXList(X)
|
|
#undef X
|
|
P_PrefabKind_COUNT
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Tile helpers
|
|
|
|
i32 P_TileIdxFromTilePos(Vec2 p);
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Prefab helpers
|
|
|
|
P_PrefabFlag P_FlagsFromPrefabKind(P_PrefabKind kind);
|