aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmap.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llworldmap.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llworldmap.cpp52
1 files changed, 46 insertions, 6 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index 7311989..572f31f 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -48,6 +49,13 @@
48 49
49const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes 50const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes
50 51
52// For DEV-17507, do lazy image loading in llworldmapview.cpp instead,
53// limiting requests to currently visible regions and minimizing the
54// number of textures being requested simultaneously.
55//
56// Uncomment IMMEDIATE_IMAGE_LOAD to restore the old behavior
57//
58//#define IMMEDIATE_IMAGE_LOAD
51LLItemInfo::LLItemInfo(F32 global_x, F32 global_y, 59LLItemInfo::LLItemInfo(F32 global_x, F32 global_y,
52 const std::string& name, 60 const std::string& name,
53 LLUUID id, 61 LLUUID id,
@@ -178,6 +186,7 @@ void LLWorldMap::eraseItems()
178 mInfohubs.clear(); 186 mInfohubs.clear();
179 mPGEvents.clear(); 187 mPGEvents.clear();
180 mMatureEvents.clear(); 188 mMatureEvents.clear();
189 mAdultEvents.clear();
181 mLandForSale.clear(); 190 mLandForSale.clear();
182 } 191 }
183// mAgentLocationsMap.clear(); // persists 192// mAgentLocationsMap.clear(); // persists
@@ -303,11 +312,23 @@ void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer)
303 sendItemRequest(MAP_ITEM_MATURE_EVENT); 312 sendItemRequest(MAP_ITEM_MATURE_EVENT);
304 } 313 }
305 314
315 if (mAdultEvents.size() == 0)
316 {
317 // Request for events (adult)
318 sendItemRequest(MAP_ITEM_ADULT_EVENT);
319 }
320
306 if (mLandForSale.size() == 0) 321 if (mLandForSale.size() == 0)
307 { 322 {
308 // Request for Land For Sale 323 // Request for Land For Sale
309 sendItemRequest(MAP_ITEM_LAND_FOR_SALE); 324 sendItemRequest(MAP_ITEM_LAND_FOR_SALE);
310 } 325 }
326
327 if (mLandForSaleAdult.size() == 0)
328 {
329 // Request for Land For Sale
330 sendItemRequest(MAP_ITEM_LAND_FOR_SALE_ADULT);
331 }
311 332
312 clearImageRefs(); 333 clearImageRefs();
313 clearSimFlags(); 334 clearSimFlags();
@@ -498,9 +519,9 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**)
498 new_layer.LayerDefined = TRUE; 519 new_layer.LayerDefined = TRUE;
499 msg->getUUIDFast(_PREHASH_LayerData, _PREHASH_ImageID, new_layer.LayerImageID, block); 520 msg->getUUIDFast(_PREHASH_LayerData, _PREHASH_ImageID, new_layer.LayerImageID, block);
500 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE); 521 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE);
501 522
502 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get()); 523 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get());
503 new_layer.LayerImage->setClamp(TRUE, TRUE); 524 new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP);
504 525
505 U32 left, right, top, bottom; 526 U32 left, right, top, bottom;
506 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Left, left, block); 527 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Left, left, block);
@@ -610,13 +631,18 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
610 siminfo->mRegionFlags = region_flags; 631 siminfo->mRegionFlags = region_flags;
611 siminfo->mWaterHeight = (F32) water_height; 632 siminfo->mWaterHeight = (F32) water_height;
612 siminfo->mMapImageID[agent_flags] = image_id; 633 siminfo->mMapImageID[agent_flags] = image_id;
634
635#ifdef IMMEDIATE_IMAGE_LOAD
613 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); 636 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
614 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get()); 637 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get());
615 siminfo->mCurrentImage->setClamp(TRUE, TRUE); 638 siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP);
639#endif
616 640
617 if (siminfo->mMapImageID[2].notNull()) 641 if (siminfo->mMapImageID[2].notNull())
618 { 642 {
643#ifdef IMMEDIATE_IMAGE_LOAD
619 siminfo->mOverlayImage = gImageList.getImage(siminfo->mMapImageID[2], MIPMAP_TRUE, FALSE); 644 siminfo->mOverlayImage = gImageList.getImage(siminfo->mMapImageID[2], MIPMAP_TRUE, FALSE);
645#endif
620 } 646 }
621 else 647 else
622 { 648 {
@@ -729,6 +755,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
729 } 755 }
730 case MAP_ITEM_PG_EVENT: // events 756 case MAP_ITEM_PG_EVENT: // events
731 case MAP_ITEM_MATURE_EVENT: 757 case MAP_ITEM_MATURE_EVENT:
758 case MAP_ITEM_ADULT_EVENT:
732 { 759 {
733 struct tm* timep; 760 struct tm* timep;
734 // Convert to Pacific, based on server's opinion of whether 761 // Convert to Pacific, based on server's opinion of whether
@@ -749,16 +776,29 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
749 { 776 {
750 LLWorldMap::getInstance()->mPGEvents.push_back(new_item); 777 LLWorldMap::getInstance()->mPGEvents.push_back(new_item);
751 } 778 }
752 else 779 else if (type == MAP_ITEM_MATURE_EVENT)
753 { 780 {
754 LLWorldMap::getInstance()->mMatureEvents.push_back(new_item); 781 LLWorldMap::getInstance()->mMatureEvents.push_back(new_item);
755 } 782 }
783 else if (type == MAP_ITEM_ADULT_EVENT)
784 {
785 LLWorldMap::getInstance()->mAdultEvents.push_back(new_item);
786 }
787
756 break; 788 break;
757 } 789 }
758 case MAP_ITEM_LAND_FOR_SALE: // land for sale 790 case MAP_ITEM_LAND_FOR_SALE: // land for sale
791 case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale
759 { 792 {
760 new_item.mToolTip = llformat("%d sq. m. L$%d", new_item.mExtra, new_item.mExtra2); 793 new_item.mToolTip = llformat("%d sq. m. L$%d", new_item.mExtra, new_item.mExtra2);
761 LLWorldMap::getInstance()->mLandForSale.push_back(new_item); 794 if (type == MAP_ITEM_LAND_FOR_SALE)
795 {
796 LLWorldMap::getInstance()->mLandForSale.push_back(new_item);
797 }
798 else if (type == MAP_ITEM_LAND_FOR_SALE_ADULT)
799 {
800 LLWorldMap::getInstance()->mLandForSaleAdult.push_back(new_item);
801 }
762 break; 802 break;
763 } 803 }
764 case MAP_ITEM_CLASSIFIED: // classifieds 804 case MAP_ITEM_CLASSIFIED: // classifieds