diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index e5b631fa33..96011e2d4d 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -22,6 +22,8 @@ #include "CCPhysicsSprite.h" +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) + #if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION) #error "Either Chipmunk or Box2d should be enabled, but not both at the same time" #endif @@ -300,6 +302,8 @@ float PhysicsSprite::getRotation() const return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); +#else + return 0.0f; #endif } @@ -408,3 +412,5 @@ void PhysicsSprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t fla } NS_CC_EXT_END + +#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 33f48a20b0..7d68e7ca1a 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -27,6 +27,8 @@ #include "extensions/ExtensionMacros.h" #include "extensions/ExtensionExport.h" +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) + struct cpBody; class b2Body; @@ -135,4 +137,6 @@ protected: NS_CC_EXT_END +#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION + #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__