summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llpointer.h6
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp74
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h8
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp152
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.h31
-rw-r--r--indra/newview/llnavmeshstation.cpp88
-rw-r--r--indra/newview/llnavmeshstation.h8
-rw-r--r--indra/newview/llsurface.cpp13
-rw-r--r--indra/newview/llsurface.h1
-rw-r--r--indra/newview/llviewerregion.cpp8
-rw-r--r--indra/newview/llviewerregion.h4
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_console.xml10
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml20
14 files changed, 232 insertions, 195 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h
index affa040602..88c09c8dca 100644
--- a/indra/llcommon/llpointer.h
+++ b/indra/llcommon/llpointer.h
@@ -140,6 +140,10 @@ public:
}
protected:
+#ifdef LL_LIBRARY_INCLUDE
+ void ref();
+ void unref();
+#else
void ref()
{
if (mPointer)
@@ -162,7 +166,7 @@ protected:
}
}
}
-
+#endif
protected:
Type* mPointer;
};
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 314bd790dd..bff87cea95 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1517,8 +1517,8 @@ if (WINDOWS)
PROPERTIES
# *TODO -reenable this once we get server usage sorted out
#LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\""
- LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc /FORCE:MULTIPLE"
- LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /FORCE:MULTIPLE"
+ LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc "
+ LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE "/FORCE:MULTIPLE"
)
if(USE_PRECOMPILED_HEADERS)
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 269bef22fe..d51f427c4e 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -35,6 +35,7 @@
#include "llradiogroup.h"
#include "llsliderctrl.h"
#include "lllineeditor.h"
+#include "lltextbase.h"
#include "lltextvalidate.h"
#include "llnavmeshstation.h"
#include "llviewerregion.h"
@@ -53,6 +54,8 @@
#define XUI_CHARACTER_TYPE_C 3
#define XUI_CHARACTER_TYPE_D 4
+const int CURRENT_REGION = 99;
+const int MAX_OBSERVERS = 10;
//---------------------------------------------------------------------------
// LLFloaterPathfindingConsole
//---------------------------------------------------------------------------
@@ -95,6 +98,9 @@ BOOL LLFloaterPathfindingConsole::postBuild()
llassert(mCharacterTypeRadioGroup != NULL);
mCharacterTypeRadioGroup->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this));
+ mPathfindingStatus = findChild<LLTextBase>("pathfinding_status");
+ llassert(mPathfindingStatus != NULL);
+
mTerrainMaterialA = findChild<LLLineEditor>("terrain_material_a");
llassert(mTerrainMaterialA != NULL);
mTerrainMaterialA->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onTerrainMaterialASet, this));
@@ -303,6 +309,18 @@ void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 pTerrainMaterial)
mTerrainMaterialD->setValue(LLSD(pTerrainMaterial));
}
+void LLFloaterPathfindingConsole::setHasNavMeshReceived()
+{
+ std::string str = getString("navmesh_fetch_complete_available");
+ mPathfindingStatus->setText((LLStringExplicit)str);
+}
+
+void LLFloaterPathfindingConsole::setHasNoNavMesh()
+{
+ std::string str = getString("navmesh_fetch_complete_none");
+ mPathfindingStatus->setText((LLStringExplicit)str);
+}
+
LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
: LLFloater(pSeed),
mShowNavMeshCheckBox(NULL),
@@ -313,12 +331,16 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mPathSelectionRadioGroup(NULL),
mCharacterWidthSlider(NULL),
mCharacterTypeRadioGroup(NULL),
+ mPathfindingStatus(NULL),
mTerrainMaterialA(NULL),
mTerrainMaterialB(NULL),
mTerrainMaterialC(NULL),
- mTerrainMaterialD(NULL),
- mNavMeshDownloadObserver()
+ mTerrainMaterialD(NULL)
{
+ for (int i=0;i<MAX_OBSERVERS;++i)
+ {
+ mNavMeshDownloadObserver[i].setPathfindingConsole(this);
+ }
}
LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole()
@@ -339,22 +361,50 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
//prep# end test
if ( LLPathingLib::getInstance() == NULL )
{
- llinfos<<"No implementation of pathing library."<<llendl;
+ std::string str = getString("navmesh_library_not_implemented");
+ LLStyle::Params styleParams;
+ styleParams.color = LLUIColorTable::instance().getColor("DrYellow");
+ mPathfindingStatus->setText((LLStringExplicit)str, styleParams);
+ llwarns <<"Errror: cannout find pathing library implementation."<<llendl;
}
else
{
+ mCurrentMDO = 0;
//make sure the region is essentially enabled for navmesh support
std::string capability = "RetrieveNavMeshSrc";
- std::string url = gAgent.getRegion()->getCapability( capability );
- if ( !url.empty() )
- {
- llinfos<<"Region has required caps of type ["<<capability<<"]"<<llendl;
- LLNavMeshStation::getInstance()->setNavMeshDownloadURL( url );
- LLNavMeshStation::getInstance()->downloadNavMeshSrc( mNavMeshDownloadObserver.getObserverHandle() );
- }
- else
+
+ //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 );
+
+ int regionCnt = regions.size();
+ for ( int i=0; i<regionCnt; ++i )
{
- llinfos<<"Region has does not required caps of type ["<<capability<<"]"<<llendl;
+ 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 = shift[i];
+ LLNavMeshStation::getInstance()->downloadNavMeshSrc( mNavMeshDownloadObserver[mCurrentMDO].getObserverHandle(), dir );
+ ++mCurrentMDO;
+ }
+ else
+ {
+ 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;
+ }
}
}
}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index c01ae286eb..ed63a669ea 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -37,6 +37,7 @@ class LLSD;
class LLRadioGroup;
class LLSliderCtrl;
class LLLineEditor;
+class LLTextBase;
class LLFloaterPathfindingConsole
: public LLFloater
@@ -97,6 +98,9 @@ public:
BOOL getShowPathToggle() const {return mShowPathCheckBox->get(); }
+ void setHasNavMeshReceived();
+ void setHasNoNavMesh();
+
protected:
private:
@@ -131,12 +135,14 @@ private:
LLRadioGroup *mPathSelectionRadioGroup;
LLSliderCtrl *mCharacterWidthSlider;
LLRadioGroup *mCharacterTypeRadioGroup;
+ LLTextBase *mPathfindingStatus;
LLLineEditor *mTerrainMaterialA;
LLLineEditor *mTerrainMaterialB;
LLLineEditor *mTerrainMaterialC;
LLLineEditor *mTerrainMaterialD;
- LLNavMeshDownloadObserver mNavMeshDownloadObserver;
+ LLNavMeshDownloadObserver mNavMeshDownloadObserver[10];
+ int mCurrentMDO;
//Container that is populated and subsequently submitted to the LLPathingSystem for processing
LLPathingLib::PathingPacket mPathData;
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index d01732d05f..9d8f99902b 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -131,7 +131,7 @@ PathfindingLinkset::PathfindingLinkset(const std::string &pUUID, const LLSD& pNa
mPathState = getPathState(isPermanent, isWalkable);
llassert(pNavMeshItem.has("phantom"));
- //llassert(pNavMeshItem.get("phantom").isBoolean()); XXX stinson 01/10/2012: this should be a boolean but is not
+ llassert(pNavMeshItem.get("phantom").isBoolean());
mIsPhantom = pNavMeshItem.get("phantom").asBoolean();
llassert(pNavMeshItem.has("A"));
@@ -624,6 +624,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
llassert(mLinksetsScrollList != NULL);
mLinksetsScrollList->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onLinksetsSelectionChange, this));
mLinksetsScrollList->setCommitOnSelectionChange(true);
+ mLinksetsScrollList->sortByColumnIndex(0, true);
mLinksetsStatus = findChild<LLTextBase>("linksets_status");
llassert(mLinksetsStatus != NULL);
@@ -655,6 +656,15 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mEditPathState = findChild<LLRadioGroup>("edit_path_state");
llassert(mEditPathState != NULL);
+ mEditPathStateWalkable = findChild<LLUICtrl>("edit_pathing_state_walkable");
+ llassert(mEditPathStateWalkable != NULL);
+
+ mEditPathStateObstacle = findChild<LLUICtrl>("edit_pathing_state_obstacle");
+ llassert(mEditPathStateObstacle != NULL);
+
+ mEditPathStateIgnored = findChild<LLUICtrl>("edit_pathing_state_ignored");
+ llassert(mEditPathStateIgnored != NULL);
+
mLabelWalkabilityCoefficients = findChild<LLTextBase>("walkability_coefficients_label");
llassert(mLabelWalkabilityCoefficients != NULL);
@@ -694,7 +704,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mApplyEdits->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyChangesClicked, this));
setEnableEditFields(false);
- setFetchState(kFetchInitial);
+ setMessagingState(kMessagingInitial);
return LLFloater::postBuild();
}
@@ -709,20 +719,23 @@ void LLFloaterPathfindingLinksets::openLinksetsEditor()
LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets");
}
-LLFloaterPathfindingLinksets::EFetchState LLFloaterPathfindingLinksets::getFetchState() const
+LLFloaterPathfindingLinksets::EMessagingState LLFloaterPathfindingLinksets::getMessagingState() const
{
- return mFetchState;
+ return mMessagingState;
}
-BOOL LLFloaterPathfindingLinksets::isFetchInProgress() const
+BOOL LLFloaterPathfindingLinksets::isMessagingInProgress() const
{
BOOL retVal;
- switch (getFetchState())
+ switch (getMessagingState())
{
- case kFetchStarting :
- case kFetchRequestSent :
- case kFetchRequestSent_MultiRequested :
- case kFetchReceived :
+ case kMessagingFetchStarting :
+ case kMessagingFetchRequestSent :
+ case kMessagingFetchRequestSent_MultiRequested :
+ case kMessagingFetchReceived :
+ case kMessagingModifyStarting :
+ case kMessagingModifyRequestSent :
+ case kMessagingModifyReceived :
retVal = true;
break;
default :
@@ -736,7 +749,7 @@ BOOL LLFloaterPathfindingLinksets::isFetchInProgress() const
LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
: LLFloater(pSeed),
mPathfindingLinksets(),
- mFetchState(kFetchInitial),
+ mMessagingState(kMessagingInitial),
mLinksetsScrollList(NULL),
mLinksetsStatus(NULL),
mFilterByName(NULL),
@@ -745,6 +758,9 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
mFilterByObstacle(NULL),
mFilterByIgnored(NULL),
mEditPathState(NULL),
+ mEditPathStateWalkable(NULL),
+ mEditPathStateObstacle(NULL),
+ mEditPathStateIgnored(NULL),
mLabelWalkabilityCoefficients(NULL),
mLabelEditA(NULL),
mLabelEditB(NULL),
@@ -765,28 +781,28 @@ LLFloaterPathfindingLinksets::~LLFloaterPathfindingLinksets()
void LLFloaterPathfindingLinksets::sendNavMeshDataGetRequest()
{
- if (isFetchInProgress())
+ if (isMessagingInProgress())
{
- if (getFetchState() == kFetchRequestSent)
+ if (getMessagingState() == kMessagingFetchRequestSent)
{
- setFetchState(kFetchRequestSent_MultiRequested);
+ setMessagingState(kMessagingFetchRequestSent_MultiRequested);
}
}
else
{
- setFetchState(kFetchStarting);
+ setMessagingState(kMessagingFetchStarting);
mPathfindingLinksets.clearLinksets();
updateLinksetsList();
std::string navMeshDataURL = getCapabilityURL();
if (navMeshDataURL.empty())
{
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
llwarns << "cannot query object navmesh properties from current region '" << getRegionName() << "'" << llendl;
}
else
{
- setFetchState(kFetchRequestSent);
+ setMessagingState(kMessagingFetchRequestSent);
LLHTTPClient::get(navMeshDataURL, new NavMeshDataGetResponder(navMeshDataURL, this));
}
}
@@ -794,28 +810,31 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataGetRequest()
void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostData)
{
- std::string navMeshDataURL = getCapabilityURL();
- if (navMeshDataURL.empty())
+ if (!isMessagingInProgress())
{
- llwarns << "cannot put object navmesh properties for current region '" << getRegionName() << "'" << llendl;
- }
- else
- {
- LLHTTPClient::put(navMeshDataURL, pPostData, new NavMeshDataPutResponder(navMeshDataURL, this));
+ std::string navMeshDataURL = getCapabilityURL();
+ if (navMeshDataURL.empty())
+ {
+ llwarns << "cannot put object navmesh properties for current region '" << getRegionName() << "'" << llendl;
+ }
+ else
+ {
+ LLHTTPClient::put(navMeshDataURL, pPostData, new NavMeshDataPutResponder(navMeshDataURL, this));
+ }
}
}
void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData)
{
- setFetchState(kFetchReceived);
+ setMessagingState(kMessagingFetchReceived);
mPathfindingLinksets.setNavMeshData(pNavMeshData);
updateLinksetsList();
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
}
void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string& pURL, const std::string& pErrorReason)
{
- setFetchState(kFetchError);
+ setMessagingState(kMessagingFetchError);
mPathfindingLinksets.clearLinksets();
updateLinksetsList();
llwarns << "Error fetching object navmesh properties from URL '" << pURL << "' because " << pErrorReason << llendl;
@@ -823,17 +842,15 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string&
void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData)
{
- setFetchState(kFetchReceived);
+ setMessagingState(kMessagingModifyReceived);
mPathfindingLinksets.updateNavMeshData(pModifiedData);
updateLinksetsList();
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
}
void LLFloaterPathfindingLinksets::handleNavMeshDataPutError(const std::string& pURL, const std::string& pErrorReason)
{
- setFetchState(kFetchError);
- mPathfindingLinksets.clearLinksets();
- updateLinksetsList();
+ setMessagingState(kMessagingModifyError);
llwarns << "Error putting object navmesh properties to URL '" << pURL << "' because " << pErrorReason << llendl;
}
@@ -852,21 +869,6 @@ std::string LLFloaterPathfindingLinksets::getRegionName() const
std::string LLFloaterPathfindingLinksets::getCapabilityURL() const
{
-#ifdef XXX_STINSON_REGION_CAP_RENAME
- std::string navMeshDataURL("");
-
- LLViewerRegion* region = gAgent.getRegion();
- if (region != NULL)
- {
- navMeshDataURL = region->getCapability("ObjectNavMeshProperties");
- if (navMeshDataURL.empty())
- {
- navMeshDataURL = region->getCapability("ObjectNavmesh");
- }
- }
-
- return navMeshDataURL;
-#else // XXX_STINSON_REGION_CAP_RENAME
std::string navMeshDataURL("");
LLViewerRegion* region = gAgent.getRegion();
@@ -876,12 +878,11 @@ std::string LLFloaterPathfindingLinksets::getCapabilityURL() const
}
return navMeshDataURL;
-#endif // XXX_STINSON_REGION_CAP_RENAME
}
-void LLFloaterPathfindingLinksets::setFetchState(EFetchState pFetchState)
+void LLFloaterPathfindingLinksets::setMessagingState(EMessagingState pMessagingState)
{
- mFetchState = pFetchState;
+ mMessagingState = pMessagingState;
updateLinksetsStatusMessage();
}
@@ -1054,28 +1055,44 @@ void LLFloaterPathfindingLinksets::updateLinksetsStatusMessage()
std::string statusText("");
LLStyle::Params styleParams;
- switch (getFetchState())
+ switch (getMessagingState())
{
- case kFetchStarting :
- statusText = getString("linksets_fetching_starting");
+ case kMessagingInitial:
+ statusText = getString("linksets_messaging_initial");
+ break;
+ case kMessagingFetchStarting :
+ statusText = getString("linksets_messaging_fetch_starting");
+ break;
+ case kMessagingFetchRequestSent :
+ statusText = getString("linksets_messaging_fetch_inprogress");
+ break;
+ case kMessagingFetchRequestSent_MultiRequested :
+ statusText = getString("linksets_messaging_fetch_inprogress_multi_request");
break;
- case kFetchRequestSent :
- statusText = getString("linksets_fetching_inprogress");
+ case kMessagingFetchReceived :
+ statusText = getString("linksets_messaging_fetch_received");
break;
- case kFetchRequestSent_MultiRequested :
- statusText = getString("linksets_fetching_inprogress_multi_request");
+ case kMessagingFetchError :
+ statusText = getString("linksets_messaging_fetch_error");
+ styleParams.color = warningColor;
+ break;
+ case kMessagingModifyStarting :
+ statusText = getString("linksets_messaging_modify_starting");
break;
- case kFetchReceived :
- statusText = getString("linksets_fetching_received");
+ case kMessagingModifyRequestSent :
+ statusText = getString("linksets_messaging_modify_inprogress");
break;
- case kFetchError :
- statusText = getString("linksets_fetching_error");
+ case kMessagingModifyReceived :
+ statusText = getString("linksets_messaging_modify_received");
+ break;
+ case kMessagingModifyError :
+ statusText = getString("linksets_messaging_modify_error");
styleParams.color = warningColor;
break;
- case kFetchComplete :
+ case kMessagingComplete :
if (mLinksetsScrollList->isEmpty())
{
- statusText = getString("linksets_fetching_done_none_found");
+ statusText = getString("linksets_messaging_complete_none_found");
}
else
{
@@ -1092,12 +1109,12 @@ void LLFloaterPathfindingLinksets::updateLinksetsStatusMessage()
LLStringUtil::format_map_t string_args;
string_args["[NUM_SELECTED]"] = numSelectedItemsString;
string_args["[NUM_TOTAL]"] = numItemsString;
- statusText = getString("linksets_fetching_done_available", string_args);
+ statusText = getString("linksets_messaging_complete_available", string_args);
}
break;
- case kFetchInitial:
default:
- statusText = getString("linksets_fetching_initial");
+ statusText = getString("linksets_messaging_initial");
+ llassert(0);
break;
}
@@ -1222,6 +1239,9 @@ void LLFloaterPathfindingLinksets::applyEditFields()
void LLFloaterPathfindingLinksets::setEnableEditFields(BOOL pEnabled)
{
mEditPathState->setEnabled(pEnabled);
+ mEditPathStateWalkable->setEnabled(pEnabled);
+ mEditPathStateObstacle->setEnabled(pEnabled);
+ mEditPathStateIgnored->setEnabled(pEnabled);
mLabelWalkabilityCoefficients->setEnabled(pEnabled);
mLabelEditA->setEnabled(pEnabled);
mLabelEditB->setEnabled(pEnabled);
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h
index 915d799079..11750a2ca0 100644
--- a/indra/newview/llfloaterpathfindinglinksets.h
+++ b/indra/newview/llfloaterpathfindinglinksets.h
@@ -178,28 +178,32 @@ class LLFloaterPathfindingLinksets
public:
typedef enum
{
- kFetchInitial,
- kFetchStarting,
- kFetchRequestSent,
- kFetchRequestSent_MultiRequested,
- kFetchReceived,
- kFetchError,
- kFetchComplete
- } EFetchState;
+ kMessagingInitial,
+ kMessagingFetchStarting,
+ kMessagingFetchRequestSent,
+ kMessagingFetchRequestSent_MultiRequested,
+ kMessagingFetchReceived,
+ kMessagingFetchError,
+ kMessagingModifyStarting,
+ kMessagingModifyRequestSent,
+ kMessagingModifyReceived,
+ kMessagingModifyError,
+ kMessagingComplete
+ } EMessagingState;
virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
static void openLinksetsEditor();
- EFetchState getFetchState() const;
- BOOL isFetchInProgress() const;
+ EMessagingState getMessagingState() const;
+ BOOL isMessagingInProgress() const;
protected:
private:
PathfindingLinksets mPathfindingLinksets;
- EFetchState mFetchState;
+ EMessagingState mMessagingState;
LLScrollListCtrl *mLinksetsScrollList;
LLTextBase *mLinksetsStatus;
LLLineEditor *mFilterByName;
@@ -208,6 +212,9 @@ private:
LLCheckBoxCtrl *mFilterByObstacle;
LLCheckBoxCtrl *mFilterByIgnored;
LLRadioGroup *mEditPathState;
+ LLUICtrl *mEditPathStateWalkable;
+ LLUICtrl *mEditPathStateObstacle;
+ LLUICtrl *mEditPathStateIgnored;
LLTextBase *mLabelWalkabilityCoefficients;
LLTextBase *mLabelEditA;
LLTextBase *mLabelEditB;
@@ -235,7 +242,7 @@ private:
std::string getRegionName() const;
std::string getCapabilityURL() const;
- void setFetchState(EFetchState pFetchState);
+ void setMessagingState(EMessagingState pMessagingState);
void onApplyFiltersClicked();
void onClearFiltersClicked();
diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp
index bb08f00f40..6f6ebc184a 100644
--- a/indra/newview/llnavmeshstation.cpp
+++ b/indra/newview/llnavmeshstation.cpp
@@ -36,60 +36,15 @@ LLNavMeshStation::LLNavMeshStation()
{
}
//===============================================================================
-class LLNavMeshUploadResponder : public LLCurl::Responder
-{
-public:
- LLNavMeshUploadResponder( const LLHandle<LLNavMeshObserver>& observer_handle )
- : mObserverHandle( observer_handle )
- {
- }
-
- void clearPendingRequests ( void )
- {
- }
-
- void error( U32 statusNum, const std::string& reason )
- {
- //statusNum;
- llwarns << "Transport error "<<reason<<llendl;
- }
-
- void result( const LLSD& content )
- {
- llinfos<<"Content received"<<llendl;
- //TODO# some sanity checking
- if ( content.has("error") )
- {
- llwarns << "Error on fetched data"<< llendl;
- }
- else
- {
- LLNavMeshObserver* pObserver = mObserverHandle.get();
- if ( pObserver )
- {
- llinfos<<"Do something immensely important w/content"<<llendl;
- //pObserver->execute();
- }
- }
- }
-
-private:
- //Observer handle
- LLHandle<LLNavMeshObserver> mObserverHandle;
-};
-//===============================================================================
class LLNavMeshDownloadResponder : public LLCurl::Responder
{
public:
- LLNavMeshDownloadResponder( const LLHandle<LLNavMeshDownloadObserver>& observer_handle )
+ LLNavMeshDownloadResponder( const LLHandle<LLNavMeshDownloadObserver>& observer_handle, int dir )
: mObserverHandle( observer_handle )
+ , mDir( dir )
{
}
- void clearPendingRequests ( void )
- {
- }
-
void error( U32 statusNum, const std::string& reason )
{
//statusNum;
@@ -99,11 +54,10 @@ public:
void result( const LLSD& content )
{
llinfos<<"Content received"<<llendl;
- //TODO# some sanity checking
if ( content.has("error") )
{
llwarns << "Error on fetched data"<< llendl;
- llinfos<<"LLsd buffer on error"<<ll_pretty_print_sd(content)<<llendl;
+ //llinfos<<"LLsd buffer on error"<<ll_pretty_print_sd(content)<<llendl;
}
else
{
@@ -114,7 +68,7 @@ public:
if ( content.has("navmesh_data") )
{
const LLSD::Binary& stuff = content["navmesh_data"].asBinary();
- LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff );
+ LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff, mDir );
}
else
{
@@ -127,38 +81,10 @@ public:
private:
//Observer handle
LLHandle<LLNavMeshDownloadObserver> mObserverHandle;
+ int mDir;
};
-
-//===============================================================================
-bool LLNavMeshStation::postNavMeshToServer( LLSD& data, const LLHandle<LLNavMeshObserver>& observerHandle )
-{
- mCurlRequest = new LLCurlRequest();
-
- if ( mNavMeshUploadURL.empty() )
- {
- llinfos << "Unable to upload navmesh because of missing URL" << llendl;
- }
- else
- {
- LLCurlRequest::headers_t headers;
- mCurlRequest->post( mNavMeshUploadURL, headers, data,
- new LLNavMeshUploadResponder(/*this, data,*/ observerHandle ) );
- do
- {
- mCurlRequest->process();
- //sleep for 10ms to prevent eating a whole core
- apr_sleep(10000);
- } while ( mCurlRequest->getQueued() > 0 );
- }
-
- delete mCurlRequest;
-
- mCurlRequest = NULL;
-
- return true;
-}
//===============================================================================
-void LLNavMeshStation::downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle )
+void LLNavMeshStation::downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle, int dir )
{
if ( mNavMeshDownloadURL.empty() )
{
@@ -169,7 +95,7 @@ void LLNavMeshStation::downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObser
LLSD data;
data["agent_id"] = gAgent.getID();
data["region_id"] = gAgent.getRegion()->getRegionID();
- LLHTTPClient::post(mNavMeshDownloadURL, data, new LLNavMeshDownloadResponder( observerHandle ) );
+ LLHTTPClient::post(mNavMeshDownloadURL, data, new LLNavMeshDownloadResponder( observerHandle, dir ) );
}
}
//===============================================================================
diff --git a/indra/newview/llnavmeshstation.h b/indra/newview/llnavmeshstation.h
index 10d35786b8..c8e23513eb 100644
--- a/indra/newview/llnavmeshstation.h
+++ b/indra/newview/llnavmeshstation.h
@@ -31,7 +31,7 @@
#include "llhandle.h"
//===============================================================================
class LLCurlRequest;
-class LLMessageSystem;
+class LLFloaterPathfindingConsole;
//===============================================================================
class LLNavMeshObserver
{
@@ -47,7 +47,6 @@ protected:
LLRootHandle<LLNavMeshObserver> mObserverHandle;
};
//===============================================================================
-//prep#TODO# determine if a name change is needed?
class LLNavMeshDownloadObserver
{
public:
@@ -57,9 +56,12 @@ public:
virtual ~LLNavMeshDownloadObserver() {}
//Accessor for the observers handle
const LLHandle<LLNavMeshDownloadObserver>& getObserverHandle() const { return mObserverHandle; }
+ LLFloaterPathfindingConsole *getPathfindingConsole() {return mPathfindingConsole;}
+ void setPathfindingConsole(LLFloaterPathfindingConsole *pPathfindingConsole) {mPathfindingConsole = pPathfindingConsole;}
protected:
LLRootHandle<LLNavMeshDownloadObserver> mObserverHandle;
+ LLFloaterPathfindingConsole *mPathfindingConsole;
};
//===============================================================================
class LLNavMeshStation : public LLSingleton<LLNavMeshStation>
@@ -76,7 +78,7 @@ public:
//Callback to handle the requested src data for this regions navmesh src
static void processNavMeshSrc( LLMessageSystem* msg, void** );
//Initiate download of the navmesh source from the server
- void downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle );
+ void downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle, int dir );
protected:
//Curl object to facilitate posts to server
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 66df7dae3e..65393cc168 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -346,6 +346,19 @@ void LLSurface::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegio
}
}
+
+void LLSurface::getNeighboringRegionsStatus( std::vector<S32>& regions )
+{
+ S32 i;
+ for (i = 0; i < 8; i++)
+ {
+ if ( mNeighbors[i] != NULL )
+ {
+ regions.push_back( i );
+ }
+ }
+}
+
void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
{
S32 i;
diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h
index a4ef4fe2de..8052fb0d18 100644
--- a/indra/newview/llsurface.h
+++ b/indra/newview/llsurface.h
@@ -142,6 +142,7 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLSurface &S);
void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+ void getNeighboringRegionsStatus( std::vector<S32>& regions );
public:
// Number of grid points on one side of a region, including +1 buffer for
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 978580498e..cc4cac4202 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1522,9 +1522,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("MeshUploadFlag");
capabilityNames.append("NavMeshUpload");
capabilityNames.append("NewFileAgentInventory");
-#ifdef XXX_STINSON_REGION_CAP_RENAME
- capabilityNames.append("ObjectNavmesh");
-#endif // XXX_STINSON_REGION_CAP_RENAME
capabilityNames.append("ObjectNavMeshProperties");
capabilityNames.append("ParcelPropertiesUpdate");
capabilityNames.append("ParcelMediaURLFilterList");
@@ -1799,7 +1796,10 @@ void LLViewerRegion::getNeighboringRegions( std::vector<LLViewerRegion*>& unique
{
mImpl->mLandp->getNeighboringRegions( uniqueRegions );
}
-
+void LLViewerRegion::getNeighboringRegionsStatus( std::vector<S32>& regions )
+{
+ mImpl->mLandp->getNeighboringRegionsStatus( regions );
+}
void LLViewerRegion::showReleaseNotes()
{
std::string url = this->getCapability("ServerReleaseNotes");
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 59b7234f43..6004165b0e 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -44,9 +44,6 @@
#include "m4math.h" // LLMatrix4
#include "llhttpclient.h"
-// This definition is a reminder to remove the extra call to check for both capability names for the ObjectNavMeshProperties service
-#define XXX_STINSON_REGION_CAP_RENAME
-
// Surface id's
#define LAND 1
#define WATER 2
@@ -328,6 +325,7 @@ public:
bool objectsCrossParcel(const std::vector<LLBBox>& boxes) const;
void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+ void getNeighboringRegionsStatus( std::vector<S32>& regions );
public:
struct CompareDistance
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml
index 5716ec30b7..7b751d525f 100644
--- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml
@@ -11,6 +11,12 @@
single_instance="true"
title="Pathfinding"
width="833">
+ <floater.string name="navmesh_fetch_initial"></floater.string>
+ <floater.string name="navmesh_fetch_inprogress">Downloading the navmesh ...</floater.string>
+ <floater.string name="navmesh_fetch_complete_available">Navmesh received.</floater.string>
+ <floater.string name="navmesh_fetch_complete_none">No navmesh for region.</floater.string>
+ <floater.string name="navmesh_region_not_enabled">Pathfinding is not enabled for this region.</floater.string>
+ <floater.string name="navmesh_library_not_implemented">Cannot find pathing library implementation.</floater.string>
<text
height="13"
word_wrap="true"
@@ -240,14 +246,14 @@ to see the path between them.
word_wrap="true"
use_ellipses="false"
type="string"
- text_color="DrYellow"
+ text_color="LabelTextColor"
length="1"
follows="left|top"
layout="topleft"
left="240"
+ name="pathfinding_status"
top_pad="10"
width="208">
- Result: No path found.
</text>
<view_border
bevel_style="none"
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
index 81d9376fee..e5d06481e5 100644
--- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
@@ -11,14 +11,18 @@
single_instance="true"
title="Pathfinding linksets"
width="950">
- <floater.string name="linksets_fetching_initial"></floater.string>
- <floater.string name="linksets_fetching_starting">Building query for pathfinding linksets ...</floater.string>
- <floater.string name="linksets_fetching_inprogress">Querying for pathfinding linksets ...</floater.string>
- <floater.string name="linksets_fetching_inprogress_multi_request">Querying for pathfinding linksets (already in progress) ...</floater.string>
- <floater.string name="linksets_fetching_received">Loading pathfinding linksets data from response ...</floater.string>
- <floater.string name="linksets_fetching_error">Error detected while querying for pathfinding linksets</floater.string>
- <floater.string name="linksets_fetching_done_none_found">No pathfinding linksets</floater.string>
- <floater.string name="linksets_fetching_done_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL]</floater.string>
+ <floater.string name="linksets_messaging_initial"></floater.string>
+ <floater.string name="linksets_messaging_fetch_starting">Building query for pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_inprogress">Querying for pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_inprogress_multi_request">Querying for pathfinding linksets (already in progress) ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_received">Loading pathfinding linksets data from response ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_error">Error detected while querying for pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_modify_starting">Building modify message for selected pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_modify_inprogress">Modifying selected pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_modify_received">Loading modified pathfinding linksets data from response ...</floater.string>
+ <floater.string name="linksets_messaging_modify_error">Error detected while modifying for pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_complete_none_found">No pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_complete_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL]</floater.string>
<floater.string name="linkset_path_state_walkable">Walkable</floater.string>
<floater.string name="linkset_path_state_obstacle">Obstacle</floater.string>
<floater.string name="linkset_path_state_ignored">Ignored</floater.string>