mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user