Allow DebugDraw not to flush the draw queue

This commit is contained in:
James Urquhart 2016-06-04 12:22:57 +01:00
parent 0ac3d95cb9
commit 1b2abbeaaa
2 changed files with 5 additions and 3 deletions

View file

@ -210,7 +210,7 @@ void DebugDrawer::drawTransformedBoxOutline(const Point3F &a, const Point3F &b,
drawLine(point3, point7, color);
}
void DebugDrawer::render()
void DebugDrawer::render(bool clear)
{
#ifdef ENABLE_DEBUGDRAW
if(!isDrawing)
@ -335,7 +335,7 @@ void DebugDrawer::render()
shouldToggleFreeze = false;
}
if(p->dieTime <= curTime && !isFrozen && p->dieTime != U32_MAX)
if(clear && p->dieTime <= curTime && !isFrozen && p->dieTime != U32_MAX)
{
*walk = p->next;
mPrimChunker.free(p);

View file

@ -105,7 +105,9 @@ public:
static void init();
/// Called globally to render debug draw state. Also does state updates.
void render();
void render(bool clear=true);
bool willDraw() { return isDrawing && mHead; }
void toggleFreeze() { shouldToggleFreeze = true; };
void toggleDrawing()