summaryrefslogtreecommitdiffhomepage
path: root/loader/wall-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-08 23:09:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-08 23:09:20 +0100
commit4f7b007d3239fd1ce3566b30ab86434ccda1da48 (patch)
tree651c0eea8706e8a2c9fdac5ce4566f1dff5e691a /loader/wall-atlas.cpp
parent55a76536bbcc0ab662c3b56e4af7370d5932f063 (diff)
loader: wall loader wip
Diffstat (limited to 'loader/wall-atlas.cpp')
-rw-r--r--loader/wall-atlas.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp
index 5baa24f3..3c4e3896 100644
--- a/loader/wall-atlas.cpp
+++ b/loader/wall-atlas.cpp
@@ -3,9 +3,10 @@
#include "loader/wall-cell.hpp"
#include "compat/assert.hpp"
#include "compat/exception.hpp"
+#include "compat/vector-wrapper.hpp"
#include "src/wall-atlas.hpp"
-#include "serialize/json-helper.hpp"
-#include "serialize/corrade-string.hpp"
+//#include "serialize/json-helper.hpp"
+//#include "serialize/corrade-string.hpp"
#include <Corrade/Containers/Array.h>
#include <Corrade/Containers/ArrayViewStl.h>
#include <Corrade/Containers/StringIterable.h>
@@ -15,20 +16,6 @@
namespace floormat {
-using nlohmann::json;
-
-[[maybe_unused]] static void from_json(const json& j, wall_cell& val)
-{
- val = {};
- val.name = j["name"];
- fm_soft_assert(loader.check_atlas_name(val.name));
-}
-
-[[maybe_unused]] static void to_json(json& j, const wall_cell& val)
-{
- j["name"] = val.name;
-}
-
std::shared_ptr<wall_atlas> loader_::get_wall_atlas(StringView name) noexcept(false)
{
fm_assert(name != "<invalid>"_s);
@@ -140,7 +127,7 @@ void loader_impl::get_wall_atlas_list()
{
fm_assert(wall_atlas_map.empty());
- wall_atlas_array = json_helper::from_json<std::vector<wall_cell>>(Path::join(WALL_TILESET_PATH, "walls.json"_s));
+ wall_atlas_array = wall_cell::load_atlases_from_json().vec;
wall_atlas_array.shrink_to_fit();
wall_atlas_map.clear();
wall_atlas_map.reserve(wall_atlas_array.size()*2);