diff options
| -rw-r--r-- | map.c | 8 | ||||
| -rw-r--r-- | map.h | 2 | ||||
| -rw-r--r-- | render.c | 2 | 
3 files changed, 11 insertions, 1 deletions
@@ -3,3 +3,11 @@  int map_size(int w, int h) {  	return sizeof(Map) + w * h * sizeof(Map_Tile);  } + +Map_Tile* map_tiles(Map* m) { +	return (Map_Tile*)&m[1]; +} + +const Map_Tile* map_tilesc(const Map* m) { +	return (Map_Tile*)&m[1]; +} @@ -8,5 +8,7 @@ typedef struct Map {  typedef unsigned Map_Tile;  int map_size(int w, int h); +Map_Tile* map_tiles(Map* m); +const Map_Tile* map_tilesc(const Map* m);  #endif @@ -758,7 +758,7 @@ void ren_map(  	const int* left  ) {  	int x, y, w, h, hh, hhi, ey; -	const int* data = (const int*)&map[1]; +	const Map_Tile* data = map_tilesc(map);  	/* temp */  	const Texture* texture = get_texture(asset_id_brick_texture);  	const Texture* ceiling = get_texture(asset_id_floorboardsbot_texture);  |