From c2ddcfae49bb1b4794facd64de1c2ac62fdb5715 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 12 Oct 2009 05:32:52 +0000 Subject: fix for EXT-1328: Alpha textures are not displayed correctly when first loaded. to be reviewed by davep. --- indra/newview/llface.cpp | 7 ++++++- indra/newview/llface.h | 1 + indra/newview/llviewertexture.cpp | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b0ae13348b..4246cbc27f 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -280,6 +280,11 @@ void LLFace::setTexture(LLViewerTexture* tex) mTexture = tex ; } +void LLFace::dirtyTexture() +{ + gPipeline.markTextured(getDrawable()); +} + void LLFace::switchTexture(LLViewerTexture* new_texture) { if(mTexture == new_texture) @@ -295,7 +300,7 @@ void LLFace::switchTexture(LLViewerTexture* new_texture) getViewerObject()->changeTEImage(mTEOffset, new_texture) ; setTexture(new_texture) ; - gPipeline.markTextured(getDrawable()); + dirtyTexture(); } void LLFace::setTEOffset(const S32 te_offset) diff --git a/indra/newview/llface.h b/indra/newview/llface.h index f6ffefcb7c..d734b327d9 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -90,6 +90,7 @@ public: U16 getGeomStart() const { return mGeomIndex; } // index into draw pool void setTexture(LLViewerTexture* tex) ; void switchTexture(LLViewerTexture* new_texture); + void dirtyTexture(); LLXformMatrix* getXform() const { return mXform; } BOOL hasGeometry() const { return mGeomCount > 0; } LLVector3 getPositionAgent() const; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9f096209dd..a0ab4cb1e6 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1315,7 +1315,10 @@ bool LLViewerFetchedTexture::updateFetch() mComponents = mRawImage->getComponents(); mGLTexturep->setComponents(mComponents) ; - gTextureList.dirtyImage(this); + for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) + { + (*iter)->dirtyTexture() ; + } } mIsRawImageValid = TRUE; gTextureList.mCreateTextureList.insert(this); -- cgit v1.2.3