From d0395f8468b33817a79a0fd625ae52cdff06ae19 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 9 Feb 2024 19:34:15 +0100 Subject: loader: move vobj_cell to its own file --- loader/ground-traits.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'loader/ground-traits.cpp') diff --git a/loader/ground-traits.cpp b/loader/ground-traits.cpp index 5cb8d29e..0ec42f0e 100644 --- a/loader/ground-traits.cpp +++ b/loader/ground-traits.cpp @@ -14,15 +14,15 @@ namespace floormat::loader_detail { -using traits = atlas_loader_traits; +using ground_traits = atlas_loader_traits; -StringView traits::loader_name() { return "ground_atlas"_s; } -auto traits::atlas_of(const Cell& x) -> const std::shared_ptr& { return x.atlas; } -auto traits::atlas_of(Cell& x) -> std::shared_ptr& { return x.atlas; } -StringView traits::name_of(const Cell& x) { return x.name; } -StringView traits::name_of(const Atlas& x) { return x.name(); } +StringView ground_traits::loader_name() { return "ground_atlas"_s; } +auto ground_traits::atlas_of(const Cell& x) -> const std::shared_ptr& { return x.atlas; } +auto ground_traits::atlas_of(Cell& x) -> std::shared_ptr& { return x.atlas; } +StringView ground_traits::name_of(const Cell& x) { return x.name; } +StringView ground_traits::name_of(const Atlas& x) { return x.name(); } -void traits::ensure_atlases_loaded(Storage& st) +void ground_traits::ensure_atlases_loaded(Storage& st) { if (!st.is_empty()) [[likely]] return; @@ -58,7 +58,7 @@ void traits::ensure_atlases_loaded(Storage& st) fm_debug_assert(!st.is_empty()); } -auto traits::make_invalid_atlas(Storage& s) -> const Cell& +auto ground_traits::make_invalid_atlas(Storage& s) -> const Cell& { if (!s.invalid_atlas) [[unlikely]] { @@ -70,9 +70,9 @@ auto traits::make_invalid_atlas(Storage& s) -> const Cell& return *s.invalid_atlas; } -auto traits::make_atlas(StringView name, const Cell& cell) -> std::shared_ptr +auto ground_traits::make_atlas(StringView name, const Cell& c) -> std::shared_ptr { - auto def = ground_def{name, cell.size, cell.pass}; + auto def = ground_def{name, c.size, c.pass}; auto tex = loader.texture(loader.GROUND_TILESET_PATH, name); auto atlas = std::make_shared(def, tex); return atlas; -- cgit v1.2.3