diff options
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
| -rw-r--r-- | indra/newview/llviewerdisplay.cpp | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 314e32bffd..ccd17be939 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -55,7 +55,6 @@ #include "llmemory.h" #include "llparcel.h" #include "llperfstats.h" -#include "llpostprocess.h" #include "llrender.h" #include "llscenemonitor.h" #include "llsdjson.h" @@ -217,9 +216,10 @@ void display_update_camera() { final_far *= 0.5f; } - else if (LLViewerTexture::sDesiredDiscardBias > 2.f) + // When system memory is critically low or recovering, shrink draw distance. + else if (const F32 mem_factor = LLMemory::getSystemMemoryBudgetFactor(); mem_factor > 1.f) { - final_far = llmax(32.f, final_far / (LLViewerTexture::sDesiredDiscardBias - 1.f)); + final_far = llmax(32.f, final_far / mem_factor); } LLViewerCamera::getInstance()->setFar(final_far); LLVOAvatar::sRenderDistance = llclamp(final_far, 16.f, 256.f); @@ -280,6 +280,12 @@ static void update_tp_display(bool minimized) F32 teleport_save_time = TELEPORT_EXPIRY + TELEPORT_EXPIRY_PER_ATTACHMENT * attach_count; F32 teleport_elapsed = gTeleportDisplayTimer.getElapsedTimeF32(); F32 teleport_percent = teleport_elapsed * (100.f / teleport_save_time); + + // Reuse the minimized-window path to suppress the teleport progress screen. + if (gSavedSettings.getBOOL("DisableTeleportScreens")) + { + minimized = true; + } if (gAgent.getTeleportState() != LLAgent::TELEPORT_START && teleport_percent > 100.f) { // Give up. Don't keep the UI locked forever. @@ -316,6 +322,24 @@ static void update_tp_display(bool minimized) { // Transition to REQUESTED. Viewer has sent some kind // of TeleportRequest to the source simulator + + // NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm). + // Reset the mouselook zoom state on teleport so we don't get stuck at + // the zoomed FOV after arriving at the destination. + if (gAgentCamera.cameraMouselook()) + { + LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues"); + bool wasZoomed = (mlFovValues.mV[VZ] > 0.0f); + mlFovValues.mV[VZ] = 0.0f; // clear "currently zoomed" flag + gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues); + if (wasZoomed) + { + // Restore the normal (pre-zoom) FOV + gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VX]); + } + } + // NaCl End + gTeleportDisplayTimer.reset(); const std::string& msg = LLAgent::sTeleportProgressMessages["requesting"]; LL_INFOS("Teleport") << "A teleport request has been sent, setting state to TELEPORT_REQUESTED" << LL_ENDL; @@ -576,9 +600,9 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) LLImageGL::updateStats(gFrameTimeSeconds); static LLCachedControl<S32> avatar_name_tag_mode(gSavedSettings, "AvatarNameTagMode", 1); - static LLCachedControl<bool> name_tag_show_group_titles(gSavedSettings, "NameTagShowGroupTitles", true); + static LLCachedControl<S32> name_tag_show_group_titles(gSavedSettings, "GroupTitlesTagMode", 2 /*all group tags*/); LLVOAvatar::sRenderName = avatar_name_tag_mode; - LLVOAvatar::sRenderGroupTitles = name_tag_show_group_titles && avatar_name_tag_mode > 0; + LLVOAvatar::sRenderGroupTitles = avatar_name_tag_mode > 0 ? name_tag_show_group_titles : 0; gPipeline.mBackfaceCull = true; gFrameCount++; @@ -1109,12 +1133,12 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) if (gShaderProfileFrame) { gShaderProfileFrame = false; - boost::json::value stats{ boost::json::object_kind }; + boost::json::value stats( boost::json::object_kind ); getProfileStatsContext(stats.as_object()); LLGLSLShader::finishProfile(stats); auto report_name = getProfileStatsFilename(); - std::ofstream outf(report_name); + llofstream outf(report_name); if (! outf) { LL_WARNS() << "Couldn't write to " << std::quoted(report_name) << LL_ENDL; @@ -1180,15 +1204,12 @@ std::string getProfileStatsFilename() // same second), may produce (e.g.) sec==61, but avoids collisions and // preserves chronological filename sort order. std::string name; - std::error_code ec; do { // base + missing 2-digit seconds, append ".json" // post-increment sec in case we have to try again name = stringize(base, std::setw(2), std::setfill('0'), sec++, ".json"); - } while (std::filesystem::exists(fsyspath(name), ec)); - // Ignoring ec means we might potentially return a name that does already - // exist -- but if we can't check its existence, what more can we do? + } while (LLFile::exists(name)); return name; } |
