diff options
author | Rider Linden <rider@lindenlab.com> | 2018-05-22 13:16:37 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-05-22 13:16:37 -0700 |
commit | 3888de9439c20eb1698e16fb878a47d78cfdf85e (patch) | |
tree | 1d0b9b739f1429f1387934ce7c6a92cd61f1a857 /indra/newview/lllocalbitmaps.cpp | |
parent | 656967b326c59a3966261cd75e256e3a7a27cc0a (diff) | |
parent | c70119ebabc4b06e2b0db02aea8c56e01fbc666e (diff) |
Merge
Diffstat (limited to 'indra/newview/lllocalbitmaps.cpp')
-rw-r--r-- | indra/newview/lllocalbitmaps.cpp | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index a55938f334..760325b652 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -358,8 +358,9 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) updateUserPrims(old_id, new_id, LLRender::DIFFUSE_MAP); updateUserPrims(old_id, new_id, LLRender::NORMAL_MAP); updateUserPrims(old_id, new_id, LLRender::SPECULAR_MAP); - - updateUserSculpts(old_id, new_id); // isn't there supposed to be an IMG_DEFAULT_SCULPT or something? + + updateUserVolumes(old_id, new_id, LLRender::LIGHT_TEX); + updateUserVolumes(old_id, new_id, LLRender::SCULPT_TEX); // isn't there supposed to be an IMG_DEFAULT_SCULPT or something? // default safeguard image for layers if( new_id == IMG_DEFAULT ) @@ -502,26 +503,39 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id, U32 channel) } } } - } -void LLLocalBitmap::updateUserSculpts(LLUUID old_id, LLUUID new_id) +void LLLocalBitmap::updateUserVolumes(LLUUID old_id, LLUUID new_id, U32 channel) { LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_STANDARD); - for(U32 volume_iter = 0; volume_iter < old_texture->getNumVolumes(); volume_iter++) + for (U32 volume_iter = 0; volume_iter < old_texture->getNumVolumes(channel); volume_iter++) { - LLVOVolume* volume_to_object = (*old_texture->getVolumeList())[volume_iter]; - LLViewerObject* object = (LLViewerObject*)volume_to_object; - - if(object) + LLVOVolume* volobjp = (*old_texture->getVolumeList(channel))[volume_iter]; + switch (channel) { - if (object->isSculpted() && object->getVolume() && - object->getVolume()->getParams().getSculptID() == old_id) + case LLRender::LIGHT_TEX: + { + if (volobjp->getLightTextureID() == old_id) + { + volobjp->setLightTextureID(new_id); + } + break; + } + case LLRender::SCULPT_TEX: { - LLSculptParams* old_params = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLSculptParams new_params(*old_params); - new_params.setSculptTexture(new_id, (*old_params).getSculptType()); - object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, new_params, TRUE); + LLViewerObject* object = (LLViewerObject*)volobjp; + + if (object) + { + if (object->isSculpted() && object->getVolume() && + object->getVolume()->getParams().getSculptID() == old_id) + { + LLSculptParams* old_params = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLSculptParams new_params(*old_params); + new_params.setSculptTexture(new_id, (*old_params).getSculptType()); + object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, new_params, TRUE); + } + } } } } |