summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2011-12-14 16:07:47 -0500
committerprep <prep@lindenlab.com>2011-12-14 16:07:47 -0500
commit7f8aebf78bddf0d15180700162da1728cb5a2bbf (patch)
tree9b0ad2556f8222e5f221f7912b86fafa49019cc5 /indra/newview/llviewerdisplay.cpp
parent35b6450d10b826a6bbb60e9dc00e8eaafa8b0d26 (diff)
Moved navmesh rendering invocation into viewerdisplay.
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp47
1 files changed, 45 insertions, 2 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index cb40af7061..b33d8904fc 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -77,6 +77,7 @@
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llpostprocess.h"
+#include "llpathinglib.h"
extern LLPointer<LLViewerTexture> gStartTexture;
@@ -880,7 +881,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderGeom");
-
+ bool exclusiveDraw = false;
if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
&& !gRestoreGL)
{
@@ -893,9 +894,51 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
else
{
- gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
+ //Render any navmesh geometry
+ if ( LLPathingLib::getInstance() )
+ {
+ //prep#
+ if ( LLPathingLib::getInstance()->getRenderNavMeshState() )
+ {
+ glClearColor(0,0,0,0);
+ glEnable(GL_TEXTURE_2D);
+ glShadeModel(GL_SMOOTH);
+ glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
+ glClearDepth(1.0f);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
+ GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
+ glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
+
+ LLPathingLib::getInstance()->renderNavMesh();
+ exclusiveDraw = true;
+ }
+
+ if ( LLPathingLib::getInstance()->getRenderShapeState() )
+ {
+ glClearColor(0,0,0,0);
+ glEnable(GL_TEXTURE_2D);
+ glShadeModel(GL_SMOOTH);
+ glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
+ glClearDepth(1.0f);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
+ GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
+ glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
+ LLGLSUIDefault texture_state;
+ LLGLDepthTest gls_depth(GL_TRUE);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ LLPathingLib::getInstance()->renderNavMeshShapesVBO();
+ exclusiveDraw = true;
+ }
+ }
}
+ if ( !exclusiveDraw )
+ {
+ gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE);
+ }
+
gGL.setColorMask(true, true);
//store this frame's modelview matrix for use