Merge viewer-bear

meow-7.2.2
Ansariel 2016-10-01 17:03:57 +02:00
commit 92f6d8d521
8 changed files with 54 additions and 62 deletions

View File

@ -203,6 +203,8 @@ Ansariel Hiller
MAINT-6612
MAINT-6637
MAINT-6636
MAINT-6744
MAINT-6752
Aralara Rajal
Arare Chantilly
CHUIBUG-191

View File

@ -147,7 +147,7 @@ if (WINDOWS)
add_definitions(/WX)
endif (NOT VS_DISABLE_FATAL_WARNINGS)
# configure win32 API for Windows Vista+ compatibility
# configure Win32 API for Windows Vista+ compatibility
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")

View File

@ -2207,15 +2207,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
LLCharacter* character = *char_iter;
// look for an existing instance of this motion
// <FS:ND> FIRE-14972/FIRE-14589 there can be more than just LLKeyframeMotion instances, in which way the c-cast will create
// a pointer to an invalid object. That quickly causes memory corruption.
// LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->findMotion(asset_uuid);
LLKeyframeMotion* motionp = dynamic_cast< LLKeyframeMotion* >( character->findMotion(asset_uuid) );
// </FS:ND>
LLKeyframeMotion* motionp = dynamic_cast<LLKeyframeMotion*> (character->findMotion(asset_uuid));
if (motionp)
{
if (0 == status)

View File

@ -60,27 +60,13 @@
#include <dinput.h>
#include <Dbt.h.>
// culled from winuser.h
#ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */
const S32 WM_MOUSEWHEEL = 0x020A;
#endif
#ifndef WHEEL_DELTA /* Added to be compatible with later SDK's */
const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */
#endif
const S32 MAX_MESSAGE_PER_UPDATE = 20;
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
const F32 ICON_FLASH_TIME = 0.5f;
// <FS:Ansariel> Use default screen DPI defined in WinUser.h
//const F32 DEFAULT_DPI = 96.0f;
const F32 DEFAULT_DPI = F32(USER_DEFAULT_SCREEN_DPI);
// </FS:Ansariel>
#ifndef WM_DPICHANGED
// <FS:Ansariel> Define as per WinUser.h
//const S32 WM_DPICHANGED = 0x02E0;
#ifndef WM_DPICHANGED
#define WM_DPICHANGED 0x02E0
// </FS:Ansariel>
#endif
extern BOOL gDebugWindowProc;
@ -2658,10 +2644,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_DPICHANGED:
{
LPRECT lprc_new_scale;
// <FS:Ansariel> Use constant
//F32 new_scale = LOWORD(w_param) / 96.0f;
F32 new_scale = LOWORD(w_param) / DEFAULT_DPI;
// </FS:Ansariel>
F32 new_scale = LOWORD(w_param) / USER_DEFAULT_SCREEN_DPI;
lprc_new_scale = (LPRECT)l_param;
S32 new_width = lprc_new_scale->right - lprc_new_scale->left;
S32 new_height = lprc_new_scale->bottom - lprc_new_scale->top;
@ -4077,7 +4060,7 @@ F32 LLWindowWin32::getSystemUISize()
hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy);
if (hr == S_OK)
{
scale_value = dpix / DEFAULT_DPI;
scale_value = dpix / USER_DEFAULT_SCREEN_DPI;
}
else
{
@ -4096,7 +4079,7 @@ F32 LLWindowWin32::getSystemUISize()
else
{
LL_WARNS() << "Could not load shcore.dll library (included by <ShellScalingAPI.h> from Win 8.1 SDK). Using legacy DPI awareness API of Win XP/7" << LL_ENDL;
scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / DEFAULT_DPI;
scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI;
}
ReleaseDC(hWnd, hdc);

View File

@ -475,10 +475,7 @@ void LLGroupListItem::setGroupID(const LLUUID& group_id)
void LLGroupListItem::setGroupIconID(const LLUUID& group_icon_id)
{
if (group_icon_id.notNull())
{
mGroupIcon->setIconId(group_icon_id);
}
mGroupIcon->setIconId(group_icon_id);
}
void LLGroupListItem::setGroupIconVisible(bool visible)

View File

@ -41,6 +41,7 @@
#include "lltooltip.h" // positionViewNearMouse()
#include "lltrans.h"
#include "lluictrl.h"
#include "llgroupiconctrl.h"
//////////////////////////////////////////////////////////////////////////////
// LLInspectGroup
@ -233,8 +234,7 @@ void LLInspectGroup::processGroupData()
getChild<LLUICtrl>("group_details")->setValue( LLSD(data->mCharter) );
// LLGroupIconCtrl
getChild<LLUICtrl>("group_icon")->setValue(LLSD(mGroupID));
getChild<LLGroupIconCtrl>("group_icon")->setIconId(data->mInsigniaID);
std::string cost;
bool is_member = LLGroupActions::isInGroup(mGroupID);

View File

@ -99,27 +99,30 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
LLUUID from_id = notification->getPayload()["from_id"];
//Will not play a notification sound for inventory and teleport offer based upon chat preference
// <FS:Ansariel> Notification sounds
//bool playSound = (!notification->isDND()
// && ((notification->getName() == "UserGiveItem"
// && gSavedSettings.getBOOL("PlaySoundInventoryOffer"))
// || (notification->getName() == "TeleportOffered"
// && gSavedSettings.getBOOL("PlaySoundTeleportOffer"))));
const std::string notif_name = notification->getName();
bool playSound = (!notification->isDND()
&& ((notif_name == "UserGiveItem"
if (!notification->isDND())
{
//Will not play a notification sound for inventory and teleport offer based upon chat preference
// <FS:Ansariel> Notification sounds
//bool playSound = (notification->getName() == "UserGiveItem"
// && gSavedSettings.getBOOL("PlaySoundInventoryOffer"))
// || ((notification->getName() == "TeleportOffered"
// || notification->getName() == "TeleportOffered_MaturityExceeded"
// || notification->getName() == "TeleportOffered_MaturityBlocked")
// && gSavedSettings.getBOOL("PlaySoundTeleportOffer"));
const std::string notif_name = notification->getName();
bool playSound = (notif_name == "UserGiveItem"
&& gSavedSettings.getBOOL("PlayModeUISndInventoryOffer"))
|| ((notif_name == "TeleportOffered" || notif_name == "TeleportOffered_SLUrl" ||
notif_name == "TeleportOffered_MaturityExceeded" || notif_name == "TeleportOffered_MaturityExceeded_SLUrl" ||
notif_name == "TeleportOffered_MaturityBlocked" || notif_name == "TeleportOffered_MaturityBlocked_SLUrl")
&& gSavedSettings.getBOOL("PlayModeUISndTeleportOffer"))));
// </FS:Ansariel>
&& gSavedSettings.getBOOL("PlayModeUISndTeleportOffer"));
// </FS:Ansariel>
if(playSound)
{
notification->playSound();
}
if (playSound)
{
notification->playSound();
}
}
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
// Don't spawn an IM session for non-chat related events

View File

@ -272,6 +272,12 @@ static const U8 NO_FACE = 255;
BOOL gQuietSnapshot = FALSE;
const F32 MIN_AFK_TIME = 6.f; // minimum time after setting away state before coming back
// 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;
@ -1666,9 +1672,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)
@ -1829,12 +1842,14 @@ 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)
{
// <FS:Ansariel> BUG-40548: Don't bug user with DPI scaling changed on first run after clean install
//mSystemUIScaleFactorChanged = true;
mSystemUIScaleFactorChanged = !p.first_run;
// </FS:Ansariel>
gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor);
gSavedSettings.setF32("UIScaleFactor", system_scale_factor);
}
@ -1842,7 +1857,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;
@ -5915,7 +5930,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;
@ -5928,7 +5943,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