summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-01-11 17:39:26 +0200
committermaxim_productengine <mnikolenko@productengine.com>2019-01-11 17:39:26 +0200
commit9c8584a3a7562810c83dd5e2d02e42e6d6870d96 (patch)
tree0f0273ac1893dfcf070f6321064caf75b71bfdbe /indra/newview/llfloatermodelpreview.cpp
parentc42202804cdc3242886615e2dcf9e9d15ec64218 (diff)
SL-10327 FIXED Scalable preview of mesh model is shown with black bar on top in the Upload Model menu
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index c86eed2192..2cc42460a5 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));