diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-15 19:31:20 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-15 19:31:20 +0300 |
commit | ae931987356a71dbe8fc7ec31f2a2fe9108b4495 (patch) | |
tree | d8edd9820ad2848f4adebc310ffe25d6ec355885 /indra/newview/llviewerwindow.cpp | |
parent | 5a893f262f6c8367e7098ac68f8d605e80695745 (diff) | |
parent | cf2b4dbfb280986cf859b12fd55158d7b9e0ac3d (diff) |
Merge branch 'main' into marchcat/maint-c-restore
# Conflicts:
# indra/llcommon/lldate.h
# indra/newview/llappviewer.cpp
# indra/newview/llinventorybridge.cpp
# indra/newview/llmaterialeditor.cpp
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c2c466207b..10dcda9dee 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -80,14 +80,12 @@ #include "message.h" #include "object_flags.h" #include "lltimer.h" -#include "llviewermenu.h" #include "lltooltip.h" #include "llmediaentry.h" #include "llurldispatcher.h" #include "raytrace.h" // newview includes -#include "llagent.h" #include "llbox.h" #include "llchicletbar.h" #include "llconsole.h" @@ -119,7 +117,6 @@ #include "llfontfreetype.h" #include "llgesturemgr.h" #include "llglheaders.h" -#include "lltooltip.h" #include "llhudmanager.h" #include "llhudobject.h" #include "llhudview.h" @@ -134,7 +131,6 @@ #include "llmorphview.h" #include "llmoveview.h" #include "llnavigationbar.h" -#include "llnotificationhandler.h" #include "llpaneltopinfobar.h" #include "llpopupview.h" #include "llpreviewtexture.h" @@ -167,17 +163,13 @@ #include "lltoolselectland.h" #include "lltrans.h" #include "lluictrlfactory.h" -#include "llurldispatcher.h" // SLURL from other app instance #include "llversioninfo.h" #include "llvieweraudio.h" -#include "llviewercamera.h" #include "llviewergesture.h" #include "llviewertexturelist.h" #include "llviewerinventory.h" -#include "llviewerinput.h" #include "llviewermedia.h" #include "llviewermediafocus.h" -#include "llviewermenu.h" #include "llviewermessage.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" @@ -211,7 +203,6 @@ #include "llwindowlistener.h" #include "llviewerwindowlistener.h" -#include "llpaneltopinfobar.h" #include "llcleanup.h" #if LL_WINDOWS @@ -498,7 +489,8 @@ public: clearText(); - if (gSavedSettings.getBOOL("DebugShowTime")) + static LLCachedControl<bool> debug_show_time(gSavedSettings, "DebugShowTime", false); + if (debug_show_time()) { F32 time = gFrameTimeSeconds; S32 hours = (S32)(time / (60*60)); @@ -507,7 +499,8 @@ public: addText(xpos, ypos, llformat("Time: %d:%02d:%02d", hours,mins,secs)); ypos += y_inc; } - if (gSavedSettings.getBOOL("DebugShowMemory")) + static LLCachedControl<bool> debug_show_memory(gSavedSettings, "DebugShowMemory", false); + if (debug_show_memory()) { addText(xpos, ypos, STRINGIZE("Memory: " << (LLMemory::getCurrentRSS() / 1024) << " (KB)")); @@ -600,7 +593,8 @@ public: ypos += y_inc; }*/ - if (gSavedSettings.getBOOL("DebugShowRenderInfo")) + static LLCachedControl<bool> debug_show_render_info(gSavedSettings, "DebugShowRenderInfo", false); + if (debug_show_render_info()) { LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); @@ -739,7 +733,8 @@ public: gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; } - if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo")) + static LLCachedControl<bool> debug_show_avatar_render_info(gSavedSettings, "DebugShowAvatarRenderInfo", false); + if (debug_show_avatar_render_info()) { std::map<std::string, LLVOAvatar*> sorted_avs; { @@ -772,7 +767,8 @@ public: av_iter++; } } - if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) + static LLCachedControl<bool> debug_show_render_matrices(gSavedSettings, "DebugShowRenderMatrices", false); + if (debug_show_render_matrices()) { char camera_lines[8][32]; memset(camera_lines, ' ', sizeof(camera_lines)); @@ -798,7 +794,8 @@ public: ypos += y_inc; } // disable use of glReadPixels which messes up nVidia nSight graphics debugging - if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) + static LLCachedControl<bool> debug_show_color(gSavedSettings, "DebugShowColor", false); + if (debug_show_color() && !LLRender::sNsightDebugSupport) { U8 color[4]; LLCoordGL coord = gViewerWindow->getCurrentMouse(); @@ -890,7 +887,8 @@ public: } } - if (gSavedSettings.getBOOL("DebugShowTextureInfo")) + static LLCachedControl<bool> debug_show_texture_info(gSavedSettings, "DebugShowTextureInfo", false); + if (debug_show_texture_info()) { LLViewerObject* objectp = NULL ; @@ -1465,10 +1463,13 @@ void LLViewerWindow::handleMouseLeave(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 + if (!LLApp::isExiting() && !LLApp::isStopped()) + { + // 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; } @@ -1616,7 +1617,8 @@ bool LLViewerWindow::handleActivate(LLWindow *window, bool activated) mActive = false; // if the user has chosen to go Away automatically after some time, then go Away when minimizing - if (gSavedSettings.getS32("AFKTimeout")) + static LLCachedControl<S32> afk_time(gSavedSettings, "AFKTimeout", 300); + if (afk_time()) { gAgent.setAFK(); } @@ -4833,7 +4835,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save filepath += extension; llstat stat_info; - err = LLFile::stat( filepath, &stat_info ); + err = LLFile::stat(filepath, &stat_info); i++; } while( -1 != err // Search until the file is not found (i.e., stat() gives an error). @@ -6186,7 +6188,7 @@ void LLPickInfo::fetchResults() mObjectOffset = gAgentCamera.calcFocusOffset(objectp, v_intersection, mPickPt.mX, mPickPt.mY); mObjectID = objectp->mID; mObjectFace = (te_offset == NO_FACE) ? -1 : (S32)te_offset; - + mPickHUD = objectp->isHUDAttachment(); mPosGlobal = gAgent.getPosGlobalFromAgent(v_intersection); |