summaryrefslogtreecommitdiffhomepage
path: root/serialize/world-reader.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-11 17:53:05 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-11 17:59:32 +0100
commitfbb2582a66be0b98166e1f6ac21eb218aefd82e1 (patch)
treee87a7be1b82d544e9692c0fc86dc4eebc8979dc3 /serialize/world-reader.cpp
parentada0f5e07d1a67d5067d44e48806a25db30c6135 (diff)
src/scenery, save: store dt as 16-bit fixed point
Bump save proto version.
Diffstat (limited to 'serialize/world-reader.cpp')
-rw-r--r--serialize/world-reader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index f5459203..4d27c27f 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -173,7 +173,12 @@ void reader_state::read_chunks(reader_t& s)
else
sc.frame.frame << s;
if (sc.frame.active)
- sc.frame.delta << s;
+ {
+ if (PROTO >= 4) [[likely]]
+ sc.frame.delta << s;
+ else
+ sc.frame.delta = (std::uint16_t)Math::clamp(int(s.read<float>() * 65535), 0, 65535);
+ }
}
t.scenery() = sc;
}