diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 87db66aa7d..a3951daa41 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -172,7 +172,7 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) { } // Haze only if the mode is not inherit - if (_hazeMode != HAZE_MODE_INHERIT) { + if (_hazeMode != COMPONENT_MODE_INHERIT) { _hazeStage->_currentFrame.pushHaze(_hazeIndex); } } @@ -332,12 +332,12 @@ void ZoneEntityRenderer::updateKeyAmbientFromEntity() { } void ZoneEntityRenderer::updateHazeFromEntity(const TypedEntityPointer& entity) { - setHazeMode((HazeMode)entity->getHazeMode()); + setHazeMode((ComponentMode)entity->getHazeMode()); const auto& haze = editHaze(); const uint32_t hazeMode = entity->getHazeMode(); - haze->setHazeActive(hazeMode == HAZE_MODE_ENABLED); + haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED); haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect()); haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange())); @@ -471,7 +471,7 @@ void ZoneEntityRenderer::setBackgroundMode(BackgroundMode mode) { _backgroundMode = mode; } -void ZoneEntityRenderer::setHazeMode(HazeMode mode) { +void ZoneEntityRenderer::setHazeMode(ComponentMode mode) { _hazeMode = mode; } diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.h b/libraries/entities-renderer/src/RenderableZoneEntityItem.h index d8c451d2a1..30da96cd9d 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.h +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.h @@ -21,7 +21,7 @@ #include #include #include "RenderableEntityItem.h" -#include +#include #if 0 #include @@ -55,7 +55,7 @@ private: void setAmbientURL(const QString& ambientUrl); void setSkyboxURL(const QString& skyboxUrl); void setBackgroundMode(BackgroundMode mode); - void setHazeMode(HazeMode mode); + void setHazeMode(ComponentMode mode); void setSkyboxColor(const glm::vec3& color); void setProceduralUserData(const QString& userData); @@ -85,7 +85,7 @@ private: const model::HazePointer _haze{ std::make_shared() }; BackgroundMode _backgroundMode{ BACKGROUND_MODE_INHERIT }; - HazeMode _hazeMode{ HAZE_MODE_INHERIT }; + ComponentMode _hazeMode{ COMPONENT_MODE_INHERIT }; indexed_container::Index _sunIndex{ LightStage::INVALID_INDEX }; indexed_container::Index _ambientIndex{ LightStage::INVALID_INDEX }; diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 543c4a58b5..1c6782ba73 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -220,27 +220,27 @@ void EntityItemProperties::setBackgroundModeFromString(const QString& background } } -using HazePair = std::pair; -const std::array HAZE_MODES = { { - HazePair{ HAZE_MODE_INHERIT,{ "inherit" } }, - HazePair{ HAZE_MODE_DISABLED,{ "disabled" } }, - HazePair{ HAZE_MODE_ENABLED,{ "enabled" } } +using ComponentPair = std::pair; +const std::array COMPONENT_MODES = { { + ComponentPair{ COMPONENT_MODE_INHERIT,{ "inherit" } }, + ComponentPair{ COMPONENT_MODE_DISABLED,{ "disabled" } }, + ComponentPair{ COMPONENT_MODE_ENABLED,{ "enabled" } } } }; QString EntityItemProperties::getHazeModeAsString() const { - return HAZE_MODES[_hazeMode].second; + return COMPONENT_MODES[_hazeMode].second; } QString EntityItemProperties::getHazeModeString(uint32_t mode) { - return HAZE_MODES[mode].second; + return COMPONENT_MODES[mode].second; } void EntityItemProperties::setHazeModeFromString(const QString& hazeMode) { - auto result = std::find_if(HAZE_MODES.begin(), HAZE_MODES.end(), [&](const HazePair& pair) { + auto result = std::find_if(COMPONENT_MODES.begin(), COMPONENT_MODES.end(), [&](const ComponentPair& pair) { return (pair.second == hazeMode); }); - if (result != HAZE_MODES.end()) { + if (result != COMPONENT_MODES.end()) { _hazeMode = result->first; _hazeModeChanged = true; } diff --git a/libraries/entities/src/EntityItemProperties.h b/libraries/entities/src/EntityItemProperties.h index 599d919792..654cd1a6af 100644 --- a/libraries/entities/src/EntityItemProperties.h +++ b/libraries/entities/src/EntityItemProperties.h @@ -179,7 +179,7 @@ public: DEFINE_PROPERTY_REF_ENUM(PROP_BACKGROUND_MODE, BackgroundMode, backgroundMode, BackgroundMode, BACKGROUND_MODE_INHERIT); DEFINE_PROPERTY_GROUP(Stage, stage, StagePropertyGroup); - DEFINE_PROPERTY_REF_ENUM(PROP_HAZE_MODE, HazeMode, hazeMode, uint32_t, (uint32_t)HAZE_MODE_INHERIT); + DEFINE_PROPERTY_REF_ENUM(PROP_HAZE_MODE, HazeMode, hazeMode, uint32_t, (uint32_t)COMPONENT_MODE_INHERIT); DEFINE_PROPERTY_GROUP(Skybox, skybox, SkyboxPropertyGroup); DEFINE_PROPERTY_GROUP(Haze, haze, HazePropertyGroup); diff --git a/libraries/entities/src/ZoneEntityItem.h b/libraries/entities/src/ZoneEntityItem.h index c626789205..9c1c9fd9c1 100644 --- a/libraries/entities/src/ZoneEntityItem.h +++ b/libraries/entities/src/ZoneEntityItem.h @@ -18,7 +18,7 @@ #include "SkyboxPropertyGroup.h" #include "HazePropertyGroup.h" #include "StagePropertyGroup.h" -#include +#include class ZoneEntityItem : public EntityItem { public: @@ -146,7 +146,7 @@ protected: BackgroundMode _backgroundMode = BACKGROUND_MODE_INHERIT; - uint8_t _hazeMode{ (uint8_t)HAZE_MODE_INHERIT }; + uint8_t _hazeMode{ (uint8_t)COMPONENT_MODE_INHERIT }; float _hazeRange{ HazePropertyGroup::DEFAULT_HAZE_RANGE }; xColor _hazeBlendInColor{ HazePropertyGroup::DEFAULT_HAZE_BLEND_IN_COLOR }; diff --git a/libraries/shared/src/HazeMode.h b/libraries/shared/src/ComponentMode.h similarity index 52% rename from libraries/shared/src/HazeMode.h rename to libraries/shared/src/ComponentMode.h index 0c0af013cd..03721c6a45 100644 --- a/libraries/shared/src/HazeMode.h +++ b/libraries/shared/src/ComponentMode.h @@ -1,5 +1,5 @@ // -// HazeMode.h +// ComponentMode.h // libraries/entities/src // // Created by Nissim Hadar on 9/21/17. @@ -9,16 +9,16 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef hifi_HazeMode_h -#define hifi_HazeMode_h +#ifndef hifi_ComponentMode_h +#define hifi_ComponentMode_h -enum HazeMode { - HAZE_MODE_INHERIT, - HAZE_MODE_DISABLED, - HAZE_MODE_ENABLED, +enum ComponentMode { + COMPONENT_MODE_INHERIT, + COMPONENT_MODE_DISABLED, + COMPONENT_MODE_ENABLED, - HAZE_MODE_ITEM_COUNT + COMPONENT_MODE_ITEM_COUNT }; -#endif // hifi_HazeMode_h +#endif // hifi_ComponentMode_h