summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llprimitive/llprimitive.h1
-rw-r--r--indra/newview/llpanelvolume.cpp4
-rw-r--r--indra/newview/llvovolume.cpp7
-rw-r--r--indra/newview/llvovolume.h1
-rw-r--r--indra/newview/pipeline.cpp6
5 files changed, 14 insertions, 5 deletions
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 4f828186cb..59697d1ebd 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -286,6 +286,7 @@ public:
void setLightTexture(const LLUUID& id) { mLightTexture = id; }
LLUUID getLightTexture() const { return mLightTexture; }
+ bool isLightSpotlight() const { return !mLightTexture.isNull(); }
void setParams(const LLVector3& params) { mParams = params; }
LLVector3 getParams() const { return mParams; }
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index fbe68b4d92..8b01637239 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -574,7 +574,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
LLUUID id = LightTextureCtrl->getImageAssetID();
if (id.notNull())
{
- if (volobjp->getLightTextureID().isNull())
+ if (!volobjp->isLightSpotlight())
{ //this commit is making this a spot light, set UI to default params
volobjp->setLightTextureID(id);
LLVector3 spot_params = volobjp->getSpotLightParams();
@@ -591,7 +591,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
volobjp->setSpotLightParams(spot_params);
}
}
- else if (volobjp->getLightTextureID().notNull())
+ else if (volobjp->isLightSpotlight())
{ //no longer a spot light
volobjp->setLightTextureID(id);
//self->childDisable("Light FOV");
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e6de33c459..b7b024fa1d 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2451,6 +2451,13 @@ void LLVOVolume::updateSpotLightPriority()
}
+bool LLVOVolume::isLightSpotlight()
+{
+ LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+ return params->isLightSpotlight();
+}
+
+
LLViewerTexture* LLVOVolume::getLightTexture()
{
LLUUID id = getLightTextureID();
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index a8bb597f93..fbae011ffc 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -215,6 +215,7 @@ public:
LLColor3 getLightBaseColor() const; // not scaled by intensity
LLColor3 getLightColor() const; // scaled by intensity
LLUUID getLightTextureID() const;
+ bool isLightSpotlight() const;
LLVector3 getSpotLightParams() const;
void updateSpotLightPriority();
F32 getSpotLightPriority() const;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 1ef5b5ded1..cceb417634 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4555,7 +4555,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f);
glLightf (gllight, GL_LINEAR_ATTENUATION, linatten);
glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f);
- if (light->getLightTexture()) // directional (spot-)light
+ if (light->isLightSpotlight()) // directional (spot-)light
{
LLVector3 spotparams = light->getSpotLightParams();
LLQuaternion quat = light->getRenderRotation();
@@ -6647,7 +6647,7 @@ void LLPipeline::renderDeferredLighting()
{ //draw box if camera is outside box
if (render_local)
{
- if (volume->getLightTexture())
+ if (volume->isLightSpotlight())
{
drawablep->getVOVolume()->updateSpotLightPriority();
spot_lights.push_back(drawablep);
@@ -6664,7 +6664,7 @@ void LLPipeline::renderDeferredLighting()
}
else if (render_fullscreen)
{
- if (volume->getLightTexture())
+ if (volume->isLightSpotlight())
{
drawablep->getVOVolume()->updateSpotLightPriority();
fullscreen_spot_lights.push_back(drawablep);