diff options
Diffstat (limited to 'map.h')
| -rw-r--r-- | map.h | 60 | 
1 files changed, 60 insertions, 0 deletions
@@ -0,0 +1,60 @@ +#ifndef map_h_included +#define map_h_included + +#include "config.h" + +struct Renderer; + +#define tiles_xmacro \ +	x(tile_stone,         0,   0)  \ +	x(tile_block1,        16,  0)  \ +	x(tile_block2,        32,  0)  \ +	x(tile_brick,         48,  0)  \ +	x(tile_ladder1,       64,  0)  \ +	x(tile_ladder2,       80,  0)  \ +	x(tile_stone_ramp1,   96,  0)  \ +	x(tile_stone_ramp2,  112,  0)  \ +	x(tile_stone_ramp3,  128,  0)  \ +	x(tile_stone_ramp4,  144,  0)  \ +	x(tile_stone_ramp5,    0,  16) \ +	x(tile_stone_ramp6,   16,  16) \ +	x(tile_stone_ramp7,   32,  16) \ +	x(tile_stone_ramp8,   48,  16) \ +	x(tile_stone_ramp9,   64,  16) \ +	x(tile_stone_ramp10,  80,  16) \ +	x(tile_stone_ramp11,  96,  16) \ +	x(tile_stone_ramp12, 112,  16) \ +	x(tile_stone_ramp13, 128,  16) \ +	x(tile_stone_ramp14, 144,  16) \ +	x(tile_brick_ramp5,    0,  32) \ +	x(tile_brick_ramp6,   16,  32) \ +	x(tile_brick_ramp7,   32,  32) \ +	x(tile_brick_ramp8,   48,  32) \ +	x(tile_brick_ramp9,   64,  32) \ +	x(tile_brick_ramp10,  80,  32) \ +	x(tile_brick_ramp11,  96,  32) \ +	x(tile_brick_ramp12, 112,  32) \ +	x(tile_brick_ramp13, 128,  32) \ + +typedef enum { +#define x(n, x, y) \ +	n, +	tiles_xmacro +#undef x +	tile_count +} Map_Tile; + +typedef struct Map { +	unsigned short tiles[map_w * map_h]; +	unsigned short collision[map_w * map_h]; +	/* collision: +	 * 0  = nothing +	 * 1  = tile +	 * >2 = mask +	 */ +} Map; + +void generate_floor(Map* m, int seed); +void render_map(const Map* m, struct Renderer* r); + +#endif  |