43 lines
735 B
C
43 lines
735 B
C
#ifndef HANDMADE_TILE_H_SENTRY
|
|
#define HANDMADE_TILE_H_SENTRY
|
|
|
|
typedef struct tile_map_position {
|
|
U32 AbsTileX;
|
|
U32 AbsTileY;
|
|
U32 AbsTileZ;
|
|
|
|
/* NOTE: Tile-relative X and Y. */
|
|
F32 TileRelX;
|
|
F32 TileRelY;
|
|
} tile_map_position;
|
|
|
|
typedef struct tile_chunk_position {
|
|
U32 TileChunkX;
|
|
U32 TileChunkY;
|
|
U32 TileChunkZ;
|
|
|
|
U32 RelTileX;
|
|
U32 RelTileY;
|
|
} tile_chunk_position;
|
|
|
|
typedef struct tile_chunk {
|
|
U32 *Tiles;
|
|
} tile_chunk;
|
|
|
|
typedef struct tile_map {
|
|
U32 ChunkShift;
|
|
U32 ChunkMask;
|
|
U32 ChunkDim;
|
|
|
|
F32 TileSideInMeters;
|
|
|
|
/* TODO: Real sparseness. */
|
|
U32 TileChunkCountX;
|
|
U32 TileChunkCountY;
|
|
U32 TileChunkCountZ;
|
|
|
|
tile_chunk *TileChunks;
|
|
} tile_map;
|
|
|
|
#endif
|