Browse Source

Allow DebugDraw not to flush the draw queue

James Urquhart 9 years ago
parent
commit
1b2abbeaaa
2 changed files with 5 additions and 3 deletions
  1. 2 2
      Engine/source/gfx/sim/debugDraw.cpp
  2. 3 1
      Engine/source/gfx/sim/debugDraw.h

+ 2 - 2
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);

+ 3 - 1
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()