aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmapview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llworldmapview.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/llworldmapview.cpp')
-rw-r--r--linden/indra/newview/llworldmapview.cpp57
1 files changed, 40 insertions, 17 deletions
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 83e10d9..65a084d 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -167,8 +167,7 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect )
167 mMouseDownPanY( 0 ), 167 mMouseDownPanY( 0 ),
168 mMouseDownX( 0 ), 168 mMouseDownX( 0 ),
169 mMouseDownY( 0 ), 169 mMouseDownY( 0 ),
170 mSelectIDStart(0), 170 mSelectIDStart(0)
171 mAgentCountsUpdateTime(0)
172{ 171{
173 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS; 172 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS;
174 clearLastClick(); 173 clearLastClick();
@@ -298,12 +297,6 @@ void LLWorldMapView::draw()
298 297
299 F64 current_time = LLTimer::getElapsedSeconds(); 298 F64 current_time = LLTimer::getElapsedSeconds();
300 299
301 if (current_time - mAgentCountsUpdateTime > AGENT_COUNTS_UPDATE_TIME)
302 {
303 gWorldMap->sendItemRequest(MAP_ITEM_AGENT_COUNT);
304 mAgentCountsUpdateTime = current_time;
305 }
306
307 mVisibleRegions.clear(); 300 mVisibleRegions.clear();
308 301
309 // animate pan if necessary 302 // animate pan if necessary
@@ -324,7 +317,6 @@ void LLWorldMapView::draw()
324 { 317 {
325 LLGLSNoTexture no_texture; 318 LLGLSNoTexture no_texture;
326 319
327
328 glMatrixMode(GL_MODELVIEW); 320 glMatrixMode(GL_MODELVIEW);
329 321
330 // Clear the background alpha to 0 322 // Clear the background alpha to 0
@@ -388,14 +380,12 @@ void LLWorldMapView::draw()
388 current_image->setBoostLevel(LLViewerImage::BOOST_MAP_LAYER); 380 current_image->setBoostLevel(LLViewerImage::BOOST_MAP_LAYER);
389 current_image->setKnownDrawSize(llround(pix_width), llround(pix_height)); 381 current_image->setKnownDrawSize(llround(pix_width), llround(pix_height));
390 382
391#if 1 || LL_RELEASE_FOR_DOWNLOAD
392 if (!current_image->getHasGLTexture()) 383 if (!current_image->getHasGLTexture())
393 { 384 {
394 continue; // better to draw nothing than the default image 385 continue; // better to draw nothing than the default image
395 } 386 }
396#endif
397 387
398 LLTextureView::addDebugImage(current_image); 388// LLTextureView::addDebugImage(current_image);
399 389
400 // Draw using the texture. If we don't clamp we get artifact at 390 // Draw using the texture. If we don't clamp we get artifact at
401 // the edge. 391 // the edge.
@@ -548,7 +538,7 @@ void LLWorldMapView::draw()
548 overlayimage->setKnownDrawSize(draw_size, draw_size); 538 overlayimage->setKnownDrawSize(draw_size, draw_size);
549 } 539 }
550 540
551 LLTextureView::addDebugImage(simimage); 541// LLTextureView::addDebugImage(simimage);
552 542
553 if (sim_visible && info->mAlpha > 0.001f) 543 if (sim_visible && info->mAlpha > 0.001f)
554 { 544 {
@@ -640,7 +630,7 @@ void LLWorldMapView::draw()
640 // Draw the region name in the lower left corner 630 // Draw the region name in the lower left corner
641 LLFontGL* font = LLFontGL::sSansSerifSmall; 631 LLFontGL* font = LLFontGL::sSansSerifSmall;
642 632
643 char mesg[MAX_STRING]; 633 char mesg[MAX_STRING]; /* Flawfinder: ignore */
644 if (gMapScale < sThresholdA) 634 if (gMapScale < sThresholdA)
645 { 635 {
646 mesg[0] = '\0'; 636 mesg[0] = '\0';
@@ -658,11 +648,11 @@ void LLWorldMapView::draw()
658 // LLViewerRegion::accessToShortString(info->mAccess) ); 648 // LLViewerRegion::accessToShortString(info->mAccess) );
659 if (info->mAccess == SIM_ACCESS_DOWN) 649 if (info->mAccess == SIM_ACCESS_DOWN)
660 { 650 {
661 sprintf(mesg, "%s (Offline)", info->mName.c_str()); 651 snprintf(mesg, MAX_STRING, "%s (Offline)", info->mName.c_str()); /* Flawfinder: ignore */
662 } 652 }
663 else 653 else
664 { 654 {
665 sprintf(mesg, "%s", info->mName.c_str()); 655 snprintf(mesg, MAX_STRING, "%s", info->mName.c_str()); /* Flawfinder: ignore */
666 } 656 }
667 } 657 }
668 658
@@ -841,6 +831,39 @@ void LLWorldMapView::draw()
841 updateVisibleBlocks(); 831 updateVisibleBlocks();
842} 832}
843 833
834//virtual
835void LLWorldMapView::setVisible(BOOL visible)
836{
837 LLPanel::setVisible(visible);
838 if (!visible && gWorldMap)
839 {
840 for (S32 map = 0; map < MAP_SIM_IMAGE_TYPES; map++)
841 {
842 for (U32 layer_idx=0; layer_idx<gWorldMap->mMapLayers[map].size(); ++layer_idx)
843 {
844 if (gWorldMap->mMapLayers[map][layer_idx].LayerDefined)
845 {
846 LLWorldMapLayer *layer = &gWorldMap->mMapLayers[map][layer_idx];
847 layer->LayerImage->setBoostLevel(0);
848 }
849 }
850 }
851 for (LLWorldMap::sim_info_map_t::iterator it = gWorldMap->mSimInfoMap.begin();
852 it != gWorldMap->mSimInfoMap.end(); ++it)
853 {
854 LLSimInfo* info = (*it).second;
855 if (info->mCurrentImage.notNull())
856 {
857 info->mCurrentImage->setBoostLevel(0);
858 }
859 if (info->mOverlayImage.notNull())
860 {
861 info->mOverlayImage->setBoostLevel(0);
862 }
863 }
864 }
865}
866
844void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image) 867void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image)
845{ 868{
846 LLWorldMap::item_info_list_t::const_iterator e; 869 LLWorldMap::item_info_list_t::const_iterator e;
@@ -1912,7 +1935,7 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask )
1912 { 1935 {
1913 gFloaterWorldMap->close(); 1936 gFloaterWorldMap->close();
1914 // This is an ungainly hack 1937 // This is an ungainly hack
1915 char uuid_str[38]; 1938 char uuid_str[38]; /* Flawfinder: ignore */
1916 S32 event_id; 1939 S32 event_id;
1917 id.toString(uuid_str); 1940 id.toString(uuid_str);
1918 sscanf(&uuid_str[28], "%X", &event_id); 1941 sscanf(&uuid_str[28], "%X", &event_id);