Recast: duDebugDrawGridXY cleanup

Renamed duDebugDrawGridXY_TF2 to duDebugDrawGridXY and removed the old implementation of duDebugDrawGridXY.
This commit is contained in:
Kawe Mazidjatari 2024-07-01 13:24:43 +02:00
parent 8b51403310
commit bc94f59439
3 changed files with 5 additions and 28 deletions

View File

@ -451,7 +451,7 @@ void Editor_TileMesh::handleRender()
const int tw = (gw + (int)m_tileSize-1) / (int)m_tileSize;
const int th = (gh + (int)m_tileSize-1) / (int)m_tileSize;
const float s = m_tileSize*m_cellSize;
duDebugDrawGridXY_TF2(&m_dd, bmax[0],bmin[1],bmin[2], tw,th, s, duRGBA(0,0,0,64), 1.0f);
duDebugDrawGridXY(&m_dd, bmax[0],bmin[1],bmin[2], tw,th, s, duRGBA(0,0,0,64), 1.0f);
// Draw active tile
duDebugDrawBoxWire(&m_dd, m_lastBuiltTileBmin[0],m_lastBuiltTileBmin[1],m_lastBuiltTileBmin[2],

View File

@ -161,10 +161,6 @@ void duDebugDrawGridXY(struct duDebugDraw* dd, const float ox, const float oy, c
const int w, const int h, const float size,
const unsigned int col, const float lineWidth);
void duDebugDrawGridXY_TF2(struct duDebugDraw* dd, const float max_x, const float oy, const float oz,
const int w, const int h, const float size,
const unsigned int col, const float lineWidth);
// Versions without begin/end, can be used to draw multiple primitives.
void duAppendCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz,
float maxx, float maxy, float maxz, unsigned int col);

View File

@ -187,36 +187,17 @@ void duDebugDrawGridXY(struct duDebugDraw* dd, const float ox, const float oy, c
dd->begin(DU_DRAW_LINES, lineWidth);
for (int i = 0; i <= h; ++i)
{
dd->vertex(ox, oy + i * size, oz, col);
dd->vertex(ox + w * size, oy + i * size, oz, col);
dd->vertex(ox,oy+i*size,oz, col);
dd->vertex(ox-w*size,oy+i*size,oz, col);
}
for (int i = 0; i <= w; ++i)
{
dd->vertex(ox + i * size, oy, oz, col);
dd->vertex(ox + i * size, oy + h * size, oz , col);
dd->vertex(ox-i*size,oy,oz, col);
dd->vertex(ox-i*size,oy+h*size,oz, col);
}
dd->end();
}
void duDebugDrawGridXY_TF2(struct duDebugDraw* dd, const float max_x, const float oy, const float oz,
const int w, const int h, const float size,
const unsigned int col, const float lineWidth)
{
if (!dd) return;
dd->begin(DU_DRAW_LINES, lineWidth);
for (int i = 0; i <= h; ++i)
{
dd->vertex(max_x, oy + i * size, oz, col);
dd->vertex(max_x - w * size, oy + i * size, oz, col);
}
for (int i = 0; i <= w; ++i)
{
dd->vertex(max_x - i * size, oy, oz, col);
dd->vertex(max_x - i * size, oy + h * size, oz, col);
}
dd->end();
}
void duAppendCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz,
float maxx, float maxy, float maxz, unsigned int col)
{