diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-23 22:38:54 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-23 22:38:54 +0200 |
commit | 0efe01d0e7286e9eb60c4739ae748c0cb6e7a51f (patch) | |
tree | 09121d7fcbb17151ea10331bfb3de0474fe6a661 /editor/camera.cpp | |
parent | b6a067678ab9e225647b256595d54dde2ce6f2f5 (diff) |
a
Diffstat (limited to 'editor/camera.cpp')
-rw-r--r-- | editor/camera.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/editor/camera.cpp b/editor/camera.cpp index 7af77211..52496762 100644 --- a/editor/camera.cpp +++ b/editor/camera.cpp @@ -1,9 +1,10 @@ #include "app.hpp" +#include "src/global-coords.hpp" #include <Magnum/GL/DefaultFramebuffer.h> namespace floormat { -void app::do_camera(double dt) +void app::do_camera(flota dt) { if (keys[key::camera_reset]) reset_camera_offset(); @@ -65,24 +66,4 @@ global_coords app::pixel_to_tile(Vector2d position) const return { x, y }; } -std::array<std::int16_t, 4> app::get_draw_bounds() const noexcept -{ - - using limits = std::numeric_limits<std::int16_t>; - auto x0 = limits::max(), x1 = limits::min(), y0 = limits::max(), y1 = limits::min(); - - for (const auto win = Vector2d(windowSize()); - auto p : {pixel_to_tile(Vector2d{0, 0}).chunk(), - pixel_to_tile(Vector2d{win[0]-1, 0}).chunk(), - pixel_to_tile(Vector2d{0, win[1]-1}).chunk(), - pixel_to_tile(Vector2d{win[0]-1, win[1]-1}).chunk()}) - { - x0 = std::min(x0, p.x); - x1 = std::max(x1, p.x); - y0 = std::min(y0, p.y); - y1 = std::max(y1, p.y); - } - return {x0, x1, y0, y1}; -} - } // namespace floormat |