diff options
author | Danila Shutov <dcbrwn2@gmail.com> | 2020-06-16 22:48:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 20:48:31 +0100 |
commit | 3a6dfda358112e2fb5d6f887a1a1e936eacddadd (patch) | |
tree | 340e1e0442ef8ba346b522580b2b6bee66246b30 /src/object_properties.cpp | |
parent | 0a1181f7637adab6fe1ba5d3c09038912a06b37f (diff) | |
download | minetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.tar.gz minetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.tar.bz2 minetest-3a6dfda358112e2fb5d6f887a1a1e936eacddadd.zip |
Make shading of CAOs optional (#10033)
Diffstat (limited to 'src/object_properties.cpp')
-rw-r--r-- | src/object_properties.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/object_properties.cpp b/src/object_properties.cpp index 6ff344dce..8d51bcbfa 100644 --- a/src/object_properties.cpp +++ b/src/object_properties.cpp @@ -69,6 +69,7 @@ std::string ObjectProperties::dump() os << ", zoom_fov=" << zoom_fov; os << ", use_texture_alpha=" << use_texture_alpha; os << ", damage_texture_modifier=" << damage_texture_modifier; + os << ", shaded=" << shaded; return os.str(); } @@ -116,6 +117,7 @@ void ObjectProperties::serialize(std::ostream &os) const writeF32(os, zoom_fov); writeU8(os, use_texture_alpha); os << serializeString(damage_texture_modifier); + writeU8(os, shaded); // Add stuff only at the bottom. // Never remove anything, because we don't want new versions of this @@ -170,5 +172,9 @@ void ObjectProperties::deSerialize(std::istream &is) use_texture_alpha = readU8(is); try { damage_texture_modifier = deSerializeString(is); + u8 tmp = readU8(is); + if (is.eof()) + throw SerializationError(""); + shaded = tmp; } catch (SerializationError &e) {} } |