diff options
Diffstat (limited to 'loader/json.cpp')
-rw-r--r-- | loader/json.cpp | 17 |
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 |