projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move client-specific files to 'src/client' (#7902)
[oweals/minetest.git]
/
src
/
object_properties.cpp
diff --git
a/src/object_properties.cpp
b/src/object_properties.cpp
index 9cbaadc64db36af52cfeb885a6d0d3fbd74b3f91..d42fbcc6caaa8377d2b918a851f30acf9761815f 100644
(file)
--- 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;
<< "," << 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
{
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);
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);
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);
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);
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);
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
// 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);
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);
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);
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));
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);
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);
}
}