summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-07-08 21:05:28 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-07-08 21:05:28 -0600
commitcf5ff54ae682778f9835fe224143406eef856690 (patch)
tree6acf3049a5bf5afbf589a7c18715eb11f93fde29 /indra
parent36a05ebd9a2a969bab4621f522a9a82f69e523d7 (diff)
parentf8f0fa041087e64abb0b7bc54c14999da9d55ab1 (diff)
Automated merge with https://bitbucket.org/VirLinden/viewer-development-shining-fixes
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);
+ }
}