diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-02 14:44:32 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-02 14:46:59 +0100 |
commit | 889d2c0c0933cf2fd9e068b1d2b79eb936b29b58 (patch) | |
tree | cfc5f5b6e417c28482734645a69e0d49388fa5b3 /serialize/world-writer.cpp | |
parent | 8dbf450e34121358992e48212ae22cb7f5fc92f9 (diff) |
src, serialize: work on pass mode
1. add one more value to the enum
2. serialize it properly in binary
3. serialize it as string in json
Diffstat (limited to 'serialize/world-writer.cpp')
-rw-r--r-- | serialize/world-writer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp index 7cd4b6d9..5ff0a39c 100644 --- a/serialize/world-writer.cpp +++ b/serialize/world-writer.cpp @@ -180,8 +180,7 @@ template<typename T> void write_scenery_flags(binary_writer<T>& s, const scenery& proto) { std::uint8_t flags = 0; - flags |= (1 << 0) * proto.passable; - flags |= (1 << 1) * proto.blocks_view; + flags |= pass_mode_(proto.passability) & pass_mask; flags |= (1 << 2) * proto.active; flags |= (1 << 3) * proto.closing; flags |= (1 << 4) * proto.interactive; @@ -320,8 +319,8 @@ void writer_state::serialize_chunk(const chunk& c, chunk_coords coord) if (flags != 0 && ashortp(img_g) && ashortp(img_n) && ashortp(img_w)) flags |= meta_short_atlasid; - fm_debug_assert((x.pass_mode & pass_mask) == x.pass_mode); - flags |= x.pass_mode; + fm_debug_assert((pass_mode_(x.passability) & pass_mask) == pass_mode_(x.passability)); + flags |= pass_mode_(x.passability); s << flags; |