summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwlsky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-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 f9fd501072..a219386b53 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -62,13 +62,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
+ lldebugs << "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::getInstance()->propagateParameters();
}
@@ -218,7 +229,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);
@@ -399,5 +410,8 @@ void LLDrawPoolWLSky::cleanupGL()
//static
void LLDrawPoolWLSky::restoreGL()
{
- sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ if(sCloudNoiseRawImage.notNull())
+ {
+ sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+ }
}