summaryrefslogtreecommitdiffhomepage
path: root/main/draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/draw.cpp')
-rw-r--r--main/draw.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/main/draw.cpp b/main/draw.cpp
index b68c0b2b..4077da16 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -53,17 +53,19 @@ void app::draw_world()
for (std::int16_t y = miny; y <= maxy; y++)
for (std::int16_t x = minx; x <= maxx; x++)
{
- if (!_world.contains(chunk_coords{x, y}))
- make_test_chunk(*_world[chunk_coords{x, y}]);
- const with_shifted_camera_offset o{_shader, x, y};
- _floor_mesh.draw(_shader, *_world[chunk_coords{x, y}]);
+ const chunk_coords c{x, y};
+ if (!_world.contains(c))
+ make_test_chunk(*_world[c]);
+ const with_shifted_camera_offset o{_shader, c};
+ _floor_mesh.draw(_shader, *_world[c]);
}
for (std::int16_t y = miny; y <= maxy; y++)
for (std::int16_t x = minx; x <= maxx; x++)
{
- const with_shifted_camera_offset o{_shader, x, y};
- _wall_mesh.draw(_shader, *_world[chunk_coords{x, y}]);
+ const chunk_coords c{x, y};
+ const with_shifted_camera_offset o{_shader, c};
+ _wall_mesh.draw(_shader, *_world[c]);
}
#endif
}