summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-10-07 21:11:47 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-10-07 21:11:47 +0300
commitd66cd019b30ec6ab519fa0ea0c76c1beb99be74c (patch)
tree86d78b577080eb4dd29575f487776bde13914de7
parent752613c433751ca90e13a1d3c77e8df55308e246 (diff)
parent5dd97bc2bd4924b0342068e697b5d45165225b76 (diff)
Merged in lindenlab/viewer-bear
-rw-r--r--indra/llrender/llimagegl.cpp19
-rw-r--r--indra/llrender/llimagegl.h2
-rw-r--r--indra/newview/llappearancemgr.cpp6
-rw-r--r--indra/newview/llfloatersnapshot.cpp2
-rw-r--r--indra/newview/llmoveview.cpp12
-rw-r--r--indra/newview/llmoveview.h2
-rw-r--r--indra/newview/lltexturecache.cpp6
-rw-r--r--indra/newview/llviewermenufile.cpp8
-rw-r--r--indra/newview/llviewermessage.cpp5
-rw-r--r--indra/newview/llviewerwindow.cpp29
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
11 files changed, 65 insertions, 27 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index ebed454271..81a5537f78 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -487,14 +487,15 @@ bool LLImageGL::checkSize(S32 width, S32 height)
return check_power_of_two(width) && check_power_of_two(height);
}
-void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level)
+bool LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level)
{
if (width != mWidth || height != mHeight || ncomponents != mComponents)
{
// Check if dimensions are a power of two!
if (!checkSize(width,height))
{
- LL_ERRS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << LL_ENDL;
+ LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << LL_ENDL;
+ return false;
}
if (mTexName)
@@ -529,6 +530,8 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
mMaxDiscardLevel = MAX_DISCARD_LEVEL;
}
}
+
+ return true;
}
//----------------------------------------------------------------------------
@@ -909,7 +912,11 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
S32 h = raw_image->getHeight() << discard_level;
// setSize may call destroyGLTexture if the size does not match
- setSize(w, h, raw_image->getComponents(), discard_level);
+ if (!setSize(w, h, raw_image->getComponents(), discard_level))
+ {
+ LL_WARNS() << "Trying to create a texture with incorrect dimensions!" << LL_ENDL;
+ return FALSE;
+ }
if( !mHasExplicitFormat )
{
@@ -1273,7 +1280,11 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
S32 h = raw_h << discard_level;
// setSize may call destroyGLTexture if the size does not match
- setSize(w, h, imageraw->getComponents(), discard_level);
+ if (!setSize(w, h, imageraw->getComponents(), discard_level))
+ {
+ LL_WARNS() << "Trying to create a texture with incorrect dimensions!" << LL_ENDL;
+ return FALSE;
+ }
if( !mHasExplicitFormat )
{
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 21982eab1d..ad2aea9067 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -94,7 +94,7 @@ protected:
public:
virtual void dump(); // debugging info to LL_INFOS()
- void setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level = -1);
+ bool setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level = -1);
void setComponents(S32 ncomponents) { mComponents = (S8)ncomponents ;}
void setAllowCompression(bool allow) { mAllowCompression = allow; }
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 252e2f5dec..92e3cd0279 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3477,13 +3477,13 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
}
else
{
- if (cofVersion < lastRcv)
+ if (cofVersion <= lastRcv)
{
LL_WARNS("Avatar") << "Have already received update for cof version " << lastRcv
<< " but requesting for " << cofVersion << LL_ENDL;
return;
}
- if (lastReq > cofVersion)
+ if (lastReq >= cofVersion)
{
LL_WARNS("Avatar") << "Request already in flight for cof version " << lastReq
<< " but requesting for " << cofVersion << LL_ENDL;
@@ -3503,7 +3503,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
LL_WARNS("Avatar") << "Forcing version failure on COF Baking" << LL_ENDL;
}
- LL_INFOS() << "Requesting bake for COF version " << cofVersion << LL_ENDL;
+ LL_INFOS("Avatar") << "Requesting bake for COF version " << cofVersion << LL_ENDL;
LLSD postData;
if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate"))
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index ff7594a531..b5ba64716d 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1375,7 +1375,7 @@ const LLVector3d& LLFloaterSnapshotBase::getPosTakenGlobal()
// static
void LLFloaterSnapshot::setAgentEmail(const std::string& email)
{
- LLFloaterSnapshot* instance = getInstance();
+ LLFloaterSnapshot* instance = findInstance();
if (instance)
{
LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container");
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 70035bcc74..c3dd08c327 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -252,7 +252,7 @@ void LLFloaterMove::setSittingMode(BOOL bSitting)
LLPanelStandStopFlying::setStandStopFlyingMode(LLPanelStandStopFlying::SSFM_STOP_FLYING);
}
}
- enableInstance(!bSitting);
+ enableInstance();
}
// protected
@@ -459,7 +459,7 @@ void LLFloaterMove::showModeButtons(BOOL bShow)
}
//static
-void LLFloaterMove::enableInstance(BOOL bEnable)
+void LLFloaterMove::enableInstance()
{
LLFloaterMove* instance = LLFloaterReg::findTypedInstance<LLFloaterMove>("moveview");
if (instance)
@@ -470,7 +470,7 @@ void LLFloaterMove::enableInstance(BOOL bEnable)
}
else
{
- instance->showModeButtons(bEnable);
+ instance->showModeButtons(isAgentAvatarValid() && !gAgentAvatarp->isSitting());
}
}
}
@@ -566,7 +566,7 @@ BOOL LLPanelStandStopFlying::postBuild()
{
mStandButton = getChild<LLButton>("stand_btn");
mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this));
- mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE));
+ mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance));
mStandButton->setVisible(FALSE);
LLHints::registerHintTarget("stand_btn", mStandButton->getHandle());
@@ -685,8 +685,7 @@ void LLPanelStandStopFlying::onStandButtonClick()
LLSelectMgr::getInstance()->deselectAllForStandingUp();
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
- setFocus(FALSE); // EXT-482
- mStandButton->setVisible(FALSE); // force visibility changing to avoid seeing Stand & Move buttons at once.
+ setFocus(FALSE);
}
void LLPanelStandStopFlying::onStopFlyingButtonClick()
@@ -694,7 +693,6 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick()
gAgent.setFlying(FALSE);
setFocus(FALSE); // EXT-482
- mStopFlyingButton->setVisible(FALSE);
}
/**
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index c525d9dfdb..4a31f2a814 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -56,7 +56,7 @@ public:
static void setAlwaysRunMode(bool run);
void setAlwaysRunModeImpl(bool run);
static void setSittingMode(BOOL bSitting);
- static void enableInstance(BOOL bEnable);
+ static void enableInstance();
/*virtual*/ void onOpen(const LLSD& key);
static void sUpdateFlyingStatus();
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 37cc908e84..36c4f0d516 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1928,6 +1928,12 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis
{
//make a duplicate to keep the original raw image untouched.
raw = raw->duplicate();
+ if (raw->isBufferInvalid())
+ {
+ LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL;
+ return false;
+ }
+
raw->scale(w, h) ;
discardlevel += i ;
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 54b12cae12..b48b45502b 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -508,8 +508,8 @@ class LLFileEnableCloseAllWindows : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::getInstance();
- LLFloaterOutfitSnapshot* floater_outfit_snapshot = LLFloaterOutfitSnapshot::getInstance();
+ LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance();
+ LLFloaterOutfitSnapshot* floater_outfit_snapshot = LLFloaterOutfitSnapshot::findInstance();
bool is_floaters_snapshot_opened = (floater_snapshot && floater_snapshot->isInVisibleChain())
|| (floater_outfit_snapshot && floater_outfit_snapshot->isInVisibleChain());
bool open_children = gFloaterView->allChildrenClosed() && !is_floaters_snapshot_opened;
@@ -523,10 +523,10 @@ class LLFileCloseAllWindows : public view_listener_t
{
bool app_quitting = false;
gFloaterView->closeAllChildren(app_quitting);
- LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::getInstance();
+ LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance();
if (floater_snapshot)
floater_snapshot->closeFloater(app_quitting);
- LLFloaterOutfitSnapshot* floater_outfit_snapshot = LLFloaterOutfitSnapshot::getInstance();
+ LLFloaterOutfitSnapshot* floater_outfit_snapshot = LLFloaterOutfitSnapshot::findInstance();
if (floater_outfit_snapshot)
floater_outfit_snapshot->closeFloater(app_quitting);
if (gMenuHolder) gMenuHolder->hideMenus();
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 1a220a07b9..f27b77e2f1 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6611,6 +6611,11 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
if (("ScriptTakeMoney" == script_perm.question) && has_not_only_debit)
continue;
+ if (script_perm.question == "JoinAnExperience")
+ { // Some experience only permissions do not have an explicit permission bit. Add them here.
+ script_question += " " + LLTrans::getString("ForceSitAvatar") + "\n";
+ }
+
script_question += " " + LLTrans::getString(script_perm.question) + "\n";
}
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 9679f69e2c..4f4b33fa8c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -251,6 +251,11 @@ BOOL gDisplayBadge = FALSE;
static const U8 NO_FACE = 255;
BOOL gQuietSnapshot = FALSE;
+// Minimum value for UIScaleFactor, also defined in preferences, ui_scale_slider
+static const F32 MIN_UI_SCALE = 0.75f;
+// 2.0 in preferences, but win10 supports larger scaling and value is used more as
+// sanity check, so leaving space for larger values from DPI updates.
+static const F32 MAX_UI_SCALE = 7.0f;
static const F32 MIN_DISPLAY_SCALE = 0.75f;
std::string LLViewerWindow::sSnapshotBaseName;
@@ -1595,9 +1600,16 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window)
void LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height)
{
- gSavedSettings.setF32("UIScaleFactor", ui_scale_factor);
- LLViewerWindow::reshape(window_width, window_height);
- mResDirty = true;
+ if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE)
+ {
+ gSavedSettings.setF32("UIScaleFactor", ui_scale_factor);
+ LLViewerWindow::reshape(window_width, window_height);
+ mResDirty = true;
+ }
+ else
+ {
+ LL_WARNS() << "DPI change caused UI scale to go out of bounds: " << ui_scale_factor << LL_ENDL;
+ }
}
void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg)
@@ -1753,6 +1765,11 @@ LLViewerWindow::LLViewerWindow(const Params& p)
F32 system_scale_factor = mWindow->getSystemUISize();
+ if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE)
+ {
+ // reset to default;
+ system_scale_factor = 1.f;
+ }
if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor)
{
mSystemUIScaleFactorChanged = !p.first_run;
@@ -1763,7 +1780,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
// Get the real window rect the window was created with (since there are various OS-dependent reasons why
// the size of a window or fullscreen context may have been adjusted slightly...)
- F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor");
+ F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE);
mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f));
mDisplayScale *= ui_scale_factor;
@@ -5251,7 +5268,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const
void LLViewerWindow::calcDisplayScale()
{
- F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor");
+ F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE);
LLVector2 display_scale;
display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f));
display_scale *= ui_scale_factor;
@@ -5264,7 +5281,7 @@ void LLViewerWindow::calcDisplayScale()
if (display_scale != mDisplayScale)
{
- LL_INFOS() << "Setting display scale to " << display_scale << LL_ENDL;
+ LL_INFOS() << "Setting display scale to " << display_scale << " for ui scale: " << ui_scale_factor << LL_ENDL;
mDisplayScale = display_scale;
// Init default fonts
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 6fedf83bed..e6901b23f3 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -499,6 +499,7 @@ Please try logging in again in a minute.</string>
<string name="TeleportYourAgent">Teleport you</string>
<string name="ManageEstateSilently">Manage your estates silently</string>
<string name="ChangeYourDefaultAnimations">Change your default animations</string>
+ <string name="ForceSitAvatar">Force your avatar to sit</string>
<string name="NotConnected">Not Connected</string>
<string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name -->