summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-06-22 15:02:07 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-06-22 15:02:07 -0600
commitf8f0fa041087e64abb0b7bc54c14999da9d55ab1 (patch)
tree1d1d7f88eb0489a141f5af683d6859a62d372863 /indra
parentaa7e36f35b2588bcf3a90892a041a12c32ab53f4 (diff)
fix for STORM-1417: [crashhunters] crash at [0] LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions) [secondlife-bin llrender.cpp]
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 409b18d522..ec74769fa1 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -60,13 +60,24 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
llerrs << "Error: Failed to load cloud noise image " << cloudNoiseFilename << llendl;
}
- cloudNoiseFile->load(cloudNoiseFilename);
-
- sCloudNoiseRawImage = new LLImageRaw();
+ if(cloudNoiseFile->load(cloudNoiseFilename))
+ {
+ sCloudNoiseRawImage = new LLImageRaw();
- cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f);
+ if(cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f))
+ {
+ //debug use
+ llinfos << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " <<
+ (S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << llendl ;
+ llassert_always(sCloudNoiseRawImage->getData()) ;
- sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ }
+ else
+ {
+ sCloudNoiseRawImage = NULL ;
+ }
+ }
LLWLParamManager::instance()->propagateParameters();
}
@@ -201,7 +212,7 @@ void LLDrawPoolWLSky::renderStars(void) const
void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
{
- if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))
+ if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && sCloudNoiseTexture.notNull())
{
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -373,5 +384,8 @@ void LLDrawPoolWLSky::cleanupGL()
//static
void LLDrawPoolWLSky::restoreGL()
{
- sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ if(sCloudNoiseRawImage.notNull())
+ {
+ sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ }
}