Make sure that no debug drawing happens if debug mode is disabled

(turns out that besides out explicit calls to debug drawing bullet
includes additional calls, and they were still executed even if
debug was disabled).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10048 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-10-26 21:17:24 +00:00
parent 9251f75064
commit 1099f3aa69

View File

@ -41,7 +41,13 @@ class IrrDebugDrawer : public btIDebugDraw
DebugModeType m_debug_mode;
protected:
virtual void setDebugMode(int debug_mode) {}
virtual int getDebugMode() const { return DBG_DrawWireframe;}
/** Callback for bullet: if debug drawing should be done or not.
* Note that getDebugMode is even called when debug_drawing is disabled
* (i.e. not via Physics::draw()), but internally from bullet. So
* we have to make sure to return nodebug if debugging is disabled. */
virtual int getDebugMode() const
{ return m_debug_mode==DM_NONE ? DBG_NoDebug
: DBG_DrawWireframe;}
public:
IrrDebugDrawer();
void render(float dt);