Merge pull request #8103 from cpascal/fix_no_physics

Fixed compile error when I turned off physics definitions.
This commit is contained in:
minggo 2014-09-25 09:56:45 +08:00
commit efa1c86fc5
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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__