diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/app.hpp | 4 | ||||
-rw-r--r-- | main/camera.cpp | 5 | ||||
-rw-r--r-- | main/draw.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/main/app.hpp b/main/app.hpp index e5c0e34b..403b8888 100644 --- a/main/app.hpp +++ b/main/app.hpp @@ -75,8 +75,8 @@ struct app final : Platform::Application const void* _dummy = register_debug_callback(); tile_shader _shader; - tile_atlas_ floor1 = loader.tile_atlas("metal1.tga", {2, 2}); - tile_atlas_ floor2 = loader.tile_atlas("floor1.tga", {4, 4}); + tile_atlas_ floor1 = loader.tile_atlas("floor-tiles.tga", {44, 4}); + tile_atlas_ floor2 = loader.tile_atlas("metal1.tga", {2, 2}); tile_atlas_ wall1 = loader.tile_atlas("wood2.tga", {2, 2}); tile_atlas_ wall2 = loader.tile_atlas("wood1.tga", {2, 2}); chunk _chunk = make_test_chunk(); diff --git a/main/camera.cpp b/main/camera.cpp index bfbf6aa5..b0b8f001 100644 --- a/main/camera.cpp +++ b/main/camera.cpp @@ -15,6 +15,11 @@ void app::do_camera(float dt) else if (keys[key::camera_right]) camera_offset += Vector2(-1, 0) * dt * pixels_per_second; + { + const auto max_camera_offset = Vector2(windowSize() * 10); + camera_offset[0] = std::clamp(camera_offset[0], -max_camera_offset[0], max_camera_offset[0]); + camera_offset[1] = std::clamp(camera_offset[1], -max_camera_offset[1], max_camera_offset[1]); + } _shader.set_camera_offset(camera_offset); if (keys[key::camera_reset]) diff --git a/main/draw.cpp b/main/draw.cpp index b032e2a2..91277c34 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -52,8 +52,7 @@ void app::draw_chunk(chunk& c) fn(0, y); fn(x, y); - printf("%d %d -> %d %d\n", minx, miny, maxx, maxy); - fflush(stdout); + // TODO printf(""); // put breakpoint here } |