summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-11-21 17:40:12 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-11-21 17:40:12 -0500
commit1dd24cfcf85f4807410bb8d5320a692e2d7e121c (patch)
tree251ed82297a6f3036f9ef7beb07da9f5119bc93d /indra/newview
parentd145cbf37100d50ac6fc15c6009cb496615ed7fb (diff)
SH-2614 FIX, SH-2684 FIX - fixed buggy state management in onPhysicsUseLOD
Diffstat (limited to 'indra/newview')
-rwxr-xr-x[-rw-r--r--]indra/newview/llfloatermodelpreview.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 881f087d7b..49e29e7447 100644..100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -995,38 +995,38 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata)
//static
void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
{
- S32 num_modes = 4;
- S32 which_mode = 3;
- static S32 previous_mode = which_mode;
+ S32 num_lods = 4;
+ S32 which_mode;
LLCtrlSelectionInterface* iface = sInstance->childGetSelectionInterface("physics_lod_combo");
if (iface)
{
which_mode = iface->getFirstSelectedIndex();
}
+ else
+ {
+ llwarns << "no iface" << llendl;
+ return;
+ }
- S32 file_mode = iface->getItemCount() - 1;
- bool file_browse = which_mode == file_mode;
- bool lod_to_file = file_browse && (previous_mode != file_mode);
- bool file_to_lod = !file_browse && (previous_mode == file_mode);
-
- if (!lod_to_file)
+ if (which_mode <= 0)
{
- which_mode = num_modes - which_mode;
- sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
+ llwarns << "which_mode out of range, " << which_mode << llendl;
}
- if (lod_to_file || file_to_lod)
+ S32 file_mode = iface->getItemCount() - 1;
+ if (which_mode < file_mode)
{
- LLModelPreview *model_preview = sInstance->mModelPreview;
- if (model_preview)
- {
- model_preview->refresh();
- model_preview->updateStatusMessages();
- }
+ S32 which_lod = num_lods - which_mode;
+ sInstance->mModelPreview->setPhysicsFromLOD(which_lod);
}
- previous_mode = which_mode;
+ LLModelPreview *model_preview = sInstance->mModelPreview;
+ if (model_preview)
+ {
+ model_preview->refresh();
+ model_preview->updateStatusMessages();
+ }
}
//static