From ba90ba2ca91c448d80722985811fc6bddc6e9bf2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 11 Jan 2024 16:40:29 +0100 Subject: w --- loader/atlas.cpp | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'loader/atlas.cpp') diff --git a/loader/atlas.cpp b/loader/atlas.cpp index eb368952..6ad91c56 100644 --- a/loader/atlas.cpp +++ b/loader/atlas.cpp @@ -2,7 +2,6 @@ #include "compat/assert.hpp" #include "compat/exception.hpp" #include "src/emplacer.hpp" -#include "src/ground-atlas.hpp" #include "src/anim-atlas.hpp" #include #include @@ -13,6 +12,8 @@ #include #include +// todo rename file to 'scenery.cpp' + namespace floormat { StringView loader_::make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, StringView name) @@ -45,33 +46,6 @@ bool loader_::check_atlas_name(StringView str) noexcept namespace floormat::loader_detail { -std::shared_ptr loader_impl::ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) -{ - if (auto it = ground_atlas_map.find(name); it != ground_atlas_map.end()) - { - fm_assert(it->second->pass_mode() == pass); - return it->second; - } - - fm_soft_assert(check_atlas_name(name)); - - char buf[FILENAME_MAX]; - auto path = make_atlas_path(buf, GROUND_TILESET_PATH, name); - - auto atlas = std::make_shared(path, name, texture(""_s, path, false), size, pass); - ground_atlas_map[atlas->name()] = atlas; - return atlas; -} - -std::shared_ptr loader_impl::ground_atlas(StringView filename) noexcept(false) -{ - fm_assert(!ground_atlas_map.empty()); - auto it = ground_atlas_map.find(filename); - if (it == ground_atlas_map.end()) - fm_throw("no such tile atlas '{}'"_cf, filename); - return it->second; -} - ArrayView loader_impl::anim_atlas_list() { if (anim_atlases.empty()) @@ -107,7 +81,7 @@ std::shared_ptr loader_impl::anim_atlas(StringView name, StringView } } - auto tex = texture(""_s, path, false); + auto tex = texture(""_s, path); fm_soft_assert(!anim_info.object_name.isEmpty()); fm_soft_assert(anim_info.pixel_size.product() > 0); -- cgit v1.2.3