From 0f6242d9fd948cda1abf18885eef320b22d310c5 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2009 14:00:38 -0800 Subject: Sanitize naming of getWindowRect (scaled vs. raw pixels) and getWorldViewRect (scaled vs. raw) Reduces chance of future UI bugs related to UI size. Discussed with Richard. --- indra/newview/pipeline.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2daaf77772..3ec23f4cb2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -510,8 +510,8 @@ void LLPipeline::resizeScreenTexture() { if (gPipeline.canUseVertexShaders() && assertInitialized()) { - GLuint resX = gViewerWindow->getWorldViewWidth(); - GLuint resY = gViewerWindow->getWorldViewHeight(); + GLuint resX = gViewerWindow->getWorldViewWidthRaw(); + GLuint resY = gViewerWindow->getWorldViewHeightRaw(); allocateScreenBuffer(resX,resY); @@ -696,8 +696,8 @@ void LLPipeline::createGLBuffers() stop_glerror(); - GLuint resX = gViewerWindow->getWorldViewWidth(); - GLuint resY = gViewerWindow->getWorldViewHeight(); + GLuint resX = gViewerWindow->getWorldViewWidthRaw(); + GLuint resY = gViewerWindow->getWorldViewHeightRaw(); if (LLPipeline::sRenderGlow) { //screen space glow buffers @@ -3049,7 +3049,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PICKING)) { LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderForSelect"); - gObjectList.renderObjectsForSelect(camera, gViewerWindow->getVirtualWindowRect()); + gObjectList.renderObjectsForSelect(camera, gViewerWindow->getWindowRectScaled()); } else { @@ -5530,8 +5530,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); LLVector2 tc1(0,0); - LLVector2 tc2((F32) gViewerWindow->getWorldViewWidth()*2, - (F32) gViewerWindow->getWorldViewHeight()*2); + LLVector2 tc2((F32) gViewerWindow->getWorldViewWidthRaw()*2, + (F32) gViewerWindow->getWorldViewHeightRaw()*2); if (res_mod > 1) { @@ -5731,14 +5731,14 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } - gGLViewport[0] = gViewerWindow->getWorldViewRect().mLeft; - gGLViewport[1] = gViewerWindow->getWorldViewRect().mBottom; - gGLViewport[2] = gViewerWindow->getWorldViewRect().getWidth(); - gGLViewport[3] = gViewerWindow->getWorldViewRect().getHeight(); + gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; + gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; + gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); + gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - tc2.setVec((F32) gViewerWindow->getWorldViewWidth(), - (F32) gViewerWindow->getWorldViewHeight()); + tc2.setVec((F32) gViewerWindow->getWorldViewWidthRaw(), + (F32) gViewerWindow->getWorldViewHeightRaw()); gGL.flush(); @@ -8742,7 +8742,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) glClearStencil(0); // get the number of pixels per angle - F32 pa = gViewerWindow->getWindowDisplayHeight() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); + F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); //get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing) U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512); -- cgit v1.2.3