summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-02-05 11:19:14 -0600
committerDave Parks <davep@lindenlab.com>2010-02-05 11:19:14 -0600
commit43ca4e104b613c95a1147751122f7ff007542e5c (patch)
tree62af085abb58aff625a806ef5edfd2c894daee93 /indra/newview/llvovolume.cpp
parent92e07a0c5eb97ea4f839eaf824699d403ac56c6d (diff)
EXT-4209 Fix for sculptie prims not updating geometry when texture is loaded.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp73
1 files changed, 55 insertions, 18 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3cdf485d7d..25ed931fb5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -192,6 +192,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mMediaImplList.resize(getNumTEs());
mLastFetchedMediaVersion = -1;
+ mIndexInTex = 0;
}
LLVOVolume::~LLVOVolume()
@@ -226,6 +227,11 @@ void LLVOVolume::markDead()
{
removeMediaImpl(i);
}
+
+ if (mSculptTexture.notNull())
+ {
+ mSculptTexture->removeVolume(this);
+ }
}
LLViewerObject::markDead();
@@ -740,7 +746,9 @@ void LLVOVolume::updateTextureVirtualSize()
{
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID id = sculpt_params->getSculptTexture();
- mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+
+ updateSculptTexture();
+
if (mSculptTexture.notNull())
{
mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
@@ -929,35 +937,53 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
{
mVolumeImpl->onSetVolume(volume_params, detail);
}
-
+
+ updateSculptTexture();
+
if (isSculpted())
{
- mSculptTexture = LLViewerTextureManager::getFetchedTexture(volume_params.getSculptID(), TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ updateSculptTexture();
+
if (mSculptTexture.notNull())
{
- //ignore sculpt GL usage since bao fixed this in a separate branch
- if (!gGLActive)
- {
- gGLActive = TRUE;
- sculpt();
- gGLActive = FALSE;
- }
- else
- {
- sculpt();
- }
+ sculpt();
}
}
- else
- {
- mSculptTexture = NULL;
- }
return TRUE;
}
return FALSE;
}
+void LLVOVolume::updateSculptTexture()
+{
+ LLPointer<LLViewerFetchedTexture> old_sculpt = mSculptTexture;
+
+ if (isSculpted())
+ {
+ LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+ LLUUID id = sculpt_params->getSculptTexture();
+ mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ }
+ else
+ {
+ mSculptTexture = NULL;
+ }
+
+ if (mSculptTexture != old_sculpt)
+ {
+ if (old_sculpt.notNull())
+ {
+ old_sculpt->removeVolume(this);
+ }
+ if (mSculptTexture.notNull())
+ {
+ mSculptTexture->addVolume(this);
+ }
+ }
+
+}
+
// sculpt replaces generate() for sculpted surfaces
void LLVOVolume::sculpt()
{
@@ -1021,6 +1047,17 @@ void LLVOVolume::sculpt()
}
}
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
+
+ //notify rebuild any other VOVolumes that reference this sculpty volume
+ for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
+ {
+ LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
+ if (volume != this && volume->getVolume() == getVolume())
+ {
+ gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
+ volume->mSculptChanged = TRUE;
+ }
+ }
}
}