From f3130b85e6ddbff7b0ce700c52d3eb54d9c98b71 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 28 Jul 2011 17:51:00 -0600
Subject: fix for SH-2023: Brightness Bump maps don't load when shadows are
 enabled

---
 indra/newview/lldrawpoolbump.cpp |  4 ++--
 indra/newview/llvovolume.cpp     | 19 +++++++++++--------
 indra/newview/llvovolume.h       |  2 +-
 3 files changed, 14 insertions(+), 11 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index d801f6df18..6f71c54f79 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1073,8 +1073,8 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
 		if (!src_image->hasCallbacks())
 		{ //if image has no callbacks but resolutions don't match, trigger raw image loaded callback again
 			if (src_image->getWidth() != bump->getWidth() ||
-				src_image->getHeight() != bump->getHeight() ||
-				(LLPipeline::sRenderDeferred && bump->getComponents() != 4))
+				src_image->getHeight() != bump->getHeight())// ||
+				//(LLPipeline::sRenderDeferred && bump->getComponents() != 4))
 			{
 				src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
 				src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4c137d3394..d8b02fab27 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -704,19 +704,22 @@ BOOL LLVOVolume::isVisible() const
 	return FALSE ;
 }
 
-void LLVOVolume::updateTextureVirtualSize()
+void LLVOVolume::updateTextureVirtualSize(bool forced)
 {
 	LLFastTimer ftm(FTM_VOLUME_TEXTURES);
 	// Update the pixel area of all faces
 
-	if(!isVisible())
+	if(!forced)
 	{
-		return ;
-	}
+		if(!isVisible())
+		{
+			return ;
+		}
 
-	if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE))
-	{
-		return;
+		if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE))
+		{
+			return;
+		}
 	}
 
 	static LLCachedControl<bool> dont_load_textures(gSavedSettings,"TextureDisable");
@@ -3995,7 +3998,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 		}
 
 		llassert_always(vobj);
-		vobj->updateTextureVirtualSize();
+		vobj->updateTextureVirtualSize(true);
 		vobj->preRebuild();
 
 		drawablep->clearState(LLDrawable::HAS_ALPHA);
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index fc00f0c0d0..13565cb27c 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -206,7 +206,7 @@ public:
 	/*virtual*/ BOOL	updateLOD();
 				void	updateRadius();
 	/*virtual*/ void	updateTextures();
-				void	updateTextureVirtualSize();
+				void	updateTextureVirtualSize(bool forced = false);
 
 				void	updateFaceFlags();
 				void	regenFaces();
-- 
cgit v1.2.3