diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llworldmapview.cpp | 81 |
1 files changed, 25 insertions, 56 deletions
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index 1cc4921..a9e1061 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "llmath.h" // clampf() | 38 | #include "llmath.h" // clampf() |
39 | #include "llregionhandle.h" | 39 | #include "llregionhandle.h" |
40 | #include "lleventflags.h" | 40 | #include "lleventflags.h" |
41 | #include "llglimmediate.h" | 41 | #include "llrender.h" |
42 | 42 | ||
43 | #include "llagent.h" | 43 | #include "llagent.h" |
44 | #include "llcallingcard.h" | 44 | #include "llcallingcard.h" |
@@ -85,7 +85,6 @@ LLUIImagePtr LLWorldMapView::sTrackCircleImage = NULL; | |||
85 | LLUIImagePtr LLWorldMapView::sTrackArrowImage = NULL; | 85 | LLUIImagePtr LLWorldMapView::sTrackArrowImage = NULL; |
86 | 86 | ||
87 | LLUIImagePtr LLWorldMapView::sClassifiedsImage = NULL; | 87 | LLUIImagePtr LLWorldMapView::sClassifiedsImage = NULL; |
88 | LLUIImagePtr LLWorldMapView::sPopularImage = NULL; | ||
89 | LLUIImagePtr LLWorldMapView::sForSaleImage = NULL; | 88 | LLUIImagePtr LLWorldMapView::sForSaleImage = NULL; |
90 | 89 | ||
91 | F32 LLWorldMapView::sThresholdA = 48.f; | 90 | F32 LLWorldMapView::sThresholdA = 48.f; |
@@ -111,22 +110,21 @@ F32 CONE_SIZE = 0.6f; | |||
111 | 110 | ||
112 | void LLWorldMapView::initClass() | 111 | void LLWorldMapView::initClass() |
113 | { | 112 | { |
114 | LLUUID image_id; | ||
115 | |||
116 | sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga"); | 113 | sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga"); |
117 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); | 114 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); |
118 | sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); | 115 | sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); |
119 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); | 116 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); |
120 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); | 117 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); |
118 | |||
121 | sHomeImage = LLUI::getUIImage("map_home.tga"); | 119 | sHomeImage = LLUI::getUIImage("map_home.tga"); |
122 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); | 120 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); |
123 | sInfohubImage = LLUI::getUIImage("map_infohub.tga"); | 121 | sInfohubImage = LLUI::getUIImage("map_infohub.tga"); |
124 | sEventImage = LLUI::getUIImage("map_event.tga"); | 122 | sEventImage = LLUI::getUIImage("map_event.tga"); |
125 | sEventMatureImage = LLUI::getUIImage("map_event_mature.tga"); | 123 | sEventMatureImage = LLUI::getUIImage("map_event_mature.tga"); |
124 | |||
126 | sTrackCircleImage = LLUI::getUIImage("map_track_16.tga"); | 125 | sTrackCircleImage = LLUI::getUIImage("map_track_16.tga"); |
127 | sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga"); | 126 | sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga"); |
128 | sClassifiedsImage = LLUI::getUIImage("icon_top_pick.tga"); | 127 | sClassifiedsImage = LLUI::getUIImage("icon_top_pick.tga"); |
129 | sPopularImage = LLUI::getUIImage("icon_popular.tga"); | ||
130 | sForSaleImage = LLUI::getUIImage("icon_for_sale.tga"); | 128 | sForSaleImage = LLUI::getUIImage("icon_for_sale.tga"); |
131 | } | 129 | } |
132 | 130 | ||
@@ -138,15 +136,16 @@ void LLWorldMapView::cleanupClass() | |||
138 | sAvatarLargeImage = NULL; | 136 | sAvatarLargeImage = NULL; |
139 | sAvatarAboveImage = NULL; | 137 | sAvatarAboveImage = NULL; |
140 | sAvatarBelowImage = NULL; | 138 | sAvatarBelowImage = NULL; |
139 | |||
141 | sTelehubImage = NULL; | 140 | sTelehubImage = NULL; |
142 | sInfohubImage = NULL; | 141 | sInfohubImage = NULL; |
143 | sHomeImage = NULL; | 142 | sHomeImage = NULL; |
144 | sEventImage = NULL; | 143 | sEventImage = NULL; |
145 | sEventMatureImage = NULL; | 144 | sEventMatureImage = NULL; |
145 | |||
146 | sTrackCircleImage = NULL; | 146 | sTrackCircleImage = NULL; |
147 | sTrackArrowImage = NULL; | 147 | sTrackArrowImage = NULL; |
148 | sClassifiedsImage = NULL; | 148 | sClassifiedsImage = NULL; |
149 | sPopularImage = NULL; | ||
150 | sForSaleImage = NULL; | 149 | sForSaleImage = NULL; |
151 | } | 150 | } |
152 | 151 | ||
@@ -303,17 +302,17 @@ void LLWorldMapView::draw() | |||
303 | 302 | ||
304 | // Clear the background alpha to 0 | 303 | // Clear the background alpha to 0 |
305 | gGL.flush(); | 304 | gGL.flush(); |
306 | glColorMask(FALSE, FALSE, FALSE, TRUE); | 305 | gGL.setColorMask(false, true); |
307 | glAlphaFunc(GL_GEQUAL, 0.00f); | 306 | gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f); |
308 | gGL.blendFunc(GL_ONE, GL_ZERO); | 307 | gGL.setSceneBlendType(LLRender::BT_REPLACE); |
309 | gGL.color4f(0.0f, 0.0f, 0.0f, 0.0f); | 308 | gGL.color4f(0.0f, 0.0f, 0.0f, 0.0f); |
310 | gl_rect_2d(0, height, width, 0); | 309 | gl_rect_2d(0, height, width, 0); |
311 | } | 310 | } |
312 | 311 | ||
313 | gGL.flush(); | 312 | gGL.flush(); |
314 | glAlphaFunc(GL_GEQUAL, 0.01f); | 313 | gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); |
315 | glColorMask(TRUE, TRUE, TRUE, TRUE); | 314 | gGL.setColorMask(true, true); |
316 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 315 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
317 | 316 | ||
318 | F32 layer_alpha = 1.f; | 317 | F32 layer_alpha = 1.f; |
319 | 318 | ||
@@ -378,7 +377,7 @@ void LLWorldMapView::draw() | |||
378 | // Draw map image into RGB | 377 | // Draw map image into RGB |
379 | //gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 378 | //gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
380 | gGL.flush(); | 379 | gGL.flush(); |
381 | glColorMask(TRUE, TRUE, TRUE, FALSE); | 380 | gGL.setColorMask(true, false); |
382 | gGL.color4f(1.f, 1.f, 1.f, layer_alpha); | 381 | gGL.color4f(1.f, 1.f, 1.f, layer_alpha); |
383 | 382 | ||
384 | gGL.begin(LLVertexBuffer::QUADS); | 383 | gGL.begin(LLVertexBuffer::QUADS); |
@@ -394,7 +393,7 @@ void LLWorldMapView::draw() | |||
394 | 393 | ||
395 | // draw an alpha of 1 where the sims are visible | 394 | // draw an alpha of 1 where the sims are visible |
396 | gGL.flush(); | 395 | gGL.flush(); |
397 | glColorMask(FALSE, FALSE, FALSE, TRUE); | 396 | gGL.setColorMask(false, true); |
398 | gGL.color4f(1.f, 1.f, 1.f, 1.f); | 397 | gGL.color4f(1.f, 1.f, 1.f, 1.f); |
399 | 398 | ||
400 | gGL.begin(LLVertexBuffer::QUADS); | 399 | gGL.begin(LLVertexBuffer::QUADS); |
@@ -410,8 +409,8 @@ void LLWorldMapView::draw() | |||
410 | } | 409 | } |
411 | 410 | ||
412 | gGL.flush(); | 411 | gGL.flush(); |
413 | glAlphaFunc(GL_GEQUAL, 0.01f); | 412 | gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); |
414 | glColorMask(TRUE, TRUE, TRUE, TRUE); | 413 | gGL.setColorMask(true, true); |
415 | 414 | ||
416 | #if 1 | 415 | #if 1 |
417 | F32 sim_alpha = 1.f; | 416 | F32 sim_alpha = 1.f; |
@@ -534,7 +533,7 @@ void LLWorldMapView::draw() | |||
534 | LLGLSUIDefault gls_ui; | 533 | LLGLSUIDefault gls_ui; |
535 | LLViewerImage::bindTexture(simimage); | 534 | LLViewerImage::bindTexture(simimage); |
536 | 535 | ||
537 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 536 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
538 | F32 alpha = sim_alpha * info->mAlpha; | 537 | F32 alpha = sim_alpha * info->mAlpha; |
539 | gGL.color4f(1.f, 1.0f, 1.0f, alpha); | 538 | gGL.color4f(1.f, 1.0f, 1.0f, alpha); |
540 | 539 | ||
@@ -569,8 +568,8 @@ void LLWorldMapView::draw() | |||
569 | { | 568 | { |
570 | // draw an alpha of 1 where the sims are visible (except NULL sims) | 569 | // draw an alpha of 1 where the sims are visible (except NULL sims) |
571 | gGL.flush(); | 570 | gGL.flush(); |
572 | gGL.blendFunc(GL_ONE, GL_ZERO); | 571 | gGL.setSceneBlendType(LLRender::BT_REPLACE); |
573 | glColorMask(FALSE, FALSE, FALSE, TRUE); | 572 | gGL.setColorMask(false, true); |
574 | gGL.color4f(1.f, 1.f, 1.f, 1.f); | 573 | gGL.color4f(1.f, 1.f, 1.f, 1.f); |
575 | 574 | ||
576 | LLGLSNoTexture gls_no_texture; | 575 | LLGLSNoTexture gls_no_texture; |
@@ -582,14 +581,14 @@ void LLWorldMapView::draw() | |||
582 | gGL.end(); | 581 | gGL.end(); |
583 | 582 | ||
584 | gGL.flush(); | 583 | gGL.flush(); |
585 | glColorMask(TRUE, TRUE, TRUE, TRUE); | 584 | gGL.setColorMask(true, true); |
586 | } | 585 | } |
587 | } | 586 | } |
588 | 587 | ||
589 | if (info->mAccess == SIM_ACCESS_DOWN) | 588 | if (info->mAccess == SIM_ACCESS_DOWN) |
590 | { | 589 | { |
591 | // Draw a transparent red square over down sims | 590 | // Draw a transparent red square over down sims |
592 | gGL.blendFunc(GL_DST_ALPHA, GL_SRC_ALPHA); | 591 | gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_SOURCE_ALPHA); |
593 | gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f); | 592 | gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f); |
594 | 593 | ||
595 | LLGLSNoTexture gls_no_texture; | 594 | LLGLSNoTexture gls_no_texture; |
@@ -606,7 +605,7 @@ void LLWorldMapView::draw() | |||
606 | && info->mAccess > SIM_ACCESS_PG | 605 | && info->mAccess > SIM_ACCESS_PG |
607 | && gAgent.isTeen()) | 606 | && gAgent.isTeen()) |
608 | { | 607 | { |
609 | gGL.blendFunc(GL_DST_ALPHA, GL_ZERO); | 608 | gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ZERO); |
610 | 609 | ||
611 | LLGLSNoTexture gls_no_texture; | 610 | LLGLSNoTexture gls_no_texture; |
612 | gGL.color3f(1.f, 0.f, 0.f); | 611 | gGL.color3f(1.f, 0.f, 0.f); |
@@ -667,14 +666,14 @@ void LLWorldMapView::draw() | |||
667 | LLGLSUIDefault gls_ui; | 666 | LLGLSUIDefault gls_ui; |
668 | { | 667 | { |
669 | LLGLSNoTexture gls_no_texture; | 668 | LLGLSNoTexture gls_no_texture; |
670 | glAlphaFunc(GL_GEQUAL, 0.0f); | 669 | gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f); |
671 | gGL.blendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA); | 670 | gGL.blendFunc(LLRender::BF_ONE_MINUS_DEST_ALPHA, LLRender::BF_DEST_ALPHA); |
672 | gGL.color4fv( mBackgroundColor.mV ); | 671 | gGL.color4fv( mBackgroundColor.mV ); |
673 | gl_rect_2d(0, height, width, 0); | 672 | gl_rect_2d(0, height, width, 0); |
674 | } | 673 | } |
675 | 674 | ||
676 | glAlphaFunc(GL_GEQUAL, 0.01f); | 675 | gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); |
677 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 676 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
678 | 677 | ||
679 | // Infohubs | 678 | // Infohubs |
680 | if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB) | 679 | if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB) |
@@ -705,11 +704,6 @@ void LLWorldMapView::draw() | |||
705 | drawGenericItems(LLWorldMap::getInstance()->mClassifieds, sClassifiedsImage); | 704 | drawGenericItems(LLWorldMap::getInstance()->mClassifieds, sClassifiedsImage); |
706 | } | 705 | } |
707 | 706 | ||
708 | if (gSavedSettings.getBOOL("MapShowPopular")) | ||
709 | { | ||
710 | drawGenericItems(LLWorldMap::getInstance()->mPopular, sPopularImage); | ||
711 | } | ||
712 | |||
713 | if (gSavedSettings.getBOOL("MapShowEvents")) | 707 | if (gSavedSettings.getBOOL("MapShowEvents")) |
714 | { | 708 | { |
715 | drawEvents(); | 709 | drawEvents(); |
@@ -1533,10 +1527,6 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, | |||
1533 | { | 1527 | { |
1534 | (*it).mSelected = FALSE; | 1528 | (*it).mSelected = FALSE; |
1535 | } | 1529 | } |
1536 | for (it = LLWorldMap::getInstance()->mPopular.begin(); it != LLWorldMap::getInstance()->mPopular.end(); ++it) | ||
1537 | { | ||
1538 | (*it).mSelected = FALSE; | ||
1539 | } | ||
1540 | for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) | 1530 | for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) |
1541 | { | 1531 | { |
1542 | (*it).mSelected = FALSE; | 1532 | (*it).mSelected = FALSE; |
@@ -1578,21 +1568,6 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, | |||
1578 | } | 1568 | } |
1579 | } | 1569 | } |
1580 | 1570 | ||
1581 | if (gSavedSettings.getBOOL("MapShowPopular")) | ||
1582 | { | ||
1583 | for (it = LLWorldMap::getInstance()->mPopular.begin(); it != LLWorldMap::getInstance()->mPopular.end(); ++it) | ||
1584 | { | ||
1585 | LLItemInfo& popular = *it; | ||
1586 | |||
1587 | if (checkItemHit(x, y, popular, id, true)) | ||
1588 | { | ||
1589 | *hit_type = MAP_ITEM_POPULAR; | ||
1590 | mItemPicked = TRUE; | ||
1591 | return; | ||
1592 | } | ||
1593 | } | ||
1594 | } | ||
1595 | |||
1596 | if (gSavedSettings.getBOOL("MapShowLandForSale")) | 1571 | if (gSavedSettings.getBOOL("MapShowLandForSale")) |
1597 | { | 1572 | { |
1598 | for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) | 1573 | for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) |
@@ -1796,12 +1771,6 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) | |||
1796 | LLFloaterDirectory::showEvents(event_id); | 1771 | LLFloaterDirectory::showEvents(event_id); |
1797 | break; | 1772 | break; |
1798 | } | 1773 | } |
1799 | case MAP_ITEM_POPULAR: | ||
1800 | { | ||
1801 | gFloaterWorldMap->close(); | ||
1802 | LLFloaterDirectory::showPopular(id); | ||
1803 | break; | ||
1804 | } | ||
1805 | case MAP_ITEM_LAND_FOR_SALE: | 1774 | case MAP_ITEM_LAND_FOR_SALE: |
1806 | { | 1775 | { |
1807 | gFloaterWorldMap->close(); | 1776 | gFloaterWorldMap->close(); |