summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2014-08-29 04:59:14 -0700
committerGraham Linden <graham@lindenlab.com>2014-08-29 04:59:14 -0700
commitda5bd17afd1b78fbd41b247986567204d9470275 (patch)
tree2d6f6087e3fa8a8e4609719907c6e08db7c5fc92 /indra/newview
parent3501487bfc9463bf2b732d790819bc2938816287 (diff)
Fix issue with double-addition of LOD/PHYS modifiers in some codepaths
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 685048ace7..52f9f5af66 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1397,13 +1397,19 @@ void LLModelPreview::rebuildUploadData()
std::string name_to_match = instance.mLabel;
llassert(!name_to_match.empty());
+ std::string toAdd;
switch (i)
{
- case LLModel::LOD_IMPOSTOR: name_to_match += "_LOD0"; break;
- case LLModel::LOD_LOW: name_to_match += "_LOD1"; break;
- case LLModel::LOD_MEDIUM: name_to_match += "_LOD2"; break;
- case LLModel::LOD_PHYSICS: name_to_match += "_PHYS"; break;
- case LLModel::LOD_HIGH: break;
+ case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break;
+ case LLModel::LOD_LOW: toAdd = "_LOD1"; break;
+ case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break;
+ case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break;
+ case LLModel::LOD_HIGH: break;
+ }
+
+ if (name_to_match.find(toAdd) == -1)
+ {
+ name_to_match += toAdd;
}
FindModel(mScene[i], name_to_match, lod_model, transform);
@@ -1441,13 +1447,19 @@ void LLModelPreview::rebuildUploadData()
std::string name_to_match = instance.mLabel;
llassert(!name_to_match.empty());
+ std::string toAdd;
switch (searchLOD)
{
- case LLModel::LOD_IMPOSTOR: name_to_match += "_LOD0"; break;
- case LLModel::LOD_LOW: name_to_match += "_LOD1"; break;
- case LLModel::LOD_MEDIUM: name_to_match += "_LOD2"; break;
- case LLModel::LOD_PHYSICS: name_to_match += "_PHYS"; break;
- case LLModel::LOD_HIGH: break;
+ case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break;
+ case LLModel::LOD_LOW: toAdd = "_LOD1"; break;
+ case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break;
+ case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break;
+ case LLModel::LOD_HIGH: break;
+ }
+
+ if (name_to_match.find(toAdd) == -1)
+ {
+ name_to_match += toAdd;
}
// See if we can find an appropriately named model in LOD 'searchLOD'