1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-19 15:09:43 +00:00

Use different alpha color for navmesh tiles with non zero user id

This commit is contained in:
elsid 2021-11-01 21:00:40 +01:00
parent 3c41d0efc3
commit 0511a81baa
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -105,14 +105,15 @@ namespace
dd->end();
}
// Copied from https://github.com/recastnavigation/recastnavigation/blob/c5cbd53024c8a9d8d097a4371215e3342d2fdc87/DebugUtils/Source/DetourDebugDraw.cpp#L120-L235
// Based on https://github.com/recastnavigation/recastnavigation/blob/c5cbd53024c8a9d8d097a4371215e3342d2fdc87/DebugUtils/Source/DetourDebugDraw.cpp#L120-L235
void drawMeshTile(duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery* query,
const dtMeshTile* tile, unsigned char flags)
{
dtPolyRef base = mesh.getPolyRefBase(tile);
int tileNum = mesh.decodePolyIdTile(base);
const unsigned int tileColor = duIntToCol(tileNum, 128);
const unsigned int tileNumColor = duIntToCol(tileNum, 128);
const unsigned alpha = tile->header->userId == 0 ? 64 : 128;
dd->depthMask(false);
@ -127,13 +128,13 @@ namespace
unsigned int col;
if (query && query->isInClosedList(base | (dtPolyRef)i))
col = duRGBA(255,196,0,64);
col = duRGBA(255, 196, 0, alpha);
else
{
if (flags & DU_DRAWNAVMESH_COLOR_TILES)
col = tileColor;
col = duTransCol(tileNumColor, alpha);
else
col = duTransCol(dd->areaToCol(p->getArea()), 64);
col = duTransCol(dd->areaToCol(p->getArea()), alpha);
}
for (int j = 0; j < pd->triCount; ++j)