diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-06 18:40:37 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-06 18:40:37 -0800 |
commit | a0c626fe411336871505c2c414143ae4b2f73259 (patch) | |
tree | 37048430da906cf5cd4a2e0ef6f2866f7b011599 /indra/newview/llfloaterpathfindingconsole.cpp | |
parent | 6c9561c882cf0d5bb0cb547852e95daec19f559c (diff) |
PATH-205,PATH-304: More work to handle downloading of out-of-date navmeshes.
Diffstat (limited to 'indra/newview/llfloaterpathfindingconsole.cpp')
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 73 |
1 files changed, 3 insertions, 70 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index f2404dcb6b..fe5c6b8d44 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -171,77 +171,10 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1));
}
- mNavMeshZone.setCurrentRegionAsCenter();
- mNavMeshZone.refresh();
-#if 0
- LLPathingLib::getInstance()->cleanupResidual();
-
- mCurrentMDO = 0;
- mNavMeshCnt = 0;
-
- //make sure the region is essentially enabled for navmesh support
- std::string capability = "RetrieveNavMeshSrc";
-
- LLViewerRegion* pCurrentRegion = gAgent.getRegion();
- std::vector<LLViewerRegion*> regions;
- regions.push_back( pCurrentRegion );
- 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 ( shiftDirections.size() != regions.size() )
- {
- shiftDirections.clear();regions.clear();
- regions.push_back( pCurrentRegion );
- shiftDirections.push_back( CURRENT_REGION );
- }
+ mNavMeshZone.initialize();
- int regionCnt = regions.size();
- mNavMeshCnt = regionCnt;
-
- for ( int i=0; i<regionCnt; ++i )
- {
- std::string url = regions[i]->getCapability( capability );
-
- if ( !url.empty() )
- {
- std::string str = getString("navmesh_fetch_inprogress");
- mPathfindingStatus->setText((LLStringExplicit)str);
- LLNavMeshStation::getInstance()->setNavMeshDownloadURL( url );
- int dir = shiftDirections[i];
- LLNavMeshStation::getInstance()->downloadNavMeshSrc( mNavMeshDownloadObserver[mCurrentMDO].getObserverHandle(), dir );
- ++mCurrentMDO;
- }
- else
- {
- --mNavMeshCnt;
- std::string str = getString("navmesh_region_not_enabled");
- LLStyle::Params styleParams;
- styleParams.color = LLUIColorTable::instance().getColor("DrYellow");
- mPathfindingStatus->setText((LLStringExplicit)str, styleParams);
- llinfos<<"Region has does not required caps of type ["<<capability<<"]"<<llendl;
- }
- }
-#endif
+ mNavMeshZone.enable();
+ mNavMeshZone.refresh();
}
if (!mAgentStateSlot.connected())
|