From 971a060bbb6cb092532634e9ed8884ea7f921fea Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Fri, 5 Sep 2008 06:22:18 +0000 Subject: [PATCH] Define btAssert as empty in non-debug builds. GL_DEPTH_BUFFER_BIT -> GL_DEPTH_TEST, thanks to Mihail Isakov, http://code.google.com/p/bullet/issues/detail?id=86 --- Demos/OpenGL/GL_ShapeDrawer.cpp | 4 ++-- .../CollisionDispatch/btBoxBoxDetector.cpp | 4 ++-- src/LinearMath/btScalar.h | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Demos/OpenGL/GL_ShapeDrawer.cpp b/Demos/OpenGL/GL_ShapeDrawer.cpp index d9832b366..185e4424b 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.cpp +++ b/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -725,7 +725,7 @@ convexMesh->getMeshInterface()->InternalProcessAllTriangles(&drawCallback,aabbMi -glDisable(GL_DEPTH_BUFFER_BIT); +glDisable(GL_DEPTH_TEST); glRasterPos3f(0,0,0);//mvtx.x(), vtx.y(), vtx.z()); if (debugMode&btIDebugDraw::DBG_DrawText) { @@ -736,7 +736,7 @@ if (debugMode& btIDebugDraw::DBG_DrawFeaturesText) { //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo()); } -glEnable(GL_DEPTH_BUFFER_BIT); +glEnable(GL_DEPTH_TEST); // glPopMatrix(); if(m_textureenabled) glDisable(GL_TEXTURE_2D); diff --git a/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp b/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp index 85cfe39f2..9276b7117 100644 --- a/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp +++ b/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp @@ -226,7 +226,7 @@ void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[]) a = btScalar(j)*(2*M__PI/m) + A[i0]; if (a > M__PI) a -= 2*M__PI; btScalar maxdiff=1e9,diff; -#ifndef dNODEBUG +#if defined(DEBUG) || defined (_DEBUG) *iret = i0; // iret is not allowed to keep this value #endif for (i=0; i +#if defined(DEBUG) || defined (_DEBUG) #define btAssert assert +#else + #define btAssert(x) +#endif //btFullAssert is optional, slows down a lot #define btFullAssert(x) @@ -116,7 +120,13 @@ inline int btGetVersion() #ifndef assert #include #endif + +#if defined(DEBUG) || defined (_DEBUG) #define btAssert assert +#else + #define btAssert(x) +#endif + //btFullAssert is optional, slows down a lot #define btFullAssert(x) #define btLikely(_c) _c