From 2141477c69d379b02ca52e0df9171834b37aadd7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 22 Nov 2022 21:03:49 +0100 Subject: scenery work --- main/draw.cpp | 2 +- main/main-impl.hpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'main') 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 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); -- cgit v1.2.3