Files
handmadehero/handmade_tile.h
T
2026-04-22 20:39:29 -07:00

49 lines
840 B
C

#ifndef HANDMADE_TILE_H_SENTRY
#define HANDMADE_TILE_H_SENTRY
typedef struct tile_map_difference {
F32 dX;
F32 dY;
F32 dZ;
} tile_map_difference;
typedef struct tile_map_position {
U32 AbsTileX;
U32 AbsTileY;
U32 AbsTileZ;
/* NOTE: X and Y relative to tile center. */
F32 OffsetX;
F32 OffsetY;
} 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