OSDN Git Service

Fixes - had to abstract clock function for Windows support
authorryan <>
Fri, 11 Mar 2011 04:52:21 +0000 (04:52 +0000)
committerryan <>
Fri, 11 Mar 2011 04:52:21 +0000 (04:52 +0000)
ogrebullet/Dynamics/include/OgreBulletDynamicsWorld.h
ogrebullet/Dynamics/src/OgreBulletDynamicsWorld.cpp
src/sbs/profiler.cpp
src/sbs/profiler.h

index 826059b..f1f2ac8 100644 (file)
@@ -36,6 +36,28 @@ THE SOFTWARE.
 #include "OgreBulletCollisionsWorld.h"
 #include "Debug/OgreBulletCollisionsDebugDrawer.h"
 
+class _OgreBulletExport oClock\r
+{\r
+public:\r
+       oClock();\r
+\r
+       ~oClock();\r
+\r
+       /// Resets the initial reference time.\r
+       void reset();\r
+\r
+       /// Returns the time in ms since the last call to reset or since \r
+       /// the btClock was created.\r
+       unsigned long int getTimeMilliseconds();\r
+\r
+       /// Returns the time in us since the last call to reset or since \r
+       /// the Clock was created.\r
+       unsigned long int getTimeMicroseconds();\r
+\r
+private:\r
+       btClock *clock;\r
+};\r
+
 namespace OgreBulletDynamics
 {
     // -------------------------------------------------------------------------
index b329170..3e4ce58 100644 (file)
@@ -45,6 +45,32 @@ THE SOFTWARE.
 using namespace Ogre;
 using namespace OgreBulletCollisions;
 
+oClock::oClock()
+{
+       clock = new btClock();
+}
+
+oClock::~oClock()
+{
+       delete clock;
+       clock = 0;
+}
+
+void oClock::reset()
+{
+       clock->reset();
+}
+
+unsigned long int oClock::getTimeMilliseconds()
+{
+       return clock->getTimeMilliseconds();
+}
+
+unsigned long int oClock::getTimeMicroseconds()
+{
+       return clock->getTimeMicroseconds();
+}
+
 namespace OgreBulletDynamics
 {
 
index 07ffbc8..a86efd8 100644 (file)
@@ -1,9 +1,10 @@
+#include <OgreBulletDynamicsWorld.h>
 #include "globals.h"
 #include "sbs.h"
 #include "profiler.h"
 
 extern SBS *sbs; //external pointer to the SBS engine
-static btClock gProfileClock;
+static oClock gProfileClock;
 
 /*
 
index cf7dec9..f681a59 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _SBS_PROFILER_H
 #define _SBS_PROFILER_H
 
-#include "LinearMath/btQuickprof.h"
-
 #define ENABLE_PROFILING
 
 /***************************************************************************************************