summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp690
1 files changed, 365 insertions, 325 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index a0b0fabb66..275164b698 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -224,19 +224,19 @@
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
void swap();
-extern BOOL gDebugClicks;
-extern BOOL gDisplaySwapBuffers;
-extern BOOL gDepthDirty;
-extern BOOL gResizeScreenTexture;
-extern BOOL gCubeSnapshot;
-extern BOOL gSnapshotNoPost;
+extern bool gDebugClicks;
+extern bool gDisplaySwapBuffers;
+extern bool gDepthDirty;
+extern bool gResizeScreenTexture;
+extern bool gCubeSnapshot;
+extern bool gSnapshotNoPost;
LLViewerWindow *gViewerWindow = NULL;
LLFrameTimer gAwayTimer;
LLFrameTimer gAwayTriggerTimer;
-BOOL gShowOverlayTitle = FALSE;
+bool gShowOverlayTitle = false;
LLViewerObject* gDebugRaycastObject = NULL;
LLVOPartGroup* gDebugRaycastParticle = NULL;
@@ -252,13 +252,13 @@ LLVector4a gDebugRaycastStart;
LLVector4a gDebugRaycastEnd;
// HUD display lines in lower right
-BOOL gDisplayWindInfo = FALSE;
-BOOL gDisplayCameraPos = FALSE;
-BOOL gDisplayFOV = FALSE;
-BOOL gDisplayBadge = FALSE;
+bool gDisplayWindInfo = false;
+bool gDisplayCameraPos = false;
+bool gDisplayFOV = false;
+bool gDisplayBadge = false;
static const U8 NO_FACE = 255;
-BOOL gQuietSnapshot = FALSE;
+bool gQuietSnapshot = false;
// Minimum value for UIScaleFactor, also defined in preferences, ui_scale_slider
static const F32 MIN_UI_SCALE = 0.75f;
@@ -293,7 +293,7 @@ public:
// chat.mText = message;
// chat.mSourceType = CHAT_SOURCE_SYSTEM;
- // chat_floater->addChat(chat, FALSE, FALSE);
+ // chat_floater->addChat(chat, false, false);
//}
//}
}
@@ -998,7 +998,7 @@ void LLViewerWindow::handlePieMenu(S32 x, S32 y, MASK mask)
}
}
-BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down, bool& is_toolmgr_action)
+bool LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, bool down, bool& is_toolmgr_action)
{
const char* buttonname = "";
const char* buttonstatestr = "";
@@ -1090,7 +1090,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << LL_ENDL;
}
- BOOL r = mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down);
+ bool r = mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down);
if (r) {
LL_DEBUGS() << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << LL_ENDL;
@@ -1102,7 +1102,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
else if (down && clicktype == CLICK_RIGHT)
{
handlePieMenu(x, y, mask);
- r = TRUE;
+ r = true;
}
return r;
}
@@ -1110,11 +1110,11 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
// Mark the click as handled and return if we aren't within the root view to avoid spurious bugs
if( !mRootView->pointInView(x, y) )
{
- return TRUE;
+ return true;
}
// Give the UI views a chance to process the click
- BOOL r= mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ;
+ bool r= mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ;
if (r)
{
@@ -1136,7 +1136,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
{
LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui() << LL_ENDL;
}
- return TRUE;
+ return true;
} else if (LLView::sDebugMouseHandling)
{
LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " not handled by view" << LL_ENDL;
@@ -1148,24 +1148,24 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
{
LLViewerEventRecorder::instance().clear_xui();
is_toolmgr_action = true;
- return TRUE;
+ return true;
}
if (down && clicktype == CLICK_RIGHT)
{
handlePieMenu(x, y, mask);
- return TRUE;
+ return true;
}
// If we got this far on a down-click, it wasn't handled.
// Up-clicks, though, are always handled as far as the OS is concerned.
- BOOL default_rtn = !down;
+ bool default_rtn = !down;
return default_rtn;
}
-BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
{
- mAllowMouseDragging = FALSE;
+ mAllowMouseDragging = false;
if (!mMouseDownTimer.getStarted())
{
mMouseDownTimer.start();
@@ -1174,51 +1174,51 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
{
mMouseDownTimer.reset();
}
- BOOL down = TRUE;
+ bool down = true;
//handleMouse() loops back to LLViewerWindow::handleAnyMouseClick
return gViewerInput.handleMouse(window, pos, mask, CLICK_LEFT, down);
}
-BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask)
{
// try handling as a double-click first, then a single-click if that
// wasn't handled.
- BOOL down = TRUE;
+ bool down = true;
if (gViewerInput.handleMouse(window, pos, mask, CLICK_DOUBLELEFT, down))
{
- return TRUE;
+ return true;
}
return handleMouseDown(window, pos, mask);
}
-BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
if (mMouseDownTimer.getStarted())
{
mMouseDownTimer.stop();
}
- BOOL down = FALSE;
+ bool down = false;
return gViewerInput.handleMouse(window, pos, mask, CLICK_LEFT, down);
}
-BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = TRUE;
+ bool down = true;
return gViewerInput.handleMouse(window, pos, mask, CLICK_RIGHT, down);
}
-BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = FALSE;
+ bool down = false;
return gViewerInput.handleMouse(window, pos, mask, CLICK_RIGHT, down);
}
-BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = TRUE;
+ bool down = true;
gViewerInput.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
// Always handled as far as the OS is concerned.
- return TRUE;
+ return true;
}
LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data)
@@ -1256,8 +1256,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
if (prim_media_dnd_enabled)
{
LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY,
- TRUE /* pick_transparent */,
- FALSE /* pick_rigged */);
+ true /* pick_transparent */,
+ false /* pick_rigged */);
S32 object_face = pick_info.mObjectFace;
std::string url = data;
@@ -1366,16 +1366,16 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
return result;
}
-BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
- BOOL down = FALSE;
+ bool down = false;
gViewerInput.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
// Always handled as far as the OS is concerned.
- return TRUE;
+ return true;
}
-BOOL LLViewerWindow::handleOtherMouse(LLWindow *window, LLCoordGL pos, MASK mask, S32 button, bool down)
+bool LLViewerWindow::handleOtherMouse(LLWindow *window, LLCoordGL pos, MASK mask, S32 button, bool down)
{
switch (button)
{
@@ -1390,17 +1390,17 @@ BOOL LLViewerWindow::handleOtherMouse(LLWindow *window, LLCoordGL pos, MASK mask
}
// Always handled as far as the OS is concerned.
- return TRUE;
+ return true;
}
-BOOL LLViewerWindow::handleOtherMouseDown(LLWindow *window, LLCoordGL pos, MASK mask, S32 button)
+bool LLViewerWindow::handleOtherMouseDown(LLWindow *window, LLCoordGL pos, MASK mask, S32 button)
{
- return handleOtherMouse(window, pos, mask, button, TRUE);
+ return handleOtherMouse(window, pos, mask, button, true);
}
-BOOL LLViewerWindow::handleOtherMouseUp(LLWindow *window, LLCoordGL pos, MASK mask, S32 button)
+bool LLViewerWindow::handleOtherMouseUp(LLWindow *window, LLCoordGL pos, MASK mask, S32 button)
{
- return handleOtherMouse(window, pos, mask, button, FALSE);
+ return handleOtherMouse(window, pos, mask, button, false);
}
// WARNING: this is potentially called multiple times per frame
@@ -1412,7 +1412,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
x = ll_round((F32)x / mDisplayScale.mV[VX]);
y = ll_round((F32)y / mDisplayScale.mV[VY]);
- mMouseInWindow = TRUE;
+ mMouseInWindow = true;
// Save mouse point for access during idle() and display()
@@ -1440,7 +1440,7 @@ void LLViewerWindow::handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK m
{
if (mMouseDownTimer.getElapsedTimeF32() > 0.1)
{
- mAllowMouseDragging = TRUE;
+ mAllowMouseDragging = true;
mMouseDownTimer.stop();
}
}
@@ -1454,17 +1454,17 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window)
{
// Note: we won't get this if we have captured the mouse.
llassert( gFocusMgr.getMouseCapture() == NULL );
- mMouseInWindow = FALSE;
+ mMouseInWindow = false;
LLToolTipMgr::instance().blockToolTips();
}
-BOOL LLViewerWindow::handleCloseRequest(LLWindow *window)
+bool LLViewerWindow::handleCloseRequest(LLWindow *window)
{
// User has indicated they want to close, but we may need to ask
// about modified documents.
LLAppViewer::instance()->userQuit();
// Don't quit immediately
- return FALSE;
+ return false;
}
void LLViewerWindow::handleQuit(LLWindow *window)
@@ -1489,7 +1489,7 @@ void LLViewerWindow::handleResize(LLWindow *window, S32 width, S32 height)
// The top-level window has gained focus (e.g. via ALT-TAB)
void LLViewerWindow::handleFocus(LLWindow *window)
{
- gFocusMgr.setAppHasFocus(TRUE);
+ gFocusMgr.setAppHasFocus(true);
LLModalDialog::onAppFocusGained();
gAgent.onAppFocusGained();
@@ -1509,7 +1509,7 @@ void LLViewerWindow::handleFocus(LLWindow *window)
// The top-level window has lost focus (e.g. via ALT-TAB)
void LLViewerWindow::handleFocusLost(LLWindow *window)
{
- gFocusMgr.setAppHasFocus(FALSE);
+ gFocusMgr.setAppHasFocus(false);
//LLModalDialog::onAppFocusLost();
LLToolMgr::getInstance()->onAppFocusLost();
gFocusMgr.setMouseCapture( NULL );
@@ -1522,7 +1522,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
// restore mouse cursor
showCursor();
- getWindow()->setMouseClipping(FALSE);
+ getWindow()->setMouseClipping(false);
// If losing focus while keys are down, handle them as
// an 'up' to correctly release states, then reset states
@@ -1537,7 +1537,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
}
-BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
+bool LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, bool repeated)
{
// Handle non-consuming global keybindings, like voice
// Never affects event processing.
@@ -1558,14 +1558,14 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
// would like to know about the KEYDOWN for an enter key... so ask and pass it along.
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
if (keyboard_focus && !keyboard_focus->wantsReturnKey())
- return FALSE;
+ return false;
}
// remaps, handles ignored cases and returns back to viewer window.
return gViewerInput.handleKey(key, mask, repeated);
}
-BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
+bool LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
{
// Handle non-consuming global keybindings, like voice
// Never affects event processing.
@@ -1581,7 +1581,7 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
return gViewerInput.handleKeyUp(key, mask);
}
-void LLViewerWindow::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level)
+void LLViewerWindow::handleScanKey(KEY key, bool key_down, bool key_up, bool key_level)
{
LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
gViewerInput.scanKey(key, key_down, key_up, key_level);
@@ -1591,7 +1591,7 @@ void LLViewerWindow::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key
-BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
+bool LLViewerWindow::handleActivate(LLWindow *window, bool activated)
{
if (activated)
{
@@ -1623,15 +1623,15 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
// Mute audio
audio_update_volume();
}
- return TRUE;
+ return true;
}
-BOOL LLViewerWindow::handleActivateApp(LLWindow *window, BOOL activating)
+bool LLViewerWindow::handleActivateApp(LLWindow *window, bool activating)
{
//if (!activating) gAgentCamera.changeCameraToDefault();
LLViewerJoystick::getInstance()->setNeedsReset(true);
- return FALSE;
+ return false;
}
@@ -1640,7 +1640,7 @@ void LLViewerWindow::handleMenuSelect(LLWindow *window, S32 menu_item)
}
-BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height)
+bool LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height)
{
// *TODO: Enable similar information output for other platforms? DK 2011-02-18
#if LL_WINDOWS
@@ -1677,10 +1677,10 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S
TextOutA(hdc, 0, 50, "Set \"HeadlessClient FALSE\" in settings.ini file to reenable", 61);
EndPaint(window_handle, &ps);
- return TRUE;
+ return true;
}
#endif
- return FALSE;
+ return false;
}
@@ -1724,49 +1724,49 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
}
}
-BOOL LLViewerWindow::handleTimerEvent(LLWindow *window)
+bool LLViewerWindow::handleTimerEvent(LLWindow *window)
{
//TODO: just call this every frame from gatherInput instead of using a convoluted 30fps timer callback
if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
LLViewerJoystick::getInstance()->updateStatus();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLViewerWindow::handleDeviceChange(LLWindow *window)
+bool LLViewerWindow::handleDeviceChange(LLWindow *window)
{
// give a chance to use a joystick after startup (hot-plugging)
if (!LLViewerJoystick::getInstance()->isJoystickInitialized() )
{
LLViewerJoystick::getInstance()->init(true);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height)
+bool LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height)
{
if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE)
{
LLViewerWindow::reshape(window_width, window_height);
mResDirty = true;
- return TRUE;
+ return true;
}
else
{
LL_WARNS() << "DPI change caused UI scale to go out of bounds: " << ui_scale_factor << LL_ENDL;
- return FALSE;
+ return false;
}
}
-BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window)
+bool LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window)
{
LLCoordScreen window_rect;
mWindow->getSize(&window_rect);
reshape(window_rect.mX, window_rect.mY);
- return TRUE;
+ return true;
}
void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg)
@@ -1817,17 +1817,17 @@ LLViewerWindow::LLViewerWindow(const Params& p)
mWindowRectRaw(0, p.height, p.width, 0),
mWindowRectScaled(0, p.height, p.width, 0),
mWorldViewRectRaw(0, p.height, p.width, 0),
- mLeftMouseDown(FALSE),
- mMiddleMouseDown(FALSE),
- mRightMouseDown(FALSE),
- mMouseInWindow( FALSE ),
- mAllowMouseDragging(TRUE),
+ mLeftMouseDown(false),
+ mMiddleMouseDown(false),
+ mRightMouseDown(false),
+ mMouseInWindow( false ),
+ mAllowMouseDragging(true),
mMouseDownTimer(),
mLastMask( MASK_NONE ),
mToolStored( NULL ),
- mHideCursorPermanent( FALSE ),
- mCursorHidden(FALSE),
- mIgnoreActivate( FALSE ),
+ mHideCursorPermanent( false ),
+ mCursorHidden(false),
+ mIgnoreActivate( false ),
mResDirty(false),
mStatesDirty(false),
mCurrResolutionIndex(0),
@@ -1856,17 +1856,25 @@ LLViewerWindow::LLViewerWindow(const Params& p)
/*
LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags,
- BOOL fullscreen,
- BOOL clearBg,
- BOOL disable_vsync,
- BOOL ignore_pixel_depth,
+ bool fullscreen,
+ bool clearBg,
+ bool disable_vsync,
+ bool ignore_pixel_depth,
U32 fsaa_samples)
*/
// create window
U32 max_core_count = gSavedSettings.getU32("EmulateCoreCount");
- U32 max_vram = gSavedSettings.getU32("RenderMaxVRAMBudget");
F32 max_gl_version = gSavedSettings.getF32("RenderMaxOpenGLVersion");
+
+ LLControlVariable* vram_control = gSavedSettings.getControl("RenderMaxVRAMBudget");
+ U32 max_vram = vram_control->getValue().asInteger();
+ mMaxVRAMControlConnection = vram_control->getSignal()->connect(
+ [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val)
+ {
+ if (mWindow) mWindow->setMaxVRAMMegabytes(new_val.asInteger());
+ });
+
mWindow = LLWindowManager::createWindow(this,
p.title, p.name, p.x, p.y, p.width, p.height, 0,
@@ -1901,7 +1909,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
else if (!LLViewerShaderMgr::sInitialized)
{
//immediately initialize shaders
- LLViewerShaderMgr::sInitialized = TRUE;
+ LLViewerShaderMgr::sInitialized = true;
LLViewerShaderMgr::instance()->setShaders();
}
@@ -1923,7 +1931,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
{
gSavedSettings.setF32("UIScaleFactor", 1.f);
}
- gSavedSettings.setBOOL("ResetUIScaleOnFirstRun", FALSE);
+ gSavedSettings.setBOOL("ResetUIScaleOnFirstRun", false);
}
// Get the real window rect the window was created with (since there are various OS-dependent reasons why
@@ -1971,7 +1979,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
|| (gSavedSettings.getBOOL("ProbeHardwareOnStartup")))
{
LLFeatureManager::getInstance()->applyRecommendedSettings();
- gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE);
+ gSavedSettings.setBOOL("ProbeHardwareOnStartup", false);
}
// If we crashed while initializng GL stuff last time, disable certain features
@@ -2083,7 +2091,7 @@ void LLViewerWindow::initBase()
}
gToolBarView->setShape(panel_holder->getLocalRect());
// Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI())
- gToolBarView->setVisible(FALSE);
+ gToolBarView->setVisible(false);
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
@@ -2130,8 +2138,8 @@ void LLViewerWindow::initBase()
// Add the progress bar view (startup view), which overrides everything
mProgressView = getRootView()->findChild<LLProgressView>("progress_view");
- setShowProgress(FALSE);
- setProgressCancelButtonVisible(FALSE);
+ setShowProgress(false);
+ setProgressCancelButtonVisible(false);
gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder");
LLMenuGL::sMenuContainer = gMenuHolder;
@@ -2143,7 +2151,7 @@ void LLViewerWindow::initWorldUI()
{
gIMMgr = LLIMMgr::getInstance();
LLNavigationBar::getInstance();
- gFloaterView->pushVisibleAll(FALSE);
+ gFloaterView->pushVisibleAll(false);
return;
}
@@ -2164,7 +2172,7 @@ void LLViewerWindow::initWorldUI()
chiclet_bar->setShape(chiclet_container->getLocalRect());
chiclet_bar->setFollowsAll();
chiclet_container->addChild(chiclet_bar);
- chiclet_container->setVisible(TRUE);
+ chiclet_container->setVisible(true);
}
LLRect morph_view_rect = full_window;
@@ -2185,31 +2193,40 @@ void LLViewerWindow::initWorldUI()
// Force gFloaterTools to initialize
LLFloaterReg::getInstance("build");
- // Status bar
- LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
- gStatusBar = new LLStatusBar(status_bar_container->getLocalRect());
- gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
- gStatusBar->setShape(status_bar_container->getLocalRect());
- // sync bg color with menu bar
- gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() );
- // add InBack so that gStatusBar won't be drawn over menu
- status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
- status_bar_container->setVisible(TRUE);
-
- // Navigation bar
- LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
-
- LLNavigationBar* navbar = LLNavigationBar::getInstance();
- navbar->setShape(nav_bar_container->getLocalRect());
- navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
- nav_bar_container->addChild(navbar);
- nav_bar_container->setVisible(TRUE);
-
+ LLNavigationBar* navbar = LLNavigationBar::getInstance();
+ if (!gStatusBar)
+ {
+ // Status bar
+ LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
+ gStatusBar = new LLStatusBar(status_bar_container->getLocalRect());
+ gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
+ gStatusBar->setShape(status_bar_container->getLocalRect());
+ // sync bg color with menu bar
+ gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+ // add InBack so that gStatusBar won't be drawn over menu
+ status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
+ status_bar_container->setVisible(true);
+
+ // Navigation bar
+ LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
+
+ navbar->setShape(nav_bar_container->getLocalRect());
+ navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+ nav_bar_container->addChild(navbar);
+ nav_bar_container->setVisible(true);
+ }
+ else
+ {
+ LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
+ LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
+ status_bar_container->setVisible(true);
+ nav_bar_container->setVisible(true);
+ }
- if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel"))
- {
- navbar->setVisible(FALSE);
- }
+ if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel"))
+ {
+ navbar->setVisible(false);
+ }
else
{
reshapeStatusBarContainer();
@@ -2223,11 +2240,11 @@ void LLViewerWindow::initWorldUI()
topinfo_bar->setShape(topinfo_bar_container->getLocalRect());
topinfo_bar_container->addChild(topinfo_bar);
- topinfo_bar_container->setVisible(TRUE);
+ topinfo_bar_container->setVisible(true);
if (!gSavedSettings.getBOOL("ShowMiniLocationPanel"))
{
- topinfo_bar->setVisible(FALSE);
+ topinfo_bar->setVisible(false);
}
if ( gHUDView == NULL )
@@ -2251,7 +2268,7 @@ void LLViewerWindow::initWorldUI()
LLPanelHideBeacon* panel_hide_beacon = LLPanelHideBeacon::getInstance();
panel_ssf_container->addChild(panel_hide_beacon);
- panel_ssf_container->setVisible(TRUE);
+ panel_ssf_container->setVisible(true);
LLMenuOptionPathfindingRebakeNavmesh::getInstance()->initialize();
@@ -2260,7 +2277,7 @@ void LLViewerWindow::initWorldUI()
if (gToolBarView)
{
gToolBarView->loadToolbars();
- gToolBarView->setVisible(TRUE);
+ gToolBarView->setVisible(true);
}
if (!gNonInteractive)
@@ -2297,7 +2314,7 @@ void LLViewerWindow::shutdownViews()
gFocusMgr.setTopCtrl(NULL);
if (mWindow)
{
- mWindow->allowLanguageTextInput(NULL, FALSE);
+ mWindow->allowLanguageTextInput(NULL, false);
}
delete mDebugText;
@@ -2308,7 +2325,7 @@ void LLViewerWindow::shutdownViews()
// Cleanup global views
if (gMorphView)
{
- gMorphView->setVisible(FALSE);
+ gMorphView->setVisible(false);
}
LL_INFOS() << "Global views cleaned." << LL_ENDL ;
@@ -2393,7 +2410,7 @@ void LLViewerWindow::shutdownGL()
LLSelectMgr::getInstance()->cleanup();
LL_INFOS() << "Stopping GL during shutdown" << LL_ENDL;
- stopGL(FALSE);
+ stopGL(false);
stop_glerror();
gGL.shutdown();
@@ -2415,8 +2432,10 @@ LLViewerWindow::~LLViewerWindow()
if (LLViewerShaderMgr::sInitialized)
{
LLViewerShaderMgr::releaseInstance();
- LLViewerShaderMgr::sInitialized = FALSE;
+ LLViewerShaderMgr::sInitialized = false;
}
+
+ mMaxVRAMControlConnection.disconnect();
}
@@ -2429,7 +2448,7 @@ void LLViewerWindow::showCursor()
{
mWindow->showCursor();
- mCursorHidden = FALSE;
+ mCursorHidden = false;
}
void LLViewerWindow::hideCursor()
@@ -2437,7 +2456,7 @@ void LLViewerWindow::hideCursor()
// And hide the cursor
mWindow->hideCursor();
- mCursorHidden = TRUE;
+ mCursorHidden = true;
}
void LLViewerWindow::sendShapeToSim()
@@ -2468,7 +2487,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
// may have been destructed.
if (!LLApp::isExiting())
{
- gWindowResized = TRUE;
+ gWindowResized = true;
// update our window rectangle
mWindowRectRaw.mRight = mWindowRectRaw.mLeft + width;
@@ -2485,7 +2504,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
calcDisplayScale();
- BOOL display_scale_changed = mDisplayScale != LLUI::getScaleFactor();
+ bool display_scale_changed = mDisplayScale != LLUI::getScaleFactor();
LLUI::setScaleFactor(mDisplayScale);
// update our window rectangle
@@ -2503,7 +2522,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
// Needs only a 'scale change' update, everything else gets handled by LLLayoutStack::updateClass()
LLPanelLogin::reshapePanel();
}
- LLView::sForceReshape = FALSE;
+ LLView::sForceReshape = false;
// clear font width caches
if (display_scale_changed)
@@ -2514,7 +2533,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
sendShapeToSim();
// store new settings for the mode we are in, regardless
- BOOL maximized = mWindow->getMaximized();
+ bool maximized = mWindow->getMaximized();
gSavedSettings.setBOOL("WindowMaximized", maximized);
if (!maximized)
@@ -2542,7 +2561,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
// Hide normal UI when a logon fails
-void LLViewerWindow::setNormalControlsVisible( BOOL visible )
+void LLViewerWindow::setNormalControlsVisible( bool visible )
{
if(LLChicletBar::instanceExists())
{
@@ -2654,7 +2673,7 @@ void LLViewerWindow::draw()
{
//#if LL_DEBUG
- LLView::sIsDrawing = TRUE;
+ LLView::sIsDrawing = true;
//#endif
stop_glerror();
@@ -2772,17 +2791,17 @@ void LLViewerWindow::draw()
gUIProgram.unbind();
- LLView::sIsDrawing = FALSE;
+ LLView::sIsDrawing = false;
}
// Takes a single keyup event, usually when UI is visible
-BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
+bool LLViewerWindow::handleKeyUp(KEY key, MASK mask)
{
- if (LLSetKeyBindDialog::recordKey(key, mask, FALSE))
+ if (LLSetKeyBindDialog::recordKey(key, mask, false))
{
LL_DEBUGS() << "KeyUp handled by LLSetKeyBindDialog" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key, mask);
- return TRUE;
+ return true;
}
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
@@ -2794,7 +2813,7 @@ BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
// We have keyboard focus, and it's not an accelerator
if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
{
- return keyboard_focus->handleKeyUp(key, mask, FALSE);
+ return keyboard_focus->handleKeyUp(key, mask, false);
}
else if (key < 0x80)
{
@@ -2805,14 +2824,14 @@ BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
if (keyboard_focus)
{
- if (keyboard_focus->handleKeyUp(key, mask, FALSE))
+ if (keyboard_focus->handleKeyUp(key, mask, false))
{
LL_DEBUGS() << "LLviewerWindow::handleKeyUp - in 'traverse up' - no loops seen... just called keyboard_focus->handleKeyUp an it returned true" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key, mask);
- return TRUE;
+ return true;
}
else {
- LL_DEBUGS() << "LLviewerWindow::handleKeyUp - in 'traverse up' - no loops seen... just called keyboard_focus->handleKeyUp an it returned FALSE" << LL_ENDL;
+ LL_DEBUGS() << "LLviewerWindow::handleKeyUp - in 'traverse up' - no loops seen... just called keyboard_focus->handleKeyUp an it returned false" << LL_ENDL;
}
}
@@ -2823,18 +2842,18 @@ BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
}
// Takes a single keydown event, usually when UI is visible
-BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
+bool LLViewerWindow::handleKey(KEY key, MASK mask)
{
// hide tooltips on keypress
LLToolTipMgr::instance().blockToolTips();
// Menus get handled on key down instead of key up
// so keybindings have to be recorded before that
- if (LLSetKeyBindDialog::recordKey(key, mask, TRUE))
+ if (LLSetKeyBindDialog::recordKey(key, mask, true))
{
LL_DEBUGS() << "Key handled by LLSetKeyBindDialog" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
@@ -2846,7 +2865,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
//don't switch to mouselook if any floater has focus
if ((key == KEY_MOUSELOOK) && !(mask & (MASK_CONTROL | MASK_ALT)))
{
- return TRUE;
+ return true;
}
LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(keyboard_focus);
@@ -2889,7 +2908,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
if (res == 1 && chars[0] >= 0x20)
{
// Let it fall through to character handler and get a WM_CHAR.
- return TRUE;
+ return true;
}
}
}
@@ -2900,25 +2919,25 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// We have keyboard focus, and it's not an accelerator
if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
{
- return keyboard_focus->handleKey(key, mask, FALSE);
+ return keyboard_focus->handleKey(key, mask, false);
}
else if (key < 0x80)
{
// Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
- return TRUE;
+ return true;
}
}
}
}
// let menus handle navigation keys for navigation
- if ((gMenuBarView && gMenuBarView->handleKey(key, mask, TRUE))
- ||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
- ||(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE)))
+ if ((gMenuBarView && gMenuBarView->handleKey(key, mask, true))
+ ||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, true))
+ ||(gMenuHolder && gMenuHolder->handleKey(key, mask, true)))
{
LL_DEBUGS() << "LLviewerWindow::handleKey handle nav keys for nav" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
@@ -2929,10 +2948,10 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// Check the current floater's menu first, if it has one.
if (gFocusMgr.keyboardFocusHasAccelerators()
&& keyboard_focus
- && keyboard_focus->handleKey(key,mask,FALSE))
+ && keyboard_focus->handleKey(key,mask,false))
{
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
if (gAgent.isInitialized()
@@ -2941,13 +2960,13 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
&& gMenuBarView->handleAcceleratorKey(key, mask))
{
LLViewerEventRecorder::instance().logKeyEvent(key, mask);
- return TRUE;
+ return true;
}
if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))
{
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
}
@@ -2972,13 +2991,13 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
mRootView->focusNextRoot();
}
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
// hidden edit menu for cut/copy/paste
if (gEditMenu && gEditMenu->handleAcceleratorKey(key, mask))
{
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
LLFloater* focused_floaterp = gFloaterView->getFocusedFloater();
@@ -3008,7 +3027,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
case KEY_END:
// when chatbar is empty or ArrowKeysAlwaysMove set,
// pass arrow keys on to avatar...
- return FALSE;
+ return false;
default:
break;
}
@@ -3016,14 +3035,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
}
}
- if (keyboard_focus->handleKey(key, mask, FALSE))
+ if (keyboard_focus->handleKey(key, mask, false))
{
LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
} else {
- LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << LL_ENDL;
+ LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned false" << LL_ENDL;
}
}
@@ -3031,7 +3050,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
LL_DEBUGS() << "LLviewerWindow::handleKey toolbar handling?" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
// Try for a new-format gesture
@@ -3039,7 +3058,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
LL_DEBUGS() << "LLviewerWindow::handleKey new gesture feature" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
// See if this is a gesture trigger. If so, eat the key and
@@ -3048,7 +3067,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
LL_DEBUGS() << "LLviewerWindow::handleKey check gesture trigger" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
- return TRUE;
+ return true;
}
// If "Pressing letter keys starts local chat" option is selected, we are not in mouselook,
@@ -3071,7 +3090,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
// passing NULL here, character will be added later when it is handled by character handler.
nearby_chat->startChat(NULL);
- return TRUE;
+ return true;
}
}
@@ -3082,12 +3101,12 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
&& gMenuBarView->handleAcceleratorKey(key, mask))
{
LLViewerEventRecorder::instance().logKeyEvent(key, mask);
- return TRUE;
+ return true;
}
if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))
{
- return TRUE;
+ return true;
}
// don't pass keys on to world when something in ui has focus
@@ -3097,7 +3116,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
}
-BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
+bool LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
{
// HACK: We delay processing of return keys until they arrive as a Unicode char,
// so that if you're typing chat text at low frame rate, we don't send the chat
@@ -3115,24 +3134,24 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
}
// let menus handle navigation (jump) keys
- if (gMenuBarView && gMenuBarView->handleUnicodeChar(uni_char, TRUE))
+ if (gMenuBarView && gMenuBarView->handleUnicodeChar(uni_char, true))
{
- return TRUE;
+ return true;
}
// Traverses up the hierarchy
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
if( keyboard_focus )
{
- if (keyboard_focus->handleUnicodeChar(uni_char, FALSE))
+ if (keyboard_focus->handleUnicodeChar(uni_char, false))
{
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -3346,12 +3365,12 @@ void LLViewerWindow::updateUI()
S32 x = mCurrentMousePoint.mX;
S32 y = mCurrentMousePoint.mY;
- MASK mask = gKeyboard->currentMask(TRUE);
+ MASK mask = gKeyboard->currentMask(true);
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST))
{
gDebugRaycastFaceHit = gDebugRaycastGLTFNodeHit = gDebugRaycastGLTFPrimitiveHit = -1;
- gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, TRUE, FALSE,
+ gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, false, false, true, false,
&gDebugRaycastFaceHit,
&gDebugRaycastGLTFNodeHit,
&gDebugRaycastGLTFPrimitiveHit,
@@ -3368,7 +3387,7 @@ void LLViewerWindow::updateUI()
updateMouseDelta();
updateKeyboardFocus();
- BOOL handled = FALSE;
+ bool handled = false;
LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
@@ -3620,7 +3639,7 @@ void LLViewerWindow::updateUI()
last_handle_msg = LLView::sMouseHandlerMessage;
LL_INFOS() << "Hover" << LLView::sMouseHandlerMessage << LL_ENDL;
}
- handled = TRUE;
+ handled = true;
}
else if (LLView::sDebugMouseHandling)
{
@@ -3644,7 +3663,7 @@ void LLViewerWindow::updateUI()
}
// Show a new tool tip (or update one that is already shown)
- BOOL tool_tip_handled = FALSE;
+ bool tool_tip_handled = false;
std::string tool_tip_msg;
if( handled
&& !mWindow->isCursorHidden())
@@ -3796,12 +3815,12 @@ void LLViewerWindow::updateLayout()
}
// Update the location of the blue box tool popup
LLCoordGL select_center_screen;
- MASK mask = gKeyboard->currentMask(TRUE);
+ MASK mask = gKeyboard->currentMask(true);
gFloaterTools->updatePopup( select_center_screen, mask );
}
else
{
- gFloaterTools->setVisible(FALSE);
+ gFloaterTools->setVisible(false);
}
//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
}
@@ -3835,11 +3854,11 @@ void LLViewerWindow::updateMouseDelta()
mouse_pos.mX > mWindowRectRaw.getWidth() ||
mouse_pos.mY > mWindowRectRaw.getHeight())
{
- mMouseInWindow = FALSE;
+ mMouseInWindow = false;
}
else
{
- mMouseInWindow = TRUE;
+ mMouseInWindow = true;
}
LLVector2 mouse_vel;
@@ -3895,7 +3914,7 @@ void LLViewerWindow::updateKeyboardFocus()
{
if (!parent->focusFirstItem())
{
- parent->setFocus(TRUE);
+ parent->setFocus(true);
}
new_focus_found = true;
break;
@@ -3908,7 +3927,7 @@ void LLViewerWindow::updateKeyboardFocus()
// are only moving focus higher in the hierarchy
if (!new_focus_found)
{
- cur_focus->setFocus(FALSE);
+ cur_focus->setFocus(false);
}
}
else if (cur_focus->isFocusRoot())
@@ -3930,11 +3949,11 @@ void LLViewerWindow::updateKeyboardFocus()
// sync all floaters with their focus state
gFloaterView->highlightFocusedFloater();
gSnapshotFloaterView->highlightFocusedFloater();
- MASK mask = gKeyboard->currentMask(TRUE);
+ MASK mask = gKeyboard->currentMask(true);
if ((mask & MASK_CONTROL) == 0)
{
// control key no longer held down, finish cycle mode
- gFloaterView->setCycleMode(FALSE);
+ gFloaterView->setCycleMode(false);
gFloaterView->syncFloaterTabOrder();
}
@@ -3961,7 +3980,7 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
// start off using whole window to render world
LLRect new_world_rect = mWindowRectRaw;
- if (use_full_window == false && mWorldViewPlaceholder.get())
+ if (!use_full_window && mWorldViewPlaceholder.get())
{
new_world_rect = mWorldViewPlaceholder.get()->calcScreenRect();
// clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers
@@ -3977,7 +3996,7 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
if (mWorldViewRectRaw != new_world_rect)
{
mWorldViewRectRaw = new_world_rect;
- gResizeScreenTexture = TRUE;
+ gResizeScreenTexture = true;
LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() );
LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() );
@@ -4025,9 +4044,9 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point)
// Draws the selection outlines for the currently selected objects
// Must be called after displayObjects is called, which sets the mGLName parameter
// NOTE: This function gets called 3 times:
-// render_ui_3d: FALSE, FALSE, TRUE
-// render_hud_elements: FALSE, FALSE, FALSE
-void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud )
+// render_ui_3d: false, false, true
+// render_hud_elements: false, false, false
+void LLViewerWindow::renderSelections( bool for_gl_pick, bool pick_parcel_walls, bool for_hud )
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
@@ -4146,21 +4165,21 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
// make whole viewer benefit.
LLSelectMgr::getInstance()->selectGetEditMoveLinksetPermissions(all_selected_objects_move, all_selected_objects_modify);
- BOOL draw_handles = TRUE;
+ bool draw_handles = true;
if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isMovableAvatarSelected())
{
- draw_handles = FALSE;
+ draw_handles = false;
}
if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isMovableAvatarSelected())
{
- draw_handles = FALSE;
+ draw_handles = false;
}
if ( !all_selected_objects_modify && tool == LLToolCompScale::getInstance() )
{
- draw_handles = FALSE;
+ draw_handles = false;
}
if( draw_handles )
@@ -4204,9 +4223,9 @@ LLVector3d LLViewerWindow::clickPointInWorldGlobal(S32 x, S32 y_from_bot, LLView
}
-BOOL LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewerObject *objectp, LLVector3d &point_global) const
+bool LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewerObject *objectp, LLVector3d &point_global) const
{
- BOOL intersect = FALSE;
+ bool intersect = false;
// U8 shape = objectp->mPrimitiveCode & LL_PCODE_BASE_MASK;
if (!intersect)
@@ -4226,20 +4245,20 @@ void LLViewerWindow::pickAsync( S32 x,
S32 y_from_bot,
MASK mask,
void (*callback)(const LLPickInfo& info),
- BOOL pick_transparent,
- BOOL pick_rigged,
- BOOL pick_unselectable,
- BOOL pick_reflection_probes)
+ bool pick_transparent,
+ bool pick_rigged,
+ bool pick_unselectable,
+ bool pick_reflection_probes)
{
// "Show Debug Alpha" means no object actually transparent
- BOOL in_build_mode = LLFloaterReg::instanceVisible("build");
+ bool in_build_mode = LLFloaterReg::instanceVisible("build");
if (LLDrawPoolAlpha::sShowDebugAlpha
|| (in_build_mode && gSavedSettings.getBOOL("SelectInvisibleObjects")))
{
- pick_transparent = TRUE;
+ pick_transparent = true;
}
- LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, pick_rigged, FALSE, pick_reflection_probes, pick_unselectable, TRUE, callback);
+ LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, pick_rigged, false, pick_reflection_probes, pick_unselectable, true, callback);
schedulePick(pick_info);
}
@@ -4295,19 +4314,19 @@ void LLViewerWindow::returnEmptyPicks()
}
// Performs the GL object/land pick.
-LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_particle, BOOL pick_unselectable, BOOL pick_reflection_probe)
+LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, bool pick_transparent, bool pick_rigged, bool pick_particle, bool pick_unselectable, bool pick_reflection_probe)
{
- BOOL in_build_mode = LLFloaterReg::instanceVisible("build");
+ bool in_build_mode = LLFloaterReg::instanceVisible("build");
if ((in_build_mode && gSavedSettings.getBOOL("SelectInvisibleObjects")) || LLDrawPoolAlpha::sShowDebugAlpha)
{
// build mode allows interaction with all transparent objects
// "Show Debug Alpha" means no object actually transparent
- pick_transparent = TRUE;
+ pick_transparent = true;
}
// shortcut queueing in mPicks and just update mLastPick in place
- MASK key_mask = gKeyboard->currentMask(TRUE);
- mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, pick_reflection_probe, TRUE, FALSE, NULL);
+ MASK key_mask = gKeyboard->currentMask(true);
+ mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, pick_reflection_probe, true, false, NULL);
mLastPick.fetchResults();
return mLastPick;
@@ -4342,10 +4361,10 @@ LLHUDIcon* LLViewerWindow::cursorIntersectIcon(S32 mouse_x, S32 mouse_y, F32 dep
LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 depth,
LLViewerObject *this_object,
S32 this_face,
- BOOL pick_transparent,
- BOOL pick_rigged,
- BOOL pick_unselectable,
- BOOL pick_reflection_probe,
+ bool pick_transparent,
+ bool pick_rigged,
+ bool pick_unselectable,
+ bool pick_reflection_probe,
S32* face_hit,
S32* gltf_node_hit,
S32* gltf_primitive_hit,
@@ -4531,7 +4550,7 @@ LLVector3 LLViewerWindow::mouseDirectionCamera(const S32 x, const S32 y) const
-BOOL LLViewerWindow::mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, const S32 y,
+bool LLViewerWindow::mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, const S32 y,
const LLVector3d &plane_point_global,
const LLVector3 &plane_normal_global)
{
@@ -4562,11 +4581,11 @@ BOOL LLViewerWindow::mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, con
// Returns global position
-BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_position_global, BOOL ignore_distance)
+bool LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_position_global, bool ignore_distance)
{
LLVector3 mouse_direction_global = mouseDirectionGlobal(x,y);
F32 mouse_dir_scale;
- BOOL hit_land = FALSE;
+ bool hit_land = false;
LLViewerRegion *regionp;
F32 land_z;
const F32 FIRST_PASS_STEP = 1.0f; // meters
@@ -4612,7 +4631,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
// cout << "under land at " << probe_point << " scale " << mouse_vec_scale << endl;
- hit_land = TRUE;
+ hit_land = true;
break;
}
}
@@ -4660,16 +4679,16 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
// ...just went under land again
*land_position_global = probe_point_global;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
// Saves an image to the harddrive as "SnapshotX" where X >= 1.
-void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb)
+void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb)
{
if (!image)
{
@@ -4768,7 +4787,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
}
// Look for an unused file name
- BOOL is_snapshot_name_loc_set = isSnapshotLocSet();
+ bool is_snapshot_name_loc_set = isSnapshotLocSet();
std::string filepath;
S32 i = 1;
S32 err = 0;
@@ -4822,12 +4841,12 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
}
}
-BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format)
+bool LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, bool show_ui, bool show_hud, bool do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format)
{
LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL;
LLPointer<LLImageRaw> raw = new LLImageRaw;
- BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, show_hud, do_rebuild);
+ bool success = rawSnapshot(raw, image_width, image_height, true, false, show_ui, show_hud, do_rebuild);
if (success)
{
@@ -4875,7 +4894,7 @@ void LLViewerWindow::playSnapshotAnimAndSound()
send_sound_trigger(LLUUID(gSavedSettings.getString("UISndSnapshot")), 1.0f);
}
-BOOL LLViewerWindow::isSnapshotLocSet() const
+bool LLViewerWindow::isSnapshotLocSet() const
{
std::string snapshot_dir = sSnapshotDir;
return !snapshot_dir.empty();
@@ -4886,50 +4905,51 @@ void LLViewerWindow::resetSnapshotLoc() const
gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string());
}
-BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, BOOL no_post, LLSnapshotModel::ESnapshotLayerType type)
+bool LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, bool show_ui, bool show_hud, bool do_rebuild, bool no_post, LLSnapshotModel::ESnapshotLayerType type)
{
- return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, show_hud, do_rebuild, no_post, type);
+ return rawSnapshot(raw, preview_width, preview_height, false, false, show_ui, show_hud, do_rebuild, no_post, type);
}
// Saves the image from the screen to a raw image
// Since the required size might be bigger than the available screen, this method rerenders the scene in parts (called subimages) and copy
// the results over to the final raw image.
-BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height,
- BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, BOOL no_post, LLSnapshotModel::ESnapshotLayerType type, S32 max_size)
+bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height,
+ bool keep_window_aspect, bool is_texture, bool show_ui, bool show_hud, bool do_rebuild, bool no_post, LLSnapshotModel::ESnapshotLayerType type, S32 max_size)
{
if (!raw)
{
- return FALSE;
+ return false;
}
+
//check if there is enough memory for the snapshot image
if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K
{
if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3))
{
LL_WARNS() << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << LL_ENDL ;
- return FALSE ; //there is no enough memory for taking this snapshot.
+ return false ; //there is no enough memory for taking this snapshot.
}
}
// PRE SNAPSHOT
gSnapshotNoPost = no_post;
- gDisplaySwapBuffers = FALSE;
+ gDisplaySwapBuffers = false;
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); // stencil buffer is deprecated | GL_STENCIL_BUFFER_BIT);
setCursor(UI_CURSOR_WAIT);
// Hide all the UI widgets first and draw a frame
- BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? TRUE : FALSE;
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
if ( prev_draw_ui != show_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
- BOOL hide_hud = !show_hud && LLPipeline::sShowHUDAttachments;
+ bool hide_hud = !show_hud && LLPipeline::sShowHUDAttachments;
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = FALSE;
+ LLPipeline::sShowHUDAttachments = false;
}
// if not showing ui, use full window to render world view
@@ -4945,7 +4965,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
// SNAPSHOT
S32 window_width = snapshot_width;
S32 window_height = snapshot_height;
-
+
// Note: Scaling of the UI is currently *not* supported so we limit the output size if UI is requested
if (show_ui)
{
@@ -5001,7 +5021,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
scale_factor = llmax(1.0f, 1.0f / ratio) ;
}
}
-
+
if (show_ui && scale_factor > 1.f)
{
// Note: we should never get there...
@@ -5020,20 +5040,24 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
image_buffer_x = llfloor(snapshot_width * scale_factor) ;
image_buffer_y = llfloor(snapshot_height * scale_factor) ;
}
+
+ LLImageDataLock lock(raw);
+
if ((image_buffer_x > 0) && (image_buffer_y > 0))
{
raw->resize(image_buffer_x, image_buffer_y, 3);
}
else
{
- return FALSE ;
+ return false;
}
+
if (raw->isBufferInvalid())
{
- return FALSE ;
+ return false;
}
- BOOL high_res = scale_factor >= 2.f; // Font scaling is slow, only do so if rez is much higher
+ bool high_res = scale_factor >= 2.f; // Font scaling is slow, only do so if rez is much higher
if (high_res && show_ui)
{
// Note: we should never get there...
@@ -5061,8 +5085,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
S32 output_buffer_offset_x = 0;
for (int subimage_x = 0; subimage_x < scale_factor; ++subimage_x)
{
- gDisplaySwapBuffers = FALSE;
- gDepthDirty = TRUE;
+ gDisplaySwapBuffers = false;
+ gDepthDirty = true;
S32 subimage_x_offset = llclamp(buffer_x_offset - (subimage_x * window_width), 0, window_width);
// handle fractional rows
@@ -5073,12 +5097,12 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if (read_width && read_height)
{
const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor));
- display(do_rebuild, scale_factor, subfield, TRUE);
+ display(do_rebuild, scale_factor, subfield, true);
if (!LLPipeline::sRenderDeferred)
{
// Required for showing the GUI in snapshots and performing bloom composite overlay
- // Call even if show_ui is FALSE
+ // Call even if show_ui is false
render_ui(scale_factor, subfield);
swap();
}
@@ -5142,9 +5166,9 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
output_buffer_offset_y += subimage_y_offset;
}
- gDisplaySwapBuffers = FALSE;
- gSnapshotNoPost = FALSE;
- gDepthDirty = TRUE;
+ gDisplaySwapBuffers = false;
+ gSnapshotNoPost = false;
+ gDepthDirty = true;
// POST SNAPSHOT
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
@@ -5154,7 +5178,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = TRUE;
+ LLPipeline::sShowHUDAttachments = true;
}
/*if (high_res)
@@ -5167,7 +5191,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
// Note: this formula depends on the number of components being 3. Not obvious, but it's correct.
image_width += (image_width * 3) % 4;
- BOOL ret = TRUE ;
+ bool ret = true ;
// Resize image
if(llabs(image_width - image_buffer_x) > 4 || llabs(image_height - image_buffer_y) > 4)
{
@@ -5175,9 +5199,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
}
else if(image_width != image_buffer_x || image_height != image_buffer_y)
{
- ret = raw->scale( image_width, image_height, FALSE );
+ ret = raw->scale( image_width, image_height, false );
}
-
setCursor(UI_CURSOR_ARROW);
@@ -5210,24 +5233,24 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
return ret;
}
-BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_height, const int num_render_passes)
+bool LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_height, const int num_render_passes)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_APP;
- gDisplaySwapBuffers = FALSE;
+ gDisplaySwapBuffers = false;
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); // stencil buffer is deprecated | GL_STENCIL_BUFFER_BIT);
setCursor(UI_CURSOR_WAIT);
- BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? TRUE : FALSE;
- if (prev_draw_ui != false)
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
- BOOL hide_hud = LLPipeline::sShowHUDAttachments;
+ bool hide_hud = LLPipeline::sShowHUDAttachments;
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = FALSE;
+ LLPipeline::sShowHUDAttachments = false;
}
LLRect window_rect = getWorldViewRectRaw();
@@ -5268,17 +5291,19 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
// the black flash in between captures when the number
// of render passes is more than 1. We need to also
// set it here because code in LLViewerDisplay resets
- // it to TRUE each time.
- gDisplaySwapBuffers = FALSE;
+ // it to true each time.
+ gDisplaySwapBuffers = false;
// actually render the scene
const U32 subfield = 0;
const bool do_rebuild = true;
const F32 zoom = 1.0;
- const bool for_snapshot = TRUE;
+ const bool for_snapshot = true;
display(do_rebuild, zoom, subfield, for_snapshot);
}
+ LLImageDataSharedLock lock(raw);
+
glReadPixels(
0, 0,
image_width,
@@ -5288,12 +5313,12 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
);
stop_glerror();
- gDisplaySwapBuffers = FALSE;
- gDepthDirty = TRUE;
+ gDisplaySwapBuffers = false;
+ gDepthDirty = true;
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- if (prev_draw_ui != false)
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
@@ -5301,7 +5326,7 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = TRUE;
+ LLPipeline::sShowHUDAttachments = true;
}
setCursor(UI_CURSOR_ARROW);
@@ -5317,14 +5342,14 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
void display_cube_face();
-BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubearray, S32 cubeIndex, S32 face, F32 near_clip, bool dynamic_render, bool useCustomClipPlane, LLPlane clipPlane)
+bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubearray, S32 cubeIndex, S32 face, F32 near_clip, bool dynamic_render, bool useCustomClipPlane, LLPlane clipPlane)
{
// NOTE: implementation derived from LLFloater360Capture::capture360Images() and simpleSnapshot
LL_PROFILE_ZONE_SCOPED_CATEGORY_APP;
LL_PROFILE_GPU_ZONE("cubeSnapshot");
llassert(LLPipeline::sRenderDeferred);
llassert(!gCubeSnapshot); //assert a snapshot isn't already in progress
-
+
U32 res = gPipeline.mRT->deferredScreen.getWidth();
//llassert(res <= gPipeline.mRT->deferredScreen.getWidth());
@@ -5336,7 +5361,7 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
// set new parameters specific to the 360 requirements
LLPipeline::sUseOcclusion = 0;
LLViewerCamera* camera = LLViewerCamera::getInstance();
-
+
LLViewerCamera saved_camera = LLViewerCamera::instance();
glh::matrix4f saved_proj = get_current_projection();
glh::matrix4f saved_mod = get_current_modelview();
@@ -5366,7 +5391,7 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
constexpr U32 dynamic_render_type_count = sizeof(dynamic_render_types) / sizeof(U32);
bool prev_dynamic_render_type[dynamic_render_type_count];
-
+
if (!dynamic_render)
{
for (int i = 0; i < dynamic_render_type_count; ++i)
@@ -5379,16 +5404,16 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
}
}
- BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? TRUE : FALSE;
- if (prev_draw_ui != false)
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
-
- BOOL hide_hud = LLPipeline::sShowHUDAttachments;
+
+ bool hide_hud = LLPipeline::sShowHUDAttachments;
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = FALSE;
+ LLPipeline::sShowHUDAttachments = false;
}
LLRect window_rect = getWorldViewRectRaw();
@@ -5425,20 +5450,20 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
// the black flash in between captures when the number
// of render passes is more than 1. We need to also
// set it here because code in LLViewerDisplay resets
- // it to TRUE each time.
- gDisplaySwapBuffers = FALSE;
+ // it to true each time.
+ gDisplaySwapBuffers = false;
// actually render the scene
- gCubeSnapshot = TRUE;
+ gCubeSnapshot = true;
display_cube_face();
- gCubeSnapshot = FALSE;
+ gCubeSnapshot = false;
}
- gDisplaySwapBuffers = TRUE;
+ gDisplaySwapBuffers = true;
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- if (prev_draw_ui != false)
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
@@ -5457,7 +5482,7 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
if (hide_hud)
{
- LLPipeline::sShowHUDAttachments = TRUE;
+ LLPipeline::sShowHUDAttachments = true;
}
gPipeline.resetDrawOrders();
@@ -5593,7 +5618,7 @@ void LLViewerWindow::setup2DViewport(S32 x_offset, S32 y_offset)
void LLViewerWindow::setup3DRender()
{
// setup perspective camera
- LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, mWorldViewRectRaw.mLeft, mWorldViewRectRaw.mBottom, mWorldViewRectRaw.getWidth(), mWorldViewRectRaw.getHeight(), FALSE, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f);
+ LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, mWorldViewRectRaw.mLeft, mWorldViewRectRaw.mBottom, mWorldViewRectRaw.getWidth(), mWorldViewRectRaw.getHeight(), false, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f);
setup3DViewport();
}
@@ -5623,7 +5648,7 @@ void LLViewerWindow::initTextures(S32 location_id)
}
}
-void LLViewerWindow::setShowProgress(const BOOL show)
+void LLViewerWindow::setShowProgress(const bool show)
{
if (mProgressView)
{
@@ -5639,7 +5664,7 @@ void LLViewerWindow::setStartupComplete()
}
}
-BOOL LLViewerWindow::getShowProgress() const
+bool LLViewerWindow::getShowProgress() const
{
return (mProgressView && mProgressView->getVisible());
}
@@ -5668,7 +5693,7 @@ void LLViewerWindow::setProgressPercent(const F32 percent)
}
}
-void LLViewerWindow::setProgressCancelButtonVisible( BOOL b, const std::string& label )
+void LLViewerWindow::setProgressCancelButtonVisible( bool b, const std::string& label )
{
if (mProgressView)
{
@@ -5689,7 +5714,7 @@ void LLViewerWindow::dumpState()
<< LL_ENDL;
}
-void LLViewerWindow::stopGL(BOOL save_state)
+void LLViewerWindow::stopGL(bool save_state)
{
//Note: --bao
//if not necessary, do not change the order of the function calls in this function.
@@ -5738,7 +5763,7 @@ void LLViewerWindow::stopGL(BOOL save_state)
gTextureList.destroyGL(save_state);
stop_glerror();
- gGLManager.mIsDisabled = TRUE;
+ gGLManager.mIsDisabled = true;
stop_glerror();
//unload shader's
@@ -5759,7 +5784,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
if (gGLManager.mIsDisabled)
{
LL_INFOS() << "Restoring GL..." << LL_ENDL;
- gGLManager.mIsDisabled = FALSE;
+ gGLManager.mIsDisabled = false;
initGLDefaults();
LLGLState::restoreGL();
@@ -5779,8 +5804,8 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
LLVOAvatar::restoreGL();
LLVOPartGroup::restoreGL();
- gResizeScreenTexture = TRUE;
- gWindowResized = TRUE;
+ gResizeScreenTexture = true;
+ gWindowResized = true;
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
{
@@ -5790,8 +5815,8 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
if (!progress_message.empty())
{
gRestoreGLTimer.reset();
- gRestoreGL = TRUE;
- setShowProgress(TRUE);
+ gRestoreGL = true;
+ setShowProgress(true);
setProgressString(progress_message);
}
LL_INFOS() << "...Restoring GL done" << LL_ENDL;
@@ -5841,7 +5866,7 @@ void LLViewerWindow::checkSettings()
}
}
-void LLViewerWindow::restartDisplay(BOOL show_progress_bar)
+void LLViewerWindow::restartDisplay(bool show_progress_bar)
{
LL_INFOS() << "Restaring GL" << LL_ENDL;
stopGL();
@@ -5855,11 +5880,11 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar)
}
}
-BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync, BOOL show_progress_bar)
+bool LLViewerWindow::changeDisplaySettings(LLCoordScreen size, bool enable_vsync, bool show_progress_bar)
{
- //BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized");
+ //bool was_maximized = gSavedSettings.getBOOL("WindowMaximized");
- //gResizeScreenTexture = TRUE;
+ //gResizeScreenTexture = true;
//U32 fsaa = gSavedSettings.getU32("RenderFSAASamples");
@@ -5873,7 +5898,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync
//if (fsaa == old_fsaa)
{
- return TRUE;
+ return true;
}
/*
@@ -5881,14 +5906,14 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync
// Close floaters that don't handle settings change
LLFloaterReg::hideInstance("snapshot");
- BOOL result_first_try = FALSE;
- BOOL result_second_try = FALSE;
+ bool result_first_try = false;
+ bool result_second_try = false;
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
send_agent_pause();
LL_INFOS() << "Stopping GL during changeDisplaySettings" << LL_ENDL;
stopGL();
- mIgnoreActivate = TRUE;
+ mIgnoreActivate = true;
LLCoordScreen old_size;
LLCoordScreen old_pos;
mWindow->getSize(&old_size);
@@ -5906,8 +5931,8 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync
{
// we are stuck...try once again with a minimal resolution?
send_agent_resume();
- mIgnoreActivate = FALSE;
- return FALSE;
+ mIgnoreActivate = false;
+ return false;
}
}
send_agent_resume();
@@ -5931,7 +5956,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync
size = old_size; // for reshape below
}
- BOOL success = result_first_try || result_second_try;
+ bool success = result_first_try || result_second_try;
if (success)
{
@@ -5949,7 +5974,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync
}
}
- mIgnoreActivate = FALSE;
+ mIgnoreActivate = false;
gFocusMgr.setKeyboardFocus(keyboard_focus);
return success;
@@ -6022,7 +6047,7 @@ LLRect LLViewerWindow::getChatConsoleRect()
console_rect.mLeft += CONSOLE_PADDING_LEFT;
- static const BOOL CHAT_FULL_WIDTH = gSavedSettings.getBOOL("ChatFullWidth");
+ static const bool CHAT_FULL_WIDTH = gSavedSettings.getBOOL("ChatFullWidth");
if (CHAT_FULL_WIDTH)
{
@@ -6056,7 +6081,22 @@ void LLViewerWindow::reshapeStatusBarContainer()
// collapse status_bar_container
new_height -= nav_bar_container->getRect().getHeight();
}
- status_bar_container->reshape(new_width, new_height, TRUE);
+ status_bar_container->reshape(new_width, new_height, true);
+}
+
+void LLViewerWindow::resetStatusBarContainer()
+{
+ LLNavigationBar* navbar = LLNavigationBar::getInstance();
+ if (gSavedSettings.getBOOL("ShowNavbarNavigationPanel") || navbar->getVisible())
+ {
+ // was previously showing navigation bar
+ LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
+ LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
+ S32 new_height = status_bar_container->getRect().getHeight();
+ S32 new_width = status_bar_container->getRect().getWidth();
+ new_height -= nav_bar_container->getRect().getHeight();
+ status_bar_container->reshape(new_width, new_height, true);
+ }
}
//----------------------------------------------------------------------------
@@ -6067,7 +6107,7 @@ void LLViewerWindow::setUIVisibility(bool visible)
if (!visible)
{
- gAgentCamera.changeCameraToThirdPerson(FALSE);
+ gAgentCamera.changeCameraToThirdPerson(false);
gFloaterView->hideAllFloaters();
}
else
@@ -6080,8 +6120,8 @@ void LLViewerWindow::setUIVisibility(bool visible)
gToolBarView->setToolBarsVisible(visible);
}
- LLNavigationBar::getInstance()->setVisible(visible ? gSavedSettings.getBOOL("ShowNavbarNavigationPanel") : FALSE);
- LLPanelTopInfoBar::getInstance()->setVisible(visible? gSavedSettings.getBOOL("ShowMiniLocationPanel") : FALSE);
+ LLNavigationBar::getInstance()->setVisible(visible ? gSavedSettings.getBOOL("ShowNavbarNavigationPanel") : false);
+ LLPanelTopInfoBar::getInstance()->setVisible(visible? gSavedSettings.getBOOL("ShowMiniLocationPanel") : false);
mRootView->getChildView("status_bar_container")->setVisible(visible);
}
@@ -6098,7 +6138,7 @@ LLPickInfo::LLPickInfo()
: mKeyMask(MASK_NONE),
mPickCallback(NULL),
mPickType(PICK_INVALID),
- mWantSurfaceInfo(FALSE),
+ mWantSurfaceInfo(false),
mObjectFace(-1),
mUVCoords(-1.f, -1.f),
mSTCoords(-1.f, -1.f),
@@ -6108,20 +6148,20 @@ LLPickInfo::LLPickInfo()
mTangent(),
mBinormal(),
mHUDIcon(NULL),
- mPickTransparent(FALSE),
- mPickRigged(FALSE),
- mPickParticle(FALSE)
+ mPickTransparent(false),
+ mPickRigged(false),
+ mPickParticle(false)
{
}
LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos,
MASK keyboard_mask,
- BOOL pick_transparent,
- BOOL pick_rigged,
- BOOL pick_particle,
- BOOL pick_reflection_probe,
- BOOL pick_uv_coords,
- BOOL pick_unselectable,
+ bool pick_transparent,
+ bool pick_rigged,
+ bool pick_particle,
+ bool pick_reflection_probe,
+ bool pick_uv_coords,
+ bool pick_unselectable,
void (*pick_callback)(const LLPickInfo& pick_info))
: mMousePt(mouse_pos),
mKeyMask(keyboard_mask),