From 7abfbd9961072bb4e358c675d417cc8e8bb16d70 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 11 Feb 2024 02:15:08 +0100 Subject: wip atlas --- loader/anim-traits.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'loader/anim-traits.cpp') diff --git a/loader/anim-traits.cpp b/loader/anim-traits.cpp index 9ff7e6b5..a2c932cc 100644 --- a/loader/anim-traits.cpp +++ b/loader/anim-traits.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -23,7 +24,7 @@ String& anim_traits::name_of(Cell& x) { return x.name; } void anim_traits::ensure_atlases_loaded(Storage& s) { - fm_assert(s.name_map.empty()); + fm_debug_assert(s.name_map.empty()); s.cell_array = {}; s.cell_array.reserve(16); s.name_map[loader.INVALID] = -1uz; @@ -32,10 +33,12 @@ void anim_traits::ensure_atlases_loaded(Storage& s) auto anim_traits::make_invalid_atlas(Storage& s) -> Pointer { fm_debug_assert(!s.invalid_atlas); - constexpr auto size = Vector2ui{16}; + + constexpr auto size = Vector2ui{tile_size_xy*3/4}; + constexpr auto ground = Vector2i(size/2); auto frame = anim_frame { - .ground = Vector2i(size/2), + .ground = ground, .offset = {}, .size = size, }; @@ -57,15 +60,15 @@ auto anim_traits::make_invalid_atlas(Storage& s) -> Pointer .name = loader.INVALID, .atlas = atlas, }; - return Pointer{ InPlace, std::move(info) }; + return Pointer{ InPlace, Utility::move(info) }; } -auto anim_traits::make_atlas(StringView name, const Cell&) -> std::shared_ptr +auto anim_traits::make_atlas(StringView name, const Cell& c) -> std::shared_ptr { return {}; // todo } -auto anim_traits::make_cell(StringView) -> Optional +auto anim_traits::make_cell(StringView name) -> Optional { return {}; } -- cgit v1.2.3