summaryrefslogtreecommitdiffhomepage
path: root/loader/json.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-27 21:39:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-27 21:39:41 +0100
commitefecf0ab20304b5d76b3072a66b36b50d8522082 (patch)
tree5afa6fb96ee863864c52c1a52ede96649c71278a /loader/json.cpp
parentbeb6685f605b89ce4b2dd99f87b9319e4f7f4d94 (diff)
scenery wip
Diffstat (limited to 'loader/json.cpp')
-rw-r--r--loader/json.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/loader/json.cpp b/loader/json.cpp
index 1a30a66b..7ee661f7 100644
--- a/loader/json.cpp
+++ b/loader/json.cpp
@@ -1,6 +1,9 @@
#include "impl.hpp"
#include "serialize/json-helper.hpp"
#include "serialize/anim.hpp"
+#include "serialize/tile-atlas.hpp"
+#include "serialize/scenery.hpp"
+#include <Corrade/Utility/Path.h>
namespace floormat::loader_detail {
@@ -10,3 +13,17 @@ anim_def loader_impl::deserialize_anim(StringView filename)
}
} // namespace floormat::loader_detail
+
+namespace floormat {
+
+std::vector<std::shared_ptr<struct tile_atlas>> loader_::tile_atlases(StringView filename)
+{
+ return json_helper::from_json<std::vector<std::shared_ptr<struct tile_atlas>>>(Path::join(loader_::IMAGE_PATH, filename));
+}
+
+std::vector<Serialize::serialized_scenery> loader_::sceneries()
+{
+ return json_helper::from_json<std::vector<Serialize::serialized_scenery>>(Path::join(ANIM_PATH, "scenery.json"));
+}
+
+} // namespace floormat