summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7b4d8ef329..9958657246 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -222,7 +222,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mMediaImplList.resize(getNumTEs());
mLastFetchedMediaVersion = -1;
- mIndexInTex = 0;
+ memset(&mIndexInTex, 0, sizeof(S32) * LLRender::NUM_VOLUME_TEXTURE_CHANNELS);
mMDCImplCount = 0;
}
@@ -264,7 +264,11 @@ void LLVOVolume::markDead()
if (mSculptTexture.notNull())
{
- mSculptTexture->removeVolume(this);
+ mSculptTexture->removeVolume(LLRender::SCULPT_TEX, this);
+ }
+ if (hasLightTexture())
+ {
+ getLightTexture()->removeVolume(LLRender::LIGHT_TEX, this);
}
}
@@ -1086,11 +1090,11 @@ void LLVOVolume::updateSculptTexture()
{
if (old_sculpt.notNull())
{
- old_sculpt->removeVolume(this);
+ old_sculpt->removeVolume(LLRender::SCULPT_TEX, this);
}
if (mSculptTexture.notNull())
{
- mSculptTexture->addVolume(this);
+ mSculptTexture->addVolume(LLRender::SCULPT_TEX, this);
}
}
@@ -1200,12 +1204,12 @@ void LLVOVolume::sculpt()
mSculptTexture->updateBindStatsForTester() ;
}
}
- getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
+ getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level, mSculptTexture->isMissingAsset());
//notify rebuild any other VOVolumes that reference this sculpty volume
- for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
+ for (S32 i = 0; i < mSculptTexture->getNumVolumes(LLRender::SCULPT_TEX); ++i)
{
- LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
+ LLVOVolume* volume = (*(mSculptTexture->getVolumeList(LLRender::SCULPT_TEX)))[i];
if (volume != this && volume->getVolume() == getVolume())
{
gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
@@ -2525,7 +2529,9 @@ void LLVOVolume::mediaNavigateBounceBack(U8 texture_index)
LL_WARNS("MediaOnAPrim") << "FAILED to bounce back URL \"" << url << "\" -- unloading impl" << LL_ENDL;
impl->setMediaFailed(true);
}
- else {
+ // Make sure we are not bouncing to url we came from
+ else if (impl->getCurrentMediaURL() != url)
+ {
// Okay, navigate now
LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL;
impl->navigateTo(url, "", false, true);
@@ -2837,23 +2843,30 @@ S32 LLVOVolume::getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S
void LLVOVolume::setLightTextureID(LLUUID id)
{
+ LLViewerTexture* old_texturep = getLightTexture(); // same as mLightTexture, but inits if nessesary
if (id.notNull())
{
if (!hasLightTexture())
{
setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true);
}
+ else
+ {
+ old_texturep->removeVolume(LLRender::LIGHT_TEX, this);
+ }
LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
if (param_block && param_block->getLightTexture() != id)
{
param_block->setLightTexture(id);
parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
}
+ getLightTexture()->addVolume(LLRender::LIGHT_TEX, this); // new texture
}
else
{
if (hasLightTexture())
{
+ old_texturep->removeVolume(LLRender::LIGHT_TEX, this);
setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true);
parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
mLightTexture = NULL;