diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llface.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llviewertexture.cpp | 24 | 
2 files changed, 29 insertions, 5 deletions
| diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index a5b0b05603..b0ae13348b 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -272,12 +272,12 @@ void LLFace::setTexture(LLViewerTexture* tex)  		removeAtlas() ;  	}	 -	mTexture = tex ; - -	if(mTexture.notNull()) +	if(tex)  	{ -		mTexture->addFace(this) ; -	}  +		tex->addFace(this) ; +	} + +	mTexture = tex ;  }  void LLFace::switchTexture(LLViewerTexture* new_texture) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a2f6b70006..9f096209dd 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2348,6 +2348,14 @@ void LLViewerMediaTexture::addFace(LLFace* facep)  			return ;  		}  	} + +	//check if it is a parcel media +	if(facep->getTexture() && facep->getTexture() != this && facep->getTexture()->getID() == mID) +	{ +		mTextureList.push_back(facep->getTexture()) ; //a parcel media. +		return ; +	} +  	llerrs << "The face does not have a valid texture before media texture." << llendl ;  } @@ -2406,6 +2414,18 @@ void LLViewerMediaTexture::removeFace(LLFace* facep)  			}  		}  	} + +	//check if it is a parcel media +	for(std::list< LLPointer<LLViewerTexture> >::iterator iter = mTextureList.begin(); +				iter != mTextureList.end(); ++iter) +	{ +		if((*iter)->getID() == mID) +		{ +			mTextureList.erase(iter) ; //decrease the reference number for tex by one. +			return ; +		} +	} +  	llerrs << "mTextureList texture reference number is corrupted." << llendl ;  } @@ -2442,6 +2462,10 @@ void LLViewerMediaTexture::switchTexture(LLFace* facep)  			if(te)  			{  				LLViewerTexture* tex = gTextureList.findImage(te->getID()) ; +				if(!tex && te->getID() != mID)//try parcel media. +				{ +					tex = gTextureList.findImage(mID) ; +				}  				facep->switchTexture(tex) ;  			}  		} | 
