diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-22 21:03:49 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-22 21:03:49 +0100 |
commit | 2141477c69d379b02ca52e0df9171834b37aadd7 (patch) | |
tree | 347f865c403fd86e24ae6f1d2d327554d23f1c33 /main | |
parent | 4f458fba80cbcbfecf3fa54284e3004852bbc172 (diff) |
scenery work
Diffstat (limited to 'main')
-rw-r--r-- | main/draw.cpp | 2 | ||||
-rw-r--r-- | main/main-impl.hpp | 4 |
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); |