summaryrefslogtreecommitdiffhomepage
path: root/main/update.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-21 15:56:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-21 15:56:31 +0200
commit361d35b800f7f3f217324104bc181ef4a49e10e1 (patch)
treeae5b63b10ba0cc918e416bd22fe448edde781527 /main/update.cpp
parent33530af5f134ea91a24a0dc3333765dbd891f01a (diff)
editor work
Diffstat (limited to 'main/update.cpp')
-rw-r--r--main/update.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/main/update.cpp b/main/update.cpp
index 8b0e221f..fac359e8 100644
--- a/main/update.cpp
+++ b/main/update.cpp
@@ -18,7 +18,21 @@ void app::make_test_chunk(chunk& c)
void app::do_mouse_click(const global_coords pos, int button)
{
- _editor.maybe_place_tile(_world, pos, button);
+ if (button == SDL_BUTTON_LEFT)
+ _editor.on_click(_world, pos);
+ else
+ _editor.on_release();
+}
+
+void app::do_mouse_release(int button)
+{
+ (void)button;
+ _editor.on_release();
+}
+
+void app::do_mouse_move(global_coords pos)
+{
+ _editor.on_mouse_move(_world, pos);
}
void app::update(double dt)