mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Merge pull request #11634 from highfidelity/hazeZone
Fogbugz 8477: Crash on loading older domains that have zones without the haze component.
This commit is contained in:
commit
7754061505
4 changed files with 25 additions and 9 deletions
|
@ -228,11 +228,21 @@ const std::array<ComponentPair, COMPONENT_MODE_ITEM_COUNT> COMPONENT_MODES = { {
|
|||
} };
|
||||
|
||||
QString EntityItemProperties::getHazeModeAsString() const {
|
||||
return COMPONENT_MODES[_hazeMode].second;
|
||||
// return "inherit" if _hazeMode is not valid
|
||||
if (_hazeMode < COMPONENT_MODE_ITEM_COUNT) {
|
||||
return COMPONENT_MODES[_hazeMode].second;
|
||||
} else {
|
||||
return COMPONENT_MODES[COMPONENT_MODE_INHERIT].second;
|
||||
}
|
||||
}
|
||||
|
||||
QString EntityItemProperties::getHazeModeString(uint32_t mode) {
|
||||
return COMPONENT_MODES[mode].second;
|
||||
// return "inherit" if mode is not valid
|
||||
if (mode < COMPONENT_MODE_ITEM_COUNT) {
|
||||
return COMPONENT_MODES[mode].second;
|
||||
} else {
|
||||
return COMPONENT_MODES[COMPONENT_MODE_INHERIT].second;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityItemProperties::setHazeModeFromString(const QString& hazeMode) {
|
||||
|
|
|
@ -321,8 +321,10 @@ void ZoneEntityItem::resetRenderingPropertiesChanged() {
|
|||
}
|
||||
|
||||
void ZoneEntityItem::setHazeMode(const uint32_t value) {
|
||||
_hazeMode = value;
|
||||
_hazePropertiesChanged = true;
|
||||
if (value < COMPONENT_MODE_ITEM_COUNT) {
|
||||
_hazeMode = value;
|
||||
_hazePropertiesChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ZoneEntityItem::getHazeMode() const {
|
||||
|
|
|
@ -138,6 +138,8 @@ public:
|
|||
static const bool DEFAULT_GHOSTING_ALLOWED;
|
||||
static const QString DEFAULT_FILTER_URL;
|
||||
|
||||
static const uint32_t DEFAULT_HAZE_MODE{ (uint32_t)COMPONENT_MODE_INHERIT };
|
||||
|
||||
protected:
|
||||
KeyLightPropertyGroup _keyLightProperties;
|
||||
|
||||
|
@ -146,7 +148,7 @@ protected:
|
|||
|
||||
BackgroundMode _backgroundMode = BACKGROUND_MODE_INHERIT;
|
||||
|
||||
uint8_t _hazeMode{ (uint8_t)COMPONENT_MODE_INHERIT };
|
||||
uint32_t _hazeMode{ DEFAULT_HAZE_MODE };
|
||||
|
||||
float _hazeRange{ HazePropertyGroup::DEFAULT_HAZE_RANGE };
|
||||
xColor _hazeColor{ HazePropertyGroup::DEFAULT_HAZE_COLOR };
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <glm/gtx/transform.hpp>
|
||||
#include <math.h>
|
||||
#include <qcompilerdetection.h>
|
||||
#include <ComponentMode.h>
|
||||
|
||||
using namespace model;
|
||||
|
||||
|
@ -256,8 +257,9 @@ void SunSkyStage::setSkybox(const SkyboxPointer& skybox) {
|
|||
invalidate();
|
||||
}
|
||||
|
||||
// Haze
|
||||
void SunSkyStage::setHazeMode(uint32_t mode) {
|
||||
_hazeMode = mode;
|
||||
invalidate();
|
||||
void SunSkyStage::setHazeMode(uint32_t hazeMode) {
|
||||
if (hazeMode < COMPONENT_MODE_ITEM_COUNT) {
|
||||
_hazeMode = hazeMode;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue