From 7c95af74f195c9ec4ebc0fc0264d98cd4a85be49 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 14 Sep 2011 16:30:45 -0500 Subject: SH-2243 work in progress -- application side matrix stack management --- indra/llui/llui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 58ba9e05f5..b7894f5bf7 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -150,11 +150,11 @@ void gl_state_for_2d(S32 width, S32 height) F32 window_width = (F32) width;//gViewerWindow->getWindowWidth(); F32 window_height = (F32) height;//gViewerWindow->getWindowHeight(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0f, llmax(window_width, 1.f), 0.0f, llmax(window_height,1.f), -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadIdentity(); + gGL.ortho(0.0f, llmax(window_width, 1.f), 0.0f, llmax(window_height,1.f), -1.0f, 1.0f); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.loadIdentity(); stop_glerror(); } -- cgit v1.2.3 From 9ea41c8094695365bc7ea10165ffd54cda204e88 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 20 Sep 2011 00:54:37 -0500 Subject: SH-2243 No deprecated calls for the whole session. --- indra/llui/llui.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index b7894f5bf7..212672b809 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -992,10 +992,18 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) // ...gray squares gGL.color4f( .7f, .7f, .7f, alpha ); gGL.flush(); - glPolygonStipple( checkerboard ); - LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE); - gl_rect_2d(rect); + if (!LLGLSLShader::sNoFixedFunction) + { //polygon stipple is deprecated + glPolygonStipple( checkerboard ); + + LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE); + gl_rect_2d(rect); + } + else + { + gl_rect_2d(rect); + } gGL.flush(); } -- cgit v1.2.3 From f49e7014ca9693d77ff265d3fc668a8b05ddf085 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 24 Sep 2011 23:29:38 -0500 Subject: SH-2244 Fix for crash when transparent water disabled (silently ignore setting when basic shaders enabled) --- indra/llui/llui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 212672b809..36f87fc597 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -534,7 +534,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex } } - gGL.getTexUnit(0)->bind(image); + gGL.getTexUnit(0)->bind(image, true); gGL.color4fv(color.mV); @@ -732,7 +732,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLGLSUIDefault gls_ui; - gGL.getTexUnit(0)->bind(image); + gGL.getTexUnit(0)->bind(image, true); gGL.color4fv(color.mV); @@ -785,7 +785,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD); - gGL.getTexUnit(0)->bind(image); + gGL.getTexUnit(0)->bind(image, true); gGL.color4fv(color.mV); -- cgit v1.2.3 From 961ce1c4e785103b696a8ec76674aee4c91fe011 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 15 Nov 2011 12:24:31 -0600 Subject: SH-2591 WIP -- fix for UI disappearing, introduces some artifacts in rotation ring, committing to debug elsewhere --- indra/llui/llui.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index c6f7e28027..33bc247987 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -955,10 +955,12 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor if( render_center ) { gGL.color4fv(center_color.mV); + gGL.diffuseColor4fv(center_color.mV); gl_deep_circle( radius, width, steps ); } else { + gGL.diffuseColor4fv(side_color.mV); gl_washer_2d(radius, radius - width, steps, side_color, side_color); gGL.translateUI(0.f, 0.f, width); gl_washer_2d(radius - width, radius, steps, side_color, side_color); -- cgit v1.2.3 From 2851cd519338ef4a1fde15da8d4015ab4380d6cb Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 28 Nov 2011 11:33:49 -0700 Subject: a try fix for sh-2651: [crashhunters] Crash after google translate failure and sh-2658: crash in LLPluginMessage::parse --- indra/llui/llui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 79ad99a770..69461ec099 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1823,9 +1823,12 @@ void LLUI::setupPaths() LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(filename, root, NULL); Paths paths; - LLXUIParser parser; - parser.readXUI(root, paths, filename); + if(success) + { + LLXUIParser parser; + parser.readXUI(root, paths, filename); + } sXUIPaths.clear(); if (success && paths.validateBlock()) -- cgit v1.2.3 From e0a62d894145a6903727e95890bfab6a925a11b7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 27 Jan 2012 12:41:18 -0600 Subject: SH-2768 Put transparency checkerboard back in texture preview --- indra/llui/llui.cpp | 54 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6b74c5a6be..a38d0a0b0b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -972,43 +972,53 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor // Draw gray and white checkerboard with black border void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) { - // Initialize the first time this is called. - const S32 PIXELS = 32; - static GLubyte checkerboard[PIXELS * PIXELS]; - static BOOL first = TRUE; - if( first ) - { - for( S32 i = 0; i < PIXELS; i++ ) + if (!LLGLSLShader::sNoFixedFunction) + { + // Initialize the first time this is called. + const S32 PIXELS = 32; + static GLubyte checkerboard[PIXELS * PIXELS]; + static BOOL first = TRUE; + if( first ) { - for( S32 j = 0; j < PIXELS; j++ ) + for( S32 i = 0; i < PIXELS; i++ ) { - checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF; + for( S32 j = 0; j < PIXELS; j++ ) + { + checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF; + } } + first = FALSE; } - first = FALSE; - } - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - // ...white squares - gGL.color4f( 1.f, 1.f, 1.f, alpha ); - gl_rect_2d(rect); + // ...white squares + gGL.color4f( 1.f, 1.f, 1.f, alpha ); + gl_rect_2d(rect); - // ...gray squares - gGL.color4f( .7f, .7f, .7f, alpha ); - gGL.flush(); + // ...gray squares + gGL.color4f( .7f, .7f, .7f, alpha ); + gGL.flush(); - if (!LLGLSLShader::sNoFixedFunction) - { //polygon stipple is deprecated glPolygonStipple( checkerboard ); LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE); gl_rect_2d(rect); } else - { - gl_rect_2d(rect); + { //polygon stipple is deprecated, use "Checker" texture + LLPointer img = LLUI::getUIImage("Checker"); + gGL.getTexUnit(0)->bind(img->getImage()); + gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); + + LLColor4 color(1.f, 1.f, 1.f, alpha); + LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f); + + gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), + img->getImage(), color, uv_rect); } + gGL.flush(); } -- cgit v1.2.3 From d56be1f1751f66bff09f0d223ed4712974e69e09 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 12:31:48 -0800 Subject: EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates refactored LLCoord code to be templated, ultimately to support arbitrary conversions --- indra/llui/llui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6b74c5a6be..931b696c90 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1688,21 +1688,22 @@ void LLUI::translate(F32 x, F32 y, F32 z) gGL.translateUI(x,y,z); LLFontGL::sCurOrigin.mX += (S32) x; LLFontGL::sCurOrigin.mY += (S32) y; - LLFontGL::sCurOrigin.mZ += z; + LLFontGL::sCurDepth += z; } //static void LLUI::pushMatrix() { gGL.pushUIMatrix(); - LLFontGL::sOriginStack.push_back(LLFontGL::sCurOrigin); + LLFontGL::sOriginStack.push_back(std::make_pair(LLFontGL::sCurOrigin, LLFontGL::sCurDepth)); } //static void LLUI::popMatrix() { gGL.popUIMatrix(); - LLFontGL::sCurOrigin = *LLFontGL::sOriginStack.rbegin(); + LLFontGL::sCurOrigin = LLFontGL::sOriginStack.back().first; + LLFontGL::sCurDepth = LLFontGL::sOriginStack.back().second; LLFontGL::sOriginStack.pop_back(); } @@ -1712,7 +1713,7 @@ void LLUI::loadIdentity() gGL.loadUIIdentity(); LLFontGL::sCurOrigin.mX = 0; LLFontGL::sCurOrigin.mY = 0; - LLFontGL::sCurOrigin.mZ = 0; + LLFontGL::sCurDepth = 0.f; } //static -- cgit v1.2.3 From 4e08461f8ad23fb75ca8587c781c2cf65351b1ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 19:29:10 -0800 Subject: EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates changed over to new convert() method added LLCoordFloater --- indra/llui/llui.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 931b696c90..137716743f 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1736,10 +1736,7 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) screen_x = llround((F32)x * sGLScaleFactor.mV[VX]); screen_y = llround((F32)y * sGLScaleFactor.mV[VY]); - LLCoordWindow window_point; - LLView::getWindow()->convertCoords(LLCoordGL(screen_x, screen_y), &window_point); - - LLView::getWindow()->setCursorPosition(window_point); + LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } //static @@ -1747,8 +1744,7 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; getWindow()->getCursorPosition(&cursor_pos_window); - LLCoordGL cursor_pos_gl; - getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); + LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); *x = llround((F32)cursor_pos_gl.mX / sGLScaleFactor.mV[VX]); *y = llround((F32)cursor_pos_gl.mY / sGLScaleFactor.mV[VX]); } -- cgit v1.2.3 From 45e30f35dc1a3dc07862ca9f67bbbdb238d364fe Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Feb 2012 17:50:09 -0800 Subject: EXP-1883 FIX Toolbar button tooltips display off screen for right hand tool bar, bottom tool bar, and tooltips on top bar items show off screen --- indra/llui/llui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 137716743f..31ccec0d2a 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -2049,7 +2049,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y) // Start at spawn position (using left/top) view->setOrigin( local_x, local_y - view->getRect().getHeight()); // Make sure we're on-screen and not overlapping the mouse - view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect, FALSE ); + view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect ); } LLView* LLUI::resolvePath(LLView* context, const std::string& path) -- cgit v1.2.3