mirror of
https://github.com/lubosz/overte.git
synced 2025-08-17 07:10:48 +02:00
Moved variable setting to outside of loop.
This commit is contained in:
parent
311e95e0d0
commit
86cfeac95c
1 changed files with 4 additions and 2 deletions
|
@ -2235,6 +2235,10 @@ bool EntityTree::writeToMap(QVariantMap& entityDescription, OctreeElementPointer
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityTree::readFromMap(QVariantMap& map) {
|
bool EntityTree::readFromMap(QVariantMap& map) {
|
||||||
|
// These are needed to deal with older content (before adding inheritance modes)
|
||||||
|
int contentVersion = map["Version"].toInt();
|
||||||
|
bool needsConversion = (contentVersion < (int)EntityVersion::ZoneLightInheritModes);
|
||||||
|
|
||||||
// map will have a top-level list keyed as "Entities". This will be extracted
|
// map will have a top-level list keyed as "Entities". This will be extracted
|
||||||
// and iterated over. Each member of this list is converted to a QVariantMap, then
|
// and iterated over. Each member of this list is converted to a QVariantMap, then
|
||||||
// to a QScriptValue, and then to EntityItemProperties. These properties are used
|
// to a QScriptValue, and then to EntityItemProperties. These properties are used
|
||||||
|
@ -2280,8 +2284,6 @@ bool EntityTree::readFromMap(QVariantMap& map) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix for older content not containing these fields in the zones
|
// Fix for older content not containing these fields in the zones
|
||||||
int contentVersion = map["Version"].toInt();
|
|
||||||
bool needsConversion = (contentVersion < (int)EntityVersion::ZoneLightInheritModes);
|
|
||||||
if (needsConversion && (properties.getType() == EntityTypes::EntityType::Zone)) {
|
if (needsConversion && (properties.getType() == EntityTypes::EntityType::Zone)) {
|
||||||
// The background should be enabled if the mode is skybox
|
// The background should be enabled if the mode is skybox
|
||||||
// Note that if the values are default then they are not stored in the JSON file
|
// Note that if the values are default then they are not stored in the JSON file
|
||||||
|
|
Loading…
Reference in a new issue