#ifndef map_h #define map_h #include "config.h" #include "render.h" typedef struct Map { int w, h; } Map; typedef struct { Colour u, d; Colour side[4]; /* left, right, north, south */ } Map_Fragment; typedef struct { int x, y; int brightness; Colour c; } Map_Light; typedef struct { Map_Fragment fragments[map_light_tile_size * map_light_tile_size]; } Map_Light_Tile; 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); Map_Light_Tile* map_light_tiles(Map* m); const Map_Light_Tile* map_light_tilesc(const Map* m); void bake_map(Map* m); const Map_Fragment* sample_map_light( const Map* m, int tx, int ty, int u, int v ); #endif