summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorRunitai Linden <davep@lindenlab.com>2020-03-27 17:32:01 -0500
committerRunitai Linden <davep@lindenlab.com>2020-03-27 17:32:01 -0500
commite468d8018634b51f329eae17485c3358c0a3630b (patch)
treedc12e082a97f56f422cfdd0655cb64975b986924 /indra/newview/llvovolume.cpp
parentd756e185730f46fd78e88215e0b4b9fd282fd1d7 (diff)
SL-12902 Better fix for light color values in color swatch not matching light color values inworld.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 586d3b66b0..bd7ad399f9 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3147,14 +3147,19 @@ void LLVOVolume::setIsLight(BOOL is_light)
}
}
-void LLVOVolume::setLightColor(const LLColor3& color)
+void LLVOVolume::setLightSRGBColor(const LLColor3& color)
+{
+ setLightLinearColor(linearColor3(color));
+}
+
+void LLVOVolume::setLightLinearColor(const LLColor3& color)
{
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
if (param_block)
{
- if (param_block->getColor() != color)
+ if (param_block->getLinearColor() != color)
{
- param_block->setColor(LLColor4(color, param_block->getColor().mV[3]));
+ param_block->setLinearColor(LLColor4(color, param_block->getLinearColor().mV[3]));
parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
gPipeline.markTextured(mDrawable);
mFaceMappingChanged = TRUE;
@@ -3167,9 +3172,9 @@ void LLVOVolume::setLightIntensity(F32 intensity)
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
if (param_block)
{
- if (param_block->getColor().mV[3] != intensity)
+ if (param_block->getLinearColor().mV[3] != intensity)
{
- param_block->setColor(LLColor4(LLColor3(param_block->getColor()), intensity));
+ param_block->setLinearColor(LLColor4(LLColor3(param_block->getLinearColor()), intensity));
parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
}
}
@@ -3221,12 +3226,17 @@ BOOL LLVOVolume::getIsLight() const
return getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT);
}
-LLColor3 LLVOVolume::getLightBaseColor() const
+LLColor3 LLVOVolume::getLightSRGBBaseColor() const
+{
+ return srgbColor3(getLightLinearColor());
+}
+
+LLColor3 LLVOVolume::getLightLinearBaseColor() const
{
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
if (param_block)
{
- return LLColor3(param_block->getColor());
+ return LLColor3(param_block->getLinearColor());
}
else
{
@@ -3236,17 +3246,10 @@ LLColor3 LLVOVolume::getLightBaseColor() const
LLColor3 LLVOVolume::getLightLinearColor() const
{
- LLColor3 ret = getLightSRGBColor();
- ret = linearColor3(ret);
- return ret;
-}
-
-LLColor3 LLVOVolume::getLightSRGBColor() const
-{
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
if (param_block)
{
- return LLColor3(param_block->getSRGBColor()) * param_block->getSRGBColor().mV[3];
+ return LLColor3(param_block->getLinearColor()) * param_block->getLinearColor().mV[3];
}
else
{
@@ -3254,6 +3257,13 @@ LLColor3 LLVOVolume::getLightSRGBColor() const
}
}
+LLColor3 LLVOVolume::getLightSRGBColor() const
+{
+ LLColor3 ret = getLightLinearColor();
+ ret = srgbColor3(ret);
+ return ret;
+}
+
LLUUID LLVOVolume::getLightTextureID() const
{
if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
@@ -3345,7 +3355,7 @@ F32 LLVOVolume::getLightIntensity() const
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
if (param_block)
{
- return param_block->getColor().mV[3];
+ return param_block->getLinearColor().mV[3];
}
else
{