From c908c0cc43211d9937340b2a0704e8c53241b035 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 8 Apr 2023 14:15:47 +0200 Subject: src: even less explicit global_coords ctor --- editor/editor.cpp | 4 ++-- main/draw.cpp | 2 +- src/global-coords.cpp | 6 +++--- src/global-coords.hpp | 9 ++++----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/editor/editor.cpp b/editor/editor.cpp index f09030dc..2d52d715 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -70,10 +70,10 @@ void editor::on_mouse_move(world& world, global_coords& pos, int mods) const auto [miny, maxy] = std::minmax(draw_coord.y, last.draw_coord.y); if (draw_offset[0]) for (uint32_t i = minx; i <= maxx; i++) - on_click_(world, { i, draw_coord.y }, last.btn); + on_click_(world, { i, draw_coord.y, nullptr }, last.btn); else for (uint32_t j = miny; j <= maxy; j++) - on_click_(world, { draw_coord.x, j }, last.btn); + on_click_(world, { draw_coord.x, j, nullptr }, last.btn); } else on_click_(world, draw_coord, last.btn); diff --git a/main/draw.cpp b/main/draw.cpp index 44785f61..9adb38a2 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -66,7 +66,7 @@ global_coords main_impl::pixel_to_tile(Vector2d position) const noexcept { auto vec = pixel_to_tile_(position); const auto x = (int32_t)std::floor(vec[0]), y = (int32_t)std::floor(vec[1]); - return { x, y }; + return { x, y, 0 }; } Vector2d main_impl::pixel_to_tile_(Vector2d position) const noexcept diff --git a/src/global-coords.cpp b/src/global-coords.cpp index 7df70fe0..87a2c79c 100644 --- a/src/global-coords.cpp +++ b/src/global-coords.cpp @@ -11,9 +11,9 @@ static_assert(std::is_same_v