summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/draw.cpp2
-rw-r--r--main/main-impl.hpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/main/draw.cpp b/main/draw.cpp
index ba15b365..54f33622 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -118,7 +118,7 @@ void main_impl::draw_anim() noexcept
const auto& f = atlas->frame(s.r, s.frame);
constexpr Vector2 pixel88 = tile_shader::project(TILE_MAX_DIM*TILE_SIZE20*.5f);
const auto world_pos = TILE_SIZE20 * Vector3(xy.x, xy.y, 0) + Vector3(g.offset);
- const Vector2ui offset((Vector2(_shader.camera_offset()) + Vector2(sz) - pixel88)*.5f
+ const Vector2ui offset((Vector2(_shader.camera_offset()) + Vector2(sz)*.5f)
+ _shader.project(world_pos) - Vector2(f.ground));
clickable<anim_atlas, scenery> item = {
*atlas, s,
diff --git a/main/main-impl.hpp b/main/main-impl.hpp
index 7adaeaec..dd745bef 100644
--- a/main/main-impl.hpp
+++ b/main/main-impl.hpp
@@ -88,13 +88,11 @@ private:
bool do_sleep = false;
} dt_expected;
- struct draw_bounds final { std::int16_t minx, maxx, miny, maxy; };
-
void recalc_viewport(Vector2i size) noexcept;
void draw_world() noexcept;
void draw_anim() noexcept;
- draw_bounds get_draw_bounds() const noexcept;
+ draw_bounds get_draw_bounds() const noexcept override;
[[nodiscard]] static bool check_chunk_visible(const Vector2d& offset, const Vector2i& size) noexcept;
char maybe_register_debug_callback(fm_gpu_debug flag);