summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:54:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:54:41 +0100
commiteff6b90e959d31b636d34ff94f59a2efe482f916 (patch)
tree9f238bc37271294138bc0f16fe4878a6168dfae0 /editor
parent15bbfc100a79a975f6024d6e2e6522c4e91f2cb5 (diff)
editor: apply offset to placeable ghosts
Diffstat (limited to 'editor')
-rw-r--r--editor/draw.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 611e77fc..39f1b9fe 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -8,6 +8,7 @@
#include "src/camera-offset.hpp"
#include "src/world.hpp"
#include "character.hpp"
+#include "rotation.inl"
#include <Magnum/Math/Color.h>
#include <Magnum/Math/Vector3.h>
#include <Magnum/GL/Renderer.h>
@@ -53,7 +54,8 @@ void app::draw_cursor()
{
shader.set_tint({1, 1, 1, 0.75f});
auto [_f, _w, anim_mesh] = M->meshes();
- const auto pos = cursor.tile->to_signed3()*iTILE_SIZE;
+ const auto offset = Vector3i(Vector2i(sel.offset), 0);
+ const auto pos = cursor.tile->to_signed3()*iTILE_SIZE + offset;
anim_mesh.draw(shader, *sel.atlas, sel.r, sel.frame, Vector3(pos), 1);
}
}