diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-28 23:29:46 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-28 23:29:46 +0000 |
commit | 16baf6c9d43fc29e697b5a460439ca664897450c (patch) | |
tree | 6c3ae45c538cbc90408ab72f3a02564cf5dce754 /indra/newview/llvovolume.cpp | |
parent | 75ee8558abb662b6a0a6b559c61a9549818d2962 (diff) |
merge release-QAR-499 Viewer 1.20 RC 3
merge release-QAR-508 Viewer 1.20 RC 4
merge Branch_1-20-Viewer -r 85278 : 85828 -> release
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e7dbf0bfb8..a440ae2957 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -762,16 +762,30 @@ void LLVOVolume::sculpt() return; LLPointer<LLImageRaw> raw_image = new LLImageRaw(); - mSculptTexture->readBackRaw(discard_level, raw_image, FALSE); + BOOL is_valid = mSculptTexture->readBackRaw(discard_level, raw_image, FALSE); sculpt_height = raw_image->getHeight(); sculpt_width = raw_image->getWidth(); + sculpt_components = raw_image->getComponents(); - sculpt_components = raw_image->getComponents(); - sculpt_data = raw_image->getData(); - - llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components); - + if(is_valid) + { + is_valid = mSculptTexture->isValidForSculpt(discard_level, sculpt_width, sculpt_height, sculpt_components) ; + } + if(!is_valid) + { + sculpt_width = 0; + sculpt_height = 0; + sculpt_data = NULL ; + } + else + { + if (raw_image->getDataSize() < sculpt_height * sculpt_width * sculpt_components) + llerrs << "Sculpt: image data size = " << raw_image->getDataSize() + << " < " << sculpt_height << " x " << sculpt_width << " x " <<sculpt_components << llendl; + + sculpt_data = raw_image->getData(); + } getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); } } |