diff options
Diffstat (limited to 'linden/indra/llui/llui.cpp')
-rw-r--r-- | linden/indra/llui/llui.cpp | 126 |
1 files changed, 74 insertions, 52 deletions
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 734aecf..f3e73fd 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -30,8 +30,6 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | // Utilities functions the user interface needs | 32 | // Utilities functions the user interface needs |
33 | |||
34 | //#include "llviewerprecompiledheaders.h" | ||
35 | #include "linden_common.h" | 33 | #include "linden_common.h" |
36 | 34 | ||
37 | #include <string> | 35 | #include <string> |
@@ -143,11 +141,11 @@ void gl_state_for_2d(S32 width, S32 height) | |||
143 | 141 | ||
144 | void gl_draw_x(const LLRect& rect, const LLColor4& color) | 142 | void gl_draw_x(const LLRect& rect, const LLColor4& color) |
145 | { | 143 | { |
146 | LLGLSNoTexture no_texture; | 144 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
147 | 145 | ||
148 | gGL.color4fv( color.mV ); | 146 | gGL.color4fv( color.mV ); |
149 | 147 | ||
150 | gGL.begin( LLVertexBuffer::LINES ); | 148 | gGL.begin( LLRender::LINES ); |
151 | gGL.vertex2i( rect.mLeft, rect.mTop ); | 149 | gGL.vertex2i( rect.mLeft, rect.mTop ); |
152 | gGL.vertex2i( rect.mRight, rect.mBottom ); | 150 | gGL.vertex2i( rect.mRight, rect.mBottom ); |
153 | gGL.vertex2i( rect.mLeft, rect.mBottom ); | 151 | gGL.vertex2i( rect.mLeft, rect.mBottom ); |
@@ -183,12 +181,12 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe | |||
183 | void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) | 181 | void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) |
184 | { | 182 | { |
185 | stop_glerror(); | 183 | stop_glerror(); |
186 | LLGLSNoTexture no_texture; | 184 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
187 | 185 | ||
188 | // Counterclockwise quad will face the viewer | 186 | // Counterclockwise quad will face the viewer |
189 | if( filled ) | 187 | if( filled ) |
190 | { | 188 | { |
191 | gGL.begin( LLVertexBuffer::QUADS ); | 189 | gGL.begin( LLRender::QUADS ); |
192 | gGL.vertex2i(left, top); | 190 | gGL.vertex2i(left, top); |
193 | gGL.vertex2i(left, bottom); | 191 | gGL.vertex2i(left, bottom); |
194 | gGL.vertex2i(right, bottom); | 192 | gGL.vertex2i(right, bottom); |
@@ -200,7 +198,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) | |||
200 | if( gGLManager.mATIOffsetVerticalLines ) | 198 | if( gGLManager.mATIOffsetVerticalLines ) |
201 | { | 199 | { |
202 | // Work around bug in ATI driver: vertical lines are offset by (-1,-1) | 200 | // Work around bug in ATI driver: vertical lines are offset by (-1,-1) |
203 | gGL.begin( LLVertexBuffer::LINES ); | 201 | gGL.begin( LLRender::LINES ); |
204 | 202 | ||
205 | // Verticals | 203 | // Verticals |
206 | gGL.vertex2i(left + 1, top); | 204 | gGL.vertex2i(left + 1, top); |
@@ -223,7 +221,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) | |||
223 | { | 221 | { |
224 | top--; | 222 | top--; |
225 | right--; | 223 | right--; |
226 | gGL.begin( LLVertexBuffer::LINE_STRIP ); | 224 | gGL.begin( LLRender::LINE_STRIP ); |
227 | gGL.vertex2i(left, top); | 225 | gGL.vertex2i(left, top); |
228 | gGL.vertex2i(left, bottom); | 226 | gGL.vertex2i(left, bottom); |
229 | gGL.vertex2i(right, bottom); | 227 | gGL.vertex2i(right, bottom); |
@@ -254,7 +252,7 @@ void gl_rect_2d( const LLRect& rect, const LLColor4& color, BOOL filled ) | |||
254 | void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines) | 252 | void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines) |
255 | { | 253 | { |
256 | stop_glerror(); | 254 | stop_glerror(); |
257 | LLGLSNoTexture no_texture; | 255 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
258 | 256 | ||
259 | // HACK: Overlap with the rectangle by a single pixel. | 257 | // HACK: Overlap with the rectangle by a single pixel. |
260 | right--; | 258 | right--; |
@@ -264,7 +262,7 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st | |||
264 | LLColor4 end_color = start_color; | 262 | LLColor4 end_color = start_color; |
265 | end_color.mV[VALPHA] = 0.f; | 263 | end_color.mV[VALPHA] = 0.f; |
266 | 264 | ||
267 | gGL.begin(LLVertexBuffer::QUADS); | 265 | gGL.begin(LLRender::QUADS); |
268 | 266 | ||
269 | // Right edge, CCW faces screen | 267 | // Right edge, CCW faces screen |
270 | gGL.color4fv(start_color.mV); | 268 | gGL.color4fv(start_color.mV); |
@@ -324,9 +322,9 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2 ) | |||
324 | y2++; | 322 | y2++; |
325 | } | 323 | } |
326 | 324 | ||
327 | LLGLSNoTexture no_texture; | 325 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
328 | 326 | ||
329 | gGL.begin(LLVertexBuffer::LINES); | 327 | gGL.begin(LLRender::LINES); |
330 | gGL.vertex2i(x1, y1); | 328 | gGL.vertex2i(x1, y1); |
331 | gGL.vertex2i(x2, y2); | 329 | gGL.vertex2i(x2, y2); |
332 | gGL.end(); | 330 | gGL.end(); |
@@ -343,11 +341,11 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) | |||
343 | y2++; | 341 | y2++; |
344 | } | 342 | } |
345 | 343 | ||
346 | LLGLSNoTexture no_texture; | 344 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
347 | 345 | ||
348 | gGL.color4fv( color.mV ); | 346 | gGL.color4fv( color.mV ); |
349 | 347 | ||
350 | gGL.begin(LLVertexBuffer::LINES); | 348 | gGL.begin(LLRender::LINES); |
351 | gGL.vertex2i(x1, y1); | 349 | gGL.vertex2i(x1, y1); |
352 | gGL.vertex2i(x2, y2); | 350 | gGL.vertex2i(x2, y2); |
353 | gGL.end(); | 351 | gGL.end(); |
@@ -355,17 +353,17 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) | |||
355 | 353 | ||
356 | void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColor4& color, BOOL filled) | 354 | void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColor4& color, BOOL filled) |
357 | { | 355 | { |
358 | LLGLSNoTexture no_texture; | 356 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
359 | 357 | ||
360 | gGL.color4fv(color.mV); | 358 | gGL.color4fv(color.mV); |
361 | 359 | ||
362 | if (filled) | 360 | if (filled) |
363 | { | 361 | { |
364 | gGL.begin(LLVertexBuffer::TRIANGLES); | 362 | gGL.begin(LLRender::TRIANGLES); |
365 | } | 363 | } |
366 | else | 364 | else |
367 | { | 365 | { |
368 | gGL.begin(LLVertexBuffer::LINE_LOOP); | 366 | gGL.begin(LLRender::LINE_LOOP); |
369 | } | 367 | } |
370 | gGL.vertex2i(x1, y1); | 368 | gGL.vertex2i(x1, y1); |
371 | gGL.vertex2i(x2, y2); | 369 | gGL.vertex2i(x2, y2); |
@@ -375,11 +373,11 @@ void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColo | |||
375 | 373 | ||
376 | void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max_frac) | 374 | void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max_frac) |
377 | { | 375 | { |
378 | LLGLSNoTexture no_texture; | 376 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
379 | 377 | ||
380 | length = llmin((S32)(max_frac*(right - left)), length); | 378 | length = llmin((S32)(max_frac*(right - left)), length); |
381 | length = llmin((S32)(max_frac*(top - bottom)), length); | 379 | length = llmin((S32)(max_frac*(top - bottom)), length); |
382 | gGL.begin(LLVertexBuffer::LINES); | 380 | gGL.begin(LLRender::LINES); |
383 | gGL.vertex2i(left, top); | 381 | gGL.vertex2i(left, top); |
384 | gGL.vertex2i(left + length, top); | 382 | gGL.vertex2i(left + length, top); |
385 | 383 | ||
@@ -496,11 +494,11 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma | |||
496 | { | 494 | { |
497 | gGL.translatef((F32)x, (F32)y, 0.f); | 495 | gGL.translatef((F32)x, (F32)y, 0.f); |
498 | 496 | ||
499 | image->bind(); | 497 | gGL.getTexUnit(0)->bind(image); |
500 | 498 | ||
501 | gGL.color4fv(color.mV); | 499 | gGL.color4fv(color.mV); |
502 | 500 | ||
503 | gGL.begin(LLVertexBuffer::QUADS); | 501 | gGL.begin(LLRender::QUADS); |
504 | { | 502 | { |
505 | // draw bottom left | 503 | // draw bottom left |
506 | gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); | 504 | gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); |
@@ -656,11 +654,11 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre | |||
656 | gGL.translatef( -offset_x, -offset_y, 0.f ); | 654 | gGL.translatef( -offset_x, -offset_y, 0.f ); |
657 | } | 655 | } |
658 | 656 | ||
659 | image->bind(); | 657 | gGL.getTexUnit(0)->bind(image); |
660 | 658 | ||
661 | gGL.color4fv(color.mV); | 659 | gGL.color4fv(color.mV); |
662 | 660 | ||
663 | gGL.begin(LLVertexBuffer::QUADS); | 661 | gGL.begin(LLRender::QUADS); |
664 | { | 662 | { |
665 | gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); | 663 | gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); |
666 | gGL.vertex2i(width, height ); | 664 | gGL.vertex2i(width, height ); |
@@ -694,11 +692,11 @@ void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageG | |||
694 | { | 692 | { |
695 | gGL.translatef((F32)x, (F32)y, 0.f); | 693 | gGL.translatef((F32)x, (F32)y, 0.f); |
696 | 694 | ||
697 | image->bind(); | 695 | gGL.getTexUnit(0)->bind(image); |
698 | 696 | ||
699 | gGL.color4fv(color.mV); | 697 | gGL.color4fv(color.mV); |
700 | 698 | ||
701 | gGL.begin(LLVertexBuffer::QUADS); | 699 | gGL.begin(LLRender::QUADS); |
702 | { | 700 | { |
703 | gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); | 701 | gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); |
704 | gGL.vertex2i(width, height ); | 702 | gGL.vertex2i(width, height ); |
@@ -733,7 +731,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL | |||
733 | glLineWidth(2.5f); | 731 | glLineWidth(2.5f); |
734 | glLineStipple(2, 0x3333 << shift); | 732 | glLineStipple(2, 0x3333 << shift); |
735 | 733 | ||
736 | gGL.begin(LLVertexBuffer::LINES); | 734 | gGL.begin(LLRender::LINES); |
737 | { | 735 | { |
738 | gGL.vertex3fv( start.mV ); | 736 | gGL.vertex3fv( start.mV ); |
739 | gGL.vertex3fv( end.mV ); | 737 | gGL.vertex3fv( end.mV ); |
@@ -750,7 +748,7 @@ void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom) | |||
750 | glLogicOp( GL_XOR ); | 748 | glLogicOp( GL_XOR ); |
751 | stop_glerror(); | 749 | stop_glerror(); |
752 | 750 | ||
753 | gGL.begin(LLVertexBuffer::QUADS); | 751 | gGL.begin(LLRender::QUADS); |
754 | gGL.vertex2i(left, top); | 752 | gGL.vertex2i(left, top); |
755 | gGL.vertex2i(left, bottom); | 753 | gGL.vertex2i(left, bottom); |
756 | gGL.vertex2i(right, bottom); | 754 | gGL.vertex2i(right, bottom); |
@@ -782,14 +780,14 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F | |||
782 | 780 | ||
783 | if (filled) | 781 | if (filled) |
784 | { | 782 | { |
785 | gGL.begin(LLVertexBuffer::TRIANGLE_FAN); | 783 | gGL.begin(LLRender::TRIANGLE_FAN); |
786 | gGL.vertex2f(0.f, 0.f); | 784 | gGL.vertex2f(0.f, 0.f); |
787 | // make sure circle is complete | 785 | // make sure circle is complete |
788 | steps += 1; | 786 | steps += 1; |
789 | } | 787 | } |
790 | else | 788 | else |
791 | { | 789 | { |
792 | gGL.begin(LLVertexBuffer::LINE_STRIP); | 790 | gGL.begin(LLRender::LINE_STRIP); |
793 | } | 791 | } |
794 | 792 | ||
795 | while( steps-- ) | 793 | while( steps-- ) |
@@ -809,7 +807,7 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled | |||
809 | { | 807 | { |
810 | gGL.pushMatrix(); | 808 | gGL.pushMatrix(); |
811 | { | 809 | { |
812 | LLGLSNoTexture gls_no_texture; | 810 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
813 | gGL.translatef(center_x, center_y, 0.f); | 811 | gGL.translatef(center_x, center_y, 0.f); |
814 | 812 | ||
815 | // Inexact, but reasonably fast. | 813 | // Inexact, but reasonably fast. |
@@ -821,14 +819,14 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled | |||
821 | 819 | ||
822 | if (filled) | 820 | if (filled) |
823 | { | 821 | { |
824 | gGL.begin(LLVertexBuffer::TRIANGLE_FAN); | 822 | gGL.begin(LLRender::TRIANGLE_FAN); |
825 | gGL.vertex2f(0.f, 0.f); | 823 | gGL.vertex2f(0.f, 0.f); |
826 | // make sure circle is complete | 824 | // make sure circle is complete |
827 | steps += 1; | 825 | steps += 1; |
828 | } | 826 | } |
829 | else | 827 | else |
830 | { | 828 | { |
831 | gGL.begin(LLVertexBuffer::LINE_LOOP); | 829 | gGL.begin(LLRender::LINE_LOOP); |
832 | } | 830 | } |
833 | 831 | ||
834 | while( steps-- ) | 832 | while( steps-- ) |
@@ -850,7 +848,7 @@ void gl_deep_circle( F32 radius, F32 depth, S32 steps ) | |||
850 | F32 x = radius; | 848 | F32 x = radius; |
851 | F32 y = 0.f; | 849 | F32 y = 0.f; |
852 | F32 angle_delta = F_TWO_PI / (F32)steps; | 850 | F32 angle_delta = F_TWO_PI / (F32)steps; |
853 | gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); | 851 | gGL.begin( LLRender::TRIANGLE_STRIP ); |
854 | { | 852 | { |
855 | S32 step = steps + 1; // An extra step to close the circle. | 853 | S32 step = steps + 1; // An extra step to close the circle. |
856 | while( step-- ) | 854 | while( step-- ) |
@@ -905,7 +903,7 @@ void gl_rect_2d_checkerboard(const LLRect& rect) | |||
905 | first = FALSE; | 903 | first = FALSE; |
906 | } | 904 | } |
907 | 905 | ||
908 | LLGLSNoTexture gls_no_texture; | 906 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
909 | 907 | ||
910 | // ...white squares | 908 | // ...white squares |
911 | gGL.color3f( 1.f, 1.f, 1.f ); | 909 | gGL.color3f( 1.f, 1.f, 1.f ); |
@@ -935,9 +933,9 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& | |||
935 | F32 x2 = inner_radius; | 933 | F32 x2 = inner_radius; |
936 | F32 y2 = 0.f; | 934 | F32 y2 = 0.f; |
937 | 935 | ||
938 | LLGLSNoTexture gls_no_texture; | 936 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
939 | 937 | ||
940 | gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); | 938 | gGL.begin( LLRender::TRIANGLE_STRIP ); |
941 | { | 939 | { |
942 | steps += 1; // An extra step to close the circle. | 940 | steps += 1; // An extra step to close the circle. |
943 | while( steps-- ) | 941 | while( steps-- ) |
@@ -972,8 +970,8 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, | |||
972 | F32 x2 = inner_radius * cos( start_radians ); | 970 | F32 x2 = inner_radius * cos( start_radians ); |
973 | F32 y2 = inner_radius * sin( start_radians ); | 971 | F32 y2 = inner_radius * sin( start_radians ); |
974 | 972 | ||
975 | LLGLSNoTexture gls_no_texture; | 973 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
976 | gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); | 974 | gGL.begin( LLRender::TRIANGLE_STRIP ); |
977 | { | 975 | { |
978 | steps += 1; // An extra step to close the circle. | 976 | steps += 1; // An extra step to close the circle. |
979 | while( steps-- ) | 977 | while( steps-- ) |
@@ -1008,9 +1006,9 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL | |||
1008 | F32 x2 = inner_radius * cos( HALF_DELTA ); | 1006 | F32 x2 = inner_radius * cos( HALF_DELTA ); |
1009 | F32 y2 = inner_radius * sin( HALF_DELTA ); | 1007 | F32 y2 = inner_radius * sin( HALF_DELTA ); |
1010 | 1008 | ||
1011 | LLGLSNoTexture gls_no_texture; | 1009 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
1012 | 1010 | ||
1013 | gGL.begin( LLVertexBuffer::LINES ); | 1011 | gGL.begin( LLRender::LINES ); |
1014 | { | 1012 | { |
1015 | while( count-- ) | 1013 | while( count-- ) |
1016 | { | 1014 | { |
@@ -1033,7 +1031,7 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL | |||
1033 | 1031 | ||
1034 | void gl_rect_2d_simple_tex( S32 width, S32 height ) | 1032 | void gl_rect_2d_simple_tex( S32 width, S32 height ) |
1035 | { | 1033 | { |
1036 | gGL.begin( LLVertexBuffer::QUADS ); | 1034 | gGL.begin( LLRender::QUADS ); |
1037 | 1035 | ||
1038 | gGL.texCoord2f(1.f, 1.f); | 1036 | gGL.texCoord2f(1.f, 1.f); |
1039 | gGL.vertex2i(width, height); | 1037 | gGL.vertex2i(width, height); |
@@ -1052,7 +1050,7 @@ void gl_rect_2d_simple_tex( S32 width, S32 height ) | |||
1052 | 1050 | ||
1053 | void gl_rect_2d_simple( S32 width, S32 height ) | 1051 | void gl_rect_2d_simple( S32 width, S32 height ) |
1054 | { | 1052 | { |
1055 | gGL.begin( LLVertexBuffer::QUADS ); | 1053 | gGL.begin( LLRender::QUADS ); |
1056 | gGL.vertex2i(width, height); | 1054 | gGL.vertex2i(width, height); |
1057 | gGL.vertex2i(0, height); | 1055 | gGL.vertex2i(0, height); |
1058 | gGL.vertex2i(0, 0); | 1056 | gGL.vertex2i(0, 0); |
@@ -1094,7 +1092,7 @@ void gl_segmented_rect_2d_tex(const S32 left, | |||
1094 | LLVector2 width_vec((F32)width, 0.f); | 1092 | LLVector2 width_vec((F32)width, 0.f); |
1095 | LLVector2 height_vec(0.f, (F32)height); | 1093 | LLVector2 height_vec(0.f, (F32)height); |
1096 | 1094 | ||
1097 | gGL.begin(LLVertexBuffer::QUADS); | 1095 | gGL.begin(LLRender::QUADS); |
1098 | { | 1096 | { |
1099 | // draw bottom left | 1097 | // draw bottom left |
1100 | gGL.texCoord2f(0.f, 0.f); | 1098 | gGL.texCoord2f(0.f, 0.f); |
@@ -1262,7 +1260,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, | |||
1262 | LLVector2 x_min; | 1260 | LLVector2 x_min; |
1263 | LLVector2 x_max; | 1261 | LLVector2 x_max; |
1264 | 1262 | ||
1265 | gGL.begin(LLVertexBuffer::QUADS); | 1263 | gGL.begin(LLRender::QUADS); |
1266 | { | 1264 | { |
1267 | if (start_fragment < middle_start) | 1265 | if (start_fragment < middle_start) |
1268 | { | 1266 | { |
@@ -1419,7 +1417,7 @@ void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& bo | |||
1419 | LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero; | 1417 | LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero; |
1420 | 1418 | ||
1421 | 1419 | ||
1422 | gGL.begin(LLVertexBuffer::QUADS); | 1420 | gGL.begin(LLRender::QUADS); |
1423 | { | 1421 | { |
1424 | // draw bottom left | 1422 | // draw bottom left |
1425 | gGL.texCoord2f(0.f, 0.f); | 1423 | gGL.texCoord2f(0.f, 0.f); |
@@ -1575,7 +1573,7 @@ void LLUI::initClass(LLControlGroup* config, | |||
1575 | void LLUI::cleanupClass() | 1573 | void LLUI::cleanupClass() |
1576 | { | 1574 | { |
1577 | sImageProvider->cleanUp(); | 1575 | sImageProvider->cleanUp(); |
1578 | LLLineEditor::cleanupClass(); | 1576 | LLLineEditor::cleanupLineEditor(); |
1579 | } | 1577 | } |
1580 | 1578 | ||
1581 | 1579 | ||
@@ -1647,6 +1645,34 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y) | |||
1647 | setCursorPositionScreen(screen_x, screen_y); | 1645 | setCursorPositionScreen(screen_x, screen_y); |
1648 | } | 1646 | } |
1649 | 1647 | ||
1648 | // On Windows, the user typically sets the language when they install the | ||
1649 | // app (by running it with a shortcut that sets InstallLanguage). On Mac, | ||
1650 | // or on Windows if the SecondLife.exe executable is run directly, the | ||
1651 | // language follows the OS language. In all cases the user can override | ||
1652 | // the language manually in preferences. JC | ||
1653 | // static | ||
1654 | std::string LLUI::getLanguage() | ||
1655 | { | ||
1656 | std::string language = "en-us"; | ||
1657 | if (sConfigGroup) | ||
1658 | { | ||
1659 | language = sConfigGroup->getString("Language"); | ||
1660 | if (language.empty() || language == "default") | ||
1661 | { | ||
1662 | language = sConfigGroup->getString("InstallLanguage"); | ||
1663 | } | ||
1664 | if (language.empty() || language == "default") | ||
1665 | { | ||
1666 | language = sConfigGroup->getString("SystemLanguage"); | ||
1667 | } | ||
1668 | if (language.empty() || language == "default") | ||
1669 | { | ||
1670 | language = "en-us"; | ||
1671 | } | ||
1672 | } | ||
1673 | return language; | ||
1674 | } | ||
1675 | |||
1650 | //static | 1676 | //static |
1651 | std::string LLUI::locateSkin(const std::string& filename) | 1677 | std::string LLUI::locateSkin(const std::string& filename) |
1652 | { | 1678 | { |
@@ -1660,11 +1686,7 @@ std::string LLUI::locateSkin(const std::string& filename) | |||
1660 | { | 1686 | { |
1661 | if (!gDirUtilp->fileExists(found_file)) | 1687 | if (!gDirUtilp->fileExists(found_file)) |
1662 | { | 1688 | { |
1663 | std::string localization(sConfigGroup->getString("Language")); | 1689 | std::string localization = getLanguage(); |
1664 | if(localization == "default") | ||
1665 | { | ||
1666 | localization = sConfigGroup->getString("SystemLanguage"); | ||
1667 | } | ||
1668 | std::string local_skin = "xui" + slash + localization + slash + filename; | 1690 | std::string local_skin = "xui" + slash + localization + slash + filename; |
1669 | found_file = gDirUtilp->findSkinnedFilename(local_skin); | 1691 | found_file = gDirUtilp->findSkinnedFilename(local_skin); |
1670 | } | 1692 | } |