summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-18 15:42:12 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-18 15:42:12 +0100
commit1aeaf9b9a98470f81bc41b1242474389cbcf3391 (patch)
treef3ec9818cfd8a05448eea7b317575fcfb1aadce0
parentae3941f4f9705ea7cb2fd0829a8e3431e1e12413 (diff)
serialize/save: more debug code
-rw-r--r--serialize/world-reader.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index df845732..ed256172 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -133,9 +133,12 @@ const scenery_proto& reader_state::lookup_scenery(atlasid id)
void reader_state::read_chunks(reader_t& s)
{
const auto N = s.read<chunksiz>();
+ [[maybe_unused]] std::size_t chunk_size = 0;
for (auto k = 0_uz; k < N; k++)
{
+ const auto nbytes_start = s.bytes_read();
+
std::decay_t<decltype(chunk_magic)> magic;
magic << s;
if (magic != chunk_magic)
@@ -183,6 +186,8 @@ void reader_state::read_chunks(reader_t& s)
if (PROTO >= 8) [[likely]]
entity_count << s;
+ chunk_size = s.bytes_read() - nbytes_start;
+
for (auto i = 0_uz; i < entity_count; i++)
{
std::uint64_t _id; _id << s;
@@ -248,9 +253,12 @@ void reader_state::read_chunks(reader_t& s)
}
c.sort_entities();
+ c.ensure_ground_mesh();
+ c.ensure_wall_mesh();
+ c.ensure_scenery_mesh();
+ c.ensure_passability();
- const auto nbytes = s.bytes_read();
- (void)nbytes;
+ chunk_size = s.bytes_read() - nbytes_start;
fm_assert(c.is_scenery_modified());
fm_assert(c.is_passability_modified());
}