diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 06:30:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 06:30:59 +0100 |
commit | 960e346159dbf152d9847f0998e1e717fb7dbfef (patch) | |
tree | 6aab5985d1a2f20542e152d70c9be46bbed0025e /loader/json.cpp | |
parent | 4ad635e8dfe21d2dd0e0582c44379dde26ca57a8 (diff) |
src: add pass_mode field to tile_atlas
Diffstat (limited to 'loader/json.cpp')
-rw-r--r-- | loader/json.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/loader/json.cpp b/loader/json.cpp index dbe21d50..7e6aae68 100644 --- a/loader/json.cpp +++ b/loader/json.cpp @@ -1,6 +1,7 @@ #include "impl.hpp" #include "compat/assert.hpp" #include "compat/exception.hpp" +#include "src/tile-atlas.hpp" #include "serialize/json-helper.hpp" #include "serialize/anim.hpp" #include "serialize/tile-atlas.hpp" @@ -52,9 +53,14 @@ const scenery_proto& loader_impl::scenery(StringView name) noexcept(false) namespace floormat { -std::vector<std::shared_ptr<struct tile_atlas>> loader_::tile_atlases(StringView filename) +std::vector<std::shared_ptr<struct tile_atlas>> loader_::tile_atlases(StringView filename, pass_mode p) { - return json_helper::from_json<std::vector<std::shared_ptr<struct tile_atlas>>>(Path::join(loader_::IMAGE_PATH, filename)); + auto vec = json_helper::from_json<std::vector<std::shared_ptr<struct tile_atlas>>>( + Path::join(loader_::IMAGE_PATH, filename)); + for (auto& x : vec) + if (!x->pass_mode()) + x->set_pass_mode(p); + return vec; } } // namespace floormat |