summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 1148db8b5a..64bdcccd9f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -26,6 +26,10 @@
#include "llviewerprecompiledheaders.h"
+#if LL_MSVC
+#pragma warning (disable : 4263)
+#pragma warning (disable : 4264)
+#endif
#include "dae.h"
//#include "dom.h"
#include "dom/domAsset.h"
@@ -47,6 +51,10 @@
#include "dom/domScale.h"
#include "dom/domTranslate.h"
#include "dom/domVisual_scene.h"
+#if LL_MSVC
+#pragma warning (default : 4263)
+#pragma warning (default : 4264)
+#endif
#include "llfloatermodelpreview.h"
@@ -1006,38 +1014,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