summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-02-27 15:49:15 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-02-27 15:49:15 +0200
commitd9064d3a4e83a44c518851643993b0b79ac33e13 (patch)
tree5e214b16e161dbd485229b7fafcbf8c66a005f67 /indra/newview/llviewertexture.cpp
parent4c869a97c558c0fa5759b6cf2f560c26a89a09b2 (diff)
MAINT-8317 Fixed Local Textures for Advanced Lighting Projectors do not keep the selected texture.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp56
1 files changed, 33 insertions, 23 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index e5a1bed48c..2ad6198abd 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -651,14 +651,16 @@ void LLViewerTexture::init(bool firstinit)
mAdditionalDecodePriority = 0.f;
mParcelMedia = NULL;
- mNumVolumes = 0;
+ memset(&mNumVolumes, 0, sizeof(U32)* LLRender::NUM_VOLUME_TEXTURE_CHANNELS);
mFaceList[LLRender::DIFFUSE_MAP].clear();
mFaceList[LLRender::NORMAL_MAP].clear();
mFaceList[LLRender::SPECULAR_MAP].clear();
mNumFaces[LLRender::DIFFUSE_MAP] =
mNumFaces[LLRender::NORMAL_MAP] =
mNumFaces[LLRender::SPECULAR_MAP] = 0;
- mVolumeList.clear();
+
+ mVolumeList[LLRender::LIGHT_TEX].clear();
+ mVolumeList[LLRender::SCULPT_TEX].clear();
}
//virtual
@@ -674,7 +676,8 @@ void LLViewerTexture::cleanup()
mFaceList[LLRender::DIFFUSE_MAP].clear();
mFaceList[LLRender::NORMAL_MAP].clear();
mFaceList[LLRender::SPECULAR_MAP].clear();
- mVolumeList.clear();
+ mVolumeList[LLRender::LIGHT_TEX].clear();
+ mVolumeList[LLRender::SCULPT_TEX].clear();
}
void LLViewerTexture::notifyAboutCreatingTexture()
@@ -891,40 +894,40 @@ S32 LLViewerTexture::getNumFaces(U32 ch) const
//virtual
-void LLViewerTexture::addVolume(LLVOVolume* volumep)
+void LLViewerTexture::addVolume(U32 ch, LLVOVolume* volumep)
{
- if( mNumVolumes >= mVolumeList.size())
+ if (mNumVolumes[ch] >= mVolumeList[ch].size())
{
- mVolumeList.resize(2 * mNumVolumes + 1);
+ mVolumeList[ch].resize(2 * mNumVolumes[ch] + 1);
}
- mVolumeList[mNumVolumes] = volumep;
- volumep->setIndexInTex(mNumVolumes);
- mNumVolumes++;
+ mVolumeList[ch][mNumVolumes[ch]] = volumep;
+ volumep->setIndexInTex(ch, mNumVolumes[ch]);
+ mNumVolumes[ch]++;
mLastVolumeListUpdateTimer.reset();
}
//virtual
-void LLViewerTexture::removeVolume(LLVOVolume* volumep)
+void LLViewerTexture::removeVolume(U32 ch, LLVOVolume* volumep)
{
- if(mNumVolumes > 1)
+ if (mNumVolumes[ch] > 1)
{
- S32 index = volumep->getIndexInTex();
- llassert(index < mVolumeList.size());
- llassert(index < mNumVolumes);
- mVolumeList[index] = mVolumeList[--mNumVolumes];
- mVolumeList[index]->setIndexInTex(index);
+ S32 index = volumep->getIndexInTex(ch);
+ llassert(index < mVolumeList[ch].size());
+ llassert(index < mNumVolumes[ch]);
+ mVolumeList[ch][index] = mVolumeList[ch][--mNumVolumes[ch]];
+ mVolumeList[ch][index]->setIndexInTex(ch, index);
}
else
{
- mVolumeList.clear();
- mNumVolumes = 0;
+ mVolumeList[ch].clear();
+ mNumVolumes[ch] = 0;
}
mLastVolumeListUpdateTimer.reset();
}
-S32 LLViewerTexture::getNumVolumes() const
+S32 LLViewerTexture::getNumVolumes(U32 ch) const
{
- return mNumVolumes;
+ return mNumVolumes[ch];
}
void LLViewerTexture::reorganizeFaceList()
@@ -955,9 +958,13 @@ 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())
+
+ for (U32 i = 0; i < LLRender::NUM_VOLUME_TEXTURE_CHANNELS; ++i)
{
- return;
+ if (mNumVolumes[i] + MAX_EXTRA_BUFFER_SIZE > mVolumeList[i].size())
+ {
+ return;
+ }
}
if(mLastVolumeListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
@@ -966,7 +973,10 @@ void LLViewerTexture::reorganizeVolumeList()
}
mLastVolumeListUpdateTimer.reset();
- mVolumeList.erase(mVolumeList.begin() + mNumVolumes, mVolumeList.end());
+ for (U32 i = 0; i < LLRender::NUM_VOLUME_TEXTURE_CHANNELS; ++i)
+ {
+ mVolumeList[i].erase(mVolumeList[i].begin() + mNumVolumes[i], mVolumeList[i].end());
+ }
}
//virtual