OpenSim compatible world map. YUCK!!!
This commit is contained in:
@@ -492,8 +492,7 @@ set(viewer_SOURCE_FILES
|
|||||||
llwlparamset.cpp
|
llwlparamset.cpp
|
||||||
llworld.cpp
|
llworld.cpp
|
||||||
llworldmap.cpp
|
llworldmap.cpp
|
||||||
llworldmapmessage.cpp
|
llmapresponders.cpp
|
||||||
llworldmipmap.cpp
|
|
||||||
llworldmapview.cpp
|
llworldmapview.cpp
|
||||||
llxmlrpctransaction.cpp
|
llxmlrpctransaction.cpp
|
||||||
noise.cpp
|
noise.cpp
|
||||||
@@ -965,8 +964,7 @@ set(viewer_HEADER_FILES
|
|||||||
llwlparamset.h
|
llwlparamset.h
|
||||||
llworld.h
|
llworld.h
|
||||||
llworldmap.h
|
llworldmap.h
|
||||||
llworldmapmessage.h
|
llmapresponders.h
|
||||||
llworldmipmap.h
|
|
||||||
llworldmapview.h
|
llworldmapview.h
|
||||||
llxmlrpctransaction.h
|
llxmlrpctransaction.h
|
||||||
macmain.h
|
macmain.h
|
||||||
|
|||||||
@@ -7147,6 +7147,17 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<string>http://map.secondlife.com.s3.amazonaws.com/</string>
|
<string>http://map.secondlife.com.s3.amazonaws.com/</string>
|
||||||
</map>
|
</map>
|
||||||
|
<key>UseWebMapTiles</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Use web map tiles whenever possible</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
</map>
|
||||||
<key>MapOverlayIndex</key>
|
<key>MapOverlayIndex</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
@@ -7180,10 +7191,10 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
</map>
|
</map>
|
||||||
<key>MapShowEvents</key>
|
<key>MapShowPGEvents</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
<string>Show events on world map</string>
|
<string>Show PG events on world map</string>
|
||||||
<key>Persist</key>
|
<key>Persist</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
@@ -7191,6 +7202,28 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>MapShowMatureEvents</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Show mature events on world map</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</map>
|
||||||
|
<key>MapShowAdultEvents</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Show adult events on world map</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</map>
|
||||||
<key>MapShowInfohubs</key>
|
<key>MapShowInfohubs</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -110,6 +110,7 @@
|
|||||||
#include "lltoolmgr.h"
|
#include "lltoolmgr.h"
|
||||||
#include "lltoolpie.h"
|
#include "lltoolpie.h"
|
||||||
#include "lltoolview.h"
|
#include "lltoolview.h"
|
||||||
|
#include "lltrans.h"
|
||||||
#include "llui.h" // for make_ui_sound
|
#include "llui.h" // for make_ui_sound
|
||||||
#include "llurldispatcher.h"
|
#include "llurldispatcher.h"
|
||||||
#include "llviewercamera.h"
|
#include "llviewercamera.h"
|
||||||
@@ -139,7 +140,6 @@
|
|||||||
#include "llfollowcam.h"
|
#include "llfollowcam.h"
|
||||||
|
|
||||||
#include "llao.h"
|
#include "llao.h"
|
||||||
#include "llworldmapmessage.h"
|
|
||||||
#include "llfollowcam.h"
|
#include "llfollowcam.h"
|
||||||
|
|
||||||
// [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3b)
|
// [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3b)
|
||||||
@@ -8517,21 +8517,26 @@ std::string LLAgent::getCapability(const std::string& name) const
|
|||||||
}
|
}
|
||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
// <edit>
|
|
||||||
|
|
||||||
void LLAgent::showLureDestination(const std::string fromname, const int global_x, const int global_y, const int x, const int y, const int z, const std::string maturity)
|
void LLAgent::showLureDestination(const std::string fromname, const int global_x, const int global_y, const int x, const int y, const int z, const std::string maturity)
|
||||||
{
|
{
|
||||||
const LLVector3d posglobal = LLVector3d(F64(global_x), F64(global_y), F64(0));
|
const LLVector3d posglobal = LLVector3d(F64(global_x), F64(global_y), F64(0));
|
||||||
LLSimInfo* siminfo;
|
LLSimInfo* siminfo;
|
||||||
siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(posglobal);
|
siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(posglobal);
|
||||||
|
std::string sim_name;
|
||||||
|
LLWorldMap::getInstance()->simNameFromPosGlobal( posglobal, sim_name );
|
||||||
|
|
||||||
if(siminfo)
|
if(siminfo)
|
||||||
{
|
{
|
||||||
llinfos << fromname << "'s teleport lure is to " << siminfo->getName() << " (" << maturity << ")" << llendl;
|
llinfos << fromname << "'s teleport lure is to " << sim_name << " (" << maturity << ")" << llendl;
|
||||||
std::string url = LLURLDispatcher::buildSLURL(siminfo->getName(), S32(x), S32(y), S32(z));
|
LLStringUtil::format_map_t args;
|
||||||
std::string msg;
|
args["[NAME]"] = fromname;
|
||||||
msg = llformat("%s's teleport lure is to %s", fromname.c_str(), url.c_str());
|
args["[DESTINATION]"] = LLURLDispatcher::buildSLURL(sim_name.c_str(), S32(x), S32(y), S32(z));
|
||||||
if(maturity != "")
|
std::string msg = LLTrans::getString("TeleportLureMaturity", args);
|
||||||
|
if (maturity != "")
|
||||||
|
{
|
||||||
msg.append(llformat(" (%s)", maturity.c_str()));
|
msg.append(llformat(" (%s)", maturity.c_str()));
|
||||||
|
}
|
||||||
LLChat chat(msg);
|
LLChat chat(msg);
|
||||||
LLFloaterChat::addChat(chat);
|
LLFloaterChat::addChat(chat);
|
||||||
}
|
}
|
||||||
@@ -8546,7 +8551,7 @@ void LLAgent::showLureDestination(const std::string fromname, const int global_x
|
|||||||
LLAgent::lure_y = y;
|
LLAgent::lure_y = y;
|
||||||
LLAgent::lure_z = z;
|
LLAgent::lure_z = z;
|
||||||
LLAgent::lure_maturity = maturity;
|
LLAgent::lure_maturity = maturity;
|
||||||
LLWorldMapMessage::getInstance()->sendMapBlockRequest(lure_global_x, lure_global_y, lure_global_x, lure_global_y, true);
|
LLWorldMap::getInstance()->sendMapBlockRequest(lure_global_x, lure_global_y, lure_global_x, lure_global_y, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8555,14 +8560,19 @@ void LLAgent::onFoundLureDestination()
|
|||||||
LLAgent::lure_show = FALSE;
|
LLAgent::lure_show = FALSE;
|
||||||
LLSimInfo* siminfo;
|
LLSimInfo* siminfo;
|
||||||
siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(LLAgent::lure_posglobal);
|
siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(LLAgent::lure_posglobal);
|
||||||
|
std::string sim_name;
|
||||||
|
LLWorldMap::getInstance()->simNameFromPosGlobal(LLAgent::lure_posglobal, sim_name );
|
||||||
if(siminfo)
|
if(siminfo)
|
||||||
{
|
{
|
||||||
llinfos << LLAgent::lure_name << "'s teleport lure is to " << siminfo->getName() << " (" << LLAgent::lure_maturity << ")" << llendl;
|
llinfos << LLAgent::lure_name << "'s teleport lure is to " << sim_name << " (" << LLAgent::lure_maturity << ")" << llendl;
|
||||||
std::string url = LLURLDispatcher::buildSLURL(siminfo->getName(), S32(LLAgent::lure_x), S32(LLAgent::lure_y), S32(LLAgent::lure_z));
|
LLStringUtil::format_map_t args;
|
||||||
std::string msg;
|
args["[NAME]"] = LLAgent::lure_name;
|
||||||
msg = llformat("%s's teleport lure is to %s", LLAgent::lure_name.c_str(), url.c_str());
|
args["[DESTINATION]"] = LLURLDispatcher::buildSLURL(sim_name, S32(LLAgent::lure_x), S32(LLAgent::lure_y), S32(LLAgent::lure_z));
|
||||||
if(LLAgent::lure_maturity != "")
|
std::string msg = LLTrans::getString("TeleportOfferMaturity", args);
|
||||||
|
if (LLAgent::lure_maturity != "")
|
||||||
|
{
|
||||||
msg.append(llformat(" (%s)", LLAgent::lure_maturity.c_str()));
|
msg.append(llformat(" (%s)", LLAgent::lure_maturity.c_str()));
|
||||||
|
}
|
||||||
LLChat chat(msg);
|
LLChat chat(msg);
|
||||||
LLFloaterChat::addChat(chat);
|
LLFloaterChat::addChat(chat);
|
||||||
}
|
}
|
||||||
@@ -8570,7 +8580,6 @@ void LLAgent::onFoundLureDestination()
|
|||||||
llwarns << "Grand scheme failed" << llendl;
|
llwarns << "Grand scheme failed" << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// </edit>
|
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,7 @@
|
|||||||
#include "llviewermenu.h"
|
#include "llviewermenu.h"
|
||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h"
|
||||||
#include "llviewerstats.h"
|
#include "llviewerstats.h"
|
||||||
#include "llviewerimage.h"
|
|
||||||
#include "llworldmap.h"
|
#include "llworldmap.h"
|
||||||
#include "llworldmapmessage.h"
|
|
||||||
#include "llworldmapview.h"
|
#include "llworldmapview.h"
|
||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "llappviewer.h"
|
#include "llappviewer.h"
|
||||||
@@ -81,12 +79,6 @@
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
static const F32 MAP_ZOOM_TIME = 0.2f;
|
static const F32 MAP_ZOOM_TIME = 0.2f;
|
||||||
|
|
||||||
// Merov: we switched from using the "world size" (which varies depending where the user went) to a fixed
|
|
||||||
// width of 512 regions max visible at a time. This makes the zoom slider works in a consistent way across
|
|
||||||
// sessions and doesn't prevent the user to pan the world if it was to grow a lot beyond that limit.
|
|
||||||
// Currently (01/26/09), this value allows the whole grid to be visible in a 1024x1024 window.
|
|
||||||
static const S32 MAX_VISIBLE_REGIONS = 512;
|
|
||||||
|
|
||||||
enum EPanDirection
|
enum EPanDirection
|
||||||
{
|
{
|
||||||
PAN_UP,
|
PAN_UP,
|
||||||
@@ -175,6 +167,7 @@ LLFloaterWorldMap::LLFloaterWorldMap()
|
|||||||
{
|
{
|
||||||
LLCallbackMap::map_t factory_map;
|
LLCallbackMap::map_t factory_map;
|
||||||
factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL);
|
factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL);
|
||||||
|
factory_map["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL);
|
||||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", &factory_map);
|
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", &factory_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +179,30 @@ void* LLFloaterWorldMap::createWorldMapView(void* data)
|
|||||||
|
|
||||||
BOOL LLFloaterWorldMap::postBuild()
|
BOOL LLFloaterWorldMap::postBuild()
|
||||||
{
|
{
|
||||||
mPanel = getChild<LLPanel>("objects_mapview");
|
mTabs = getChild<LLTabContainer>("maptab");
|
||||||
|
if (!mTabs) return FALSE;
|
||||||
|
|
||||||
|
LLPanel *panel;
|
||||||
|
|
||||||
|
panel = mTabs->getChild<LLPanel>("objects_mapview");
|
||||||
|
if (panel)
|
||||||
|
{
|
||||||
|
mTabs->setTabChangeCallback(panel, onCommitBackground);
|
||||||
|
mTabs->setTabUserData(panel, this);
|
||||||
|
}
|
||||||
|
panel = mTabs->getChild<LLPanel>("terrain_mapview");
|
||||||
|
if (panel)
|
||||||
|
{
|
||||||
|
mTabs->setTabChangeCallback(panel, onCommitBackground);
|
||||||
|
mTabs->setTabUserData(panel, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The following callback syncs the worlmap tabs with the images.
|
||||||
|
// Commented out since it was crashing when LLWorldMap became a singleton.
|
||||||
|
// We should be fine without it but override the onOpen method and put it
|
||||||
|
// there if it turns out to be needed. -MG
|
||||||
|
//
|
||||||
|
//onCommitBackground((void*)this, false);
|
||||||
|
|
||||||
childSetCommitCallback("friend combo", onAvatarComboCommit, this);
|
childSetCommitCallback("friend combo", onAvatarComboCommit, this);
|
||||||
|
|
||||||
@@ -247,7 +263,7 @@ BOOL LLFloaterWorldMap::postBuild()
|
|||||||
LLFloaterWorldMap::~LLFloaterWorldMap()
|
LLFloaterWorldMap::~LLFloaterWorldMap()
|
||||||
{
|
{
|
||||||
// All cleaned up by LLView destructor
|
// All cleaned up by LLView destructor
|
||||||
mPanel = NULL;
|
mTabs = NULL;
|
||||||
|
|
||||||
// Inventory deletes all observers on shutdown
|
// Inventory deletes all observers on shutdown
|
||||||
mInventory = NULL;
|
mInventory = NULL;
|
||||||
@@ -280,7 +296,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
|
|||||||
gFloaterWorldMap->open(); /* Flawfinder: ignore */
|
gFloaterWorldMap->open(); /* Flawfinder: ignore */
|
||||||
|
|
||||||
LLWorldMapView* map_panel;
|
LLWorldMapView* map_panel;
|
||||||
map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel;
|
map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel();
|
||||||
map_panel->clearLastClick();
|
map_panel->clearLastClick();
|
||||||
|
|
||||||
if (!was_visible)
|
if (!was_visible)
|
||||||
@@ -292,8 +308,15 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
|
|||||||
}
|
}
|
||||||
map_panel->updateVisibleBlocks();
|
map_panel->updateVisibleBlocks();
|
||||||
|
|
||||||
// Reload items as they may have changed
|
// Reload the agent positions when we show the window
|
||||||
LLWorldMap::getInstance()->reloadItems();
|
LLWorldMap::getInstance()->eraseItems();
|
||||||
|
|
||||||
|
// Reload any maps that may have changed
|
||||||
|
LLWorldMap::getInstance()->clearSimFlags();
|
||||||
|
|
||||||
|
const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex();
|
||||||
|
const bool request_from_sim = true;
|
||||||
|
LLWorldMap::getInstance()->setCurrentLayer(panel_num, request_from_sim);
|
||||||
|
|
||||||
// We may already have a bounding box for the regions of the world,
|
// We may already have a bounding box for the regions of the world,
|
||||||
// so use that to adjust the view.
|
// so use that to adjust the view.
|
||||||
@@ -327,7 +350,9 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
|
|||||||
// static
|
// static
|
||||||
void LLFloaterWorldMap::reloadIcons(void*)
|
void LLFloaterWorldMap::reloadIcons(void*)
|
||||||
{
|
{
|
||||||
LLWorldMap::getInstance()->reloadItems();
|
LLWorldMap::getInstance()->eraseItems();
|
||||||
|
|
||||||
|
LLWorldMap::getInstance()->sendMapLayerRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -365,7 +390,7 @@ void LLFloaterWorldMap::setVisible( BOOL visible )
|
|||||||
|
|
||||||
if( !visible )
|
if( !visible )
|
||||||
{
|
{
|
||||||
// While we're not visible, discard the image tiles and overlays
|
// While we're not visible, discard the overlay images we're using
|
||||||
LLWorldMap::getInstance()->clearImageRefs();
|
LLWorldMap::getInstance()->clearImageRefs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,6 +427,12 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
|||||||
void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent )
|
void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent )
|
||||||
{
|
{
|
||||||
LLFloater::reshape( width, height, called_from_parent );
|
LLFloater::reshape( width, height, called_from_parent );
|
||||||
|
|
||||||
|
// Might have changed size of world display area
|
||||||
|
// JC: Technically, this is correct, but it makes the slider "pop"
|
||||||
|
// if you resize the window, then draw the slider. Just leaving it
|
||||||
|
// the way it was when you opened the window seems better.
|
||||||
|
// adjustZoomSliderBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -480,7 +511,7 @@ void LLFloaterWorldMap::draw()
|
|||||||
|
|
||||||
childSetEnabled("Teleport", (BOOL)tracking_status);
|
childSetEnabled("Teleport", (BOOL)tracking_status);
|
||||||
// childSetEnabled("Clear", (BOOL)tracking_status);
|
// childSetEnabled("Clear", (BOOL)tracking_status);
|
||||||
childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking());
|
childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
|
||||||
childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
|
childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
|
||||||
|
|
||||||
setMouseOpaque(TRUE);
|
setMouseOpaque(TRUE);
|
||||||
@@ -501,18 +532,6 @@ void LLFloaterWorldMap::draw()
|
|||||||
F32 map_scale = 256.f*pow(2.f, mCurZoomVal);
|
F32 map_scale = 256.f*pow(2.f, mCurZoomVal);
|
||||||
LLWorldMapView::setScale( map_scale );
|
LLWorldMapView::setScale( map_scale );
|
||||||
|
|
||||||
// Enable/disable checkboxes depending on the zoom level
|
|
||||||
// If above threshold level (i.e. low res) -> Disable all checkboxes
|
|
||||||
// If under threshold level (i.e. high res) -> Enable all checkboxes
|
|
||||||
bool enable = LLWorldMapView::showRegionInfo();
|
|
||||||
childSetEnabled("people_chk", enable);
|
|
||||||
childSetEnabled("infohub_chk", enable);
|
|
||||||
childSetEnabled("telehubchk", enable);
|
|
||||||
childSetEnabled("land_for_sale_chk", enable);
|
|
||||||
childSetEnabled("event_chk", enable);
|
|
||||||
childSetEnabled("event_mature_chk", enable);
|
|
||||||
childSetEnabled("event_adult_chk", enable);
|
|
||||||
|
|
||||||
LLFloater::draw();
|
LLFloater::draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,14 +619,14 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
|
|||||||
void LLFloaterWorldMap::trackEvent(const LLItemInfo &event_info)
|
void LLFloaterWorldMap::trackEvent(const LLItemInfo &event_info)
|
||||||
{
|
{
|
||||||
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
||||||
LLTracker::trackLocation(event_info.getGlobalPosition(), event_info.getName(), event_info.getToolTip(), LLTracker::LOCATION_EVENT);
|
LLTracker::trackLocation(event_info.mPosGlobal, event_info.mName, event_info.mToolTip, LLTracker::LOCATION_EVENT);
|
||||||
setDefaultBtn("Teleport");
|
setDefaultBtn("Teleport");
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
|
void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
|
||||||
{
|
{
|
||||||
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
||||||
LLTracker::trackLocation(item.getGlobalPosition(), item.getName(), item.getToolTip(), LLTracker::LOCATION_ITEM);
|
LLTracker::trackLocation(item.mPosGlobal, item.mName, item.mToolTip, LLTracker::LOCATION_ITEM);
|
||||||
setDefaultBtn("Teleport");
|
setDefaultBtn("Teleport");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,27 +635,29 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
|
|||||||
LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
|
LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
|
||||||
if (!sim_info)
|
if (!sim_info)
|
||||||
{
|
{
|
||||||
// We haven't found a region for that point yet, leave the tracking to the world map
|
LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE;
|
||||||
LLWorldMap::getInstance()->setTracking(pos_global);
|
LLWorldMap::getInstance()->mInvalidLocation = FALSE;
|
||||||
|
LLWorldMap::getInstance()->mUnknownLocation = pos_global;
|
||||||
LLTracker::stopTracking(NULL);
|
LLTracker::stopTracking(NULL);
|
||||||
S32 world_x = S32(pos_global.mdV[0] / 256);
|
S32 world_x = S32(pos_global.mdV[0] / 256);
|
||||||
S32 world_y = S32(pos_global.mdV[1] / 256);
|
S32 world_y = S32(pos_global.mdV[1] / 256);
|
||||||
LLWorldMapMessage::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true);
|
LLWorldMap::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true);
|
||||||
setDefaultBtn("");
|
setDefaultBtn("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sim_info->isDown())
|
if (sim_info->mAccess == SIM_ACCESS_DOWN)
|
||||||
{
|
{
|
||||||
// Down region. Show the blue circle of death!
|
// Down sim. Show the blue circle of death!
|
||||||
// i.e. let the world map that this and tell it it's invalid
|
LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE;
|
||||||
LLWorldMap::getInstance()->setTracking(pos_global);
|
LLWorldMap::getInstance()->mUnknownLocation = pos_global;
|
||||||
LLWorldMap::getInstance()->setTrackingInvalid();
|
LLWorldMap::getInstance()->mInvalidLocation = TRUE;
|
||||||
LLTracker::stopTracking(NULL);
|
LLTracker::stopTracking(NULL);
|
||||||
setDefaultBtn("");
|
setDefaultBtn("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string sim_name = sim_info->getName();
|
std::string sim_name;
|
||||||
|
LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name );
|
||||||
F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS );
|
F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS );
|
||||||
F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
|
F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
|
||||||
std::string full_name = llformat("%s (%d, %d, %d)",
|
std::string full_name = llformat("%s (%d, %d, %d)",
|
||||||
@@ -651,7 +672,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
|
|||||||
std::string tooltip("");
|
std::string tooltip("");
|
||||||
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
mTrackedStatus = LLTracker::TRACKING_LOCATION;
|
||||||
LLTracker::trackLocation(pos_global, full_name, tooltip);
|
LLTracker::trackLocation(pos_global, full_name, tooltip);
|
||||||
LLWorldMap::getInstance()->cancelTracking(); // The floater is taking over the tracking
|
LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
|
||||||
|
LLWorldMap::getInstance()->mIsTrackingDoubleClick = FALSE;
|
||||||
|
LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
|
||||||
|
|
||||||
setDefaultBtn("Teleport");
|
setDefaultBtn("Teleport");
|
||||||
}
|
}
|
||||||
@@ -780,9 +803,9 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3
|
|||||||
|
|
||||||
// pass sim name to combo box
|
// pass sim name to combo box
|
||||||
gFloaterWorldMap->mCompletingRegionName = region_name;
|
gFloaterWorldMap->mCompletingRegionName = region_name;
|
||||||
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name);
|
LLWorldMap::getInstance()->sendNamedRegionRequest(region_name);
|
||||||
LLStringUtil::toLower(gFloaterWorldMap->mCompletingRegionName);
|
LLStringUtil::toLower(gFloaterWorldMap->mCompletingRegionName);
|
||||||
LLWorldMap::getInstance()->setTrackingCommit();
|
LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -963,7 +986,7 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
|
|||||||
{
|
{
|
||||||
childSetValue("spin z", 0);
|
childSetValue("spin z", 0);
|
||||||
}
|
}
|
||||||
LLWorldMap::getInstance()->cancelTracking();
|
LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
|
||||||
mCompletingRegionName = "";
|
mCompletingRegionName = "";
|
||||||
mExactMatch = FALSE;
|
mExactMatch = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1000,16 +1023,18 @@ void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui)
|
|||||||
// can see the whole world, plus a little.
|
// can see the whole world, plus a little.
|
||||||
void LLFloaterWorldMap::adjustZoomSliderBounds()
|
void LLFloaterWorldMap::adjustZoomSliderBounds()
|
||||||
{
|
{
|
||||||
// Merov: we switched from using the "world size" (which varies depending where the user went) to a fixed
|
// World size in regions
|
||||||
// width of 512 regions max visible at a time. This makes the zoom slider works in a consistent way across
|
S32 world_width_regions = LLWorldMap::getInstance()->getWorldWidth() / REGION_WIDTH_UNITS;
|
||||||
// sessions and doesn't prevent the user to pan the world if it was to grow a lot beyond that limit.
|
S32 world_height_regions = LLWorldMap::getInstance()->getWorldHeight() / REGION_WIDTH_UNITS;
|
||||||
// Currently (01/26/09), this value allows the whole grid to be visible in a 1024x1024 window.
|
|
||||||
S32 world_width_regions = MAX_VISIBLE_REGIONS;
|
// Pad the world size a little bit, so we have a nice border on
|
||||||
S32 world_height_regions = MAX_VISIBLE_REGIONS;
|
// the edge
|
||||||
|
world_width_regions++;
|
||||||
|
world_height_regions++;
|
||||||
|
|
||||||
// Find how much space we have to display the world
|
// Find how much space we have to display the world
|
||||||
LLWorldMapView* map_panel;
|
LLWorldMapView* map_panel;
|
||||||
map_panel = (LLWorldMapView*)mPanel;
|
map_panel = (LLWorldMapView*)mTabs->getCurrentPanel();
|
||||||
LLRect view_rect = map_panel->getRect();
|
LLRect view_rect = map_panel->getRect();
|
||||||
|
|
||||||
// View size in pixels
|
// View size in pixels
|
||||||
@@ -1059,7 +1084,7 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLWorldMapView* map_panel;
|
LLWorldMapView* map_panel;
|
||||||
map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel;
|
map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel();
|
||||||
map_panel->translatePan( pan_x, pan_y );
|
map_panel->translatePan( pan_x, pan_y );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1259,16 +1284,16 @@ void LLFloaterWorldMap::onLocationCommit( void* userdata )
|
|||||||
|
|
||||||
LLStringUtil::toLower(str);
|
LLStringUtil::toLower(str);
|
||||||
gFloaterWorldMap->mCompletingRegionName = str;
|
gFloaterWorldMap->mCompletingRegionName = str;
|
||||||
LLWorldMap::getInstance()->setTrackingCommit();
|
LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
|
||||||
self->mExactMatch = FALSE;
|
self->mExactMatch = FALSE;
|
||||||
if (str.length() >= 3)
|
if (str.length() >= 3)
|
||||||
{
|
{
|
||||||
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(str);
|
LLWorldMap::getInstance()->sendNamedRegionRequest(str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str += "#";
|
str += "#";
|
||||||
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(str);
|
LLWorldMap::getInstance()->sendNamedRegionRequest(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1279,7 +1304,7 @@ void LLFloaterWorldMap::onClearBtn(void* data)
|
|||||||
LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
|
LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
|
||||||
self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
|
self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
|
||||||
LLTracker::stopTracking((void *)(intptr_t)TRUE);
|
LLTracker::stopTracking((void *)(intptr_t)TRUE);
|
||||||
LLWorldMap::getInstance()->cancelTracking();
|
LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
|
||||||
self->mSLURL = ""; // Clear the SLURL since it's invalid
|
self->mSLURL = ""; // Clear the SLURL since it's invalid
|
||||||
self->mSetToUserPosition = TRUE; // Revert back to the current user position
|
self->mSetToUserPosition = TRUE; // Revert back to the current user position
|
||||||
}
|
}
|
||||||
@@ -1354,9 +1379,9 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate)
|
|||||||
pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal();
|
pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(LLWorldMap::getInstance()->isTracking())
|
else if(LLWorldMap::getInstance()->mIsTrackingUnknownLocation)
|
||||||
{
|
{
|
||||||
pos_global = LLWorldMap::getInstance()->getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal();;
|
pos_global = LLWorldMap::getInstance()->mUnknownLocation - gAgent.getCameraPositionGlobal();;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1364,8 +1389,8 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate)
|
|||||||
pos_global.clearVec();
|
pos_global.clearVec();
|
||||||
}
|
}
|
||||||
|
|
||||||
LLWorldMapView::setPan( -llfloor((F32)(pos_global.mdV[VX] * (F64)LLWorldMapView::sMapScale / REGION_WIDTH_METERS)),
|
LLWorldMapView::setPan( -llfloor((F32)(pos_global.mdV[VX] * (F64)LLWorldMapView::sPixelsPerMeter)),
|
||||||
-llfloor((F32)(pos_global.mdV[VY] * (F64)LLWorldMapView::sMapScale / REGION_WIDTH_METERS)),
|
-llfloor((F32)(pos_global.mdV[VY] * (F64)LLWorldMapView::sPixelsPerMeter)),
|
||||||
!animate);
|
!animate);
|
||||||
mWaitingForTracker = FALSE;
|
mWaitingForTracker = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1541,6 +1566,17 @@ void LLFloaterWorldMap::flyToAvatar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
void LLFloaterWorldMap::onCommitBackground(void* userdata, bool from_click)
|
||||||
|
{
|
||||||
|
LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
|
||||||
|
|
||||||
|
// Find my index
|
||||||
|
S32 index = self->mTabs->getCurrentPanelIndex();
|
||||||
|
|
||||||
|
LLWorldMap::getInstance()->setCurrentLayer(index);
|
||||||
|
}
|
||||||
|
|
||||||
void LLFloaterWorldMap::updateSims(bool found_null_sim)
|
void LLFloaterWorldMap::updateSims(bool found_null_sim)
|
||||||
{
|
{
|
||||||
if (mCompletingRegionName == "")
|
if (mCompletingRegionName == "")
|
||||||
@@ -1558,27 +1594,28 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
|
|||||||
BOOL match_found = FALSE;
|
BOOL match_found = FALSE;
|
||||||
S32 num_results = 0;
|
S32 num_results = 0;
|
||||||
std::map<U64, LLSimInfo*>::const_iterator it;
|
std::map<U64, LLSimInfo*>::const_iterator it;
|
||||||
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
|
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
|
||||||
{
|
{
|
||||||
LLSimInfo* info = it->second;
|
LLSimInfo* info = (*it).second;
|
||||||
std::string sim_name_lower = info->getName();
|
std::string sim_name = info->mName;
|
||||||
|
std::string sim_name_lower = sim_name;
|
||||||
LLStringUtil::toLower(sim_name_lower);
|
LLStringUtil::toLower(sim_name_lower);
|
||||||
|
|
||||||
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
|
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
|
||||||
{
|
{
|
||||||
if (LLWorldMap::getInstance()->isTrackingCommit())
|
if (LLWorldMap::getInstance()->mIsTrackingCommit)
|
||||||
{
|
{
|
||||||
if (info->isName(mCompletingRegionName))
|
if (sim_name_lower == mCompletingRegionName)
|
||||||
{
|
{
|
||||||
selected_value = info->getName();
|
selected_value = sim_name;
|
||||||
match_found = TRUE;
|
match_found = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLSD value;
|
LLSD value;
|
||||||
value["id"] = info->getName();
|
value["id"] = sim_name;
|
||||||
value["columns"][0]["column"] = "sim_name";
|
value["columns"][0]["column"] = "sim_name";
|
||||||
value["columns"][0]["value"] = info->getName();
|
value["columns"][0]["value"] = sim_name;
|
||||||
list->addElement(value);
|
list->addElement(value);
|
||||||
num_results++;
|
num_results++;
|
||||||
}
|
}
|
||||||
@@ -1645,13 +1682,15 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
|
|||||||
LLStringUtil::toLower(sim_name);
|
LLStringUtil::toLower(sim_name);
|
||||||
|
|
||||||
std::map<U64, LLSimInfo*>::const_iterator it;
|
std::map<U64, LLSimInfo*>::const_iterator it;
|
||||||
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
|
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
|
||||||
{
|
{
|
||||||
LLSimInfo* info = it->second;
|
LLSimInfo* info = (*it).second;
|
||||||
|
std::string info_sim_name = info->mName;
|
||||||
|
LLStringUtil::toLower(info_sim_name);
|
||||||
|
|
||||||
if (info->isName(sim_name))
|
if (sim_name == info_sim_name)
|
||||||
{
|
{
|
||||||
LLVector3d pos_global = info->getGlobalOrigin();
|
LLVector3d pos_global = from_region_handle( info->mHandle );
|
||||||
F64 local_x = self->childGetValue("spin x");
|
F64 local_x = self->childGetValue("spin x");
|
||||||
F64 local_y = self->childGetValue("spin y");
|
F64 local_y = self->childGetValue("spin y");
|
||||||
F64 local_z = self->childGetValue("spin z");
|
F64 local_z = self->childGetValue("spin z");
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class LLInventoryModel;
|
|||||||
class LLInventoryObserver;
|
class LLInventoryObserver;
|
||||||
class LLItemInfo;
|
class LLItemInfo;
|
||||||
class LLTabContainer;
|
class LLTabContainer;
|
||||||
|
class LLWorldMapView;
|
||||||
|
|
||||||
class LLFloaterWorldMap : public LLFloater
|
class LLFloaterWorldMap : public LLFloater
|
||||||
{
|
{
|
||||||
@@ -111,7 +112,7 @@ public:
|
|||||||
// teleport to the tracked item, if there is one
|
// teleport to the tracked item, if there is one
|
||||||
void teleport();
|
void teleport();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
static void onPanBtn( void* userdata );
|
static void onPanBtn( void* userdata );
|
||||||
|
|
||||||
static void onGoHome(void* data);
|
static void onGoHome(void* data);
|
||||||
@@ -122,6 +123,8 @@ private:
|
|||||||
static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
|
static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
|
||||||
static void onAvatarComboCommit( LLUICtrl* ctrl, void* data );
|
static void onAvatarComboCommit( LLUICtrl* ctrl, void* data );
|
||||||
|
|
||||||
|
static void onCommitBackground(void* data, bool from_click);
|
||||||
|
|
||||||
static void onComboTextEntry( LLLineEditor* ctrl, void* data );
|
static void onComboTextEntry( LLLineEditor* ctrl, void* data );
|
||||||
static void onSearchTextEntry( LLLineEditor* ctrl, void* data );
|
static void onSearchTextEntry( LLLineEditor* ctrl, void* data );
|
||||||
|
|
||||||
@@ -158,10 +161,10 @@ private:
|
|||||||
|
|
||||||
void cacheLandmarkPosition();
|
void cacheLandmarkPosition();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
LLPanel* mPanel; // Panel displaying the map
|
LLTabContainer* mTabs;
|
||||||
|
|
||||||
// Ties to LLWorldMapView::sMapScale, in pixels per region
|
// Sets sMapScale, in pixels per region
|
||||||
F32 mCurZoomVal;
|
F32 mCurZoomVal;
|
||||||
LLFrameTimer mZoomTimer;
|
LLFrameTimer mZoomTimer;
|
||||||
|
|
||||||
|
|||||||
@@ -1136,21 +1136,6 @@ bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer<LLEvent> event, const LLS
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLNetMap::LLRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
|
||||||
{
|
|
||||||
BOOL rotate = gSavedSettings.getBOOL("MiniMapRotate");
|
|
||||||
gSavedSettings.setBOOL("MiniMapRotate", !rotate);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
|
||||||
{
|
|
||||||
LLNetMap *self = mPtr;
|
|
||||||
BOOL enabled = gSavedSettings.getBOOL("MiniMapRotate");
|
|
||||||
self->findControl(userdata["control"].asString())->setValue(enabled);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
{
|
{
|
||||||
LLTracker::stopTracking(NULL);
|
LLTracker::stopTracking(NULL);
|
||||||
|
|||||||
@@ -160,18 +160,6 @@ private:
|
|||||||
/*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
|
/*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLRotateMap : public LLMemberListener<LLNetMap>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLCheckRotateMap : public LLMemberListener<LLNetMap>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLStopTracking : public LLMemberListener<LLNetMap>
|
class LLStopTracking : public LLMemberListener<LLNetMap>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
#include "llweb.h"
|
#include "llweb.h"
|
||||||
#include "llwind.h"
|
#include "llwind.h"
|
||||||
#include "llworld.h"
|
#include "llworld.h"
|
||||||
#include "llworldmapmessage.h"
|
#include "llworldmap.h"
|
||||||
#include "llxfermanager.h"
|
#include "llxfermanager.h"
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
#include "llappviewer.h"
|
#include "llappviewer.h"
|
||||||
@@ -1783,6 +1783,8 @@ bool idle_startup()
|
|||||||
if(!map_server_url.empty())
|
if(!map_server_url.empty())
|
||||||
{
|
{
|
||||||
gSavedSettings.setString("MapServerURL", map_server_url);
|
gSavedSettings.setString("MapServerURL", map_server_url);
|
||||||
|
LLWorldMap::gotMapServerURL(true);
|
||||||
|
llinfos << "Got Map server URL: " << map_server_url << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override grid info with anything sent in the login response
|
// Override grid info with anything sent in the login response
|
||||||
@@ -3558,8 +3560,9 @@ void register_viewer_callbacks(LLMessageSystem* msg)
|
|||||||
|
|
||||||
msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply);
|
msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply);
|
||||||
|
|
||||||
msg->setHandlerFunc("MapBlockReply", LLWorldMapMessage::processMapBlockReply);
|
msg->setHandlerFunc("MapLayerReply", LLWorldMap::processMapLayerReply);
|
||||||
msg->setHandlerFunc("MapItemReply", LLWorldMapMessage::processMapItemReply);
|
msg->setHandlerFunc("MapBlockReply", LLWorldMap::processMapBlockReply);
|
||||||
|
msg->setHandlerFunc("MapItemReply", LLWorldMap::processMapItemReply);
|
||||||
|
|
||||||
msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply);
|
msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply);
|
||||||
msg->setHandlerFunc("PickInfoReply", LLPanelPick::processPickInfoReply);
|
msg->setHandlerFunc("PickInfoReply", LLPanelPick::processPickInfoReply);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include "llstartup.h" // gStartupState
|
#include "llstartup.h" // gStartupState
|
||||||
#include "llurlsimstring.h"
|
#include "llurlsimstring.h"
|
||||||
#include "llweb.h"
|
#include "llweb.h"
|
||||||
#include "llworldmapmessage.h"
|
#include "llworldmap.h"
|
||||||
|
|
||||||
// library includes
|
// library includes
|
||||||
#include "llsd.h"
|
#include "llsd.h"
|
||||||
@@ -243,7 +243,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mous
|
|||||||
url_displayp->setName(region_name);
|
url_displayp->setName(region_name);
|
||||||
|
|
||||||
// Request a region handle by name
|
// Request a region handle by name
|
||||||
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name,
|
LLWorldMap::getInstance()->sendNamedRegionRequest(region_name,
|
||||||
LLURLDispatcherImpl::regionNameCallback,
|
LLURLDispatcherImpl::regionNameCallback,
|
||||||
url,
|
url,
|
||||||
false); // don't teleport
|
false); // don't teleport
|
||||||
@@ -282,7 +282,7 @@ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::strin
|
|||||||
LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos);
|
LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos);
|
||||||
|
|
||||||
U64 new_region_handle = to_region_handle(global_pos);
|
U64 new_region_handle = to_region_handle(global_pos);
|
||||||
LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle,
|
LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle,
|
||||||
LLURLDispatcherImpl::regionHandleCallback,
|
LLURLDispatcherImpl::regionHandleCallback,
|
||||||
url, teleport);
|
url, teleport);
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,7 @@ public:
|
|||||||
{
|
{
|
||||||
url += tokens[i].asString() + "/";
|
url += tokens[i].asString() + "/";
|
||||||
}
|
}
|
||||||
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name,
|
LLWorldMap::getInstance()->sendNamedRegionRequest(region_name,
|
||||||
LLURLDispatcherImpl::regionHandleCallback,
|
LLURLDispatcherImpl::regionHandleCallback,
|
||||||
url,
|
url,
|
||||||
true); // teleport
|
true); // teleport
|
||||||
|
|||||||
@@ -1001,6 +1001,9 @@ void init_client_menu(LLMenuGL* menu)
|
|||||||
// </dogmode>
|
// </dogmode>
|
||||||
menu->append(new LLMenuItemCallGL("Clear Group Cache",
|
menu->append(new LLMenuItemCallGL("Clear Group Cache",
|
||||||
LLGroupMgr::debugClearAllGroups));
|
LLGroupMgr::debugClearAllGroups));
|
||||||
|
|
||||||
|
menu->append(new LLMenuItemCheckGL("Use Web Map Tiles", menu_toggle_control, NULL, menu_check_control, (void*)"UseWebMapTiles"));
|
||||||
|
|
||||||
menu->appendSeparator();
|
menu->appendSeparator();
|
||||||
|
|
||||||
sub_menu = new LLMenuGL("Rendering");
|
sub_menu = new LLMenuGL("Rendering");
|
||||||
@@ -3543,7 +3546,8 @@ void set_god_level(U8 god_level)
|
|||||||
LLFloaterDirectory::requestClassifieds();
|
LLFloaterDirectory::requestClassifieds();
|
||||||
|
|
||||||
// God mode changes region visibility
|
// God mode changes region visibility
|
||||||
LLWorldMap::getInstance()->reloadItems(true);
|
LLWorldMap::getInstance()->reset();
|
||||||
|
LLWorldMap::getInstance()->setCurrentLayer(0);
|
||||||
|
|
||||||
// inventory in items may change in god mode
|
// inventory in items may change in god mode
|
||||||
gObjectList.dirtyAllObjectInventory();
|
gObjectList.dirtyAllObjectInventory();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -33,245 +33,207 @@
|
|||||||
#ifndef LL_LLWORLDMAP_H
|
#ifndef LL_LLWORLDMAP_H
|
||||||
#define LL_LLWORLDMAP_H
|
#define LL_LLWORLDMAP_H
|
||||||
|
|
||||||
#include "llworldmipmap.h"
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "v3math.h"
|
||||||
#include "v3dmath.h"
|
#include "v3dmath.h"
|
||||||
|
#include "llframetimer.h"
|
||||||
|
#include "llmapimagetype.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
#include "llmemory.h"
|
#include "llmemory.h"
|
||||||
#include "llviewerregion.h"
|
|
||||||
#include "llviewerimage.h"
|
#include "llviewerimage.h"
|
||||||
|
#include "lleventinfo.h"
|
||||||
|
#include "v3color.h"
|
||||||
|
|
||||||
|
class LLMessageSystem;
|
||||||
|
|
||||||
|
|
||||||
// Description of objects like hubs, events, land for sale, people and more (TBD).
|
|
||||||
// Note: we don't store a "type" in there so we need to store instances of this class in
|
|
||||||
// well known objects (i.e. list of objects which type is "well known").
|
|
||||||
class LLItemInfo
|
class LLItemInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLItemInfo(F32 global_x, F32 global_y, const std::string& name, LLUUID id);
|
LLItemInfo(F32 global_x, F32 global_y, const std::string& name, LLUUID id, S32 extra = 0, S32 extra2 = 0);
|
||||||
|
|
||||||
// Setters
|
std::string mName;
|
||||||
void setTooltip(std::string& tooltip) { mToolTip = tooltip; }
|
std::string mToolTip;
|
||||||
void setElevation(F64 z) { mPosGlobal.mdV[VZ] = z; }
|
LLVector3d mPosGlobal;
|
||||||
void setCount(S32 count) { mCount = count; }
|
LLUUID mID;
|
||||||
// void setSelected(bool selected) { mSelected = selected; }
|
BOOL mSelected;
|
||||||
// void setColor(LLColor4 color) { mColor = color; }
|
S32 mExtra;
|
||||||
|
S32 mExtra2;
|
||||||
// Accessors
|
U64 mRegionHandle;
|
||||||
const LLVector3d& getGlobalPosition() const { return mPosGlobal; }
|
|
||||||
const std::string& getName() const { return mName; }
|
|
||||||
const std::string& getToolTip() const { return mToolTip; }
|
|
||||||
const LLUUID& getUUID() const { return mID; }
|
|
||||||
S32 getCount() const { return mCount; }
|
|
||||||
|
|
||||||
U64 getRegionHandle() const { return to_region_handle(mPosGlobal); } // Build the handle on the fly
|
|
||||||
|
|
||||||
bool isName(const std::string& name) const { return (mName == name); } // True if name same as item's name
|
|
||||||
// bool isSelected() const { return mSelected; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string mName; // Name of the individual item
|
|
||||||
std::string mToolTip; // Tooltip : typically, something to be displayed to the user when selecting this item
|
|
||||||
LLVector3d mPosGlobal; // Global world position
|
|
||||||
LLUUID mID; // UUID of the item
|
|
||||||
S32 mCount; // Number of elements in item (e.g. people count)
|
|
||||||
// Currently not used but might prove useful one day so we comment out
|
|
||||||
// bool mSelected; // Selected or not: updated by the viewer UI, not the simulator or asset DB
|
|
||||||
// LLColor4 mColor; // Color of the item
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Info per region
|
#define MAP_SIM_IMAGE_TYPES 3
|
||||||
// Such records are stored in a global map hold by the LLWorldMap and indexed by region handles.
|
// 0 - Prim
|
||||||
// To avoid creating too many of them, they are requested in "blocks" corresponding to areas covered by the screen.
|
// 1 - Terrain Only
|
||||||
// Unfortunately, when the screen covers the whole world (zoomed out), that can translate in requesting info for
|
// 2 - Overlay: Land For Sale
|
||||||
// every sim on the grid... Not good...
|
|
||||||
// To avoid this, the code implements a cut-off threshold for overlay graphics and, therefore, all LLSimInfo.
|
|
||||||
// In other words, when zooming out too much, we simply stop requesting LLSimInfo and
|
|
||||||
// LLItemInfo and just display the map tiles.
|
|
||||||
// As they are stored in different structures (LLSimInfo and LLWorldMipmap), this strategy is now workable.
|
|
||||||
class LLSimInfo
|
class LLSimInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLSimInfo(U64 handle);
|
LLSimInfo();
|
||||||
|
|
||||||
// Convert local region coordinates into world coordinates
|
LLVector3d getGlobalPos(LLVector3 local_pos) const;
|
||||||
LLVector3d getGlobalPos(const LLVector3& local_pos) const;
|
|
||||||
// Get the world coordinates of the SW corner of that region
|
// Get the world coordinates of the SW corner of that region
|
||||||
LLVector3d getGlobalOrigin() const;
|
LLVector3d getGlobalOrigin() const;
|
||||||
|
|
||||||
void clearImage(); // Clears the reference to the Land for sale image for that region
|
public:
|
||||||
void dropImagePriority(); // Drops the boost level of the Land for sale image for that region
|
U64 mHandle;
|
||||||
void updateAgentCount(F64 time); // Send an item request for agent count on that region if time's up
|
std::string mName;
|
||||||
|
|
||||||
// Setters
|
F64 mAgentsUpdateTime;
|
||||||
void setName(std::string& name) { mName = name; }
|
BOOL mShowAgentLocations; // are agents visible?
|
||||||
void setAccess (U32 accesscode) { mAccess = accesscode; }
|
|
||||||
void setRegionFlags (U32 region_flags) { mRegionFlags = region_flags; }
|
|
||||||
void setLandForSaleImage (LLUUID image_id);
|
|
||||||
// void setWaterHeight (F32 water_height) { mWaterHeight = water_height; }
|
|
||||||
|
|
||||||
// Accessors
|
U8 mAccess;
|
||||||
const std::string getName() const { return mName; }
|
U32 mRegionFlags;
|
||||||
const std::string getFlagsString() const { return LLViewerRegion::regionFlagsToString(mRegionFlags); }
|
F32 mWaterHeight;
|
||||||
const std::string getAccessString() const { return LLViewerRegion::accessToString((U8)mAccess); }
|
|
||||||
const std::string getShortAccessString() const { return LLViewerRegion::accessToShortString((U8)mAccess); }
|
|
||||||
|
|
||||||
const S32 getAgentCount() const; // Compute the total agents count
|
F32 mAlpha;
|
||||||
LLPointer<LLViewerImage> getLandForSaleImage(); // Get the overlay image, fetch it if necessary
|
|
||||||
// <edit>
|
|
||||||
//Added this so I could get map images on opensim.
|
|
||||||
const LLUUID getMapImageID() const { return mMapImageID; }
|
|
||||||
|
|
||||||
bool isName(const std::string& name) const;
|
// Image ID for the current overlay mode.
|
||||||
bool isDown() { return (mAccess == SIM_ACCESS_DOWN); }
|
LLUUID mMapImageID[MAP_SIM_IMAGE_TYPES];
|
||||||
bool isPG() { return (mAccess <= SIM_ACCESS_PG); }
|
|
||||||
|
|
||||||
// Debug only
|
// Hold a reference to the currently displayed image.
|
||||||
void dump() const; // Print the region info to the standard output
|
LLPointer<LLViewerImage> mCurrentImage;
|
||||||
|
LLPointer<LLViewerImage> mOverlayImage;
|
||||||
// Items lists handling
|
};
|
||||||
typedef std::vector<LLItemInfo> item_info_list_t;
|
|
||||||
void clearItems();
|
#define MAP_BLOCK_RES 256
|
||||||
|
|
||||||
void insertTeleHub(const LLItemInfo& item) { mTelehubs.push_back(item); }
|
struct LLWorldMapLayer
|
||||||
void insertInfoHub(const LLItemInfo& item) { mInfohubs.push_back(item); }
|
{
|
||||||
void insertPGEvent(const LLItemInfo& item) { mPGEvents.push_back(item); }
|
BOOL LayerDefined;
|
||||||
void insertMatureEvent(const LLItemInfo& item) { mMatureEvents.push_back(item); }
|
LLPointer<LLViewerImage> LayerImage;
|
||||||
void insertAdultEvent(const LLItemInfo& item) { mAdultEvents.push_back(item); }
|
LLUUID LayerImageID;
|
||||||
void insertLandForSale(const LLItemInfo& item) { mLandForSale.push_back(item); }
|
LLRect LayerExtents;
|
||||||
void insertLandForSaleAdult(const LLItemInfo& item) { mLandForSaleAdult.push_back(item); }
|
|
||||||
void insertAgentLocation(const LLItemInfo& item);
|
LLWorldMapLayer() : LayerDefined(FALSE) { }
|
||||||
|
|
||||||
const LLSimInfo::item_info_list_t& getTeleHub() const { return mTelehubs; }
|
|
||||||
const LLSimInfo::item_info_list_t& getInfoHub() const { return mInfohubs; }
|
|
||||||
const LLSimInfo::item_info_list_t& getPGEvent() const { return mPGEvents; }
|
|
||||||
const LLSimInfo::item_info_list_t& getMatureEvent() const { return mMatureEvents; }
|
|
||||||
const LLSimInfo::item_info_list_t& getAdultEvent() const { return mAdultEvents; }
|
|
||||||
const LLSimInfo::item_info_list_t& getLandForSale() const { return mLandForSale; }
|
|
||||||
const LLSimInfo::item_info_list_t& getLandForSaleAdult() const { return mLandForSaleAdult; }
|
|
||||||
const LLSimInfo::item_info_list_t& getAgentLocation() const { return mAgentLocations; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
U64 mHandle; // This is a hash of the X and Y world coordinates of the SW corner of the sim
|
|
||||||
std::string mName; // Region name
|
|
||||||
|
|
||||||
F64 mAgentsUpdateTime; // Time stamp giving the last time the agents information was requested for that region
|
|
||||||
bool mFirstAgentRequest; // Init agent request flag
|
|
||||||
|
|
||||||
U32 mAccess; // Down/up and maturity rating of the region
|
|
||||||
U32 mRegionFlags; // Tell us if the siminfo has been received (if non 0) and what kind of region it is (Sandbox, allow damage)
|
|
||||||
// Currently not used but might prove useful one day so we comment out
|
|
||||||
// F32 mWaterHeight; // Water height on the region (not actively used)
|
|
||||||
|
|
||||||
// Handling the "land for sale / land for auction" overlay image
|
|
||||||
|
|
||||||
LLUUID mMapImageID; // Image ID of the overlay image
|
|
||||||
LLPointer<LLViewerImage> mOverlayImage; // Reference to the overlay image
|
|
||||||
|
|
||||||
// Items for this region
|
|
||||||
// Those are data received through item requests (as opposed to block requests for the rest of the data)
|
|
||||||
item_info_list_t mTelehubs; // List of tele hubs in the region
|
|
||||||
item_info_list_t mInfohubs; // List of info hubs in the region
|
|
||||||
item_info_list_t mPGEvents; // List of PG events in the region
|
|
||||||
item_info_list_t mMatureEvents; // List of Mature events in the region
|
|
||||||
item_info_list_t mAdultEvents; // List of Adult events in the region (AO)
|
|
||||||
item_info_list_t mLandForSale; // List of Land for sales in the region
|
|
||||||
item_info_list_t mLandForSaleAdult; // List of Adult Land for sales in the region (AO)
|
|
||||||
item_info_list_t mAgentLocations; // List of agents in the region
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// We request region data on the world by "blocks" of (MAP_BLOCK_SIZE x MAP_BLOCK_SIZE) regions
|
|
||||||
// This is to reduce the number of requests to the asset DB and get things in big "blocks"
|
|
||||||
const S32 MAP_MAX_SIZE = 2048;
|
|
||||||
const S32 MAP_BLOCK_SIZE = 4;
|
|
||||||
const S32 MAP_BLOCK_RES = (MAP_MAX_SIZE / MAP_BLOCK_SIZE);
|
|
||||||
|
|
||||||
class LLWorldMap : public LLSingleton<LLWorldMap>
|
class LLWorldMap : public LLSingleton<LLWorldMap>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
typedef void(*url_callback_t)(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport);
|
||||||
|
|
||||||
LLWorldMap();
|
LLWorldMap();
|
||||||
~LLWorldMap();
|
~LLWorldMap();
|
||||||
|
|
||||||
// Clear all: list of region info, tiles, blocks and items
|
// clears the list
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void clearImageRefs(); // Clears the image references
|
// clear the visible items
|
||||||
void dropImagePriorities(); // Drops the priority of the images being fetched
|
void eraseItems();
|
||||||
void reloadItems(bool force = false); // Reload the items (people, hub, etc...)
|
|
||||||
|
|
||||||
// Region Map access
|
// Removes references to cached images
|
||||||
typedef std::map<U64, LLSimInfo*> sim_info_map_t;
|
void clearImageRefs();
|
||||||
const LLWorldMap::sim_info_map_t& getRegionMap() const { return mSimInfoMap; }
|
|
||||||
void updateRegions(S32 x0, S32 y0, S32 x1, S32 y1); // Requests region info for a rectangle of regions (in grid coordinates)
|
|
||||||
|
|
||||||
// Insert a region and items in the map global instance
|
// Clears the flags indicating that we've received sim infos
|
||||||
// Note: x_world and y_world in world coordinates (meters)
|
// Causes a re-request of the sim info without erasing extisting info
|
||||||
static bool insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 accesscode, U32 region_flags);
|
void clearSimFlags();
|
||||||
static bool insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2);
|
|
||||||
|
|
||||||
// Get info on sims (region) : note that those methods only search the range of loaded sims (the one that are being browsed)
|
// Returns simulator information, or NULL if out of range
|
||||||
// *not* the entire world. So a NULL return does not mean a down or unexisting region, just an out of range region.
|
|
||||||
LLSimInfo* simInfoFromHandle(const U64 handle);
|
LLSimInfo* simInfoFromHandle(const U64 handle);
|
||||||
|
|
||||||
|
// Returns simulator information, or NULL if out of range
|
||||||
LLSimInfo* simInfoFromPosGlobal(const LLVector3d& pos_global);
|
LLSimInfo* simInfoFromPosGlobal(const LLVector3d& pos_global);
|
||||||
|
|
||||||
|
// Returns simulator information for named sim, or NULL if non-existent
|
||||||
LLSimInfo* simInfoFromName(const std::string& sim_name);
|
LLSimInfo* simInfoFromName(const std::string& sim_name);
|
||||||
|
|
||||||
// Gets simulator name from a global position, returns true if found
|
// Gets simulator name for a global position, returns true if it was found
|
||||||
bool simNameFromPosGlobal(const LLVector3d& pos_global, std::string& outSimName );
|
bool simNameFromPosGlobal(const LLVector3d& pos_global, std::string& outSimName );
|
||||||
|
|
||||||
// Debug only
|
// Sets the current layer
|
||||||
void dump(); // Print the world info to the standard output
|
void setCurrentLayer(S32 layer, bool request_layer = false);
|
||||||
|
|
||||||
// Track handling
|
void sendMapLayerRequest();
|
||||||
void cancelTracking() { mIsTrackingLocation = false; mIsTrackingFound = false; mIsInvalidLocation = false; mIsTrackingDoubleClick = false; mIsTrackingCommit = false; }
|
void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false);
|
||||||
|
void sendNamedRegionRequest(std::string region_name);
|
||||||
|
void sendNamedRegionRequest(std::string region_name,
|
||||||
|
url_callback_t callback,
|
||||||
|
const std::string& callback_url,
|
||||||
|
bool teleport);
|
||||||
|
void sendHandleRegionRequest(U64 region_handle,
|
||||||
|
url_callback_t callback,
|
||||||
|
const std::string& callback_url,
|
||||||
|
bool teleport);
|
||||||
|
void sendItemRequest(U32 type, U64 handle = 0);
|
||||||
|
|
||||||
void setTracking(const LLVector3d& loc) { mIsTrackingLocation = true; mTrackingLocation = loc; mIsTrackingFound = false; mIsInvalidLocation = false; mIsTrackingDoubleClick = false; mIsTrackingCommit = false;}
|
static void processMapLayerReply(LLMessageSystem*, void**);
|
||||||
void setTrackingInvalid() { mIsTrackingFound = true; mIsInvalidLocation = true; }
|
static void processMapBlockReply(LLMessageSystem*, void**);
|
||||||
void setTrackingValid() { mIsTrackingFound = true; mIsInvalidLocation = false; }
|
static void processMapItemReply(LLMessageSystem*, void**);
|
||||||
void setTrackingDoubleClick() { mIsTrackingDoubleClick = true; }
|
|
||||||
void setTrackingCommit() { mIsTrackingCommit = true; }
|
|
||||||
|
|
||||||
bool isTracking() { return mIsTrackingLocation; }
|
static void gotMapServerURL(bool flag) { sGotMapURL = flag; }
|
||||||
bool isTrackingValidLocation() { return mIsTrackingFound && !mIsInvalidLocation; }
|
static bool useWebMapTiles();
|
||||||
bool isTrackingInvalidLocation() { return mIsTrackingFound && mIsInvalidLocation; }
|
static LLPointer<LLViewerImage> loadObjectsTile(U32 grid_x, U32 grid_y);
|
||||||
bool isTrackingDoubleClick() { return mIsTrackingDoubleClick; }
|
|
||||||
bool isTrackingCommit() { return mIsTrackingCommit; }
|
|
||||||
bool isTrackingInRectangle(F64 x0, F64 y0, F64 x1, F64 y1);
|
|
||||||
|
|
||||||
LLVector3d getTrackedPositionGlobal() const { return mTrackingLocation; }
|
void dump();
|
||||||
|
|
||||||
// World Mipmap delegation: currently used when drawing the mipmap
|
// Extend the bounding box of the list of simulators. Returns true
|
||||||
void equalizeBoostLevels();
|
// if the extents changed.
|
||||||
LLPointer<LLViewerImage> getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load = true) { return mWorldMipmap.getObjectsTile(grid_x, grid_y, level, load); }
|
BOOL extendAABB(U32 x_min, U32 y_min, U32 x_max, U32 y_max);
|
||||||
|
|
||||||
|
// build coverage maps for telehub region visualization
|
||||||
|
void updateTelehubCoverage();
|
||||||
|
BOOL coveredByTelehub(LLSimInfo* infop);
|
||||||
|
|
||||||
|
// Bounds of the world, in meters
|
||||||
|
U32 getWorldWidth() const;
|
||||||
|
U32 getWorldHeight() const;
|
||||||
|
public:
|
||||||
|
// Map from region-handle to simulator info
|
||||||
|
typedef std::map<U64, LLSimInfo*> sim_info_map_t;
|
||||||
|
sim_info_map_t mSimInfoMap;
|
||||||
|
|
||||||
|
BOOL mIsTrackingUnknownLocation, mInvalidLocation, mIsTrackingDoubleClick, mIsTrackingCommit;
|
||||||
|
LLVector3d mUnknownLocation;
|
||||||
|
|
||||||
|
bool mRequestLandForSale;
|
||||||
|
|
||||||
|
typedef std::vector<LLItemInfo> item_info_list_t;
|
||||||
|
item_info_list_t mTelehubs;
|
||||||
|
item_info_list_t mInfohubs;
|
||||||
|
item_info_list_t mPGEvents;
|
||||||
|
item_info_list_t mMatureEvents;
|
||||||
|
item_info_list_t mAdultEvents;
|
||||||
|
item_info_list_t mLandForSale;
|
||||||
|
item_info_list_t mLandForSaleAdult;
|
||||||
|
|
||||||
|
std::map<U64,S32> mNumAgents;
|
||||||
|
|
||||||
|
typedef std::map<U64, item_info_list_t> agent_list_map_t;
|
||||||
|
agent_list_map_t mAgentLocationsMap;
|
||||||
|
|
||||||
|
std::vector<LLWorldMapLayer> mMapLayers[MAP_SIM_IMAGE_TYPES];
|
||||||
|
BOOL mMapLoaded[MAP_SIM_IMAGE_TYPES];
|
||||||
|
BOOL * mMapBlockLoaded[MAP_SIM_IMAGE_TYPES];
|
||||||
|
S32 mCurrentMap;
|
||||||
|
|
||||||
|
// AABB of the list of simulators
|
||||||
|
U32 mMinX;
|
||||||
|
U32 mMaxX;
|
||||||
|
U32 mMinY;
|
||||||
|
U32 mMaxY;
|
||||||
|
|
||||||
|
U8* mNeighborMap;
|
||||||
|
U8* mTelehubCoverageMap;
|
||||||
|
S32 mNeighborMapWidth;
|
||||||
|
S32 mNeighborMapHeight;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool clearItems(bool force = false); // Clears the item lists
|
LLTimer mRequestTimer;
|
||||||
void clearSimFlags(); // Clears the block flags indicating that we've already requested region infos
|
|
||||||
|
|
||||||
// Create a region record corresponding to the handle, insert it in the region map and returns a pointer
|
// search for named region for url processing
|
||||||
LLSimInfo* createSimInfoFromHandle(const U64 handle);
|
std::string mSLURLRegionName;
|
||||||
|
U64 mSLURLRegionHandle;
|
||||||
|
std::string mSLURL;
|
||||||
|
url_callback_t mSLURLCallback;
|
||||||
|
bool mSLURLTeleport;
|
||||||
|
|
||||||
// Map from region-handle to region info
|
static bool sGotMapURL;
|
||||||
sim_info_map_t mSimInfoMap;
|
|
||||||
|
|
||||||
// Holds the tiled mipmap of the world. This is the structure that contains the images used for rendering.
|
|
||||||
LLWorldMipmap mWorldMipmap;
|
|
||||||
|
|
||||||
// The World is divided in "blocks" of (MAP_BLOCK_SIZE x MAP_BLOCK_SIZE) regions that get requested at once.
|
|
||||||
// This boolean table avoids "blocks" to be requested multiple times.
|
|
||||||
// Issue: Not sure this scheme is foolproof though as I've seen
|
|
||||||
// cases where a block is never retrieved and, because of this boolean being set, never re-requested
|
|
||||||
bool * mMapBlockLoaded; // Telling us if the block of regions has been requested or not
|
|
||||||
|
|
||||||
// Track location data : used while there's nothing tracked yet by LLTracker
|
|
||||||
bool mIsTrackingLocation; // True when we're tracking a point
|
|
||||||
bool mIsTrackingFound; // True when the tracking position has been found, valid or not
|
|
||||||
bool mIsInvalidLocation; // The region is down or the location does not correspond to an existing region
|
|
||||||
bool mIsTrackingDoubleClick; // User double clicked to set the location (i.e. teleport when found please...)
|
|
||||||
bool mIsTrackingCommit; // User used the search or landmark fields to set the location
|
|
||||||
LLVector3d mTrackingLocation; // World global position being tracked
|
|
||||||
|
|
||||||
// General grid items request timing flags (used for events,hubs and land for sale)
|
|
||||||
LLTimer mRequestTimer;
|
|
||||||
bool mFirstRequest;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,274 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llworldmapmessage.cpp
|
|
||||||
* @brief Handling of the messages to the DB made by and for the world map.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "llviewerprecompiledheaders.h"
|
|
||||||
|
|
||||||
#include "llworldmapmessage.h"
|
|
||||||
|
|
||||||
#include "llworldmap.h"
|
|
||||||
#include "llagent.h"
|
|
||||||
#include "llfloaterworldmap.h"
|
|
||||||
|
|
||||||
#include "llviewernetwork.h" //for isInProductionGrid()
|
|
||||||
#include "hippogridmanager.h"
|
|
||||||
|
|
||||||
const U32 LAYER_FLAG = 2;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
// World Map Message Handling
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
LLWorldMapMessage::LLWorldMapMessage() :
|
|
||||||
mSLURLRegionName(),
|
|
||||||
mSLURLRegionHandle(0),
|
|
||||||
mSLURL(),
|
|
||||||
mSLURLCallback(0),
|
|
||||||
mSLURLTeleport(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LLWorldMapMessage::~LLWorldMapMessage()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLWorldMapMessage::sendItemRequest(U32 type, U64 handle)
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "Send item request : type = " << type << LL_ENDL;
|
|
||||||
LLMessageSystem* msg = gMessageSystem;
|
|
||||||
|
|
||||||
msg->newMessageFast(_PREHASH_MapItemRequest);
|
|
||||||
msg->nextBlockFast(_PREHASH_AgentData);
|
|
||||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
|
||||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
|
||||||
msg->addU32Fast(_PREHASH_Flags, LAYER_FLAG);
|
|
||||||
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
|
|
||||||
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
|
|
||||||
|
|
||||||
msg->nextBlockFast(_PREHASH_RequestData);
|
|
||||||
msg->addU32Fast(_PREHASH_ItemType, type);
|
|
||||||
msg->addU64Fast(_PREHASH_RegionHandle, handle); // If zero, filled in on sim
|
|
||||||
|
|
||||||
gAgent.sendReliableMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLWorldMapMessage::sendNamedRegionRequest(std::string region_name)
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::sendNamedRegionRequest()" << LL_ENDL;
|
|
||||||
LLMessageSystem* msg = gMessageSystem;
|
|
||||||
|
|
||||||
// Request for region data
|
|
||||||
msg->newMessageFast(_PREHASH_MapNameRequest);
|
|
||||||
msg->nextBlockFast(_PREHASH_AgentData);
|
|
||||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
|
||||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
|
||||||
msg->addU32Fast(_PREHASH_Flags, LAYER_FLAG);
|
|
||||||
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
|
|
||||||
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
|
|
||||||
msg->nextBlockFast(_PREHASH_NameData);
|
|
||||||
msg->addStringFast(_PREHASH_Name, region_name);
|
|
||||||
gAgent.sendReliableMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLWorldMapMessage::sendNamedRegionRequest(std::string region_name,
|
|
||||||
url_callback_t callback,
|
|
||||||
const std::string& callback_url,
|
|
||||||
bool teleport) // immediately teleport when result returned
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::sendNamedRegionRequest()" << LL_ENDL;
|
|
||||||
mSLURLRegionName = region_name;
|
|
||||||
mSLURLRegionHandle = 0;
|
|
||||||
mSLURL = callback_url;
|
|
||||||
mSLURLCallback = callback;
|
|
||||||
mSLURLTeleport = teleport;
|
|
||||||
|
|
||||||
sendNamedRegionRequest(region_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLWorldMapMessage::sendHandleRegionRequest(U64 region_handle,
|
|
||||||
url_callback_t callback,
|
|
||||||
const std::string& callback_url,
|
|
||||||
bool teleport) // immediately teleport when result returned
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::sendHandleRegionRequest()" << LL_ENDL;
|
|
||||||
mSLURLRegionName.clear();
|
|
||||||
mSLURLRegionHandle = region_handle;
|
|
||||||
mSLURL = callback_url;
|
|
||||||
mSLURLCallback = callback;
|
|
||||||
mSLURLTeleport = teleport;
|
|
||||||
|
|
||||||
U32 global_x;
|
|
||||||
U32 global_y;
|
|
||||||
from_region_handle(region_handle, &global_x, &global_y);
|
|
||||||
U16 grid_x = (U16)(global_x / REGION_WIDTH_UNITS);
|
|
||||||
U16 grid_y = (U16)(global_y / REGION_WIDTH_UNITS);
|
|
||||||
|
|
||||||
sendMapBlockRequest(grid_x, grid_y, grid_x, grid_y, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLWorldMapMessage::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent)
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::sendMapBlockRequest()" << ", min = (" << min_x << ", " << min_y << "), max = (" << max_x << ", " << max_y << "), nonexistent = " << return_nonexistent << LL_ENDL;
|
|
||||||
LLMessageSystem* msg = gMessageSystem;
|
|
||||||
msg->newMessageFast(_PREHASH_MapBlockRequest);
|
|
||||||
msg->nextBlockFast(_PREHASH_AgentData);
|
|
||||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
|
||||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
|
||||||
U32 flags = LAYER_FLAG;
|
|
||||||
flags |= (return_nonexistent ? 0x10000 : 0);
|
|
||||||
msg->addU32Fast(_PREHASH_Flags, flags);
|
|
||||||
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
|
|
||||||
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
|
|
||||||
msg->nextBlockFast(_PREHASH_PositionData);
|
|
||||||
msg->addU16Fast(_PREHASH_MinX, min_x);
|
|
||||||
msg->addU16Fast(_PREHASH_MinY, min_y);
|
|
||||||
msg->addU16Fast(_PREHASH_MaxX, max_x);
|
|
||||||
msg->addU16Fast(_PREHASH_MaxY, max_y);
|
|
||||||
gAgent.sendReliableMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
// public static
|
|
||||||
void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**)
|
|
||||||
{
|
|
||||||
U32 agent_flags;
|
|
||||||
msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags);
|
|
||||||
|
|
||||||
// There's only one flag that we ever use here
|
|
||||||
if (agent_flags != LAYER_FLAG
|
|
||||||
&& gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE)
|
|
||||||
{
|
|
||||||
llwarns << "Invalid map image type returned! layer = " << agent_flags << llendl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_Data);
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::processMapBlockReply(), num_blocks = " << num_blocks << LL_ENDL;
|
|
||||||
|
|
||||||
bool found_null_sim = false;
|
|
||||||
|
|
||||||
for (S32 block=0; block<num_blocks; ++block)
|
|
||||||
{
|
|
||||||
U16 x_regions;
|
|
||||||
U16 y_regions;
|
|
||||||
std::string name;
|
|
||||||
U8 accesscode;
|
|
||||||
U32 region_flags;
|
|
||||||
// U8 water_height;
|
|
||||||
// U8 agents;
|
|
||||||
LLUUID image_id;
|
|
||||||
msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block);
|
|
||||||
msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block);
|
|
||||||
msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name, block);
|
|
||||||
msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, accesscode, block);
|
|
||||||
msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block);
|
|
||||||
// msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block);
|
|
||||||
// msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block);
|
|
||||||
msg->getUUIDFast(_PREHASH_Data, _PREHASH_MapImageID, image_id, block);
|
|
||||||
|
|
||||||
U32 x_world = (U32)(x_regions) * REGION_WIDTH_UNITS;
|
|
||||||
U32 y_world = (U32)(y_regions) * REGION_WIDTH_UNITS;
|
|
||||||
|
|
||||||
// Insert that region in the world map, if failure, flag it as a "null_sim"
|
|
||||||
if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, name, image_id, (U32)accesscode, region_flags)))
|
|
||||||
{
|
|
||||||
found_null_sim = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we hit a valid tracking location, do what needs to be done app level wise
|
|
||||||
if (LLWorldMap::getInstance()->isTrackingValidLocation())
|
|
||||||
{
|
|
||||||
LLVector3d pos_global = LLWorldMap::getInstance()->getTrackedPositionGlobal();
|
|
||||||
if (LLWorldMap::getInstance()->isTrackingDoubleClick())
|
|
||||||
{
|
|
||||||
// Teleport if the user double clicked
|
|
||||||
gAgent.teleportViaLocation(pos_global);
|
|
||||||
}
|
|
||||||
// Update the "real" tracker information
|
|
||||||
gFloaterWorldMap->trackLocation(pos_global);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle the SLURL callback if any
|
|
||||||
if(LLWorldMapMessage::getInstance()->mSLURLCallback != NULL)
|
|
||||||
{
|
|
||||||
U64 handle = to_region_handle(x_world, y_world);
|
|
||||||
// Check if we reached the requested region
|
|
||||||
if ((LLStringUtil::compareInsensitive(LLWorldMapMessage::getInstance()->mSLURLRegionName, name)==0)
|
|
||||||
|| (LLWorldMapMessage::getInstance()->mSLURLRegionHandle == handle))
|
|
||||||
{
|
|
||||||
url_callback_t callback = LLWorldMapMessage::getInstance()->mSLURLCallback;
|
|
||||||
|
|
||||||
LLWorldMapMessage::getInstance()->mSLURLCallback = NULL;
|
|
||||||
LLWorldMapMessage::getInstance()->mSLURLRegionName.clear();
|
|
||||||
LLWorldMapMessage::getInstance()->mSLURLRegionHandle = 0;
|
|
||||||
|
|
||||||
callback(handle, LLWorldMapMessage::getInstance()->mSLURL, image_id, LLWorldMapMessage::getInstance()->mSLURLTeleport);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// <edit>
|
|
||||||
if(LLAgent::lure_show)
|
|
||||||
{
|
|
||||||
if((x_regions == LLAgent::lure_global_x) && (y_regions == LLAgent::lure_global_y))
|
|
||||||
{
|
|
||||||
gAgent.onFoundLureDestination();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// </edit>
|
|
||||||
}
|
|
||||||
// Tell the UI to update itself
|
|
||||||
gFloaterWorldMap->updateSims(found_null_sim);
|
|
||||||
}
|
|
||||||
|
|
||||||
// public static
|
|
||||||
void LLWorldMapMessage::processMapItemReply(LLMessageSystem* msg, void**)
|
|
||||||
{
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMap::processMapItemReply()" << LL_ENDL;
|
|
||||||
U32 type;
|
|
||||||
msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ItemType, type);
|
|
||||||
|
|
||||||
S32 num_blocks = msg->getNumberOfBlocks("Data");
|
|
||||||
|
|
||||||
for (S32 block=0; block<num_blocks; ++block)
|
|
||||||
{
|
|
||||||
U32 X, Y;
|
|
||||||
std::string name;
|
|
||||||
S32 extra, extra2;
|
|
||||||
LLUUID uuid;
|
|
||||||
msg->getU32Fast(_PREHASH_Data, _PREHASH_X, X, block);
|
|
||||||
msg->getU32Fast(_PREHASH_Data, _PREHASH_Y, Y, block);
|
|
||||||
msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name, block);
|
|
||||||
msg->getUUIDFast(_PREHASH_Data, _PREHASH_ID, uuid, block);
|
|
||||||
msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra, extra, block);
|
|
||||||
msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra2, extra2, block);
|
|
||||||
|
|
||||||
LLWorldMap::getInstance()->insertItem(X, Y, name, uuid, type, extra, extra2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llworldmapmessage.h
|
|
||||||
* @brief Handling of the messages to the DB made by and for the world map.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LL_LLWORLDMAPMESSAGE_H
|
|
||||||
#define LL_LLWORLDMAPMESSAGE_H
|
|
||||||
|
|
||||||
// Handling of messages (send and process) as well as SLURL callback if necessary
|
|
||||||
class LLMessageSystem;
|
|
||||||
|
|
||||||
class LLWorldMapMessage : public LLSingleton<LLWorldMapMessage>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef void(*url_callback_t)(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport);
|
|
||||||
|
|
||||||
LLWorldMapMessage();
|
|
||||||
~LLWorldMapMessage();
|
|
||||||
|
|
||||||
// Process incoming answers to map stuff requests
|
|
||||||
static void processMapBlockReply(LLMessageSystem*, void**);
|
|
||||||
static void processMapItemReply(LLMessageSystem*, void**);
|
|
||||||
|
|
||||||
// Request data for all regions in a rectangular area. Coordinates in grids (i.e. meters / 256).
|
|
||||||
void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false);
|
|
||||||
|
|
||||||
// Various methods to request LLSimInfo data to the simulator and asset DB
|
|
||||||
void sendNamedRegionRequest(std::string region_name);
|
|
||||||
void sendNamedRegionRequest(std::string region_name,
|
|
||||||
url_callback_t callback,
|
|
||||||
const std::string& callback_url,
|
|
||||||
bool teleport);
|
|
||||||
void sendHandleRegionRequest(U64 region_handle,
|
|
||||||
url_callback_t callback,
|
|
||||||
const std::string& callback_url,
|
|
||||||
bool teleport);
|
|
||||||
|
|
||||||
// Request item data for regions
|
|
||||||
// Note: the handle works *only* when requesting agent count (type = MAP_ITEM_AGENT_LOCATIONS). In that case,
|
|
||||||
// the request will actually be transitting through the spaceserver (all that is done on the sim).
|
|
||||||
// All other values of type do create a global grid request to the asset DB. So no need to try to get, say,
|
|
||||||
// the events for one particular region. For such a request, the handle is ignored.
|
|
||||||
void sendItemRequest(U32 type, U64 handle = 0);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Search for region (by name or handle) for SLURL processing and teleport
|
|
||||||
// None of this relies explicitly on the LLWorldMap instance so better handle it here
|
|
||||||
std::string mSLURLRegionName;
|
|
||||||
U64 mSLURLRegionHandle;
|
|
||||||
std::string mSLURL;
|
|
||||||
url_callback_t mSLURLCallback;
|
|
||||||
bool mSLURLTeleport;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LL_LLWORLDMAPMESSAGE_H
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -39,14 +39,21 @@
|
|||||||
#define LL_LLWORLDMAPVIEW_H
|
#define LL_LLWORLDMAPVIEW_H
|
||||||
|
|
||||||
#include "llpanel.h"
|
#include "llpanel.h"
|
||||||
#include "llworldmap.h"
|
#include "v3math.h"
|
||||||
|
#include "v3dmath.h"
|
||||||
#include "v4color.h"
|
#include "v4color.h"
|
||||||
|
#include "llviewerimage.h"
|
||||||
|
#include "llmapimagetype.h"
|
||||||
|
#include "llworldmap.h"
|
||||||
|
|
||||||
|
class LLItemInfo;
|
||||||
|
|
||||||
const S32 DEFAULT_TRACKING_ARROW_SIZE = 16;
|
const S32 DEFAULT_TRACKING_ARROW_SIZE = 16;
|
||||||
|
|
||||||
class LLUUID;
|
class LLColor4;
|
||||||
class LLVector3d;
|
class LLColor4U;
|
||||||
class LLVector3;
|
class LLCoordGL;
|
||||||
|
class LLViewerImage;
|
||||||
class LLTextBox;
|
class LLTextBox;
|
||||||
|
|
||||||
|
|
||||||
@@ -71,26 +78,22 @@ public:
|
|||||||
bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track);
|
bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track);
|
||||||
void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id);
|
void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id);
|
||||||
|
|
||||||
// Scale and pan are shared across all instances! (i.e. Terrain and Objects maps are always registered)
|
// Scale and pan are shared across all instances.
|
||||||
static void setScale( F32 scale );
|
static void setScale( F32 scale );
|
||||||
static void translatePan( S32 delta_x, S32 delta_y );
|
static void translatePan( S32 delta_x, S32 delta_y );
|
||||||
static void setPan( S32 x, S32 y, BOOL snap = TRUE );
|
static void setPan( S32 x, S32 y, BOOL snap = TRUE );
|
||||||
// Return true if the current scale level is above the threshold for accessing region info
|
|
||||||
static bool showRegionInfo();
|
|
||||||
|
|
||||||
LLVector3 globalPosToView(const LLVector3d& global_pos);
|
LLVector3 globalPosToView(const LLVector3d& global_pos);
|
||||||
LLVector3d viewPosToGlobal(S32 x,S32 y);
|
LLVector3d viewPosToGlobal(S32 x,S32 y);
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
void drawGenericItems(const LLSimInfo::item_info_list_t& items, LLUIImagePtr image);
|
void drawGenericItems(const LLWorldMap::item_info_list_t& items, LLUIImagePtr image);
|
||||||
void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image);
|
void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image);
|
||||||
void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white);
|
void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white);
|
||||||
void drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color);
|
void drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color);
|
||||||
void drawAgents();
|
void drawAgents();
|
||||||
void drawItems();
|
void drawEvents();
|
||||||
void drawFrustum();
|
void drawFrustum();
|
||||||
void drawMipmap(S32 width, S32 height);
|
|
||||||
bool drawMipmapLevel(S32 width, S32 height, S32 level, bool load = true);
|
|
||||||
|
|
||||||
static void cleanupTextures();
|
static void cleanupTextures();
|
||||||
|
|
||||||
@@ -106,7 +109,7 @@ public:
|
|||||||
F32 y_pixels,
|
F32 y_pixels,
|
||||||
const LLColor4& color,
|
const LLColor4& color,
|
||||||
F32 relative_z = 0.f,
|
F32 relative_z = 0.f,
|
||||||
F32 dot_radius = 5.f);
|
F32 dot_radius = 3.f);
|
||||||
|
|
||||||
static void drawTrackingCircle( const LLRect& rect, S32 x, S32 y,
|
static void drawTrackingCircle( const LLRect& rect, S32 x, S32 y,
|
||||||
const LLColor4& color,
|
const LLColor4& color,
|
||||||
@@ -127,7 +130,9 @@ public:
|
|||||||
static void clearLastClick() { sHandledLastClick = FALSE; }
|
static void clearLastClick() { sHandledLastClick = FALSE; }
|
||||||
|
|
||||||
// if the view changes, download additional sim info as needed
|
// if the view changes, download additional sim info as needed
|
||||||
void updateVisibleBlocks();
|
// return value is number of blocks newly requested.
|
||||||
|
U32 updateBlock(S32 block_x, S32 block_y);
|
||||||
|
U32 updateVisibleBlocks();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setDirectionPos( LLTextBox* text_box, F32 rotation );
|
void setDirectionPos( LLTextBox* text_box, F32 rotation );
|
||||||
@@ -142,7 +147,6 @@ public:
|
|||||||
static LLUIImagePtr sAvatarLevelImage;
|
static LLUIImagePtr sAvatarLevelImage;
|
||||||
static LLUIImagePtr sAvatarAboveImage;
|
static LLUIImagePtr sAvatarAboveImage;
|
||||||
static LLUIImagePtr sAvatarBelowImage;
|
static LLUIImagePtr sAvatarBelowImage;
|
||||||
|
|
||||||
static LLUIImagePtr sTelehubImage;
|
static LLUIImagePtr sTelehubImage;
|
||||||
static LLUIImagePtr sInfohubImage;
|
static LLUIImagePtr sInfohubImage;
|
||||||
static LLUIImagePtr sHomeImage;
|
static LLUIImagePtr sHomeImage;
|
||||||
@@ -155,6 +159,10 @@ public:
|
|||||||
static LLUIImagePtr sForSaleImage;
|
static LLUIImagePtr sForSaleImage;
|
||||||
static LLUIImagePtr sForSaleAdultImage;
|
static LLUIImagePtr sForSaleAdultImage;
|
||||||
|
|
||||||
|
static F32 sThresholdA;
|
||||||
|
static F32 sThresholdB;
|
||||||
|
static F32 sPixelsPerMeter; // world meters to map pixels
|
||||||
|
|
||||||
static F32 sMapScale; // scale = size of a region in pixels
|
static F32 sMapScale; // scale = size of a region in pixels
|
||||||
|
|
||||||
BOOL mItemPicked;
|
BOOL mItemPicked;
|
||||||
@@ -165,7 +173,6 @@ public:
|
|||||||
static F32 sTargetPanY; // in pixels
|
static F32 sTargetPanY; // in pixels
|
||||||
static S32 sTrackingArrowX;
|
static S32 sTrackingArrowX;
|
||||||
static S32 sTrackingArrowY;
|
static S32 sTrackingArrowY;
|
||||||
static bool sVisibleTilesLoaded;
|
|
||||||
|
|
||||||
// Are we mid-pan from a user drag?
|
// Are we mid-pan from a user drag?
|
||||||
BOOL mPanning;
|
BOOL mPanning;
|
||||||
@@ -189,14 +196,10 @@ public:
|
|||||||
static BOOL sUseOldTrackingDots;
|
static BOOL sUseOldTrackingDots;
|
||||||
S32 mSelectIDStart;
|
S32 mSelectIDStart;
|
||||||
|
|
||||||
// Keep the list of regions that are displayed on screen. Avoids iterating through the whole region map after draw().
|
|
||||||
typedef std::vector<U64> handle_list_t;
|
typedef std::vector<U64> handle_list_t;
|
||||||
handle_list_t mVisibleRegions; // set every frame
|
handle_list_t mVisibleRegions; // set every frame
|
||||||
|
|
||||||
static std::map<std::string,std::string> sStringsMap;
|
static std::map<std::string,std::string> sStringsMap;
|
||||||
|
|
||||||
private:
|
|
||||||
void drawTileOutline(S32 level, F32 top, F32 left, F32 bottom, F32 right);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,294 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llworldmipmap.cpp
|
|
||||||
* @brief Data storage for the S3 mipmap of the entire world.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "llviewerprecompiledheaders.h"
|
|
||||||
|
|
||||||
#include "llworldmipmap.h"
|
|
||||||
|
|
||||||
#include "llviewercontrol.h"
|
|
||||||
#include "llviewerimagelist.h"
|
|
||||||
#include "math.h" // log()
|
|
||||||
|
|
||||||
#include "llworldmap.h"
|
|
||||||
#include "llviewernetwork.h" //for isProductionGrid();
|
|
||||||
#include "hippogridmanager.h"
|
|
||||||
|
|
||||||
// Turn this on to output tile stats in the standard output
|
|
||||||
#define DEBUG_TILES_STAT 0
|
|
||||||
|
|
||||||
LLWorldMipmap::LLWorldMipmap() :
|
|
||||||
mCurrentLevel(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LLWorldMipmap::~LLWorldMipmap()
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete all sublevel maps and clean them
|
|
||||||
void LLWorldMipmap::reset()
|
|
||||||
{
|
|
||||||
for (int level = 0; level < MAP_LEVELS; level++)
|
|
||||||
{
|
|
||||||
mWorldObjectsMipMap[level].clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method should be called before each use of the mipmap (typically, before each draw), so that to let
|
|
||||||
// the boost level of unused tiles to drop to 0 (BOOST_NONE).
|
|
||||||
// Tiles that are accessed have had their boost level pushed to BOOST_MAP_VISIBLE so we can identify them.
|
|
||||||
// The result of this strategy is that if a tile is not used during 2 consecutive loops, its boost level drops to 0.
|
|
||||||
void LLWorldMipmap::equalizeBoostLevels()
|
|
||||||
{
|
|
||||||
#if DEBUG_TILES_STAT
|
|
||||||
S32 nb_missing = 0;
|
|
||||||
S32 nb_tiles = 0;
|
|
||||||
S32 nb_visible = 0;
|
|
||||||
#endif // DEBUG_TILES_STAT
|
|
||||||
// For each level
|
|
||||||
for (S32 level = 0; level < MAP_LEVELS; level++)
|
|
||||||
{
|
|
||||||
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level];
|
|
||||||
// For each tile
|
|
||||||
for (sublevel_tiles_t::iterator iter = level_mipmap.begin(); iter != level_mipmap.end(); iter++)
|
|
||||||
{
|
|
||||||
LLPointer<LLViewerImage> img = iter->second;
|
|
||||||
S32 current_boost_level = img->getBoostLevel();
|
|
||||||
if (current_boost_level == LLViewerImageBoostLevel::BOOST_MAP_VISIBLE)
|
|
||||||
{
|
|
||||||
// If level was BOOST_MAP_VISIBLE, the tile has been used in the last draw so keep it high
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If level was BOOST_MAP only (or anything else...), the tile wasn't used in the last draw
|
|
||||||
// so we drop its boost level to BOOST_NONE.
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_NONE);
|
|
||||||
}
|
|
||||||
#if DEBUG_TILES_STAT
|
|
||||||
// Increment some stats if compile option on
|
|
||||||
nb_tiles++;
|
|
||||||
if (current_boost_level == LLViewerImageBoostLevel::BOOST_MAP_VISIBLE)
|
|
||||||
{
|
|
||||||
nb_visible++;
|
|
||||||
}
|
|
||||||
if (img->isMissingAsset())
|
|
||||||
{
|
|
||||||
nb_missing++;
|
|
||||||
}
|
|
||||||
#endif // DEBUG_TILES_STAT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if DEBUG_TILES_STAT
|
|
||||||
LL_INFOS("World Map") << "LLWorldMipmap tile stats : total requested = " << nb_tiles << ", visible = " << nb_visible << ", missing = " << nb_missing << LL_ENDL;
|
|
||||||
#endif // DEBUG_TILES_STAT
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method should be used when the mipmap is not actively used for a while, e.g., the map UI is hidden
|
|
||||||
void LLWorldMipmap::dropBoostLevels()
|
|
||||||
{
|
|
||||||
// For each level
|
|
||||||
for (S32 level = 0; level < MAP_LEVELS; level++)
|
|
||||||
{
|
|
||||||
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level];
|
|
||||||
// For each tile
|
|
||||||
for (sublevel_tiles_t::iterator iter = level_mipmap.begin(); iter != level_mipmap.end(); iter++)
|
|
||||||
{
|
|
||||||
LLPointer<LLViewerImage> img = iter->second;
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_NONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LLPointer<LLViewerImage> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load)
|
|
||||||
{
|
|
||||||
// Check the input data
|
|
||||||
llassert(level <= MAP_LEVELS);
|
|
||||||
llassert(level >= 1);
|
|
||||||
|
|
||||||
// If the *loading* level changed, cleared the new level from "missed" tiles
|
|
||||||
// so that we get a chance to reload them
|
|
||||||
if (load && (level != mCurrentLevel))
|
|
||||||
{
|
|
||||||
cleanMissedTilesFromLevel(level);
|
|
||||||
mCurrentLevel = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the region handle
|
|
||||||
U64 handle = convertGridToHandle(grid_x, grid_y);
|
|
||||||
|
|
||||||
// Check if the image is around already
|
|
||||||
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level-1];
|
|
||||||
sublevel_tiles_t::iterator found = level_mipmap.find(handle);
|
|
||||||
|
|
||||||
// If not there and load on, go load it
|
|
||||||
if (found == level_mipmap.end())
|
|
||||||
{
|
|
||||||
if (load)
|
|
||||||
{
|
|
||||||
// Load it
|
|
||||||
LLPointer<LLViewerImage> img;
|
|
||||||
|
|
||||||
//hack for opensims.
|
|
||||||
if(gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE)
|
|
||||||
img = loadObjectsTile(grid_x, grid_y, level);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);
|
|
||||||
if(info)
|
|
||||||
{
|
|
||||||
img = gImageList.getImage(info->getMapImageID(), MIPMAP_TRUE, FALSE);
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
// </edit>
|
|
||||||
// Insert the image in the map
|
|
||||||
level_mipmap.insert(sublevel_tiles_t::value_type( handle, img ));
|
|
||||||
// Find the element again in the map (it's there now...)
|
|
||||||
found = level_mipmap.find(handle);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Return with NULL if not found and we're not trying to load
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the image pointer and check if this asset is missing
|
|
||||||
LLPointer<LLViewerImage> img = found->second;
|
|
||||||
if (img->isMissingAsset())
|
|
||||||
{
|
|
||||||
// Return NULL if asset missing
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Boost the tile level so to mark it's in use *if* load on
|
|
||||||
if (load)
|
|
||||||
{
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP_VISIBLE);
|
|
||||||
}
|
|
||||||
return img;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LLPointer<LLViewerImage> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level)
|
|
||||||
{
|
|
||||||
// Get the grid coordinates
|
|
||||||
std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y);
|
|
||||||
|
|
||||||
// DO NOT COMMIT!! DEBUG ONLY!!!
|
|
||||||
// Use a local jpeg for every tile to test map speed without S3 access
|
|
||||||
//imageurl = "file://C:\\Develop\\mapserver-distribute-3\\indra\\build-vc80\\mapserver\\relwithdebinfo\\regions\\00995\\01001\\region-995-1001-prims.jpg";
|
|
||||||
// END DEBUG
|
|
||||||
//LL_INFOS("World Map") << "LLWorldMipmap::loadObjectsTile(), URL = " << imageurl << LL_ENDL;
|
|
||||||
|
|
||||||
LLPointer<LLViewerImage> img = gImageList.getImageFromUrl(imageurl);
|
|
||||||
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
|
|
||||||
|
|
||||||
// Return the smart pointer
|
|
||||||
return img;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method is used to clean up a level from tiles marked as "missing".
|
|
||||||
// The idea is to allow tiles that have been improperly marked missing to be reloaded when retraversing the level again.
|
|
||||||
// When zooming in and out rapidly, some tiles are never properly loaded and, eventually marked missing.
|
|
||||||
// This creates "blue" areas in a subresolution that never got a chance to reload if we don't clean up the level.
|
|
||||||
void LLWorldMipmap::cleanMissedTilesFromLevel(S32 level)
|
|
||||||
{
|
|
||||||
// Check the input data
|
|
||||||
llassert(level <= MAP_LEVELS);
|
|
||||||
llassert(level >= 0);
|
|
||||||
|
|
||||||
// This happens when the object is first initialized
|
|
||||||
if (level == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iterate through the subresolution level and suppress the tiles that are marked as missing
|
|
||||||
// Note: erasing in a map while iterating through it is bug prone. Using a postfix increment is mandatory here.
|
|
||||||
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level-1];
|
|
||||||
sublevel_tiles_t::iterator it = level_mipmap.begin();
|
|
||||||
while (it != level_mipmap.end())
|
|
||||||
{
|
|
||||||
LLPointer<LLViewerImage> img = it->second;
|
|
||||||
if (img->isMissingAsset())
|
|
||||||
{
|
|
||||||
level_mipmap.erase(it++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static methods
|
|
||||||
// Compute the level in the world mipmap (between 1 and MAP_LEVELS, as in the URL) given the scale (size of a sim in screen pixels)
|
|
||||||
S32 LLWorldMipmap::scaleToLevel(F32 scale)
|
|
||||||
{
|
|
||||||
// If scale really small, picks up the higest level there is (lowest resolution)
|
|
||||||
if (scale <= F32_MIN)
|
|
||||||
return MAP_LEVELS;
|
|
||||||
// Compute the power of two resolution level knowing the base level
|
|
||||||
S32 level = llfloor((log(REGION_WIDTH_METERS/scale)/log(2.0f)) + 1.0f);
|
|
||||||
// Check bounds and return the value
|
|
||||||
if (level > MAP_LEVELS)
|
|
||||||
return MAP_LEVELS;
|
|
||||||
else if (level < 1)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert world coordinates to mipmap grid coordinates at a given level (between 1 and MAP_LEVELS)
|
|
||||||
void LLWorldMipmap::globalToMipmap(F64 global_x, F64 global_y, S32 level, U32* grid_x, U32* grid_y)
|
|
||||||
{
|
|
||||||
// Check the input data
|
|
||||||
llassert(level <= MAP_LEVELS);
|
|
||||||
llassert(level >= 1);
|
|
||||||
|
|
||||||
// Convert world coordinates into grid coordinates
|
|
||||||
*grid_x = lltrunc(global_x/REGION_WIDTH_METERS);
|
|
||||||
*grid_y = lltrunc(global_y/REGION_WIDTH_METERS);
|
|
||||||
// Compute the valid grid coordinates at that level of the mipmap
|
|
||||||
S32 regions_in_tile = 1 << (level - 1);
|
|
||||||
*grid_x = *grid_x - (*grid_x % regions_in_tile);
|
|
||||||
*grid_y = *grid_y - (*grid_y % regions_in_tile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llworldmipmap.h
|
|
||||||
* @brief Data storage for the S3 mipmap of the entire world.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LL_LLWORLDMIPMAP_H
|
|
||||||
#define LL_LLWORLDMIPMAP_H
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "llmemory.h" // LLPointer
|
|
||||||
#include "indra_constants.h" // REGION_WIDTH_UNITS
|
|
||||||
#include "llregionhandle.h" // to_region_handle()
|
|
||||||
|
|
||||||
class LLViewerImage;
|
|
||||||
|
|
||||||
// LLWorldMipmap : Mipmap handling of all the tiles used to render the world at any resolution.
|
|
||||||
// This class provides a clean structured access to the hierarchy of tiles stored in the
|
|
||||||
// Amazon S3 repository and abstracts its directory/file structure.
|
|
||||||
// The interface of this class though still assumes that the caller knows the general level/tiles
|
|
||||||
// structure (at least, that it exists...) but doesn't requite the caller to know the details of it.
|
|
||||||
// IOW, you need to know that rendering levels exists as well as grid coordinates for regions,
|
|
||||||
// but you can ignore where those tiles are located, how to get them, etc...
|
|
||||||
// The class API gives you back LLPointer<LLViewerImage> per tile.
|
|
||||||
|
|
||||||
// See llworldmipmapview.cpp for the implementation of a class who knows how to render an LLWorldMipmap.
|
|
||||||
|
|
||||||
// Implementation notes:
|
|
||||||
// - On the S3 servers, the tiles are rendered in 2 flavors: Objects and Terrain.
|
|
||||||
// - For the moment, LLWorldMipmap implements access only to the Objects tiles.
|
|
||||||
class LLWorldMipmap
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Parameters of the mipmap
|
|
||||||
static const S32 MAP_LEVELS = 8; // Number of subresolution levels computed by the mapserver
|
|
||||||
static const S32 MAP_TILE_SIZE = 256; // Width in pixels of the tiles computed by the mapserver
|
|
||||||
|
|
||||||
LLWorldMipmap();
|
|
||||||
~LLWorldMipmap();
|
|
||||||
|
|
||||||
// Clear up the maps and release all image handles
|
|
||||||
void reset();
|
|
||||||
// Manage the boost levels between loops (typically draw() loops)
|
|
||||||
void equalizeBoostLevels();
|
|
||||||
// Drop the boost levels to none (used when hiding the map)
|
|
||||||
void dropBoostLevels();
|
|
||||||
// Get the tile smart pointer, does the loading if necessary
|
|
||||||
LLPointer<LLViewerImage> getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load = true);
|
|
||||||
|
|
||||||
// Helper functions: those are here as they depend solely on the topology of the mipmap though they don't access it
|
|
||||||
// Convert sim scale (given in sim width in display pixels) into a mipmap level
|
|
||||||
static S32 scaleToLevel(F32 scale);
|
|
||||||
// Convert world coordinates to mipmap grid coordinates at a given level
|
|
||||||
static void globalToMipmap(F64 global_x, F64 global_y, S32 level, U32* grid_x, U32* grid_y);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Get a handle (key) from grid coordinates
|
|
||||||
U64 convertGridToHandle(U32 grid_x, U32 grid_y) { return to_region_handle(grid_x * REGION_WIDTH_UNITS, grid_y * REGION_WIDTH_UNITS); }
|
|
||||||
// Load the relevant tile from S3
|
|
||||||
LLPointer<LLViewerImage> loadObjectsTile(U32 grid_x, U32 grid_y, S32 level);
|
|
||||||
// Clear a level from its "missing" tiles
|
|
||||||
void cleanMissedTilesFromLevel(S32 level);
|
|
||||||
|
|
||||||
// The mipmap is organized by resolution level (MAP_LEVELS of them). Each resolution level is an std::map
|
|
||||||
// using a region_handle as a key and storing a smart pointer to the image as a value.
|
|
||||||
typedef std::map<U64, LLPointer<LLViewerImage> > sublevel_tiles_t;
|
|
||||||
sublevel_tiles_t mWorldObjectsMipMap[MAP_LEVELS];
|
|
||||||
// sublevel_tiles_t mWorldTerrainMipMap[MAP_LEVELS];
|
|
||||||
|
|
||||||
S32 mCurrentLevel; // The level last accessed by a getObjectsTile()
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LL_LLWORLDMIPMAP_H
|
|
||||||
@@ -82,19 +82,19 @@
|
|||||||
<icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16"
|
<icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16"
|
||||||
image_name="map_event.tga" left="1151" mouse_opaque="true" name="event"
|
image_name="map_event.tga" left="1151" mouse_opaque="true" name="event"
|
||||||
width="16" />
|
width="16" />
|
||||||
<check_box bottom="-116" control_name="MapShowEvents" follows="top|right"
|
<check_box bottom="-116" control_name="MapShowPGEvents" follows="top|right"
|
||||||
font="SansSerifSmall" height="16" initial_value="false" label="PG"
|
font="SansSerifSmall" height="16" initial_value="false" label="PG"
|
||||||
left_delta="20" mouse_opaque="true" name="event_chk" width="55" />
|
left_delta="20" mouse_opaque="true" name="event_chk" width="55" />
|
||||||
<icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16"
|
<icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16"
|
||||||
image_name="map_event_mature.tga" left="1151" mouse_opaque="true"
|
image_name="map_event_mature.tga" left="1151" mouse_opaque="true"
|
||||||
name="events_mature_icon" width="16" />
|
name="events_mature_icon" width="16" />
|
||||||
<check_box bottom="-136" control_name="ShowMatureEvents" follows="top|right"
|
<check_box bottom="-136" control_name="MapShowMatureEvents" follows="top|right"
|
||||||
font="SansSerifSmall" height="16" initial_value="true" label="Mature"
|
font="SansSerifSmall" height="16" initial_value="true" label="Mature"
|
||||||
left_delta="20" mouse_opaque="true" name="event_mature_chk" width="55" />
|
left_delta="20" mouse_opaque="true" name="event_mature_chk" width="55" />
|
||||||
<icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16"
|
<icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16"
|
||||||
image_name="map_event_adult.tga" left="1151" mouse_opaque="true"
|
image_name="map_event_adult.tga" left="1151" mouse_opaque="true"
|
||||||
name="events_adult_icon" width="16" />
|
name="events_adult_icon" width="16" />
|
||||||
<check_box bottom="-156" control_name="ShowAdultEvents" follows="top|right"
|
<check_box bottom="-156" control_name="MapShowAdultEvents" follows="top|right"
|
||||||
font="SansSerifSmall" height="16" initial_value="false" label="Adult"
|
font="SansSerifSmall" height="16" initial_value="false" label="Adult"
|
||||||
left_delta="20" mouse_opaque="true" name="event_adult_chk" width="55" />
|
left_delta="20" mouse_opaque="true" name="event_adult_chk" width="55" />
|
||||||
<icon bottom="-180" color="0.5, 0, 0, 1" follows="top|right" height="16"
|
<icon bottom="-180" color="0.5, 0, 0, 1" follows="top|right" height="16"
|
||||||
|
|||||||
@@ -7,6 +7,13 @@
|
|||||||
|
|
||||||
<string name="hippo_label_free">free</string>
|
<string name="hippo_label_free">free</string>
|
||||||
<string name="hippo_label_week">week</string>
|
<string name="hippo_label_week">week</string>
|
||||||
|
<string name="TeleportOfferMaturity">
|
||||||
|
[NAME] is offering a TP to [DESTINATION]
|
||||||
|
</string>
|
||||||
|
<string name="TeleportLureMaturity">
|
||||||
|
[NAME]'s teleport lure is to [DESTINATION]
|
||||||
|
</string>
|
||||||
|
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<string name="LoginInProgress">Logging in. [APP_NAME] may appear frozen. Please wait.</string>
|
<string name="LoginInProgress">Logging in. [APP_NAME] may appear frozen. Please wait.</string>
|
||||||
<string name="LoginAuthenticating">Authenticating</string>
|
<string name="LoginAuthenticating">Authenticating</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user