remove depth changes

changing depth between draw modes is a bit confusing to the viewer could revist

PolyAreas must start with 1, 0 = null area in recast.
This commit is contained in:
marauder2k7 2025-07-24 15:01:28 +01:00
parent d1771756c2
commit de1642c33e
3 changed files with 5 additions and 32 deletions

View file

@ -62,7 +62,7 @@ unsigned int duDebugDrawTorque::areaToCol(unsigned int area)
{
switch (area)
{
// Ground (0) : light blue
// Ground (1) : light blue
case GroundArea: return duRGBA(0, 192, 255, 255);
// Water : blue
case WaterArea: return duRGBA(0, 0, 255, 255);
@ -94,6 +94,7 @@ void duDebugDrawTorque::begin(duDebugDrawPrimitives prim, float size)
mDesc.setCullMode(GFXCullCW);
mDesc.setBlend(false);
mDesc.setZReadWrite(true);
}
/// Submit a vertex

View file

@ -1534,22 +1534,6 @@ void NavMesh::renderToDrawer()
{
NavMesh* n = static_cast<NavMesh*>(no);
mDbgDraw.depthMask(false);
if (n->nm && m_drawMode != DRAWMODE_NAVMESH_TRANS)
{
if (m_drawMode != DRAWMODE_NAVMESH_INVIS)
duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
////const F32 texScale = 1.0f / (n->mCellSize * 10.0f); this draw mode is useless for us.
////duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
//if (n->m_geo != NULL)
//{
// duDebugDrawTriMeshSlope(&mDbgDraw, n->m_geo->getVerts(), n->m_geo->getVertCount(),
// n->m_geo->getTris(), n->m_geo->getNormals(), n->m_geo->getTriCount(), n->mWalkableSlope, texScale);
//}
}
if (n->nm &&
(m_drawMode == DRAWMODE_NAVMESH ||
m_drawMode == DRAWMODE_NAVMESH_TRANS ||
@ -1558,14 +1542,14 @@ void NavMesh::renderToDrawer()
m_drawMode == DRAWMODE_NAVMESH_PORTALS ||
m_drawMode == DRAWMODE_NAVMESH_INVIS))
{
if (m_drawMode != DRAWMODE_NAVMESH_INVIS)
duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
if(m_drawMode == DRAWMODE_NAVMESH_BVTREE)
duDebugDrawNavMeshBVTree(&mDbgDraw, *n->nm);
if(m_drawMode == DRAWMODE_NAVMESH_PORTALS)
duDebugDrawNavMeshPortals(&mDbgDraw, *n->nm);
}
mDbgDraw.depthMask(true);
for (Tile& tile : n->mTiles)
{
if (tile.chf && m_drawMode == DRAWMODE_COMPACT)
@ -1595,47 +1579,35 @@ void NavMesh::renderToDrawer()
if (tile.cset && m_drawMode == DRAWMODE_RAW_CONTOURS)
{
mDbgDraw.depthMask(false);
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
mDbgDraw.depthMask(true);
}
if (tile.cset && m_drawMode == DRAWMODE_BOTH_CONTOURS)
{
mDbgDraw.depthMask(false);
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
duDebugDrawContours(&mDbgDraw, *tile.cset);
mDbgDraw.depthMask(true);
}
if (tile.cset && m_drawMode == DRAWMODE_CONTOURS)
{
mDbgDraw.depthMask(false);
duDebugDrawContours(&mDbgDraw, *tile.cset);
mDbgDraw.depthMask(true);
}
if (tile.chf && tile.cset && m_drawMode == DRAWMODE_REGION_CONNECTIONS)
{
duDebugDrawCompactHeightfieldRegions(&mDbgDraw, *tile.chf);
mDbgDraw.depthMask(false);
duDebugDrawRegionConnections(&mDbgDraw, *tile.cset);
mDbgDraw.depthMask(true);
}
if (tile.pmesh && m_drawMode == DRAWMODE_POLYMESH)
{
mDbgDraw.depthMask(false);
duDebugDrawPolyMesh(&mDbgDraw, *tile.pmesh);
mDbgDraw.depthMask(true);
}
if (tile.dmesh && m_drawMode == DRAWMODE_POLYMESH_DETAIL)
{
mDbgDraw.depthMask(false);
duDebugDrawPolyMeshDetail(&mDbgDraw, *tile.dmesh);
mDbgDraw.depthMask(true);
}
}

View file

@ -52,7 +52,7 @@ inline void rcCol(unsigned int col, U8 &r, U8 &g, U8 &b, U8 &a)
}
enum PolyAreas {
GroundArea,
GroundArea = 1,
WaterArea,
OffMeshArea,
NumAreas