summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llfloatermodelpreview.cpp19
-rw-r--r--indra/newview/skins/default/xui/en/floater_model_preview.xml8
3 files changed, 21 insertions, 8 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 091992d1ab..76cfc03b53 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8053,7 +8053,7 @@
<key>PreviewRenderSize</key>
<map>
<key>Comment</key>
- <string>Resolution of the image rendered for the mesh upload preview</string>
+ <string>Resolution of the image rendered for the mesh upload preview (must be a power of 2)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ffc993e868..62157306b1 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -427,8 +427,23 @@ void LLFloaterModelPreview::initModelPreview()
{
delete mModelPreview;
}
- auto size = gSavedSettings.getS32("PreviewRenderSize");
- mModelPreview = new LLModelPreview(size, size, this );
+
+ S32 tex_width = 512;
+ S32 tex_height = 512;
+
+ S32 max_width = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenWidth);
+ S32 max_height = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenHeight);
+
+ while ((tex_width << 1) <= max_width)
+ {
+ tex_width <<= 1;
+ }
+ while ((tex_height << 1) <= max_height)
+ {
+ tex_height <<= 1;
+ }
+
+ mModelPreview = new LLModelPreview(tex_width, tex_height, this);
mModelPreview->setPreviewTarget(16.f);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index ec9104d5e7..1b038a0244 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1520,7 +1520,6 @@ Analysed:
name="right_panel"
top="0"
left="640"
- background_visible="true"
width="375">
<text
follows="left|top"
@@ -1540,7 +1539,6 @@ Analysed:
name="right_upper_panel"
top="8"
left="60"
- background_visible="true"
width="315">
<combo_box
top_pad="3"
@@ -1616,7 +1614,7 @@ Analysed:
layout="topleft"
left="2"
name="physics_explode_label"
- top="85"
+ bottom_pad="2"
width="150">
Preview Spread:
</text>
@@ -1624,8 +1622,8 @@ Analysed:
name="physics_explode"
follows="right|bottom"
valign="center"
- top="15"
- left="80"
+ left="105"
+ top_delta="-3"
min_val="0.0"
max_val="3.0"
height="20"