aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lltexlayer.cpp')
-rw-r--r--linden/indra/newview/lltexlayer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp
index c8e1298..ceef28b 100644
--- a/linden/indra/newview/lltexlayer.cpp
+++ b/linden/indra/newview/lltexlayer.cpp
@@ -213,6 +213,7 @@ BOOL LLTexLayerSetBuffer::needsRender()
213 LLVOAvatar* avatar = mTexLayerSet->getAvatar(); 213 LLVOAvatar* avatar = mTexLayerSet->getAvatar();
214 BOOL upload_now = needsUploadNow(); 214 BOOL upload_now = needsUploadNow();
215 BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating; 215 BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating;
216
216 if (needs_update) 217 if (needs_update)
217 { 218 {
218 BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT); 219 BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT);
@@ -275,16 +276,16 @@ BOOL LLTexLayerSetBuffer::render()
275 } 276 }
276 else 277 else
277 { 278 {
278 // mUploadPending = FALSE;//see... 279 //mUploadPending = FALSE;//see...
279 // mNeedsUpload = FALSE;// ...below... 280 //mNeedsUpload = FALSE;// ...below...
280 LLVOAvatar* avatar = mTexLayerSet->getAvatar(); 281 LLVOAvatar* avatar = mTexLayerSet->getAvatar();
281 if (avatar) 282 if (avatar)
282 { 283 {
283 avatar->setNewBakedTexture(avatar->getBakedTE(mTexLayerSet), IMG_INVISIBLE); 284 avatar->setNewBakedTexture(avatar->getBakedTE(mTexLayerSet), IMG_INVISIBLE);
284 llinfos << "Invisible baked texture set for " << mTexLayerSet->getBodyRegion() << llendl; 285 llinfos << "Invisible baked texture set for " << mTexLayerSet->getBodyRegion() << llendl;
285 } 286 }
286 readBackAndUpload(); //... here: Opensim is not happy if we don't 287 readBackAndUpload(); //... here: Opensim is not happy if we don't
287 //TODO: find out if SL is happy if we do 288 //TODO: find out if SL is happy if we do
288 } 289 }
289 } 290 }
290 } 291 }
@@ -350,12 +351,11 @@ void LLTexLayerSetBuffer::readBackAndUpload()
350 // writes into baked_color_data 351 // writes into baked_color_data
351 const char* comment_text = NULL; 352 const char* comment_text = NULL;
352 353
353 S32 baked_image_components = 5; // red green blue bump clothing 354 S32 baked_image_components = 5; // red green blue bump clothing
354 LLPointer<LLImageRaw> baked_image = new LLImageRaw( mWidth, mHeight, baked_image_components ); 355 LLPointer<LLImageRaw> baked_image = new LLImageRaw( mWidth, mHeight, baked_image_components );
355 U8* baked_image_data = baked_image->getData(); 356 U8* baked_image_data = baked_image->getData();
356 357
357 comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // 5 channels: rgb, heightfield/alpha, mask 358 comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // 5 channels: rgb, heightfield/alpha, mask
358
359 S32 i = 0; 359 S32 i = 0;
360 for (S32 u = 0; u < mWidth; u++) 360 for (S32 u = 0; u < mWidth; u++)
361 { 361 {
@@ -492,7 +492,7 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, void* user
492 avatar->setNewBakedTexture(baked_te, uuid); 492 avatar->setNewBakedTexture(baked_te, uuid);
493 } 493 }
494 else 494 else
495 { 495 {
496 ++failures; 496 ++failures;
497 llinfos << "Baked upload failed (attempt " << failures << "/" << MAX_BAKE_UPLOAD_ATTEMPTS << "), "; 497 llinfos << "Baked upload failed (attempt " << failures << "/" << MAX_BAKE_UPLOAD_ATTEMPTS << "), ";
498 if (failures >= MAX_BAKE_UPLOAD_ATTEMPTS) 498 if (failures >= MAX_BAKE_UPLOAD_ATTEMPTS)
@@ -1412,7 +1412,7 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height )
1412 1412
1413 LLTexUnit::eTextureAddressMode old_mode = image_gl->getAddressMode(); 1413 LLTexUnit::eTextureAddressMode old_mode = image_gl->getAddressMode();
1414 1414
1415 gGL.getTexUnit(0)->bind(image_gl); 1415 gGL.getTexUnit(0)->bind(image_gl, TRUE);
1416 gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); 1416 gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
1417 1417
1418 gl_rect_2d_simple_tex( width, height ); 1418 gl_rect_2d_simple_tex( width, height );
@@ -1430,7 +1430,7 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height )
1430 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); 1430 LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask );
1431 if( image_gl ) 1431 if( image_gl )
1432 { 1432 {
1433 gGL.getTexUnit(0)->bind(image_gl); 1433 gGL.getTexUnit(0)->bind(image_gl, TRUE);
1434 gl_rect_2d_simple_tex( width, height ); 1434 gl_rect_2d_simple_tex( width, height );
1435 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); 1435 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1436 } 1436 }
@@ -1656,7 +1656,7 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4
1656 1656
1657 LLTexUnit::eTextureAddressMode old_mode = image_gl->getAddressMode(); 1657 LLTexUnit::eTextureAddressMode old_mode = image_gl->getAddressMode();
1658 1658
1659 gGL.getTexUnit(0)->bind(image_gl); 1659 gGL.getTexUnit(0)->bind(image_gl, TRUE);
1660 gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); 1660 gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
1661 1661
1662 gl_rect_2d_simple_tex( width, height ); 1662 gl_rect_2d_simple_tex( width, height );
@@ -1678,7 +1678,7 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4
1678 ( (image_gl->getComponents() == 1) && getInfo()->mStaticImageIsMask ) ) 1678 ( (image_gl->getComponents() == 1) && getInfo()->mStaticImageIsMask ) )
1679 { 1679 {
1680 LLGLSNoAlphaTest gls_no_alpha_test; 1680 LLGLSNoAlphaTest gls_no_alpha_test;
1681 gGL.getTexUnit(0)->bind(image_gl); 1681 gGL.getTexUnit(0)->bind(image_gl, TRUE);
1682 gl_rect_2d_simple_tex( width, height ); 1682 gl_rect_2d_simple_tex( width, height );
1683 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); 1683 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1684 } 1684 }
@@ -2146,7 +2146,7 @@ BOOL LLTexLayerParamAlpha::render( S32 x, S32 y, S32 width, S32 height )
2146 } 2146 }
2147 2147
2148 LLGLSNoAlphaTest gls_no_alpha_test; 2148 LLGLSNoAlphaTest gls_no_alpha_test;
2149 gGL.getTexUnit(0)->bind(mCachedProcessedImageGL); 2149 gGL.getTexUnit(0)->bind(mCachedProcessedImageGL, TRUE);
2150 gl_rect_2d_simple_tex( width, height ); 2150 gl_rect_2d_simple_tex( width, height );
2151 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); 2151 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
2152 stop_glerror(); 2152 stop_glerror();