summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authordavep@billy.gateway.2wire.net <davep@billy.gateway.2wire.net>2010-02-09 12:24:04 -0600
committerdavep@billy.gateway.2wire.net <davep@billy.gateway.2wire.net>2010-02-09 12:24:04 -0600
commit871a40f2f290106f9da58dd4d09cec28fbecb0fa (patch)
treefab5c657732c6da25a4fbcbd837af7389ec283f5 /indra/newview/llviewertexture.cpp
parentd1efc0fd52c0e5dc59951f50435e121305fe9b69 (diff)
parent6d4b4762d1eb0a1431e1793a7254f8cac220062a (diff)
merge
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp63
1 files changed, 62 insertions, 1 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index ebfe7e0df4..a4899c30a1 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -496,7 +496,9 @@ void LLViewerTexture::init(bool firstinit)
mAdditionalDecodePriority = 0.f ;
mParcelMedia = NULL ;
mNumFaces = 0 ;
+ mNumVolumes = 0;
mFaceList.clear() ;
+ mVolumeList.clear();
}
//virtual
@@ -508,7 +510,7 @@ S8 LLViewerTexture::getType() const
void LLViewerTexture::cleanup()
{
mFaceList.clear() ;
-
+ mVolumeList.clear();
if(mGLTexturep)
{
mGLTexturep->cleanup();
@@ -661,6 +663,42 @@ S32 LLViewerTexture::getNumFaces() const
return mNumFaces ;
}
+
+//virtual
+void LLViewerTexture::addVolume(LLVOVolume* volumep)
+{
+ if( mNumVolumes >= mVolumeList.size())
+ {
+ mVolumeList.resize(2 * mNumVolumes + 1) ;
+ }
+ mVolumeList[mNumVolumes] = volumep ;
+ volumep->setIndexInTex(mNumVolumes) ;
+ mNumVolumes++ ;
+ mLastVolumeListUpdateTimer.reset() ;
+}
+
+//virtual
+void LLViewerTexture::removeVolume(LLVOVolume* volumep)
+{
+ if(mNumVolumes > 1)
+ {
+ S32 index = volumep->getIndexInTex() ;
+ mVolumeList[index] = mVolumeList[--mNumVolumes] ;
+ mVolumeList[index]->setIndexInTex(index) ;
+ }
+ else
+ {
+ mVolumeList.clear() ;
+ mNumVolumes = 0 ;
+ }
+ mLastVolumeListUpdateTimer.reset() ;
+}
+
+S32 LLViewerTexture::getNumVolumes() const
+{
+ return mNumVolumes ;
+}
+
void LLViewerTexture::reorganizeFaceList()
{
static const F32 MAX_WAIT_TIME = 20.f; // seconds
@@ -680,6 +718,27 @@ void LLViewerTexture::reorganizeFaceList()
mFaceList.erase(mFaceList.begin() + mNumFaces, mFaceList.end());
}
+void LLViewerTexture::reorganizeVolumeList()
+{
+ static const F32 MAX_WAIT_TIME = 20.f; // seconds
+ static const U32 MAX_EXTRA_BUFFER_SIZE = 4 ;
+
+ if(mNumVolumes + MAX_EXTRA_BUFFER_SIZE > mVolumeList.size())
+ {
+ return ;
+ }
+
+ if(mLastVolumeListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
+ {
+ return ;
+ }
+
+ mLastVolumeListUpdateTimer.reset() ;
+ mVolumeList.erase(mVolumeList.begin() + mNumVolumes, mVolumeList.end());
+}
+
+
+
//virtual
void LLViewerTexture::switchToCachedImage()
{
@@ -1598,6 +1657,7 @@ void LLViewerFetchedTexture::updateVirtualSize()
}
mNeedsResetMaxVirtualSize = TRUE ;
reorganizeFaceList() ;
+ reorganizeVolumeList();
}
bool LLViewerFetchedTexture::updateFetch()
@@ -3252,6 +3312,7 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
mNeedsResetMaxVirtualSize = TRUE ;
reorganizeFaceList() ;
+ reorganizeVolumeList();
return mMaxVirtualSize ;
}