summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-18 18:22:06 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-18 18:22:06 -0700
commitd2850572a452d74625a9b736563c479bc5f1e4cc (patch)
treeaa9a804ba0973230d11cead43e6171e3680d5f9d /indra
parent1cdef4903daea1622923550b1328b659a594b029 (diff)
Updating llpathinglibrary method calls to cleaned-up version of the library interface.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp90
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h15
-rw-r--r--indra/newview/pipeline.cpp20
3 files changed, 25 insertions, 100 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 59f72edc61..92011a9524 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -333,85 +333,55 @@ void LLFloaterPathfindingConsole::setRenderXRay(BOOL pIsRenderXRay)
mShowXRayCheckBox->set(pIsRenderXRay);
}
-LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::getRenderHeatmapType() const
+LLPathingLib::LLPLCharacterType LLFloaterPathfindingConsole::getRenderHeatmapType() const
{
- ERenderHeatmapType renderHeatmapType;
+ LLPathingLib::LLPLCharacterType renderHeatmapType;
switch (mShowNavMeshWalkabilityComboBox->getValue().asInteger())
{
case XUI_RENDER_HEATMAP_NONE :
- renderHeatmapType = kRenderHeatmapNone;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
break;
case XUI_RENDER_HEATMAP_A :
- renderHeatmapType = kRenderHeatmapA;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_A;
break;
case XUI_RENDER_HEATMAP_B :
- renderHeatmapType = kRenderHeatmapB;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_B;
break;
case XUI_RENDER_HEATMAP_C :
- renderHeatmapType = kRenderHeatmapC;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_C;
break;
case XUI_RENDER_HEATMAP_D :
- renderHeatmapType = kRenderHeatmapD;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_D;
break;
default :
- renderHeatmapType = kRenderHeatmapNone;
+ renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
llassert(0);
break;
}
- LLPathingLib::getInstance()->rebuildNavMesh( getHeatMapType() );
return renderHeatmapType;
}
-int LLFloaterPathfindingConsole::getHeatMapType() const
-{
- //converts the pathfinding console values to the navmesh filter values
-
- int renderHeatmapType = 4; //none
-
- switch ( mShowNavMeshWalkabilityComboBox->getValue().asInteger() )
- {
- case XUI_RENDER_HEATMAP_A :
- renderHeatmapType = 0;
- break;
- case XUI_RENDER_HEATMAP_B :
- renderHeatmapType = 1;
- break;
- case XUI_RENDER_HEATMAP_C :
- renderHeatmapType = 2;
- break;
- case XUI_RENDER_HEATMAP_D :
- renderHeatmapType = 3;
- break;
- default :
- renderHeatmapType = 4;
- break;
- }
-
- return renderHeatmapType;
-}
-
-
-void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType)
+void LLFloaterPathfindingConsole::setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType)
{
LLSD comboBoxValue;
switch (pRenderHeatmapType)
{
- case kRenderHeatmapNone :
+ case LLPathingLib::LLPL_CHARACTER_TYPE_NONE :
comboBoxValue = XUI_RENDER_HEATMAP_NONE;
break;
- case kRenderHeatmapA :
+ case LLPathingLib::LLPL_CHARACTER_TYPE_A :
comboBoxValue = XUI_RENDER_HEATMAP_A;
break;
- case kRenderHeatmapB :
+ case LLPathingLib::LLPL_CHARACTER_TYPE_B :
comboBoxValue = XUI_RENDER_HEATMAP_B;
break;
- case kRenderHeatmapC :
+ case LLPathingLib::LLPL_CHARACTER_TYPE_C :
comboBoxValue = XUI_RENDER_HEATMAP_C;
break;
- case kRenderHeatmapD :
+ case LLPathingLib::LLPL_CHARACTER_TYPE_D :
comboBoxValue = XUI_RENDER_HEATMAP_D;
break;
default :
@@ -470,37 +440,7 @@ LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole()
void LLFloaterPathfindingConsole::onShowWalkabilitySet()
{
- switch (getRenderHeatmapType())
- {
- case kRenderHeatmapNone :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapNone"
- << llendl;
- break;
- case kRenderHeatmapA :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapA"
- << llendl;
- break;
- case kRenderHeatmapB :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapB"
- << llendl;
- break;
- case kRenderHeatmapC :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapC"
- << llendl;
- break;
- case kRenderHeatmapD :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapD"
- << llendl;
- break;
- default :
- llassert(0);
- break;
- }
+ LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType());
}
void LLFloaterPathfindingConsole::onViewCharactersClicked()
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index ff8a1d5517..174ceb91ea 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -54,15 +54,6 @@ class LLFloaterPathfindingConsole
friend class LLFloaterReg;
public:
- typedef enum
- {
- kRenderHeatmapNone,
- kRenderHeatmapA,
- kRenderHeatmapB,
- kRenderHeatmapC,
- kRenderHeatmapD
- } ERenderHeatmapType;
-
virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
virtual void onClose(bool pIsAppQuitting);
@@ -93,10 +84,8 @@ public:
BOOL isRenderAnyShapes() const;
U32 getRenderShapeFlags();
- ERenderHeatmapType getRenderHeatmapType() const;
- void setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType);
-
- int getHeatMapType() const;
+ LLPathingLib::LLPLCharacterType getRenderHeatmapType() const;
+ void setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType);
protected:
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 9120d0efa2..d79812aa1b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4369,17 +4369,15 @@ void LLPipeline::renderDebug()
LLGLEnable cull(GL_CULL_FACE);
LLGLDisable blend(GL_BLEND);
- int materialIndex = pathfindingConsole->getHeatMapType();
-
if ( pathfindingConsole->isRenderWorld() )
{
LLGLEnable blend(GL_BLEND);
gPathfindingProgram.uniform1f("alpha_scale", 0.66f);
- llPathingLibInstance->renderNavMesh( materialIndex );
+ llPathingLibInstance->renderNavMesh();
}
else
{
- llPathingLibInstance->renderNavMesh( materialIndex );
+ llPathingLibInstance->renderNavMesh();
}
//render edges
@@ -4388,12 +4386,12 @@ void LLPipeline::renderDebug()
gPathfindingNoNormalsProgram.bind();
gPathfindingNoNormalsProgram.uniform1f("tint", 1.f);
gPathfindingNoNormalsProgram.uniform1f("alpha_scale", 1.f);
- llPathingLibInstance->renderNavMeshEdges( materialIndex );
+ llPathingLibInstance->renderNavMeshEdges();
gPathfindingProgram.bind();
}
else
{
- llPathingLibInstance->renderNavMeshEdges( materialIndex );
+ llPathingLibInstance->renderNavMeshEdges();
}
gGL.flush();
@@ -4550,8 +4548,6 @@ void LLPipeline::renderDebug()
glLineWidth(2.0f);
LLGLEnable cull(GL_CULL_FACE);
- int materialIndex = pathfindingConsole->getHeatMapType();
-
gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
@@ -4559,13 +4555,13 @@ void LLPipeline::renderDebug()
{ //draw hidden wireframe as darker and less opaque
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
gPathfindingProgram.uniform1f("ambiance", 1.f);
- llPathingLibInstance->renderNavMesh( materialIndex );
+ llPathingLibInstance->renderNavMesh();
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
else
{
gPathfindingProgram.uniform1f("ambiance", ambiance);
- llPathingLibInstance->renderNavMesh( materialIndex );
+ llPathingLibInstance->renderNavMesh();
}
//render edges
@@ -4574,12 +4570,12 @@ void LLPipeline::renderDebug()
gPathfindingNoNormalsProgram.bind();
gPathfindingNoNormalsProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
gPathfindingNoNormalsProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
- llPathingLibInstance->renderNavMeshEdges( materialIndex );
+ llPathingLibInstance->renderNavMeshEdges();
gPathfindingProgram.bind();
}
else
{
- llPathingLibInstance->renderNavMeshEdges( materialIndex );
+ llPathingLibInstance->renderNavMeshEdges();
}
gGL.flush();