diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2011-07-26 12:27:05 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2011-07-26 12:27:05 -0600 |
commit | 58dccd5fe9e1eb8f8674749987877699a6c46972 (patch) | |
tree | 9a696bafbfd93d17e2581413332e18c6ddcbfa6b /indra | |
parent | b26ff4b4edd7abd320fb7e200195137bd235a7e4 (diff) | |
parent | cf5ff54ae682778f9835fe224143406eef856690 (diff) |
Automated merge with https://bitbucket.org/VirLinden/viewer-development-shining-fixes
Diffstat (limited to 'indra')
-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..dbb39cd415 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 + 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::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); + } } |