summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-07-27 15:17:57 +0800
committerErik Kundiman <erik@megapahit.org>2024-07-28 08:24:59 +0800
commit96a81b5ecbe3bffb582ded930752c0523df5e80a (patch)
treea87a0bd09fd980562e88150dbfea3819d28d9f12 /indra/newview/llviewerdisplay.cpp
parent06e8f0c443c1ba7858d000c6d695b7e988e02053 (diff)
parented73208eb96b862b97fa285036edea1e792ca3c6 (diff)
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 9ed1fbf366..3183b39e98 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -87,21 +87,21 @@ extern bool gShiftFrame;
LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
// used to toggle renderer back on after teleport
-BOOL gTeleportDisplay = FALSE;
+bool gTeleportDisplay = false;
LLFrameTimer gTeleportDisplayTimer;
LLFrameTimer gTeleportArrivalTimer;
const F32 RESTORE_GL_TIME = 5.f; // Wait this long while reloading textures before we raise the curtain
-BOOL gForceRenderLandFence = FALSE;
-BOOL gDisplaySwapBuffers = FALSE;
-BOOL gDepthDirty = FALSE;
-BOOL gResizeScreenTexture = FALSE;
-BOOL gResizeShadowTexture = FALSE;
-BOOL gWindowResized = FALSE;
-BOOL gSnapshot = FALSE;
-BOOL gCubeSnapshot = FALSE;
-BOOL gSnapshotNoPost = FALSE;
-BOOL gShaderProfileFrame = FALSE;
+bool gForceRenderLandFence = false;
+bool gDisplaySwapBuffers = false;
+bool gDepthDirty = false;
+bool gResizeScreenTexture = false;
+bool gResizeShadowTexture = false;
+bool gWindowResized = false;
+bool gSnapshot = false;
+bool gCubeSnapshot = false;
+bool gSnapshotNoPost = false;
+bool gShaderProfileFrame = false;
// This is how long the sim will try to teleport you before giving up.
const F32 TELEPORT_EXPIRY = 15.0f;
@@ -230,7 +230,7 @@ void display_stats()
gMemoryAllocated = U64Bytes(LLMemory::getCurrentRSS());
U32Megabytes memory = gMemoryAllocated;
LL_INFOS() << "MEMORY: " << memory << LL_ENDL;
- LLMemory::logMemoryInfo(TRUE) ;
+ LLMemory::logMemoryInfo(true) ;
gRecentMemoryTime.reset();
}
const F32 ASSET_STORAGE_LOG_FREQUENCY = 60.f;
@@ -267,7 +267,7 @@ static void update_tp_display(bool minimized)
// is minimized *during* a TP. HB
if (minimized)
{
- gViewerWindow->setShowProgress(FALSE);
+ gViewerWindow->setShowProgress(false);
}
const std::string& message = gAgent.getTeleportMessage();
@@ -279,7 +279,7 @@ static void update_tp_display(bool minimized)
const std::string& msg = LLAgent::sTeleportProgressMessages["pending"];
if (!minimized)
{
- gViewerWindow->setShowProgress(TRUE);
+ gViewerWindow->setShowProgress(true);
gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f));
gViewerWindow->setProgressString(msg);
}
@@ -298,7 +298,7 @@ static void update_tp_display(bool minimized)
gAgent.setTeleportMessage(msg);
if (!minimized)
{
- gViewerWindow->setShowProgress(TRUE);
+ gViewerWindow->setShowProgress(true);
gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f));
gViewerWindow->setProgressString(msg);
gViewerWindow->setProgressMessage(gAgent.mMOTD);
@@ -332,11 +332,11 @@ static void update_tp_display(bool minimized)
gAgent.setTeleportState(LLAgent::TELEPORT_ARRIVING);
gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["arriving"]);
gAgent.sheduleTeleportIM();
- gTextureList.mForceResetTextureStats = TRUE;
- gAgentCamera.resetView(TRUE, TRUE);
+ gTextureList.mForceResetTextureStats = true;
+ gAgentCamera.resetView(true, true);
if (!minimized)
{
- gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel"));
+ gViewerWindow->setProgressCancelButtonVisible(false, LLTrans::getString("Cancel"));
gViewerWindow->setProgressPercent(75.f);
}
break;
@@ -354,7 +354,7 @@ static void update_tp_display(bool minimized)
}
if (!minimized)
{
- gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel"));
+ gViewerWindow->setProgressCancelButtonVisible(false, LLTrans::getString("Cancel"));
gViewerWindow->setProgressPercent(arrival_fraction * 25.f + 75.f);
gViewerWindow->setProgressString(message);
}
@@ -379,13 +379,13 @@ static void update_tp_display(bool minimized)
case LLAgent::TELEPORT_NONE:
// No teleport in progress
- gViewerWindow->setShowProgress(FALSE);
- gTeleportDisplay = FALSE;
+ gViewerWindow->setShowProgress(false);
+ gTeleportDisplay = false;
}
}
// Paint the display!
-void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
+void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Render");
@@ -400,22 +400,22 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gViewerWindow->getWindow()->swapBuffers();
LLPipeline::refreshCachedSettings();
gPipeline.resizeScreenTexture();
- gResizeScreenTexture = FALSE;
- gWindowResized = FALSE;
+ gResizeScreenTexture = false;
+ gWindowResized = false;
return;
}
if (gResizeShadowTexture)
{ //skip render on frames where window has been resized
gPipeline.resizeShadowTexture();
- gResizeShadowTexture = FALSE;
+ gResizeShadowTexture = false;
}
gSnapshot = for_snapshot;
if (LLPipeline::sRenderDeferred)
{ //hack to make sky show up in deferred snapshots
- for_snapshot = FALSE;
+ for_snapshot = false;
}
LLGLSDefault gls_default;
@@ -480,7 +480,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
static F32 last_update_time = 0.f;
if ((gFrameTimeSeconds - last_update_time) > 1.f)
{
- InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), NULL, FALSE);
+ InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), NULL, false);
last_update_time = gFrameTimeSeconds;
}
#elif LL_DARWIN
@@ -508,7 +508,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLGLSLShader::initProfile();
}
- //LLGLState::verify(FALSE);
+ //LLGLState::verify(false);
/////////////////////////////////////////////////
//
@@ -523,7 +523,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode");
LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("NameTagShowGroupTitles") && gSavedSettings.getS32("AvatarNameTagMode"));
- gPipeline.mBackfaceCull = TRUE;
+ gPipeline.mBackfaceCull = true;
gFrameCount++;
gRecentFrameCount++;
if (gFocusMgr.getAppHasFocus())
@@ -567,8 +567,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
F32 percent_done = gRestoreGLTimer.getElapsedTimeF32() * 100.f / RESTORE_GL_TIME;
if( percent_done > 100.f )
{
- gViewerWindow->setShowProgress(FALSE);
- gRestoreGL = FALSE;
+ gViewerWindow->setShowProgress(false);
+ gRestoreGL = false;
}
else
{
@@ -713,7 +713,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
//Increment drawable frame counter
LLDrawable::incrementVisible();
- LLSpatialGroup::sNoDelete = TRUE;
+ LLSpatialGroup::sNoDelete = true;
LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
S32 occlusion = LLPipeline::sUseOcclusion;
@@ -721,7 +721,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{ //depth buffer is invalid, don't overwrite occlusion state
LLPipeline::sUseOcclusion = llmin(occlusion, 1);
}
- gDepthDirty = FALSE;
+ gDepthDirty = false;
LLGLState::checkStates();
@@ -740,7 +740,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gResizeScreenTexture)
{
gPipeline.resizeScreenTexture();
- gResizeScreenTexture = FALSE;
+ gResizeScreenTexture = false;
}
gGL.setColorMask(true, true);
@@ -901,7 +901,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// gGL.popMatrix();
//}
- LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
+ LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater();
LLGLState::checkStates();
@@ -958,7 +958,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gOcclusionProgram.bind();
for (U32 i = 0; i < num_types; i++)
{
- gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
+ gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, false);
}
gOcclusionProgram.unbind();
@@ -971,7 +971,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Texture Unbind");
- for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
+ for (S32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
{ //dummy cleanup of any currently bound textures
if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
{
@@ -991,7 +991,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gPipeline.renderDeferredLighting();
}
- LLPipeline::sUnderWaterRender = FALSE;
+ LLPipeline::sUnderWaterRender = false;
{
//capture the frame buffer.
@@ -1006,7 +1006,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
- LLSpatialGroup::sNoDelete = FALSE;
+ LLSpatialGroup::sNoDelete = false;
gPipeline.clearReferences();
}
@@ -1022,7 +1022,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gShaderProfileFrame)
{
- gShaderProfileFrame = FALSE;
+ gShaderProfileFrame = false;
LLGLSLShader::finishProfile();
}
}
@@ -1048,7 +1048,7 @@ void display_cube_face()
gPipeline.disableLights();
- gPipeline.mBackfaceCull = TRUE;
+ gPipeline.mBackfaceCull = true;
gViewerWindow->setup3DViewport();
@@ -1070,11 +1070,11 @@ void display_cube_face()
LLEnvironment::instance().update(LLViewerCamera::getInstance());
}
- LLSpatialGroup::sNoDelete = TRUE;
+ LLSpatialGroup::sNoDelete = true;
S32 occlusion = LLPipeline::sUseOcclusion;
LLPipeline::sUseOcclusion = 0; // occlusion data is from main camera point of view, don't read or write it during cube snapshots
- //gDepthDirty = TRUE; //let "real" render pipe know it can't trust the depth buffer for occlusion data
+ //gDepthDirty = true; //let "real" render pipe know it can't trust the depth buffer for occlusion data
static LLCullResult result;
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
@@ -1108,7 +1108,7 @@ void display_cube_face()
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderStart");
- LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
+ LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater();
gGL.setColorMask(true, true);
@@ -1131,12 +1131,12 @@ void display_cube_face()
gPipeline.renderDeferredLighting();
- LLPipeline::sUnderWaterRender = FALSE;
+ LLPipeline::sUnderWaterRender = false;
// Finalize scene
//gPipeline.renderFinalize();
- LLSpatialGroup::sNoDelete = FALSE;
+ LLSpatialGroup::sNoDelete = false;
gPipeline.clearReferences();
}
@@ -1158,11 +1158,11 @@ void render_hud_attachments()
if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices())
{
- LLPipeline::sRenderingHUDs = TRUE;
+ LLPipeline::sRenderingHUDs = true;
LLCamera hud_cam = *LLViewerCamera::getInstance();
hud_cam.setOrigin(-1.f,0,0);
hud_cam.setAxes(LLVector3(1,0,0), LLVector3(0,1,0), LLVector3(0,0,1));
- LLViewerCamera::updateFrustumPlanes(hud_cam, TRUE);
+ LLViewerCamera::updateFrustumPlanes(hud_cam, true);
bool render_particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) && gSavedSettings.getBOOL("RenderHUDParticles");
@@ -1194,7 +1194,7 @@ void render_hud_attachments()
//cull, sort, and render hud objects
static LLCullResult result;
- LLSpatialGroup::sNoDelete = TRUE;
+ LLSpatialGroup::sNoDelete = true;
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
gPipeline.updateCull(hud_cam, result);
@@ -1229,7 +1229,7 @@ void render_hud_attachments()
gPipeline.renderGeomPostDeferred(hud_cam);
- LLSpatialGroup::sNoDelete = FALSE;
+ LLSpatialGroup::sNoDelete = false;
//gPipeline.clearReferences();
render_hud_elements();
@@ -1242,7 +1242,7 @@ void render_hud_attachments()
gPipeline.toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
LLPipeline::sUseOcclusion = use_occlusion;
- LLPipeline::sRenderingHUDs = FALSE;
+ LLPipeline::sRenderingHUDs = false;
}
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.popMatrix();
@@ -1303,11 +1303,11 @@ bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::mat
tmp_model *= mat;
model = tmp_model;
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -1337,7 +1337,7 @@ bool setup_hud_matrices(const LLRect& screen_region)
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.loadMatrix(model.m);
set_current_modelview(model);
- return TRUE;
+ return true;
}
void render_ui(F32 zoom_factor, int subfield)
@@ -1429,7 +1429,7 @@ void swap()
{
gViewerWindow->getWindow()->swapBuffers();
}
- gDisplaySwapBuffers = TRUE;
+ gDisplaySwapBuffers = true;
}
void renderCoordinateAxes()
@@ -1530,7 +1530,7 @@ void render_ui_3d()
draw_axes();
}
- gViewerWindow->renderSelections(FALSE, FALSE, TRUE); // Non HUD call in render_hud_elements
+ gViewerWindow->renderSelections(false, false, true); // Non HUD call in render_hud_elements
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
@@ -1586,7 +1586,7 @@ void render_ui_2d()
F32 zoom = gAgentCamera.mHUDCurZoom;
gGL.scalef(zoom,zoom,1.f);
gGL.color4fv(LLColor4::white.mV);
- gl_rect_2d(-half_width, half_height, half_width, -half_height, FALSE);
+ gl_rect_2d(-half_width, half_height, half_width, -half_height, false);
gGL.popMatrix();
gUIProgram.unbind();
stop_glerror();
@@ -1706,7 +1706,7 @@ void render_disconnected_background()
raw->expandToPowerOfTwo();
- gDisconnectedImagep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE );
+ gDisconnectedImagep = LLViewerTextureManager::getLocalTexture(raw.get(), false );
gStartTexture = gDisconnectedImagep;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}