diff options
author | Oz Linden <oz@lindenlab.com> | 2011-08-01 17:09:25 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-08-01 17:09:25 -0400 |
commit | 9eb555bbe60e0f388593c489d6c473e4adcbd956 (patch) | |
tree | 8d7ce38c1c2b539d2ee058a64eedb54b48f7949b /indra/newview/lldrawpoolwlsky.cpp | |
parent | 5f71e29d8a2a56fe560412698c40b5816e9f47e6 (diff) | |
parent | 5711fda52f3939f482358ad5265618fb56da5998 (diff) |
merge changes for storm-1535
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 28 |
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); + } } |