mirror of https://github.com/axmolengine/axmol.git
Merge pull request #8103 from cpascal/fix_no_physics
Fixed compile error when I turned off physics definitions.
This commit is contained in:
commit
efa1c86fc5
|
@ -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
|
||||
|
|
|
@ -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__
|
||||
|
|
Loading…
Reference in New Issue