summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-09-22 15:59:00 -0500
committerDave Parks <davep@lindenlab.com>2010-09-22 15:59:00 -0500
commita5fc11ea21ad8ac9bf6a4be97c16fe977db40175 (patch)
tree3644c34d3732649f72a1ec94536f56663395b9b9 /indra/newview/llfloatermodelpreview.cpp
parent6d8e9cd8bde57bd033beeb9610f7094c19655ed1 (diff)
parent7b44a8ee8de662355c8f5c8091ab25dccce494e5 (diff)
merge
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 088c9e6546..8be56009aa 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1989,13 +1989,13 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
if (lod == 3 && !mGroup.empty())
{
- for (std::map<LLModel*, U32>::iterator iter = mGroup.begin(); iter != mGroup.end(); ++iter)
+ for (std::map<LLPointer<LLModel>, U32>::iterator iter = mGroup.begin(); iter != mGroup.end(); ++iter)
{
glodDeleteGroup(iter->second);
stop_gloderror();
}
- for (std::map<LLModel*, U32>::iterator iter = mObject.begin(); iter != mObject.end(); ++iter)
+ for (std::map<LLPointer<LLModel>, U32>::iterator iter = mObject.begin(); iter != mObject.end(); ++iter)
{
glodDeleteObject(iter->second);
stop_gloderror();
@@ -2055,6 +2055,11 @@ void LLModelPreview::loadModelCallback(S32 lod)
mScene[lod] = mModelLoader->mScene;
mVertexBuffer[lod].clear();
+ if (lod == LLModel::LOD_PHYSICS)
+ {
+ mPhysicsMesh.clear();
+ }
+
setPreviewLOD(lod);
@@ -2338,6 +2343,11 @@ void LLModelPreview::genLODs(S32 which_lod)
return;
}
+ if (which_lod == LLModel::LOD_PHYSICS)
+ { //clear physics mesh map
+ mPhysicsMesh.clear();
+ }
+
LLVertexBuffer::unbind();
stop_gloderror();
@@ -2365,6 +2375,14 @@ void LLModelPreview::genLODs(S32 which_lod)
U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
+ if (mGroup[mBaseModel[0]] == 0)
+ { //clear LOD maps
+ mGroup.clear();
+ mObject.clear();
+ mPercentage.clear();
+ mPatch.clear();
+ }
+
for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter)
{ //build GLOD objects for each model in base model list
LLModel* mdl = *iter;
@@ -3118,7 +3136,7 @@ BOOL LLModelPreview::render()
{
LLMutexLock(decomp->mMutex);
- std::map<LLModel*, std::vector<LLPointer<LLVertexBuffer> > >::iterator iter =
+ std::map<LLPointer<LLModel>, std::vector<LLPointer<LLVertexBuffer> > >::iterator iter =
mPhysicsMesh.find(model);
if (iter != mPhysicsMesh.end())
{
@@ -3406,7 +3424,7 @@ void LLFloaterModelPreview::onDecompose(void* user_data)
void LLFloaterModelPreview::onModelDecompositionComplete(LLModel* model, std::vector<LLPointer<LLVertexBuffer> >& physics_mesh)
{
if (sInstance && sInstance->mModelPreview)
- {
+ {
sInstance->mModelPreview->mPhysicsMesh[model] = physics_mesh;
sInstance->mModelPreview->mDirty = true;