centralize profiler declaration
This commit is contained in:
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <testbed/framework/profiler.h>
|
#include <testbed/framework/profiler.h>
|
||||||
#include <bounce/common/profiler.h>
|
|
||||||
#include <bounce/common/time.h>
|
#include <bounce/common/time.h>
|
||||||
#include <bounce/common/template/queue.h>
|
#include <bounce/common/template/queue.h>
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include <bounce/common/settings.h>
|
#include <bounce/common/settings.h>
|
||||||
#include <bounce/common/time.h>
|
#include <bounce/common/time.h>
|
||||||
#include <bounce/common/profiler.h>
|
|
||||||
#include <bounce/common/draw.h>
|
#include <bounce/common/draw.h>
|
||||||
|
|
||||||
#include <bounce/common/math/math.h>
|
#include <bounce/common/math/math.h>
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016-2016 Irlan Robson http://www.irlan.net
|
|
||||||
*
|
|
||||||
* This software is provided 'as-is', without any express or implied
|
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
|
||||||
* arising from the use of this software.
|
|
||||||
* Permission is granted to anyone to use this software for any purpose,
|
|
||||||
* including commercial applications, and to alter it and redistribute it
|
|
||||||
* freely, subject to the following restrictions:
|
|
||||||
* 1. The origin of this software must not be misrepresented; you must not
|
|
||||||
* claim that you wrote the original software. If you use this software
|
|
||||||
* in a product, an acknowledgment in the product documentation would be
|
|
||||||
* appreciated but is not required.
|
|
||||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
* misrepresented as being the original software.
|
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef B3_PROFILER_H
|
|
||||||
#define B3_PROFILER_H
|
|
||||||
|
|
||||||
#include <bounce/common/settings.h>
|
|
||||||
|
|
||||||
#define B3_PROFILE(name) b3ProfileScope scope(name)
|
|
||||||
|
|
||||||
// You should implement this function to use your own profiler.
|
|
||||||
bool b3PushProfileScope(const char* name);
|
|
||||||
|
|
||||||
// You should implement this function to use your own profiler.
|
|
||||||
void b3PopProfileScope();
|
|
||||||
|
|
||||||
struct b3ProfileScope
|
|
||||||
{
|
|
||||||
b3ProfileScope(const char* name)
|
|
||||||
{
|
|
||||||
b = b3PushProfileScope(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
~b3ProfileScope()
|
|
||||||
{
|
|
||||||
if (b)
|
|
||||||
{
|
|
||||||
b3PopProfileScope();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
bool b;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -106,7 +106,7 @@ typedef float float32;
|
|||||||
// This controls how faster overlaps should be resolved per step.
|
// This controls how faster overlaps should be resolved per step.
|
||||||
// This is less than and would be close to 1, so that the all overlap is resolved per step.
|
// This is less than and would be close to 1, so that the all overlap is resolved per step.
|
||||||
// However values very close to 1 may lead to overshoot.
|
// However values very close to 1 may lead to overshoot.
|
||||||
#define B3_BAUMGARTE (0.1f)
|
#define B3_BAUMGARTE (0.2f)
|
||||||
|
|
||||||
// If the relative velocity of a contact point is below
|
// If the relative velocity of a contact point is below
|
||||||
// the threshold then restitution is not applied.
|
// the threshold then restitution is not applied.
|
||||||
@ -128,6 +128,8 @@ typedef float float32;
|
|||||||
#define B3_MiB(n) (1024 * B3_KiB(n))
|
#define B3_MiB(n) (1024 * B3_KiB(n))
|
||||||
#define B3_GiB(n) (1024 * B3_MiB(n))
|
#define B3_GiB(n) (1024 * B3_MiB(n))
|
||||||
|
|
||||||
|
#define B3_PROFILE(name) b3ProfileScope scope(name)
|
||||||
|
|
||||||
// You should implement this function to use your own memory allocator.
|
// You should implement this function to use your own memory allocator.
|
||||||
void* b3Alloc(u32 size);
|
void* b3Alloc(u32 size);
|
||||||
|
|
||||||
@ -138,6 +140,30 @@ void b3Free(void* block);
|
|||||||
// from this software.
|
// from this software.
|
||||||
void b3Log(const char* string, ...);
|
void b3Log(const char* string, ...);
|
||||||
|
|
||||||
|
// You should implement this function to use your own profiler.
|
||||||
|
bool b3PushProfileScope(const char* name);
|
||||||
|
|
||||||
|
// You should implement this function to use your own profiler.
|
||||||
|
void b3PopProfileScope();
|
||||||
|
|
||||||
|
struct b3ProfileScope
|
||||||
|
{
|
||||||
|
b3ProfileScope(const char* name)
|
||||||
|
{
|
||||||
|
b = b3PushProfileScope(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
~b3ProfileScope()
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
b3PopProfileScope();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
bool b;
|
||||||
|
};
|
||||||
|
|
||||||
// The current version this software.
|
// The current version this software.
|
||||||
struct b3Version
|
struct b3Version
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <bounce/dynamics/shapes/shape.h>
|
#include <bounce/dynamics/shapes/shape.h>
|
||||||
#include <bounce/dynamics/body.h>
|
#include <bounce/dynamics/body.h>
|
||||||
#include <bounce/dynamics/world_listeners.h>
|
#include <bounce/dynamics/world_listeners.h>
|
||||||
#include <bounce/common/profiler.h>
|
|
||||||
|
|
||||||
b3ContactManager::b3ContactManager() :
|
b3ContactManager::b3ContactManager() :
|
||||||
m_convexBlocks(sizeof(b3ConvexContact)),
|
m_convexBlocks(sizeof(b3ConvexContact)),
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <bounce/dynamics/contacts/contact.h>
|
#include <bounce/dynamics/contacts/contact.h>
|
||||||
#include <bounce/dynamics/contacts/contact_solver.h>
|
#include <bounce/dynamics/contacts/contact_solver.h>
|
||||||
#include <bounce/common/memory/stack_allocator.h>
|
#include <bounce/common/memory/stack_allocator.h>
|
||||||
#include <bounce/common/profiler.h>
|
|
||||||
|
|
||||||
b3Island::b3Island(b3StackAllocator* allocator, u32 bodyCapacity, u32 contactCapacity, u32 jointCapacity)
|
b3Island::b3Island(b3StackAllocator* allocator, u32 bodyCapacity, u32 contactCapacity, u32 jointCapacity)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <bounce/dynamics/contacts/contact.h>
|
#include <bounce/dynamics/contacts/contact.h>
|
||||||
#include <bounce/dynamics/joints/joint.h>
|
#include <bounce/dynamics/joints/joint.h>
|
||||||
#include <bounce/dynamics/time_step.h>
|
#include <bounce/dynamics/time_step.h>
|
||||||
#include <bounce/common/profiler.h>
|
|
||||||
|
|
||||||
extern u32 b3_allocCalls;
|
extern u32 b3_allocCalls;
|
||||||
extern u32 b3_maxAllocCalls;
|
extern u32 b3_maxAllocCalls;
|
||||||
|
Reference in New Issue
Block a user