diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-10 14:31:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-10 14:31:34 +0100 |
commit | 0a1df3ff5a6d8cc8d652477d98af666616ecc737 (patch) | |
tree | d75d067efb2d26a0e42f8132e271fbd9f809a922 /serialize/wall-atlas.cpp | |
parent | 1f90adeb8c09911a1a826453e213dccac906405b (diff) |
w
Diffstat (limited to 'serialize/wall-atlas.cpp')
-rw-r--r-- | serialize/wall-atlas.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index c0e7df03..70826e27 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -251,9 +251,6 @@ Direction read_direction_metadata(const json& jroot, Direction_ dir) val.top.pixel_size = val.top.pixel_size.flipped(); - if (jdir.contains("pass-mode")) - val.passability = jdir["pass-mode"]; - return val; } @@ -263,6 +260,8 @@ Info read_info_header(const json& jroot) fm_soft_assert(jroot.contains(("depth"))); Info val = {std::string{jroot["name"]}, jroot["depth"]}; fm_soft_assert(val.depth > 0); + if (jroot.contains("pass-mode")) + val.passability = jroot["pass-mode"]; return val; } @@ -301,8 +300,6 @@ void write_group_metadata(json& jgroup, const Group& val) void write_direction_metadata(json& jdir, const Direction& dir) { - jdir["pass-mode"] = dir.passability; - for (auto [name, memfn, tag] : Direction::groups) { const auto& group = dir.*memfn; @@ -336,6 +333,7 @@ void write_info_header(json& jroot, const Info& info) { jroot["name"] = info.name; jroot["depth"] = info.depth; + jroot["pass-mode"] = info.passability; } } // namespace floormat::Wall::detail |