aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmap.cpp
diff options
context:
space:
mode:
authorArmin Weatherwax2010-09-13 20:47:57 +0200
committerMcCabe Maxsted2010-09-13 14:35:56 -0700
commitd4cbeb3505f7aa315a226e464d556ef64ae2079f (patch)
tree45ca0938d951d42f37a2eb2545eeecabdb670b3c /linden/indra/newview/llworldmap.cpp
parentstay away from find_library! (diff)
downloadmeta-impy-d4cbeb3505f7aa315a226e464d556ef64ae2079f.zip
meta-impy-d4cbeb3505f7aa315a226e464d556ef64ae2079f.tar.gz
meta-impy-d4cbeb3505f7aa315a226e464d556ef64ae2079f.tar.bz2
meta-impy-d4cbeb3505f7aa315a226e464d556ef64ae2079f.tar.xz
Henri Beauchamp: use http map if possible. Fixes broken map in SL + http map possible for OS
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llworldmap.cpp60
1 files changed, 52 insertions, 8 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index 908cd87..c6242f6 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -37,6 +37,7 @@
37#include "llregionhandle.h" 37#include "llregionhandle.h"
38#include "message.h" 38#include "message.h"
39 39
40
40#include "llappviewer.h" // for gPacificDaylightTime 41#include "llappviewer.h" // for gPacificDaylightTime
41#include "llagent.h" 42#include "llagent.h"
42#include "llmapresponders.h" 43#include "llmapresponders.h"
@@ -46,9 +47,8 @@
46#include "llviewerimagelist.h" 47#include "llviewerimagelist.h"
47#include "llviewerregion.h" 48#include "llviewerregion.h"
48#include "llregionflags.h" 49#include "llregionflags.h"
49 50 #include "hippoGridManager.h"
50#include "hippoGridManager.h" 51bool LLWorldMap::sGotMapURL = false;
51
52const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes 52const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes
53 53
54// For DEV-17507, do lazy image loading in llworldmapview.cpp instead, 54// For DEV-17507, do lazy image loading in llworldmapview.cpp instead,
@@ -86,6 +86,11 @@ LLSimInfo::LLSimInfo()
86} 86}
87 87
88 88
89LLVector3d LLSimInfo::getGlobalOrigin() const
90{
91 return from_region_handle(mHandle);
92}
93
89LLVector3d LLSimInfo::getGlobalPos(LLVector3 local_pos) const 94LLVector3d LLSimInfo::getGlobalPos(LLVector3 local_pos) const
90{ 95{
91 LLVector3d pos = from_region_handle(mHandle); 96 LLVector3d pos = from_region_handle(mHandle);
@@ -514,16 +519,13 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**)
514 519
515 LLWorldMap::getInstance()->mMapLayers[agent_flags].clear(); 520 LLWorldMap::getInstance()->mMapLayers[agent_flags].clear();
516 521
522// bool use_web_map_tiles = useWebMapTiles();
517 BOOL adjust = FALSE; 523 BOOL adjust = FALSE;
518 for (S32 block=0; block<num_blocks; ++block) 524 for (S32 block=0; block<num_blocks; ++block)
519 { 525 {
520 LLWorldMapLayer new_layer; 526 LLWorldMapLayer new_layer;
521 new_layer.LayerDefined = TRUE; 527 new_layer.LayerDefined = TRUE;
522 msg->getUUIDFast(_PREHASH_LayerData, _PREHASH_ImageID, new_layer.LayerImageID, block); 528 msg->getUUIDFast(_PREHASH_LayerData, _PREHASH_ImageID, new_layer.LayerImageID, block);
523 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE);
524
525 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get());
526 new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP);
527 529
528 U32 left, right, top, bottom; 530 U32 left, right, top, bottom;
529 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Left, left, block); 531 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Left, left, block);
@@ -531,6 +533,18 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**)
531 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Top, top, block); 533 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Top, top, block);
532 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Bottom, bottom, block); 534 msg->getU32Fast(_PREHASH_LayerData, _PREHASH_Bottom, bottom, block);
533 535
536// if (use_web_map_tiles)
537// {
538// new_layer.LayerImage = loadObjectsTile(left, bottom); // no good... Maybe using of level 2 and higher web maps ?
539// }
540// else
541// {
542 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE);
543// }
544
545 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get());
546 new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP);
547
534 new_layer.LayerExtents.mLeft = left; 548 new_layer.LayerExtents.mLeft = left;
535 new_layer.LayerExtents.mRight = right; 549 new_layer.LayerExtents.mRight = right;
536 new_layer.LayerExtents.mBottom = bottom; 550 new_layer.LayerExtents.mBottom = bottom;
@@ -550,6 +564,26 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**)
550} 564}
551 565
552// public static 566// public static
567bool LLWorldMap::useWebMapTiles()
568{
569 return gSavedSettings.getBOOL("UseWebMapTiles") &&
570 (( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL) && LLWorldMap::getInstance()->mCurrentMap == 0);
571}
572
573// public static
574LLPointer<LLViewerImage> LLWorldMap::loadObjectsTile(U32 grid_x, U32 grid_y)
575{
576 // Get the grid coordinates
577 std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", 1, grid_x, grid_y);
578
579 LLPointer<LLViewerImage> img = gImageList.getImageFromUrl(imageurl);
580 img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
581
582 // Return the smart pointer
583 return img;
584}
585
586// public static
553void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) 587void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
554{ 588{
555 U32 agent_flags; 589 U32 agent_flags;
@@ -565,6 +599,9 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
565 599
566 bool found_null_sim = false; 600 bool found_null_sim = false;
567 601
602#ifdef IMMEDIATE_IMAGE_LOAD
603 bool use_web_map_tiles = useWebMapTiles();
604#endif
568 BOOL adjust = FALSE; 605 BOOL adjust = FALSE;
569 for (S32 block=0; block<num_blocks; ++block) 606 for (S32 block=0; block<num_blocks; ++block)
570 { 607 {
@@ -635,7 +672,14 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
635 siminfo->mMapImageID[agent_flags] = image_id; 672 siminfo->mMapImageID[agent_flags] = image_id;
636 673
637#ifdef IMMEDIATE_IMAGE_LOAD 674#ifdef IMMEDIATE_IMAGE_LOAD
638 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); 675 if (use_web_map_tiles)
676 {
677 siminfo->mCurrentImage = loadObjectsTile((U32)x_regions, (U32)y_regions);
678 }
679 else
680 {
681 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
682 }
639 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get()); 683 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get());
640 siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP); 684 siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP);
641#endif 685#endif