initialize time-step statistics in a world; rename profile function

This commit is contained in:
Irlan
2018-04-26 23:51:20 -03:00
parent 16d351ecac
commit cd6c7e188a
5 changed files with 47 additions and 40 deletions

View File

@ -19,13 +19,13 @@
#include <bounce\bounce.h>
// We don't care for a profiler. This definition does nothing.
bool b3PushProfileScope(const char* name)
void b3BeginProfileScope(const char* name)
{
return false;
}
// We don't care for a profiler. This definition does nothing.
void b3PopProfileScope()
void b3EndProfileScope()
{
}

View File

@ -61,6 +61,8 @@ public:
// Add a profiler event to the queue.
// Return true if the even has been added to the event queue
// or false if the queue is full.
// You can control the maximum number of profiler events using
// MAX_PROFILER_EVENTS.
bool PushEvent(const char* name);
// Remove the top profiler event.

View File

@ -21,30 +21,24 @@
#include <imgui/imgui.h>
extern u32 b3_allocCalls, b3_maxAllocCalls;
extern u32 b3_convexCalls, b3_convexCacheHits;
extern u32 b3_gjkCalls, b3_gjkIters, b3_gjkMaxIters;
extern bool b3_convexCache;
extern u32 b3_convexCalls, b3_convexCacheHits;
bool b3PushProfileScope(const char* name)
void b3BeginProfileScope(const char* name)
{
return g_profiler->PushEvent(name);
g_profiler->PushEvent(name);
}
void b3PopProfileScope()
void b3EndProfileScope()
{
g_profiler->PopEvent();
}
Test::Test() : m_bodyDragger(&m_bodyRay, &m_world)
{
b3_allocCalls = 0;
b3_gjkCalls = 0;
b3_gjkIters = 0;
b3_gjkMaxIters = 0;
b3_convexCache = g_testSettings->convexCache;
b3_convexCalls = 0;
b3_convexCacheHits = 0;
b3Draw_draw = g_draw;
b3_convexCache = g_testSettings->convexCache;
m_world.SetContactListener(this);
@ -58,25 +52,12 @@ Test::Test() : m_bodyDragger(&m_bodyRay, &m_world)
Test::~Test()
{
b3_allocCalls = 0;
b3_gjkCalls = 0;
b3_gjkIters = 0;
b3_gjkMaxIters = 0;
b3_convexCache = false;
b3_convexCalls = 0;
b3_convexCacheHits = 0;
b3Draw_draw = nullptr;
}
void Test::Step()
{
b3_allocCalls = 0;
b3_gjkCalls = 0;
b3_gjkIters = 0;
b3_gjkMaxIters = 0;
b3_convexCache = g_testSettings->convexCache;
b3_convexCalls = 0;
b3_convexCacheHits = 0;
// Step
float32 dt = g_testSettings->inv_hertz;