diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-16 21:51:07 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-16 21:51:07 +0200 |
| commit | 7ab99aabe8509e84b9b5b04aafa1e1ae20b40512 (patch) | |
| tree | e86c02ccaa195b0dc239ff04e50f9efa8cb54a34 /main/camera.cpp | |
| parent | 0db5306c483c718076b14349f223840cce2862bd (diff) | |
a
Diffstat (limited to 'main/camera.cpp')
| -rw-r--r-- | main/camera.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/main/camera.cpp b/main/camera.cpp index 2bbadd00..bfbf6aa5 100644 --- a/main/camera.cpp +++ b/main/camera.cpp @@ -32,23 +32,4 @@ void app::update_window_scale(Vector2i sz) _shader.set_scale(Vector2{sz}); } -Vector2 app::pixel_to_tile(Vector2 position) const -{ - const auto px = position - Vector2{windowSize()}*.5f - camera_offset; - return unproject(px) / Vector2{TILE_SIZE[0]*.5f, TILE_SIZE[1]*.5f} + Vector2{.5f, .5f}; -} - -void app::draw_cursor_tile() -{ - if (_cursor_pos) - { - const auto tile = pixel_to_tile(Vector2(*_cursor_pos)); - if (std::min(tile[0], tile[1]) >= 0 && std::max(tile[0], tile[1]) < (int)TILE_MAX_DIM) - { - const auto x = std::uint8_t(tile[0]), y = std::uint8_t(tile[1]); - draw_wireframe_quad({x, y}); - } - } -} - } // namespace floormat |
