From 1b2abbeaaaff1e641c211c66f4c307ddbf1f5351 Mon Sep 17 00:00:00 2001 From: James Urquhart Date: Sat, 4 Jun 2016 12:22:57 +0100 Subject: [PATCH] Allow DebugDraw not to flush the draw queue --- Engine/source/gfx/sim/debugDraw.cpp | 4 ++-- Engine/source/gfx/sim/debugDraw.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Engine/source/gfx/sim/debugDraw.cpp b/Engine/source/gfx/sim/debugDraw.cpp index 2625d1ebe..8a591fc26 100644 --- a/Engine/source/gfx/sim/debugDraw.cpp +++ b/Engine/source/gfx/sim/debugDraw.cpp @@ -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); diff --git a/Engine/source/gfx/sim/debugDraw.h b/Engine/source/gfx/sim/debugDraw.h index bfc2b6547..ddaba1164 100644 --- a/Engine/source/gfx/sim/debugDraw.h +++ b/Engine/source/gfx/sim/debugDraw.h @@ -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()