diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-05-11 15:34:37 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-05-11 15:34:37 +0200 |
| commit | 2f493c24e3771bca9b9ee717cb3d7c18c406678f (patch) | |
| tree | 9613b0ee6e1adf495e1171b399d818b7111565de /src/map.c | |
| parent | 2f9e8a6033075f68bbed46a66d22712a84b8f678 (diff) | |
map work
Diffstat (limited to 'src/map.c')
| -rw-r--r-- | src/map.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -169,6 +169,7 @@ void load_mapdata_into_world() { int highest_point_topright = get_height_of_tile_tr(h, x, y); int highest_point_bottomright = get_height_of_tile_br(h, x, y); int highest_point_bottomleft = get_height_of_tile_bl(h, x, y); + loaded_map.heightmap[y][x] = (tile){.height = h, .type = map_to_load.tiles[y][x], highest_point_topleft, highest_point_topright, highest_point_bottomleft, highest_point_bottomright}; loaded_map.lightmap[y][x] = (light_data){0.0f,0.0f,0.0f,0.0f}; } @@ -435,6 +436,21 @@ static void draw_backdrop(platform_window* window) renderer->render_image(img_mars_surface, x*info.tile_width, y*info.tile_width, info.tile_width, info.tile_height); } } + + // south of spaceship + for (int y = 48; y <= 70; y++) + { + if (y < tilemap_render_min_y) continue; + if (y > tilemap_render_max_y) continue; + + for (int x = -40; x <= MAP_SIZE_X + 40; x++) + { + if (x < tilemap_render_min_x) continue; + if (x > tilemap_render_max_x) continue; + + renderer->render_image(img_mars_surface, x*info.tile_width, y*info.tile_width, info.tile_width, info.tile_height); + } + } } static float offset = 0.0f; |
