aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorArmin Weatherwax2010-09-13 20:47:57 +0200
committerJacek Antonelli2010-09-16 20:12:21 -0500
commit3c36214993ea0971fa167629a997fe2cda2a2049 (patch)
tree2d06fa8c1653897f43c9ca8ef77a6f98de86d21b /linden/indra
parentFixed the layout of the fonts preferences panel's font previews (diff)
downloadmeta-impy-3c36214993ea0971fa167629a997fe2cda2a2049.zip
meta-impy-3c36214993ea0971fa167629a997fe2cda2a2049.tar.gz
meta-impy-3c36214993ea0971fa167629a997fe2cda2a2049.tar.bz2
meta-impy-3c36214993ea0971fa167629a997fe2cda2a2049.tar.xz
Henri Beauchamp: use http map if possible. Fixes broken map in SL + http map possible for OS
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/app_settings/settings.xml22
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp4
-rw-r--r--linden/indra/newview/llfloaterworldmap.h9
-rw-r--r--linden/indra/newview/llmapresponders.cpp29
-rw-r--r--linden/indra/newview/llmapresponders.h2
-rw-r--r--linden/indra/newview/llstartup.cpp11
-rw-r--r--linden/indra/newview/llviewermenu.cpp3
-rw-r--r--linden/indra/newview/llworldmap.cpp60
-rw-r--r--linden/indra/newview/llworldmap.h8
-rw-r--r--linden/indra/newview/llworldmapview.cpp70
-rw-r--r--linden/indra/newview/llworldmapview.h7
11 files changed, 169 insertions, 56 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index ca44a2f..acdb0a6 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -6912,6 +6912,28 @@
6912 <key>Value</key> 6912 <key>Value</key>
6913 <real>20.0</real> 6913 <real>20.0</real>
6914 </map> 6914 </map>
6915 <key>MapServerURL</key>
6916 <map>
6917 <key>Comment</key>
6918 <string>World map URL template for locating map tiles</string>
6919 <key>Persist</key>
6920 <integer>0</integer>
6921 <key>Type</key>
6922 <string>String</string>
6923 <key>Value</key>
6924 <string>http://map.secondlife.com.s3.amazonaws.com/</string>
6925 </map>
6926 <key>UseWebMapTiles</key>
6927 <map>
6928 <key>Comment</key>
6929 <string>Use web map tiles whenever possible</string>
6930 <key>Persist</key>
6931 <integer>1</integer>
6932 <key>Type</key>
6933 <string>Boolean</string>
6934 <key>Value</key>
6935 <integer>1</integer>
6936 </map>
6915 <key>MapOverlayIndex</key> 6937 <key>MapOverlayIndex</key>
6916 <map> 6938 <map>
6917 <key>Comment</key> 6939 <key>Comment</key>
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index 4f678c5..781cf4d 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -247,8 +247,8 @@ BOOL LLFloaterWorldMap::postBuild()
247 childSetAction("Clear", onClearBtn, this); 247 childSetAction("Clear", onClearBtn, this);
248 childSetAction("copy_slurl", onCopySLURL, this); 248 childSetAction("copy_slurl", onCopySLURL, this);
249 249
250 mCurZoomVal = log(gMapScale)/log(2.f); 250 mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f);
251 childSetValue("zoom slider", gMapScale); 251 childSetValue("zoom slider", LLWorldMapView::sMapScale);
252 252
253 setDefaultBtn(NULL); 253 setDefaultBtn(NULL);
254 254
diff --git a/linden/indra/newview/llfloaterworldmap.h b/linden/indra/newview/llfloaterworldmap.h
index 2153921..83345ed 100644
--- a/linden/indra/newview/llfloaterworldmap.h
+++ b/linden/indra/newview/llfloaterworldmap.h
@@ -68,8 +68,6 @@ public:
68 static void toggle(void*); 68 static void toggle(void*);
69 static void hide(void*); 69 static void hide(void*);
70 70
71 static void addServer(const std::string& server);
72
73 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); 71 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
74 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 72 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
75 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 73 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -103,7 +101,6 @@ public:
103 void clearLocationSelection(BOOL clear_ui = FALSE); 101 void clearLocationSelection(BOOL clear_ui = FALSE);
104 void clearAvatarSelection(BOOL clear_ui = FALSE); 102 void clearAvatarSelection(BOOL clear_ui = FALSE);
105 void clearLandmarkSelection(BOOL clear_ui = FALSE); 103 void clearLandmarkSelection(BOOL clear_ui = FALSE);
106 void clearGridSelection(BOOL clear_ui = FALSE);
107 104
108 // Adjust the maximally zoomed out limit of the zoom slider so you can 105 // Adjust the maximally zoomed out limit of the zoom slider so you can
109 // see the whole world, plus a little. 106 // see the whole world, plus a little.
@@ -118,9 +115,8 @@ public:
118protected: 115protected:
119 static void onPanBtn( void* userdata ); 116 static void onPanBtn( void* userdata );
120 117
121 static void onGridManager(void* data);
122
123 static void onGoHome(void* data); 118 static void onGoHome(void* data);
119
124 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data ); 120 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
125 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data ); 121 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
126 122
@@ -162,14 +158,13 @@ protected:
162 static void onLocationCommit( void* userdata ); 158 static void onLocationCommit( void* userdata );
163 static void onCommitLocation( LLUICtrl* ctrl, void* userdata ); 159 static void onCommitLocation( LLUICtrl* ctrl, void* userdata );
164 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata ); 160 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
165 static void onSelectServer(LLUICtrl*, void* userdata);
166 161
167 void cacheLandmarkPosition(); 162 void cacheLandmarkPosition();
168 163
169protected: 164protected:
170 LLTabContainer* mTabs; 165 LLTabContainer* mTabs;
171 166
172 // Sets gMapScale, in pixels per region 167 // Sets sMapScale, in pixels per region
173 F32 mCurZoomVal; 168 F32 mCurZoomVal;
174 LLFrameTimer mZoomTimer; 169 LLFrameTimer mZoomTimer;
175 170
diff --git a/linden/indra/newview/llmapresponders.cpp b/linden/indra/newview/llmapresponders.cpp
index 140f390..9d974f2 100644
--- a/linden/indra/newview/llmapresponders.cpp
+++ b/linden/indra/newview/llmapresponders.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc. 7 * Copyright (c) 2006-2010, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -57,6 +57,8 @@ void LLMapLayerResponder::result(const LLSD& result)
57 57
58 LLWorldMap::getInstance()->mMapLayers[agent_flags].clear(); 58 LLWorldMap::getInstance()->mMapLayers[agent_flags].clear();
59 59
60 bool use_web_map_tiles = LLWorldMap::useWebMapTiles();
61
60 LLSD::array_const_iterator iter; 62 LLSD::array_const_iterator iter;
61 BOOL adjust = FALSE; 63 BOOL adjust = FALSE;
62 for(iter = result["LayerData"].beginArray(); iter != result["LayerData"].endArray(); ++iter) 64 for(iter = result["LayerData"].beginArray(); iter != result["LayerData"].endArray(); ++iter)
@@ -65,16 +67,24 @@ void LLMapLayerResponder::result(const LLSD& result)
65 67
66 LLWorldMapLayer new_layer; 68 LLWorldMapLayer new_layer;
67 new_layer.LayerDefined = TRUE; 69 new_layer.LayerDefined = TRUE;
68 new_layer.LayerImageID = layer_data["ImageID"];
69 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE);
70 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get());
71 new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP);
72 70
73 new_layer.LayerExtents.mLeft = layer_data["Left"]; 71 new_layer.LayerExtents.mLeft = layer_data["Left"];
74 new_layer.LayerExtents.mRight = layer_data["Right"]; 72 new_layer.LayerExtents.mRight = layer_data["Right"];
75 new_layer.LayerExtents.mBottom = layer_data["Bottom"]; 73 new_layer.LayerExtents.mBottom = layer_data["Bottom"];
76 new_layer.LayerExtents.mTop = layer_data["Top"]; 74 new_layer.LayerExtents.mTop = layer_data["Top"];
77 75
76 new_layer.LayerImageID = layer_data["ImageID"];
77// if (use_web_map_tiles)
78// {
79// new_layer.LayerImage = LLWorldMap::loadObjectsTile((U32)new_layer.LayerExtents.mLeft, (U32)new_layer.LayerExtents.mBottom); // no good... Maybe using of level 2 and higher web maps ?
80// }
81// else
82// {
83 new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE);
84// }
85 gGL.getTexUnit(0)->bind(new_layer.LayerImage.get());
86 new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP);
87
78 F32 x_meters = F32(new_layer.LayerExtents.mLeft*REGION_WIDTH_UNITS); 88 F32 x_meters = F32(new_layer.LayerExtents.mLeft*REGION_WIDTH_UNITS);
79 F32 y_meters = F32(new_layer.LayerExtents.mBottom*REGION_WIDTH_UNITS); 89 F32 y_meters = F32(new_layer.LayerExtents.mBottom*REGION_WIDTH_UNITS);
80 adjust = LLWorldMap::getInstance()->extendAABB(U32(x_meters), U32(y_meters), 90 adjust = LLWorldMap::getInstance()->extendAABB(U32(x_meters), U32(y_meters),
@@ -163,7 +173,14 @@ void LLMapLayerResponder::result(const LLSD& result)
163 siminfo->mRegionFlags = region_flags; 173 siminfo->mRegionFlags = region_flags;
164 siminfo->mWaterHeight = (F32) water_height; 174 siminfo->mWaterHeight = (F32) water_height;
165 siminfo->mMapImageID[agent_flags] = image_id; 175 siminfo->mMapImageID[agent_flags] = image_id;
166 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); 176 if (use_web_map_tiles)
177 {
178 siminfo->mCurrentImage = LLWorldMap::loadObjectsTile((U32)x_regions, (U32)y_regions);
179 }
180 else
181 {
182 siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
183 }
167 siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP); 184 siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP);
168 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get()); 185 gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get());
169 186
diff --git a/linden/indra/newview/llmapresponders.h b/linden/indra/newview/llmapresponders.h
index 8fb1fb0..b6fb8e5 100644
--- a/linden/indra/newview/llmapresponders.h
+++ b/linden/indra/newview/llmapresponders.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc. 7 * Copyright (c) 2006-2010, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 0464e99..a3fde55 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -1108,6 +1108,7 @@ bool idle_startup()
1108 requested_options.push_back("buddy-list"); 1108 requested_options.push_back("buddy-list");
1109 requested_options.push_back("ui-config"); 1109 requested_options.push_back("ui-config");
1110#endif 1110#endif
1111 requested_options.push_back("map-server-url");
1111 requested_options.push_back("tutorial_setting"); 1112 requested_options.push_back("tutorial_setting");
1112 requested_options.push_back("login-flags"); 1113 requested_options.push_back("login-flags");
1113 requested_options.push_back("global-textures"); 1114 requested_options.push_back("global-textures");
@@ -1750,7 +1751,15 @@ bool idle_startup()
1750 LLStartUp::setShouldAutoLogin(false); 1751 LLStartUp::setShouldAutoLogin(false);
1751 show_connect_box = true; 1752 show_connect_box = true;
1752 } 1753 }
1753 1754
1755 std::string map_server_url = LLUserAuth::getInstance()->getResponse("map-server-url");
1756 if(!map_server_url.empty())
1757 {
1758 gSavedSettings.setString("MapServerURL", map_server_url);
1759 //llwarns << "MapServerURL" << map_server_url << llendl;
1760 }
1761 // else llwarns << "MapServerURL empty"<< llendl;
1762
1754 // Pass the user information to the voice chat server interface. 1763 // Pass the user information to the voice chat server interface.
1755 gVoiceClient->userAuthorized(firstname, lastname, gAgentID); 1764 gVoiceClient->userAuthorized(firstname, lastname, gAgentID);
1756 } 1765 }
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 2484b94..3ac59b4 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -841,6 +841,9 @@ void init_client_menu(LLMenuGL* menu)
841 841
842 menu->append(new LLMenuItemCallGL("Clear Group Cache", 842 menu->append(new LLMenuItemCallGL("Clear Group Cache",
843 LLGroupMgr::debugClearAllGroups)); 843 LLGroupMgr::debugClearAllGroups));
844
845 menu->append(new LLMenuItemCheckGL("Use Web Map Tiles", menu_toggle_control, NULL, menu_check_control, (void*)"UseWebMapTiles"));
846
844 menu->appendSeparator(); 847 menu->appendSeparator();
845 848
846 sub_menu = new LLMenuGL("Rendering"); 849 sub_menu = new LLMenuGL("Rendering");
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
diff --git a/linden/indra/newview/llworldmap.h b/linden/indra/newview/llworldmap.h
index 6ce66ff..b7089f3 100644
--- a/linden/indra/newview/llworldmap.h
+++ b/linden/indra/newview/llworldmap.h
@@ -76,6 +76,8 @@ public:
76 LLSimInfo(); 76 LLSimInfo();
77 77
78 LLVector3d getGlobalPos(LLVector3 local_pos) const; 78 LLVector3d getGlobalPos(LLVector3 local_pos) const;
79 // Get the world coordinates of the SW corner of that region
80 LLVector3d getGlobalOrigin() const;
79 81
80public: 82public:
81 U64 mHandle; 83 U64 mHandle;
@@ -164,6 +166,10 @@ public:
164 static void processMapBlockReply(LLMessageSystem*, void**); 166 static void processMapBlockReply(LLMessageSystem*, void**);
165 static void processMapItemReply(LLMessageSystem*, void**); 167 static void processMapItemReply(LLMessageSystem*, void**);
166 168
169 static void gotMapServerURL(bool flag) { sGotMapURL = flag; }
170 static bool useWebMapTiles();
171 static LLPointer<LLViewerImage> loadObjectsTile(U32 grid_x, U32 grid_y);
172
167 void dump(); 173 void dump();
168 174
169 // Extend the bounding box of the list of simulators. Returns true 175 // Extend the bounding box of the list of simulators. Returns true
@@ -226,6 +232,8 @@ private:
226 std::string mSLURL; 232 std::string mSLURL;
227 url_callback_t mSLURLCallback; 233 url_callback_t mSLURLCallback;
228 bool mSLURLTeleport; 234 bool mSLURLTeleport;
235
236 static bool sGotMapURL;
229}; 237};
230 238
231#endif 239#endif
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 2e28d18..26604c3 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -50,7 +50,6 @@
50#include "llfloatermap.h" 50#include "llfloatermap.h"
51#include "llfloaterworldmap.h" 51#include "llfloaterworldmap.h"
52#include "llfocusmgr.h" 52#include "llfocusmgr.h"
53//#include "llmutelist.h" info not being sent
54#include "lltextbox.h" 53#include "lltextbox.h"
55#include "lltextureview.h" 54#include "lltextureview.h"
56#include "lltracker.h" 55#include "lltracker.h"
@@ -103,6 +102,7 @@ F32 LLWorldMapView::sTargetPanY = 0.f;
103S32 LLWorldMapView::sTrackingArrowX = 0; 102S32 LLWorldMapView::sTrackingArrowX = 0;
104S32 LLWorldMapView::sTrackingArrowY = 0; 103S32 LLWorldMapView::sTrackingArrowY = 0;
105F32 LLWorldMapView::sPixelsPerMeter = 1.f; 104F32 LLWorldMapView::sPixelsPerMeter = 1.f;
105F32 LLWorldMapView::sMapScale = 128.f;
106F32 CONE_SIZE = 0.6f; 106F32 CONE_SIZE = 0.6f;
107 107
108std::map<std::string,std::string> LLWorldMapView::sStringsMap; 108std::map<std::string,std::string> LLWorldMapView::sStringsMap;
@@ -179,7 +179,7 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect )
179 mMouseDownY( 0 ), 179 mMouseDownY( 0 ),
180 mSelectIDStart(0) 180 mSelectIDStart(0)
181{ 181{
182 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS; 182 sPixelsPerMeter = sMapScale / REGION_WIDTH_METERS;
183 clearLastClick(); 183 clearLastClick();
184 184
185 const S32 DIR_WIDTH = 10; 185 const S32 DIR_WIDTH = 10;
@@ -240,14 +240,14 @@ void LLWorldMapView::cleanupTextures()
240// static 240// static
241void LLWorldMapView::setScale( F32 scale ) 241void LLWorldMapView::setScale( F32 scale )
242{ 242{
243 if (scale != gMapScale) 243 if (scale != sMapScale)
244 { 244 {
245 F32 old_scale = gMapScale; 245 F32 old_scale = sMapScale;
246 246
247 gMapScale = scale; 247 sMapScale = scale;
248 if (gMapScale == 0.f) 248 if (sMapScale == 0.f)
249 { 249 {
250 gMapScale = 0.1f; 250 sMapScale = 0.1f;
251 } 251 }
252 252
253 F32 ratio = (scale / old_scale); 253 F32 ratio = (scale / old_scale);
@@ -256,7 +256,7 @@ void LLWorldMapView::setScale( F32 scale )
256 sTargetPanX = sPanX; 256 sTargetPanX = sPanX;
257 sTargetPanY = sPanY; 257 sTargetPanY = sPanY;
258 258
259 sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS; 259 sPixelsPerMeter = sMapScale / REGION_WIDTH_METERS;
260 } 260 }
261} 261}
262 262
@@ -354,11 +354,11 @@ void LLWorldMapView::draw()
354 354
355 // Find x and y position relative to camera's center. 355 // Find x and y position relative to camera's center.
356 LLVector3d rel_region_pos = origin_global - camera_global; 356 LLVector3d rel_region_pos = origin_global - camera_global;
357 F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale; 357 F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * sMapScale;
358 F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale; 358 F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * sMapScale;
359 359
360 F32 pix_width = gMapScale*(layer->LayerExtents.getWidth() + 1); 360 F32 pix_width = sMapScale*(layer->LayerExtents.getWidth() + 1);
361 F32 pix_height = gMapScale*(layer->LayerExtents.getHeight() + 1); 361 F32 pix_height = sMapScale*(layer->LayerExtents.getHeight() + 1);
362 362
363 // When the view isn't panned, 0,0 = center of rectangle 363 // When the view isn't panned, 0,0 = center of rectangle
364 F32 bottom = sPanY + half_height + relative_y; 364 F32 bottom = sPanY + half_height + relative_y;
@@ -439,6 +439,8 @@ void LLWorldMapView::draw()
439 const S32 MIN_REQUEST_PER_TICK = 1; 439 const S32 MIN_REQUEST_PER_TICK = 1;
440 S32 textures_requested_this_tick = 0; 440 S32 textures_requested_this_tick = 0;
441 441
442 bool use_web_map_tiles = LLWorldMap::useWebMapTiles();
443
442 for (LLWorldMap::sim_info_map_t::iterator it = LLWorldMap::getInstance()->mSimInfoMap.begin(); 444 for (LLWorldMap::sim_info_map_t::iterator it = LLWorldMap::getInstance()->mSimInfoMap.begin();
443 it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) 445 it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
444 { 446 {
@@ -448,7 +450,7 @@ void LLWorldMapView::draw()
448 LLViewerImage* simimage = info->mCurrentImage; 450 LLViewerImage* simimage = info->mCurrentImage;
449 LLViewerImage* overlayimage = info->mOverlayImage; 451 LLViewerImage* overlayimage = info->mOverlayImage;
450 452
451 if (gMapScale < SIM_MAP_SCALE) 453 if (sMapScale < SIM_MAP_SCALE)
452 { 454 {
453 if (simimage != NULL) simimage->setBoostLevel(0); 455 if (simimage != NULL) simimage->setBoostLevel(0);
454 if (overlayimage != NULL) overlayimage->setBoostLevel(0); 456 if (overlayimage != NULL) overlayimage->setBoostLevel(0);
@@ -460,14 +462,14 @@ void LLWorldMapView::draw()
460 462
461 // Find x and y position relative to camera's center. 463 // Find x and y position relative to camera's center.
462 LLVector3d rel_region_pos = origin_global - camera_global; 464 LLVector3d rel_region_pos = origin_global - camera_global;
463 F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale; 465 F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * sMapScale;
464 F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale; 466 F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * sMapScale;
465 467
466 // When the view isn't panned, 0,0 = center of rectangle 468 // When the view isn't panned, 0,0 = center of rectangle
467 F32 bottom = sPanY + half_height + relative_y; 469 F32 bottom = sPanY + half_height + relative_y;
468 F32 left = sPanX + half_width + relative_x; 470 F32 left = sPanX + half_width + relative_x;
469 F32 top = bottom + gMapScale ; 471 F32 top = bottom + sMapScale ;
470 F32 right = left + gMapScale ; 472 F32 right = left + sMapScale ;
471 473
472 // Switch to world map texture (if available for this region) if either: 474 // Switch to world map texture (if available for this region) if either:
473 // 1. Tiles are zoomed out small enough, or 475 // 1. Tiles are zoomed out small enough, or
@@ -478,10 +480,10 @@ void LLWorldMapView::draw()
478 map_scale_cutoff = SIM_NULL_MAP_SCALE; 480 map_scale_cutoff = SIM_NULL_MAP_SCALE;
479 } 481 }
480 482
481 info->mShowAgentLocations = (gMapScale >= SIM_MAP_AGENT_SCALE); 483 info->mShowAgentLocations = (sMapScale >= SIM_MAP_AGENT_SCALE);
482 484
483 bool sim_visible = 485 bool sim_visible =
484 (gMapScale >= map_scale_cutoff) && 486 (sMapScale >= map_scale_cutoff) &&
485 (simimage != NULL) && 487 (simimage != NULL) &&
486 (simimage->getHasGLTexture()); 488 (simimage->getHasGLTexture());
487 489
@@ -521,7 +523,15 @@ void LLWorldMapView::draw()
521 (textures_requested_this_tick < MAX_REQUEST_PER_TICK))) 523 (textures_requested_this_tick < MAX_REQUEST_PER_TICK)))
522 { 524 {
523 textures_requested_this_tick++; 525 textures_requested_this_tick++;
524 info->mCurrentImage = gImageList.getImage(info->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); 526 if (use_web_map_tiles)
527 {
528 LLVector3d region_pos = info->getGlobalOrigin();
529 info->mCurrentImage = LLWorldMap::loadObjectsTile((U32)(region_pos.mdV[VX] / REGION_WIDTH_UNITS), (U32)(region_pos.mdV[VY] / REGION_WIDTH_UNITS));
530 }
531 else
532 {
533 info->mCurrentImage = gImageList.getImage(info->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
534 }
525 info->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP); 535 info->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP);
526 simimage = info->mCurrentImage; 536 simimage = info->mCurrentImage;
527 gGL.getTexUnit(0)->bind(simimage); 537 gGL.getTexUnit(0)->bind(simimage);
@@ -554,7 +564,7 @@ void LLWorldMapView::draw()
554 center_global.mdV[VX] += 128.0; 564 center_global.mdV[VX] += 128.0;
555 center_global.mdV[VY] += 128.0; 565 center_global.mdV[VY] += 128.0;
556 566
557 S32 draw_size = llround(gMapScale); 567 S32 draw_size = llround(sMapScale);
558 if (simimage != NULL) 568 if (simimage != NULL)
559 { 569 {
560 simimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP); 570 simimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
@@ -670,10 +680,10 @@ void LLWorldMapView::draw()
670 LLFontGL* font = LLFontGL::getFontSansSerifSmall(); 680 LLFontGL* font = LLFontGL::getFontSansSerifSmall();
671 681
672 std::string mesg; 682 std::string mesg;
673 if (gMapScale < sThresholdA) 683 if (sMapScale < sThresholdA)
674 { 684 {
675 } 685 }
676 else if (gMapScale < sThresholdB) 686 else if (sMapScale < sThresholdB)
677 { 687 {
678 // mesg = llformat( info->mAgents); 688 // mesg = llformat( info->mAgents);
679 } 689 }
@@ -772,13 +782,13 @@ void LLWorldMapView::draw()
772 gGL.setSceneBlendType(LLRender::BT_ALPHA); 782 gGL.setSceneBlendType(LLRender::BT_ALPHA);
773 783
774 // Infohubs 784 // Infohubs
775 if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB) 785 if (gSavedSettings.getBOOL("MapShowInfohubs")) //(sMapScale >= sThresholdB)
776 { 786 {
777 drawGenericItems(LLWorldMap::getInstance()->mInfohubs, sInfohubImage); 787 drawGenericItems(LLWorldMap::getInstance()->mInfohubs, sInfohubImage);
778 } 788 }
779 789
780 // Telehubs 790 // Telehubs
781 if (gSavedSettings.getBOOL("MapShowTelehubs")) //(gMapScale >= sThresholdB) 791 if (gSavedSettings.getBOOL("MapShowTelehubs")) //(sMapScale >= sThresholdB)
782 { 792 {
783 drawGenericItems(LLWorldMap::getInstance()->mTelehubs, sTelehubImage); 793 drawGenericItems(LLWorldMap::getInstance()->mTelehubs, sTelehubImage);
784 } 794 }
@@ -950,7 +960,7 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i
950 960
951void LLWorldMapView::drawAgents() 961void LLWorldMapView::drawAgents()
952{ 962{
953 F32 agents_scale = (gMapScale * 0.9f) / 256.f; 963 F32 agents_scale = (sMapScale * 0.9f) / 256.f;
954 964
955 LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); 965 LLColor4 avatar_color = gColors.getColor( "MapAvatar" );
956 /*LLColor4 friend_color = gColors.getColor( "MapFriend" ); 966 /*LLColor4 friend_color = gColors.getColor( "MapFriend" );
@@ -1090,7 +1100,7 @@ void LLWorldMapView::drawEvents()
1090void LLWorldMapView::drawFrustum() 1100void LLWorldMapView::drawFrustum()
1091{ 1101{
1092 // Draw frustum 1102 // Draw frustum
1093 F32 meters_to_pixels = gMapScale/ REGION_WIDTH_METERS; 1103 F32 meters_to_pixels = sMapScale/ REGION_WIDTH_METERS;
1094 1104
1095 F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); 1105 F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect();
1096 F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); 1106 F32 far_clip_meters = LLViewerCamera::getInstance()->getFar();
@@ -1219,7 +1229,7 @@ LLVector3d LLWorldMapView::viewPosToGlobal( S32 x, S32 y )
1219 1229
1220 LLVector3 pos_local( (F32)x, (F32)y, 0.f ); 1230 LLVector3 pos_local( (F32)x, (F32)y, 0.f );
1221 1231
1222 pos_local *= ( REGION_WIDTH_METERS / gMapScale ); 1232 pos_local *= ( REGION_WIDTH_METERS / sMapScale );
1223 1233
1224 LLVector3d pos_global; 1234 LLVector3d pos_global;
1225 pos_global.setVec( pos_local ); 1235 pos_global.setVec( pos_local );
@@ -1853,7 +1863,7 @@ U32 LLWorldMapView::updateBlock(S32 block_x, S32 block_y)
1853 1863
1854U32 LLWorldMapView::updateVisibleBlocks() 1864U32 LLWorldMapView::updateVisibleBlocks()
1855{ 1865{
1856 if (gMapScale < SIM_MAP_SCALE) 1866 if (sMapScale < SIM_MAP_SCALE)
1857 { 1867 {
1858 // We don't care what is loaded if we're zoomed out 1868 // We don't care what is loaded if we're zoomed out
1859 return 0; 1869 return 0;
@@ -1861,7 +1871,7 @@ U32 LLWorldMapView::updateVisibleBlocks()
1861 1871
1862 LLVector3d camera_global = gAgent.getCameraPositionGlobal(); 1872 LLVector3d camera_global = gAgent.getCameraPositionGlobal();
1863 1873
1864 F32 pixels_per_region = gMapScale; 1874 F32 pixels_per_region = sMapScale;
1865 const S32 width = getRect().getWidth(); 1875 const S32 width = getRect().getWidth();
1866 const S32 height = getRect().getHeight(); 1876 const S32 height = getRect().getHeight();
1867 // Convert pan to sim coordinates 1877 // Convert pan to sim coordinates
diff --git a/linden/indra/newview/llworldmapview.h b/linden/indra/newview/llworldmapview.h
index 3245838..4814767 100644
--- a/linden/indra/newview/llworldmapview.h
+++ b/linden/indra/newview/llworldmapview.h
@@ -30,7 +30,10 @@
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32 32
33// Global map of the world. 33// View of the global map of the world
34
35// The data (model) for the global map (a singleton, unique to the application instance) is
36// in LLWorldMap and is typically accessed using LLWorldMap::getInstance()
34 37
35#ifndef LL_LLWORLDMAPVIEW_H 38#ifndef LL_LLWORLDMAPVIEW_H
36#define LL_LLWORLDMAPVIEW_H 39#define LL_LLWORLDMAPVIEW_H
@@ -161,6 +164,8 @@ public:
161 static F32 sThresholdB; 164 static F32 sThresholdB;
162 static F32 sPixelsPerMeter; // world meters to map pixels 165 static F32 sPixelsPerMeter; // world meters to map pixels
163 166
167 static F32 sMapScale; // scale = size of a region in pixels
168
164 BOOL mItemPicked; 169 BOOL mItemPicked;
165 170
166 static F32 sPanX; // in pixels 171 static F32 sPanX; // in pixels