Fix compilation errors when logs or profiling is disabled
This commit is contained in:
parent
b1e5c029f7
commit
cd897f1151
|
@ -39,7 +39,7 @@ uint CollisionWorld::mNbWorlds = 0;
|
||||||
CollisionWorld::CollisionWorld(const WorldSettings& worldSettings, Logger* logger, Profiler* profiler)
|
CollisionWorld::CollisionWorld(const WorldSettings& worldSettings, Logger* logger, Profiler* profiler)
|
||||||
: mConfig(worldSettings), mCollisionDetection(this, mMemoryManager), mBodies(mMemoryManager.getPoolAllocator()), mCurrentBodyId(0),
|
: mConfig(worldSettings), mCollisionDetection(this, mMemoryManager), mBodies(mMemoryManager.getPoolAllocator()), mCurrentBodyId(0),
|
||||||
mFreeBodiesIds(mMemoryManager.getPoolAllocator()), mEventListener(nullptr), mName(worldSettings.worldName),
|
mFreeBodiesIds(mMemoryManager.getPoolAllocator()), mEventListener(nullptr), mName(worldSettings.worldName),
|
||||||
mProfiler(profiler), mLogger(logger), mIsProfilerCreatedByUser(profiler != nullptr),
|
mIsProfilerCreatedByUser(profiler != nullptr),
|
||||||
mIsLoggerCreatedByUser(logger != nullptr) {
|
mIsLoggerCreatedByUser(logger != nullptr) {
|
||||||
|
|
||||||
// Automatically generate a name for the world
|
// Automatically generate a name for the world
|
||||||
|
@ -57,6 +57,8 @@ CollisionWorld::CollisionWorld(const WorldSettings& worldSettings, Logger* logge
|
||||||
|
|
||||||
#ifdef IS_PROFILING_ACTIVE
|
#ifdef IS_PROFILING_ACTIVE
|
||||||
|
|
||||||
|
mProfiler = profiler;
|
||||||
|
|
||||||
// If the user has not provided its own profiler, we create one
|
// If the user has not provided its own profiler, we create one
|
||||||
if (mProfiler == nullptr) {
|
if (mProfiler == nullptr) {
|
||||||
|
|
||||||
|
@ -74,6 +76,8 @@ CollisionWorld::CollisionWorld(const WorldSettings& worldSettings, Logger* logge
|
||||||
|
|
||||||
#ifdef IS_LOGGING_ACTIVE
|
#ifdef IS_LOGGING_ACTIVE
|
||||||
|
|
||||||
|
mLogger = logger;
|
||||||
|
|
||||||
// If the user has not provided its own logger, we create one
|
// If the user has not provided its own logger, we create one
|
||||||
if (mLogger == nullptr) {
|
if (mLogger == nullptr) {
|
||||||
|
|
||||||
|
|
|
@ -463,7 +463,7 @@ class Logger {
|
||||||
#else // If logger is not active
|
#else // If logger is not active
|
||||||
|
|
||||||
// Empty macro in case logs are not enabled
|
// Empty macro in case logs are not enabled
|
||||||
#define RP3D_LOG(logger, level, message)
|
#define RP3D_LOG(logger, level, category, message)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#ifndef REACTPHYSICS3D_PROFILER_H
|
#ifndef REACTPHYSICS3D_PROFILER_H
|
||||||
#define REACTPHYSICS3D_PROFILER_H
|
#define REACTPHYSICS3D_PROFILER_H
|
||||||
|
|
||||||
#ifdef IS_PROFILING_ACTIVE
|
|
||||||
|
|
||||||
// Libraries
|
// Libraries
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "engine/Timer.h"
|
#include "engine/Timer.h"
|
||||||
|
@ -381,9 +379,18 @@ class ProfileSample {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef IS_PROFILING_ACTIVE
|
||||||
|
|
||||||
// Use this macro to start profile a block of code
|
// Use this macro to start profile a block of code
|
||||||
#define RP3D_PROFILE(name, profiler) ProfileSample profileSample(name, profiler)
|
#define RP3D_PROFILE(name, profiler) ProfileSample profileSample(name, profiler)
|
||||||
|
|
||||||
|
#else // If profile is not active
|
||||||
|
|
||||||
|
// Empty macro in case profiling is not active
|
||||||
|
#define RP3D_PROFILE(name, profiler)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// Return true if we are at the root of the profiler tree
|
// Return true if we are at the root of the profiler tree
|
||||||
inline bool ProfileNodeIterator::isRoot() {
|
inline bool ProfileNodeIterator::isRoot() {
|
||||||
return (mCurrentParentNode->getParentNode() == nullptr);
|
return (mCurrentParentNode->getParentNode() == nullptr);
|
||||||
|
@ -497,11 +504,5 @@ inline void Profiler::destroy() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // If profile is not active
|
|
||||||
|
|
||||||
// Empty macro in case profiling is not active
|
|
||||||
#define RP3D_PROFILE(name, profiler)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user