aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmapview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llworldmapview.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llworldmapview.cpp')
-rw-r--r--linden/indra/newview/llworldmapview.cpp253
1 files changed, 131 insertions, 122 deletions
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 266ffbc..2fac51a 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -35,10 +35,10 @@
35 35
36#include "indra_constants.h" 36#include "indra_constants.h"
37#include "llui.h" 37#include "llui.h"
38#include "linked_lists.h"
39#include "llmath.h" // clampf() 38#include "llmath.h" // clampf()
40#include "llregionhandle.h" 39#include "llregionhandle.h"
41#include "lleventflags.h" 40#include "lleventflags.h"
41#include "llglimmediate.h"
42 42
43#include "llagent.h" 43#include "llagent.h"
44#include "llcallingcard.h" 44#include "llcallingcard.h"
@@ -210,9 +210,11 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect )
210 mTextBoxEast->setColor( minor_color ); 210 mTextBoxEast->setColor( minor_color );
211 addChild( mTextBoxEast ); 211 addChild( mTextBoxEast );
212 212
213 major_dir_rect.mRight += 1 ;
213 mTextBoxWest = new LLTextBox( "W", major_dir_rect ); 214 mTextBoxWest = new LLTextBox( "W", major_dir_rect );
214 mTextBoxWest->setColor( minor_color ); 215 mTextBoxWest->setColor( minor_color );
215 addChild( mTextBoxWest ); 216 addChild( mTextBoxWest );
217 major_dir_rect.mRight -= 1 ;
216 218
217 mTextBoxSouth = new LLTextBox( "S", major_dir_rect ); 219 mTextBoxSouth = new LLTextBox( "S", major_dir_rect );
218 mTextBoxSouth->setColor( minor_color ); 220 mTextBoxSouth->setColor( minor_color );
@@ -325,8 +327,8 @@ void LLWorldMapView::draw()
325 sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); 327 sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f));
326 sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); 328 sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f));
327 329
328 const S32 width = mRect.getWidth(); 330 const S32 width = getRect().getWidth();
329 const S32 height = mRect.getHeight(); 331 const S32 height = getRect().getHeight();
330 const S32 half_width = width / 2; 332 const S32 half_width = width / 2;
331 const S32 half_height = height / 2; 333 const S32 half_height = height / 2;
332 LLVector3d camera_global = gAgent.getCameraPositionGlobal(); 334 LLVector3d camera_global = gAgent.getCameraPositionGlobal();
@@ -338,16 +340,18 @@ void LLWorldMapView::draw()
338 glMatrixMode(GL_MODELVIEW); 340 glMatrixMode(GL_MODELVIEW);
339 341
340 // Clear the background alpha to 0 342 // Clear the background alpha to 0
343 gGL.flush();
341 glColorMask(FALSE, FALSE, FALSE, TRUE); 344 glColorMask(FALSE, FALSE, FALSE, TRUE);
342 glAlphaFunc(GL_GEQUAL, 0.00f); 345 glAlphaFunc(GL_GEQUAL, 0.00f);
343 glBlendFunc(GL_ONE, GL_ZERO); 346 gGL.blendFunc(GL_ONE, GL_ZERO);
344 glColor4f(0.0f, 0.0f, 0.0f, 0.0f); 347 gGL.color4f(0.0f, 0.0f, 0.0f, 0.0f);
345 gl_rect_2d(0, height, width, 0); 348 gl_rect_2d(0, height, width, 0);
346 } 349 }
347 350
351 gGL.flush();
348 glAlphaFunc(GL_GEQUAL, 0.01f); 352 glAlphaFunc(GL_GEQUAL, 0.01f);
349 glColorMask(TRUE, TRUE, TRUE, TRUE); 353 glColorMask(TRUE, TRUE, TRUE, TRUE);
350 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 354 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
351 355
352 F32 layer_alpha = 1.f; 356 F32 layer_alpha = 1.f;
353 357
@@ -410,37 +414,40 @@ void LLWorldMapView::draw()
410 LLViewerImage::bindTexture(current_image); 414 LLViewerImage::bindTexture(current_image);
411 415
412 // Draw map image into RGB 416 // Draw map image into RGB
413 //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 417 //gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
418 gGL.flush();
414 glColorMask(TRUE, TRUE, TRUE, FALSE); 419 glColorMask(TRUE, TRUE, TRUE, FALSE);
415 glColor4f(1.f, 1.f, 1.f, layer_alpha); 420 gGL.color4f(1.f, 1.f, 1.f, layer_alpha);
416 421
417 glBegin(GL_QUADS); 422 gGL.begin(GL_QUADS);
418 glTexCoord2f(0.0f, 1.0f); 423 gGL.texCoord2f(0.0f, 1.0f);
419 glVertex3f(left, top, -1.0f); 424 gGL.vertex3f(left, top, -1.0f);
420 glTexCoord2f(0.0f, 0.0f); 425 gGL.texCoord2f(0.0f, 0.0f);
421 glVertex3f(left, bottom, -1.0f); 426 gGL.vertex3f(left, bottom, -1.0f);
422 glTexCoord2f(1.0f, 0.0f); 427 gGL.texCoord2f(1.0f, 0.0f);
423 glVertex3f(right, bottom, -1.0f); 428 gGL.vertex3f(right, bottom, -1.0f);
424 glTexCoord2f(1.0f, 1.0f); 429 gGL.texCoord2f(1.0f, 1.0f);
425 glVertex3f(right, top, -1.0f); 430 gGL.vertex3f(right, top, -1.0f);
426 glEnd(); 431 gGL.end();
427 432
428 // draw an alpha of 1 where the sims are visible 433 // draw an alpha of 1 where the sims are visible
434 gGL.flush();
429 glColorMask(FALSE, FALSE, FALSE, TRUE); 435 glColorMask(FALSE, FALSE, FALSE, TRUE);
430 glColor4f(1.f, 1.f, 1.f, 1.f); 436 gGL.color4f(1.f, 1.f, 1.f, 1.f);
431 437
432 glBegin(GL_QUADS); 438 gGL.begin(GL_QUADS);
433 glTexCoord2f(0.0f, 1.0f); 439 gGL.texCoord2f(0.0f, 1.0f);
434 glVertex2f(left, top); 440 gGL.vertex2f(left, top);
435 glTexCoord2f(0.0f, 0.0f); 441 gGL.texCoord2f(0.0f, 0.0f);
436 glVertex2f(left, bottom); 442 gGL.vertex2f(left, bottom);
437 glTexCoord2f(1.0f, 0.0f); 443 gGL.texCoord2f(1.0f, 0.0f);
438 glVertex2f(right, bottom); 444 gGL.vertex2f(right, bottom);
439 glTexCoord2f(1.0f, 1.0f); 445 gGL.texCoord2f(1.0f, 1.0f);
440 glVertex2f(right, top); 446 gGL.vertex2f(right, top);
441 glEnd(); 447 gGL.end();
442 } 448 }
443 449
450 gGL.flush();
444 glAlphaFunc(GL_GEQUAL, 0.01f); 451 glAlphaFunc(GL_GEQUAL, 0.01f);
445 glColorMask(TRUE, TRUE, TRUE, TRUE); 452 glColorMask(TRUE, TRUE, TRUE, TRUE);
446 453
@@ -565,52 +572,54 @@ void LLWorldMapView::draw()
565 LLGLSUIDefault gls_ui; 572 LLGLSUIDefault gls_ui;
566 LLViewerImage::bindTexture(simimage); 573 LLViewerImage::bindTexture(simimage);
567 574
568 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 575 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
569 F32 alpha = sim_alpha * info->mAlpha; 576 F32 alpha = sim_alpha * info->mAlpha;
570 glColor4f(1.f, 1.0f, 1.0f, alpha); 577 gGL.color4f(1.f, 1.0f, 1.0f, alpha);
571 578
572 glBegin(GL_QUADS); 579 gGL.begin(GL_QUADS);
573 glTexCoord2f(0.f, 1.f); 580 gGL.texCoord2f(0.f, 1.f);
574 glVertex3f(left, top, 0.f); 581 gGL.vertex3f(left, top, 0.f);
575 glTexCoord2f(0.f, 0.f); 582 gGL.texCoord2f(0.f, 0.f);
576 glVertex3f(left, bottom, 0.f); 583 gGL.vertex3f(left, bottom, 0.f);
577 glTexCoord2f(1.f, 0.f); 584 gGL.texCoord2f(1.f, 0.f);
578 glVertex3f(right, bottom, 0.f); 585 gGL.vertex3f(right, bottom, 0.f);
579 glTexCoord2f(1.f, 1.f); 586 gGL.texCoord2f(1.f, 1.f);
580 glVertex3f(right, top, 0.f); 587 gGL.vertex3f(right, top, 0.f);
581 glEnd(); 588 gGL.end();
582 589
583 if (gSavedSettings.getBOOL("MapShowLandForSale") && overlayimage && overlayimage->getHasGLTexture()) 590 if (gSavedSettings.getBOOL("MapShowLandForSale") && overlayimage && overlayimage->getHasGLTexture())
584 { 591 {
585 LLViewerImage::bindTexture(overlayimage); 592 LLViewerImage::bindTexture(overlayimage);
586 glColor4f(1.f, 1.f, 1.f, alpha); 593 gGL.color4f(1.f, 1.f, 1.f, alpha);
587 glBegin(GL_QUADS); 594 gGL.begin(GL_QUADS);
588 glTexCoord2f(0.f, 1.f); 595 gGL.texCoord2f(0.f, 1.f);
589 glVertex3f(left, top, -0.5f); 596 gGL.vertex3f(left, top, -0.5f);
590 glTexCoord2f(0.f, 0.f); 597 gGL.texCoord2f(0.f, 0.f);
591 glVertex3f(left, bottom, -0.5f); 598 gGL.vertex3f(left, bottom, -0.5f);
592 glTexCoord2f(1.f, 0.f); 599 gGL.texCoord2f(1.f, 0.f);
593 glVertex3f(right, bottom, -0.5f); 600 gGL.vertex3f(right, bottom, -0.5f);
594 glTexCoord2f(1.f, 1.f); 601 gGL.texCoord2f(1.f, 1.f);
595 glVertex3f(right, top, -0.5f); 602 gGL.vertex3f(right, top, -0.5f);
596 glEnd(); 603 gGL.end();
597 } 604 }
598 605
599 if ((info->mRegionFlags & REGION_FLAGS_NULL_LAYER) == 0) 606 if ((info->mRegionFlags & REGION_FLAGS_NULL_LAYER) == 0)
600 { 607 {
601 // draw an alpha of 1 where the sims are visible (except NULL sims) 608 // draw an alpha of 1 where the sims are visible (except NULL sims)
602 glBlendFunc(GL_ONE, GL_ZERO); 609 gGL.flush();
610 gGL.blendFunc(GL_ONE, GL_ZERO);
603 glColorMask(FALSE, FALSE, FALSE, TRUE); 611 glColorMask(FALSE, FALSE, FALSE, TRUE);
604 glColor4f(1.f, 1.f, 1.f, 1.f); 612 gGL.color4f(1.f, 1.f, 1.f, 1.f);
605 613
606 LLGLSNoTexture gls_no_texture; 614 LLGLSNoTexture gls_no_texture;
607 glBegin(GL_QUADS); 615 gGL.begin(GL_QUADS);
608 glVertex2f(left, top); 616 gGL.vertex2f(left, top);
609 glVertex2f(left, bottom); 617 gGL.vertex2f(left, bottom);
610 glVertex2f(right, bottom); 618 gGL.vertex2f(right, bottom);
611 glVertex2f(right, top); 619 gGL.vertex2f(right, top);
612 glEnd(); 620 gGL.end();
613 621
622 gGL.flush();
614 glColorMask(TRUE, TRUE, TRUE, TRUE); 623 glColorMask(TRUE, TRUE, TRUE, TRUE);
615 } 624 }
616 } 625 }
@@ -618,16 +627,16 @@ void LLWorldMapView::draw()
618 if (info->mAccess == SIM_ACCESS_DOWN) 627 if (info->mAccess == SIM_ACCESS_DOWN)
619 { 628 {
620 // Draw a transparent red square over down sims 629 // Draw a transparent red square over down sims
621 glBlendFunc(GL_DST_ALPHA, GL_SRC_ALPHA); 630 gGL.blendFunc(GL_DST_ALPHA, GL_SRC_ALPHA);
622 glColor4f(0.2f, 0.0f, 0.0f, 0.4f); 631 gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f);
623 632
624 LLGLSNoTexture gls_no_texture; 633 LLGLSNoTexture gls_no_texture;
625 glBegin(GL_QUADS); 634 gGL.begin(GL_QUADS);
626 glVertex2f(left, top); 635 gGL.vertex2f(left, top);
627 glVertex2f(left, bottom); 636 gGL.vertex2f(left, bottom);
628 glVertex2f(right, bottom); 637 gGL.vertex2f(right, bottom);
629 glVertex2f(right, top); 638 gGL.vertex2f(right, top);
630 glEnd(); 639 gGL.end();
631 } 640 }
632 641
633 // If this is mature, and you are not, draw a line across it 642 // If this is mature, and you are not, draw a line across it
@@ -635,16 +644,16 @@ void LLWorldMapView::draw()
635 && info->mAccess > SIM_ACCESS_PG 644 && info->mAccess > SIM_ACCESS_PG
636 && gAgent.isTeen()) 645 && gAgent.isTeen())
637 { 646 {
638 glBlendFunc(GL_DST_ALPHA, GL_ZERO); 647 gGL.blendFunc(GL_DST_ALPHA, GL_ZERO);
639 648
640 LLGLSNoTexture gls_no_texture; 649 LLGLSNoTexture gls_no_texture;
641 glColor3f(1.f, 0.f, 0.f); 650 gGL.color3f(1.f, 0.f, 0.f);
642 glBegin(GL_LINES); 651 gGL.begin(GL_LINES);
643 glVertex2f(left, top); 652 gGL.vertex2f(left, top);
644 glVertex2f(right, bottom); 653 gGL.vertex2f(right, bottom);
645 glVertex2f(left, bottom); 654 gGL.vertex2f(left, bottom);
646 glVertex2f(right, top); 655 gGL.vertex2f(right, top);
647 glEnd(); 656 gGL.end();
648 } 657 }
649 658
650 // Draw the region name in the lower left corner 659 // Draw the region name in the lower left corner
@@ -697,13 +706,13 @@ void LLWorldMapView::draw()
697 { 706 {
698 LLGLSNoTexture gls_no_texture; 707 LLGLSNoTexture gls_no_texture;
699 glAlphaFunc(GL_GEQUAL, 0.0f); 708 glAlphaFunc(GL_GEQUAL, 0.0f);
700 glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA); 709 gGL.blendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA);
701 glColor4fv( mBackgroundColor.mV ); 710 gGL.color4fv( mBackgroundColor.mV );
702 gl_rect_2d(0, height, width, 0); 711 gl_rect_2d(0, height, width, 0);
703 } 712 }
704 713
705 glAlphaFunc(GL_GEQUAL, 0.01f); 714 glAlphaFunc(GL_GEQUAL, 0.01f);
706 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 715 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
707 716
708 // Infohubs 717 // Infohubs
709 if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB) 718 if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB)
@@ -990,29 +999,29 @@ void LLWorldMapView::drawFrustum()
990 F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 ); 999 F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 );
991 F32 half_width_pixels = half_width_meters * meters_to_pixels; 1000 F32 half_width_pixels = half_width_meters * meters_to_pixels;
992 1001
993 F32 ctr_x = mRect.getWidth() * 0.5f + sPanX; 1002 F32 ctr_x = getRect().getWidth() * 0.5f + sPanX;
994 F32 ctr_y = mRect.getHeight() * 0.5f + sPanY; 1003 F32 ctr_y = getRect().getHeight() * 0.5f + sPanY;
995 1004
996 LLGLSNoTexture gls_no_texture; 1005 LLGLSNoTexture gls_no_texture;
997 1006
998 // Since we don't rotate the map, we have to rotate the frustum. 1007 // Since we don't rotate the map, we have to rotate the frustum.
999 glPushMatrix(); 1008 gGL.pushMatrix();
1000 glTranslatef( ctr_x, ctr_y, 0 ); 1009 gGL.translatef( ctr_x, ctr_y, 0 );
1001 glRotatef( atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); 1010 glRotatef( atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f);
1002 1011
1003 // Draw triangle with more alpha in far pixels to make it 1012 // Draw triangle with more alpha in far pixels to make it
1004 // fade out in distance. 1013 // fade out in distance.
1005 glBegin( GL_TRIANGLES ); 1014 gGL.begin( GL_TRIANGLES );
1006 glColor4f(1.f, 1.f, 1.f, 0.25f); 1015 gGL.color4f(1.f, 1.f, 1.f, 0.25f);
1007 glVertex2f( 0, 0 ); 1016 gGL.vertex2f( 0, 0 );
1008 1017
1009 glColor4f(1.f, 1.f, 1.f, 0.02f); 1018 gGL.color4f(1.f, 1.f, 1.f, 0.02f);
1010 glVertex2f( -half_width_pixels, far_clip_pixels ); 1019 gGL.vertex2f( -half_width_pixels, far_clip_pixels );
1011 1020
1012 glColor4f(1.f, 1.f, 1.f, 0.02f); 1021 gGL.color4f(1.f, 1.f, 1.f, 0.02f);
1013 glVertex2f( half_width_pixels, far_clip_pixels ); 1022 gGL.vertex2f( half_width_pixels, far_clip_pixels );
1014 glEnd(); 1023 gGL.end();
1015 glPopMatrix(); 1024 gGL.popMatrix();
1016} 1025}
1017 1026
1018 1027
@@ -1027,8 +1036,8 @@ LLVector3 LLWorldMapView::globalPosToView( const LLVector3d& global_pos )
1027 // leave Z component in meters 1036 // leave Z component in meters
1028 1037
1029 1038
1030 pos_local.mV[VX] += mRect.getWidth() / 2 + sPanX; 1039 pos_local.mV[VX] += getRect().getWidth() / 2 + sPanX;
1031 pos_local.mV[VY] += mRect.getHeight() / 2 + sPanY; 1040 pos_local.mV[VY] += getRect().getHeight() / 2 + sPanY;
1032 1041
1033 return pos_local; 1042 return pos_local;
1034} 1043}
@@ -1048,13 +1057,13 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
1048 1057
1049 if( x < 0 1058 if( x < 0
1050 || y < 0 1059 || y < 0
1051 || x >= mRect.getWidth() 1060 || x >= getRect().getWidth()
1052 || y >= mRect.getHeight() ) 1061 || y >= getRect().getHeight() )
1053 { 1062 {
1054 if (draw_arrow) 1063 if (draw_arrow)
1055 { 1064 {
1056 drawTrackingCircle( mRect, x, y, color, 3, 15 ); 1065 drawTrackingCircle( getRect(), x, y, color, 3, 15 );
1057 drawTrackingArrow( mRect, x, y, color ); 1066 drawTrackingArrow( getRect(), x, y, color );
1058 text_x = sTrackingArrowX; 1067 text_x = sTrackingArrowX;
1059 text_y = sTrackingArrowY; 1068 text_y = sTrackingArrowY;
1060 } 1069 }
@@ -1063,7 +1072,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
1063 else if (LLTracker::getTrackingStatus() == LLTracker::TRACKING_LOCATION && 1072 else if (LLTracker::getTrackingStatus() == LLTracker::TRACKING_LOCATION &&
1064 LLTracker::getTrackedLocationType() != LLTracker::LOCATION_NOTHING) 1073 LLTracker::getTrackedLocationType() != LLTracker::LOCATION_NOTHING)
1065 { 1074 {
1066 drawTrackingCircle( mRect, x, y, color, 3, 15 ); 1075 drawTrackingCircle( getRect(), x, y, color, 3, 15 );
1067 } 1076 }
1068 else 1077 else
1069 { 1078 {
@@ -1073,8 +1082,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
1073 // clamp text position to on-screen 1082 // clamp text position to on-screen
1074 const S32 TEXT_PADDING = DEFAULT_TRACKING_ARROW_SIZE + 2; 1083 const S32 TEXT_PADDING = DEFAULT_TRACKING_ARROW_SIZE + 2;
1075 S32 half_text_width = llfloor(font->getWidthF32(label) * 0.5f); 1084 S32 half_text_width = llfloor(font->getWidthF32(label) * 0.5f);
1076 text_x = llclamp(text_x, half_text_width + TEXT_PADDING, mRect.getWidth() - half_text_width - TEXT_PADDING); 1085 text_x = llclamp(text_x, half_text_width + TEXT_PADDING, getRect().getWidth() - half_text_width - TEXT_PADDING);
1077 text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, mRect.getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset); 1086 text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset);
1078 1087
1079 if (label != "") 1088 if (label != "")
1080 { 1089 {
@@ -1102,8 +1111,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
1102// If you change this, then you need to change LLTracker::getTrackedPositionGlobal() as well 1111// If you change this, then you need to change LLTracker::getTrackedPositionGlobal() as well
1103LLVector3d LLWorldMapView::viewPosToGlobal( S32 x, S32 y ) 1112LLVector3d LLWorldMapView::viewPosToGlobal( S32 x, S32 y )
1104{ 1113{
1105 x -= llfloor((mRect.getWidth() / 2 + sPanX)); 1114 x -= llfloor((getRect().getWidth() / 2 + sPanX));
1106 y -= llfloor((mRect.getHeight() / 2 + sPanY)); 1115 y -= llfloor((getRect().getHeight() / 2 + sPanY));
1107 1116
1108 LLVector3 pos_local( (F32)x, (F32)y, 0.f ); 1117 LLVector3 pos_local( (F32)x, (F32)y, 0.f );
1109 1118
@@ -1210,15 +1219,15 @@ static void drawDot(F32 x_pixels, F32 y_pixels,
1210 F32 bottom = y_pixels - dot_radius; 1219 F32 bottom = y_pixels - dot_radius;
1211 1220
1212 LLGLSNoTexture gls_no_texture; 1221 LLGLSNoTexture gls_no_texture;
1213 glColor4fv( color.mV ); 1222 gGL.color4fv( color.mV );
1214 LLUI::setLineWidth(1.5f); 1223 LLUI::setLineWidth(1.5f);
1215 F32 h_bar = relative_z > HEIGHT_THRESHOLD ? top : bottom; // horizontal bar Y 1224 F32 h_bar = relative_z > HEIGHT_THRESHOLD ? top : bottom; // horizontal bar Y
1216 glBegin( GL_LINES ); 1225 gGL.begin( GL_LINES );
1217 glVertex2f(left, h_bar); 1226 gGL.vertex2f(center, top);
1218 glVertex2f(right, h_bar); 1227 gGL.vertex2f(left, h_bar);
1219 glVertex2f(center, top); 1228 gGL.vertex2f(right, h_bar);
1220 glVertex2f(center, bottom); 1229 gGL.vertex2f(right, bottom);
1221 glEnd(); 1230 gGL.end();
1222 LLUI::setLineWidth(1.0f); 1231 LLUI::setLineWidth(1.0f);
1223 } 1232 }
1224} 1233}
@@ -1386,10 +1395,10 @@ void LLWorldMapView::drawTrackingCircle( const LLRect& rect, S32 x, S32 y, const
1386 } 1395 }
1387 1396
1388 glMatrixMode(GL_MODELVIEW); 1397 glMatrixMode(GL_MODELVIEW);
1389 glPushMatrix(); 1398 gGL.pushMatrix();
1390 glTranslatef((F32)x, (F32)y, 0.f); 1399 gGL.translatef((F32)x, (F32)y, 0.f);
1391 gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color); 1400 gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color);
1392 glPopMatrix(); 1401 gGL.popMatrix();
1393 1402
1394} 1403}
1395 1404
@@ -1448,8 +1457,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation )
1448 // Rotation of 0 means x = 1, y = 0 on the unit circle. 1457 // Rotation of 0 means x = 1, y = 0 on the unit circle.
1449 1458
1450 1459
1451 F32 map_half_height = mRect.getHeight() * 0.5f; 1460 F32 map_half_height = getRect().getHeight() * 0.5f;
1452 F32 map_half_width = mRect.getWidth() * 0.5f; 1461 F32 map_half_width = getRect().getWidth() * 0.5f;
1453 F32 text_half_height = text_box->getRect().getHeight() * 0.5f; 1462 F32 text_half_height = text_box->getRect().getHeight() * 0.5f;
1454 F32 text_half_width = text_box->getRect().getWidth() * 0.5f; 1463 F32 text_half_width = text_box->getRect().getWidth() * 0.5f;
1455 F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); 1464 F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width );
@@ -1462,8 +1471,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation )
1462 1471
1463void LLWorldMapView::updateDirections() 1472void LLWorldMapView::updateDirections()
1464{ 1473{
1465 S32 width = mRect.getWidth(); 1474 S32 width = getRect().getWidth();
1466 S32 height = mRect.getHeight(); 1475 S32 height = getRect().getHeight();
1467 1476
1468 S32 text_height = mTextBoxNorth->getRect().getHeight(); 1477 S32 text_height = mTextBoxNorth->getRect().getHeight();
1469 S32 text_width = mTextBoxNorth->getRect().getWidth(); 1478 S32 text_width = mTextBoxNorth->getRect().getWidth();
@@ -1695,7 +1704,7 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask )
1695 S32 local_x, local_y; 1704 S32 local_x, local_y;
1696 local_x = mMouseDownX + llfloor(sPanX - mMouseDownPanX); 1705 local_x = mMouseDownX + llfloor(sPanX - mMouseDownPanX);
1697 local_y = mMouseDownY + llfloor(sPanY - mMouseDownPanY); 1706 local_y = mMouseDownY + llfloor(sPanY - mMouseDownPanY);
1698 LLRect clip_rect = mRect; 1707 LLRect clip_rect = getRect();
1699 clip_rect.stretch(-8); 1708 clip_rect.stretch(-8);
1700 clip_rect.clipPointToRect(mMouseDownX, mMouseDownY, local_x, local_y); 1709 clip_rect.clipPointToRect(mMouseDownX, mMouseDownY, local_x, local_y);
1701 LLUI::setCursorPositionLocal(this, local_x, local_y); 1710 LLUI::setCursorPositionLocal(this, local_x, local_y);