diff --git a/examples/testbed/framework/profiler.cpp b/examples/testbed/framework/profiler.cpp index 5776c15..c55447e 100644 --- a/examples/testbed/framework/profiler.cpp +++ b/examples/testbed/framework/profiler.cpp @@ -17,7 +17,6 @@ */ #include -#include #include #include diff --git a/include/bounce/bounce.h b/include/bounce/bounce.h index 59ffd5f..3b26e1b 100644 --- a/include/bounce/bounce.h +++ b/include/bounce/bounce.h @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/include/bounce/common/profiler.h b/include/bounce/common/profiler.h deleted file mode 100644 index 47c499d..0000000 --- a/include/bounce/common/profiler.h +++ /dev/null @@ -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 - -#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 \ No newline at end of file diff --git a/include/bounce/common/settings.h b/include/bounce/common/settings.h index eb2bc57..b1ba36d 100644 --- a/include/bounce/common/settings.h +++ b/include/bounce/common/settings.h @@ -106,7 +106,7 @@ typedef float float32; // 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. // 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 // the threshold then restitution is not applied. @@ -128,6 +128,8 @@ typedef float float32; #define B3_MiB(n) (1024 * B3_KiB(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. void* b3Alloc(u32 size); @@ -138,6 +140,30 @@ void b3Free(void* block); // from this software. 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. struct b3Version { diff --git a/src/bounce/dynamics/contact_manager.cpp b/src/bounce/dynamics/contact_manager.cpp index dc2d781..5b20db0 100644 --- a/src/bounce/dynamics/contact_manager.cpp +++ b/src/bounce/dynamics/contact_manager.cpp @@ -22,7 +22,6 @@ #include #include #include -#include b3ContactManager::b3ContactManager() : m_convexBlocks(sizeof(b3ConvexContact)), diff --git a/src/bounce/dynamics/island.cpp b/src/bounce/dynamics/island.cpp index 9433696..2647d2a 100644 --- a/src/bounce/dynamics/island.cpp +++ b/src/bounce/dynamics/island.cpp @@ -24,7 +24,6 @@ #include #include #include -#include b3Island::b3Island(b3StackAllocator* allocator, u32 bodyCapacity, u32 contactCapacity, u32 jointCapacity) { diff --git a/src/bounce/dynamics/world.cpp b/src/bounce/dynamics/world.cpp index f8e5fee..df63af5 100644 --- a/src/bounce/dynamics/world.cpp +++ b/src/bounce/dynamics/world.cpp @@ -24,7 +24,6 @@ #include #include #include -#include extern u32 b3_allocCalls; extern u32 b3_maxAllocCalls;