From b7ee608e70f8e031e3e01c9672bedb16efa648b8 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 29 Aug 2017 19:26:55 +0200 Subject: Bump minimal protocol version to 36 (#6319) * Bump minimal protocol version to 36 Item/Node/TileDef, NodeBox, TileAnimation: Remove old compat code * Accept future serialisation versions --- src/tileanimation.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/tileanimation.cpp') diff --git a/src/tileanimation.cpp b/src/tileanimation.cpp index 67d27d396..eaef7f8cb 100644 --- a/src/tileanimation.cpp +++ b/src/tileanimation.cpp @@ -19,23 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "tileanimation.h" #include "util/serialize.h" -void TileAnimationParams::serialize(std::ostream &os, u16 protocol_version) const +void TileAnimationParams::serialize(std::ostream &os, u8 tiledef_version) const { - if (protocol_version < 29) { - if (type == TAT_VERTICAL_FRAMES) { - writeU8(os, type); - writeU16(os, vertical_frames.aspect_w); - writeU16(os, vertical_frames.aspect_h); - writeF1000(os, vertical_frames.length); - } else { - writeU8(os, TAT_NONE); - writeU16(os, 1); - writeU16(os, 1); - writeF1000(os, 1.0); - } - return; - } - writeU8(os, type); if (type == TAT_VERTICAL_FRAMES) { writeU16(os, vertical_frames.aspect_w); @@ -48,15 +33,9 @@ void TileAnimationParams::serialize(std::ostream &os, u16 protocol_version) cons } } -void TileAnimationParams::deSerialize(std::istream &is, u16 protocol_version) +void TileAnimationParams::deSerialize(std::istream &is, u8 tiledef_version) { type = (TileAnimationType) readU8(is); - if (protocol_version < 29) { - vertical_frames.aspect_w = readU16(is); - vertical_frames.aspect_h = readU16(is); - vertical_frames.length = readF1000(is); - return; - } if (type == TAT_VERTICAL_FRAMES) { vertical_frames.aspect_w = readU16(is); -- cgit v1.2.3