From 8a8e14f54a027a72cb17d45af2c6e67c4650337e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 25 Jan 2016 11:22:31 +1300 Subject: [PATCH] Rework initializers --- .../entities/src/EntityItemProperties.cpp | 19 +------------- libraries/entities/src/EntityItemProperties.h | 26 +++++++++---------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index c8bafd0619..7069b983bc 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -32,24 +32,7 @@ KeyLightPropertyGroup EntityItemProperties::_staticKeyLight; EntityPropertyList PROP_LAST_ITEM = (EntityPropertyList)(PROP_AFTER_LAST_ITEM - 1); EntityItemProperties::EntityItemProperties(EntityPropertyFlags desiredProperties) : - -_id(UNKNOWN_ENTITY_ID), -_idSet(false), -_lastEdited(0), -_type(EntityTypes::Unknown), - -_glowLevel(0.0f), -_localRenderAlpha(1.0f), - -_glowLevelChanged(false), -_localRenderAlphaChanged(false), - -_defaultSettings(true), -_naturalDimensions(1.0f, 1.0f, 1.0f), -_naturalPosition(0.0f, 0.0f, 0.0f), -_desiredProperties(desiredProperties), - -_entityFound(false) + _desiredProperties(desiredProperties) //, { } diff --git a/libraries/entities/src/EntityItemProperties.h b/libraries/entities/src/EntityItemProperties.h index c0a610ac5c..f66d17eae2 100644 --- a/libraries/entities/src/EntityItemProperties.h +++ b/libraries/entities/src/EntityItemProperties.h @@ -279,29 +279,29 @@ protected: void setCollisionMaskFromString(const QString& maskString); private: - QUuid _id; - bool _idSet; - quint64 _lastEdited; - EntityTypes::EntityType _type; + QUuid _id { UNKNOWN_ENTITY_ID }; + bool _idSet { false }; + quint64 _lastEdited { 0 }; + EntityTypes::EntityType _type { EntityTypes::Unknown }; void setType(const QString& typeName) { _type = EntityTypes::getEntityTypeFromName(typeName); } - float _glowLevel; - float _localRenderAlpha; - bool _glowLevelChanged; - bool _localRenderAlphaChanged; - bool _defaultSettings; - bool _dimensionsInitialized = true; // Only false if creating an entity locally with no dimensions properties + float _glowLevel { 0.0f }; + float _localRenderAlpha { 1.0f }; + bool _glowLevelChanged { false }; + bool _localRenderAlphaChanged { false }; + bool _defaultSettings { true }; + bool _dimensionsInitialized { true }; // Only false if creating an entity locally with no dimensions properties // NOTE: The following are pseudo client only properties. They are only used in clients which can access // properties of model geometry. But these properties are not serialized like other properties. QVector _sittingPoints; QStringList _textureNames; - glm::vec3 _naturalDimensions; - glm::vec3 _naturalPosition; + glm::vec3 _naturalDimensions { 1.0f, 1.0f, 1.0f }; + glm::vec3 _naturalPosition { 0.0f, 0.0f, 0.0f }; EntityPropertyFlags _desiredProperties; // if set will narrow scopes of copy/to/from to just these properties - bool _entityFound; + bool _entityFound { false }; }; Q_DECLARE_METATYPE(EntityItemProperties);