summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2012-02-16 15:59:54 -0500
committerprep <prep@lindenlab.com>2012-02-16 15:59:54 -0500
commit41d9bd0e6d018af9201f376a17ce52f59463e7b9 (patch)
tree2e5772b1f1d73cd337ed2f21a0b97380ce7fc70f /indra
parent70f8225a30c80d26ca349a8f63fa8f5189ae4f2b (diff)
Path-278 Debug option to download multiple navmeshes to the viewer.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp43
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h2
3 files changed, 43 insertions, 13 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0e26013152..631e45d0ec 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13483,5 +13483,16 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>RetrieveNeighboringRegion</key>
+ <map>
+ <key>Comment</key>
+ <string>Download a neighboring region when visualize a navmesh (default val 99 is for the current region).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>6</integer>
+ </map>
</map>
</llsd>
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 1b948c442b..c54f6a1ffe 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -45,6 +45,7 @@
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llviewercamera.h"
+#include "llviewercontrol.h"
#include "LLPathingLib.h"
@@ -432,7 +433,8 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mNavMeshCnt(0),
mHasStartPoint(false),
mHasEndPoint(false),
- mIsRegionFrozen(false)
+ mIsRegionFrozen(false),
+ mNeighboringRegion( CURRENT_REGION )
{
mSelfHandle.bind(this);
@@ -470,26 +472,43 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
//make sure the region is essentially enabled for navmesh support
std::string capability = "RetrieveNavMeshSrc";
-
- //prep# neighboring navmesh support proto
+
LLViewerRegion* pCurrentRegion = gAgent.getRegion();
std::vector<LLViewerRegion*> regions;
regions.push_back( pCurrentRegion );
- //pCurrentRegion->getNeighboringRegions( regions );
-
- std::vector<int> shift;
- shift.push_back( CURRENT_REGION );
- //pCurrentRegion->getNeighboringRegionsStatus( shift );
+ std::vector<int> shiftDirections;
+ shiftDirections.push_back( CURRENT_REGION );
+ mNeighboringRegion = gSavedSettings.getU32("RetrieveNeighboringRegion");
+ if ( mNeighboringRegion != CURRENT_REGION )
+ {
+ //User wants to pull in a neighboring region
+ std::vector<S32> availableRegions;
+ pCurrentRegion->getNeighboringRegionsStatus( availableRegions );
+ //Is the desired region in the available list
+ std::vector<S32>::iterator foundElem = std::find(availableRegions.begin(),availableRegions.end(),mNeighboringRegion);
+ if ( foundElem != availableRegions.end() )
+ {
+ LLViewerRegion* pCurrentRegion = gAgent.getRegion();
+ std::vector<LLViewerRegion*> regionPtrs;
+ pCurrentRegion->getNeighboringRegions( regionPtrs );
+ regions.push_back( regionPtrs[mNeighboringRegion] );
+ shiftDirections.push_back( mNeighboringRegion );
+ }
+ }
+
+
//If the navmesh shift ops and the total region counts do not match - use the current region, only.
- if ( shift.size() != regions.size() )
+ if ( shiftDirections.size() != regions.size() )
{
- shift.clear();regions.clear();
+ shiftDirections.clear();regions.clear();
regions.push_back( pCurrentRegion );
- shift.push_back( CURRENT_REGION );
+ shiftDirections.push_back( CURRENT_REGION );
}
+
int regionCnt = regions.size();
mNavMeshCnt = regionCnt;
+
for ( int i=0; i<regionCnt; ++i )
{
std::string url = regions[i]->getCapability( capability );
@@ -499,7 +518,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
std::string str = getString("navmesh_fetch_inprogress");
mPathfindingStatus->setText((LLStringExplicit)str);
LLNavMeshStation::getInstance()->setNavMeshDownloadURL( url );
- int dir = shift[i];
+ int dir = shiftDirections[i];
LLNavMeshStation::getInstance()->downloadNavMeshSrc( mNavMeshDownloadObserver[mCurrentMDO].getObserverHandle(), dir );
++mCurrentMDO;
}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index 10fcf26795..2068d2c53f 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -157,7 +157,7 @@ private:
LLNavMeshDownloadObserver mNavMeshDownloadObserver[10];
int mCurrentMDO;
int mNavMeshCnt;
-
+ U32 mNeighboringRegion;
//Container that is populated and subsequently submitted to the LLPathingSystem for processing
LLPathingLib::PathingPacket mPathData;
bool mHasStartPoint;