1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make shading of CAOs optional (#10033)

This commit is contained in:
Danila Shutov 2020-06-16 22:48:31 +03:00 committed by GitHub
parent 0a1181f763
commit 3a6dfda358
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 47 additions and 7 deletions

View file

@ -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) {}
}