X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fobject_properties.cpp;h=d42fbcc6caaa8377d2b918a851f30acf9761815f;hb=5f1cd555cd9d1c64426e173b30b5b792d211c835;hp=9cbaadc64db36af52cfeb885a6d0d3fbd74b3f91;hpb=edbc533414b0ba991a82f8003d90924e1dc60d95;p=oweals%2Fminetest.git diff --git a/src/object_properties.cpp b/src/object_properties.cpp index 9cbaadc64..d42fbcc6c 100644 --- a/src/object_properties.cpp +++ b/src/object_properties.cpp @@ -65,13 +65,16 @@ std::string ObjectProperties::dump() << "," << nametag_color.getGreen() << "," << nametag_color.getBlue() << "\" "; os << ", selectionbox=" << PP(selectionbox.MinEdge) << "," << PP(selectionbox.MaxEdge); os << ", pointable=" << pointable; - os << ", can_zoom=" << can_zoom; + os << ", static_save=" << static_save; + os << ", eye_height=" << eye_height; + os << ", zoom_fov=" << zoom_fov; + os << ", use_texture_alpha=" << use_texture_alpha; return os.str(); } void ObjectProperties::serialize(std::ostream &os) const { - writeU8(os, 2); // version, protocol_version >= 36 + writeU8(os, 3); // version, protocol_version >= 36 writeS16(os, hp_max); writeU8(os, physical); writeF1000(os, weight); @@ -98,7 +101,7 @@ void ObjectProperties::serialize(std::ostream &os) const writeARGB8(os, color); } writeU8(os, collideWithObjects); - writeF1000(os,stepheight); + writeF1000(os, stepheight); writeU8(os, automatic_face_movement_dir); writeF1000(os, automatic_face_movement_dir_offset); writeU8(os, backface_culling); @@ -107,9 +110,11 @@ void ObjectProperties::serialize(std::ostream &os) const writeF1000(os, automatic_face_movement_max_rotation_per_sec); os << serializeString(infotext); os << serializeString(wield_item); - writeU8(os, can_zoom); writeS8(os, glow); writeU16(os, breath_max); + writeF1000(os, eye_height); + writeF1000(os, zoom_fov); + writeU8(os, use_texture_alpha); // Add stuff only at the bottom. // Never remove anything, because we don't want new versions of this @@ -118,7 +123,7 @@ void ObjectProperties::serialize(std::ostream &os) const void ObjectProperties::deSerialize(std::istream &is) { int version = readU8(is); - if (version != 2) + if (version != 3) throw SerializationError("unsupported ObjectProperties version"); hp_max = readS16(is); @@ -142,6 +147,7 @@ void ObjectProperties::deSerialize(std::istream &is) makes_footstep_sound = readU8(is); automatic_rotate = readF1000(is); mesh = deSerializeString(is); + colors.clear(); u32 color_count = readU16(is); for (u32 i = 0; i < color_count; i++){ colors.push_back(readARGB8(is)); @@ -156,10 +162,9 @@ void ObjectProperties::deSerialize(std::istream &is) automatic_face_movement_max_rotation_per_sec = readF1000(is); infotext = deSerializeString(is); wield_item = deSerializeString(is); - can_zoom = readU8(is); - - try { - glow = readS8(is); - breath_max = readU16(is); - } catch (SerializationError &e) {} + glow = readS8(is); + breath_max = readU16(is); + eye_height = readF1000(is); + zoom_fov = readF1000(is); + use_texture_alpha = readU8(is); }