diff options
author | quou <quou@disroot.org> | 2024-08-04 15:34:05 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-08-04 15:34:05 +1000 |
commit | b0a5f59fe3bea9aab8f52016a90b6cbbcaea4571 (patch) | |
tree | 83b4e6f4b0d02646de888eeaff25d485e12ef73c /map.h | |
parent | 9c2f9a59096b5ec449c7557afb3220ed2597c4ea (diff) |
WIP lightmap baking
Diffstat (limited to 'map.h')
-rw-r--r-- | map.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1,14 +1,42 @@ #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 |