diff options
| author | Marijn Tamis <[email protected]> | 2019-06-13 11:54:31 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2019-06-13 11:54:31 +0200 |
| commit | 145cd88fcd3ab3e16862b90c932175a5b6e17636 (patch) | |
| tree | c090bd8d0f58d75ecfeb03b654bbae558775c0ce /NvCloth | |
| parent | Readme version number changed to 1.1.6 (diff) | |
| download | nvcloth-145cd88fcd3ab3e16862b90c932175a5b6e17636.tar.xz nvcloth-145cd88fcd3ab3e16862b90c932175a5b6e17636.zip | |
Fix PxAssertHandler namespace issue when compiling with PhysX 4.1.
Diffstat (limited to 'NvCloth')
| -rw-r--r-- | NvCloth/include/NvCloth/Callbacks.h | 17 | ||||
| -rw-r--r-- | NvCloth/samples/SampleBase/utils/CallbackImplementations.h | 2 | ||||
| -rw-r--r-- | NvCloth/src/Callbacks.cpp | 6 |
3 files changed, 9 insertions, 16 deletions
diff --git a/NvCloth/include/NvCloth/Callbacks.h b/NvCloth/include/NvCloth/Callbacks.h index 10039a9..0c2d998 100644 --- a/NvCloth/include/NvCloth/Callbacks.h +++ b/NvCloth/include/NvCloth/Callbacks.h @@ -70,7 +70,7 @@ namespace cloth */ NV_CLOTH_API(void) InitializeNvCloth(physx::PxAllocatorCallback* allocatorCallback, physx::PxErrorCallback* errorCallback, - physx::PxAssertHandler* assertHandler, physx::PxProfilerCallback* profilerCallback, + nv::cloth::PxAssertHandler* assertHandler, physx::PxProfilerCallback* profilerCallback, int autoDllIDCheck = NV_CLOTH_DLL_ID); } } @@ -78,10 +78,10 @@ NV_CLOTH_API(void) //Allocator NV_CLOTH_API(physx::PxAllocatorCallback*) GetNvClothAllocator(); //Only use internally -#if !PX_DOXYGEN -namespace physx +namespace nv +{ +namespace cloth { -#endif /* Base class to handle assert failures */ class PxAssertHandler @@ -93,14 +93,7 @@ public: virtual void operator()(const char* exp, const char* file, int line, bool& ignore) = 0; }; -#if !PX_DOXYGEN -} // namespace physx -#endif -namespace nv -{ -namespace cloth -{ //Logging void LogErrorFn (const char* fileName, int lineNumber, const char* msg, ...); void LogInvalidParameterFn (const char* fileName, int lineNumber, const char* msg, ...); @@ -113,7 +106,7 @@ void LogInfoFn (const char* fileName, int lineNumber, const char* msg, ...); #define NV_CLOTH_LOG_INFO(...) nv::cloth::LogInfoFn(__FILE__,__LINE__,__VA_ARGS__) //ASSERT -NV_CLOTH_API(physx::PxAssertHandler*) GetNvClothAssertHandler(); //This function needs to be exposed to properly inline asserts outside this dll +NV_CLOTH_API(nv::cloth::PxAssertHandler*) GetNvClothAssertHandler(); //This function needs to be exposed to properly inline asserts outside this dll #if !PX_ENABLE_ASSERTS #if PX_VC #define NV_CLOTH_ASSERT(exp) __noop diff --git a/NvCloth/samples/SampleBase/utils/CallbackImplementations.h b/NvCloth/samples/SampleBase/utils/CallbackImplementations.h index 214f689..6957399 100644 --- a/NvCloth/samples/SampleBase/utils/CallbackImplementations.h +++ b/NvCloth/samples/SampleBase/utils/CallbackImplementations.h @@ -136,7 +136,7 @@ class ErrorCallback : public physx::PxErrorCallback }; -class AssertHandler : public physx::PxAssertHandler +class AssertHandler : public nv::cloth::PxAssertHandler { public: virtual void operator()(const char* exp, const char* file, int line, bool& ignore) diff --git a/NvCloth/src/Callbacks.cpp b/NvCloth/src/Callbacks.cpp index 7a3d28a..14c7d99 100644 --- a/NvCloth/src/Callbacks.cpp +++ b/NvCloth/src/Callbacks.cpp @@ -43,13 +43,13 @@ struct NvClothContext { physx::PxAllocatorCallback* mAllocator; physx::PxErrorCallback* mErrorCallback; - physx::PxAssertHandler* mAssertHandler; + nv::cloth::PxAssertHandler* mAssertHandler; physx::PxProfilerCallback* mProfilerCallback; }; static NvClothContext sContext; -NV_CLOTH_API(void) InitializeNvCloth(physx::PxAllocatorCallback* allocatorCallback, physx::PxErrorCallback* errorCallback, physx::PxAssertHandler* assertHandler, physx::PxProfilerCallback* profilerCallback, int autoDllIDCheck) +NV_CLOTH_API(void) InitializeNvCloth(physx::PxAllocatorCallback* allocatorCallback, physx::PxErrorCallback* errorCallback, nv::cloth::PxAssertHandler* assertHandler, physx::PxProfilerCallback* profilerCallback, int autoDllIDCheck) { PX_UNUSED(autoDllIDCheck); NV_CLOTH_ASSERT_WITH_MESSAGE("NvCloth dll id mismatch, ensure you compile with matching headers/run with matching dll.", NV_CLOTH_DLL_ID == autoDllIDCheck); @@ -117,7 +117,7 @@ void LogInfoFn(const char* fileName, int lineNumber, const char* msg, ...) va_end(args); } -NV_CLOTH_API(physx::PxAssertHandler*) GetNvClothAssertHandler() +NV_CLOTH_API(nv::cloth::PxAssertHandler*) GetNvClothAssertHandler() { return sContext.mAssertHandler; } |