Merge branch 'develop' of https://github.com/2youyouo2/cocos2d-x into develop

This commit is contained in:
2youyou2 2013-12-02 13:33:26 +08:00
commit 963dd6852b
3 changed files with 24 additions and 30 deletions

View File

@ -28,7 +28,7 @@ namespace cocostudio {
const char *armatureVersion() const char *armatureVersion()
{ {
return "1.0.0.0"; return "1.1.0.0";
} }
} }

View File

@ -26,11 +26,7 @@ THE SOFTWARE.
#include "cocostudio/CCBone.h" #include "cocostudio/CCBone.h"
#include "cocostudio/CCTransformHelp.h" #include "cocostudio/CCTransformHelp.h"
#if ENABLE_PHYSICS_BOX2D_DETECT
#include "Box2D/Box2D.h"
#elif ENABLE_PHYSICS_CHIPMUNK_DETECT
#include "chipmunk.h"
#endif
using namespace cocos2d; using namespace cocos2d;
@ -38,7 +34,7 @@ namespace cocostudio {
#if ENABLE_PHYSICS_BOX2D_DETECT #if ENABLE_PHYSICS_BOX2D_DETECT
ColliderFilter::ColliderFilter(unsigned short categoryBits, unsigned short maskBits, signed short groupIndex) ColliderFilter::ColliderFilter(uint16 categoryBits, uint16 maskBits, int16 groupIndex)
: _categoryBits(categoryBits) : _categoryBits(categoryBits)
, _maskBits(maskBits) , _maskBits(maskBits)
, _groupIndex(groupIndex) , _groupIndex(groupIndex)
@ -56,7 +52,7 @@ void ColliderFilter::updateShape(b2Fixture *fixture)
} }
#elif ENABLE_PHYSICS_CHIPMUNK_DETECT #elif ENABLE_PHYSICS_CHIPMUNK_DETECT
ColliderFilter::ColliderFilter(uintptr_t collisionType, uintptr_t group) ColliderFilter::ColliderFilter(cpCollisionType collisionType, cpGroup group)
: _collisionType(collisionType) : _collisionType(collisionType)
, _group(group) , _group(group)
{ {

View File

@ -34,14 +34,12 @@ THE SOFTWARE.
#if ENABLE_PHYSICS_CHIPMUNK_DETECT #if ENABLE_PHYSICS_CHIPMUNK_DETECT
struct cpBody; #include "chipmunk.h"
struct cpShape;
#elif ENABLE_PHYSICS_BOX2D_DETECT #elif ENABLE_PHYSICS_BOX2D_DETECT
class b2Body; #include "Box2D/Box2D.h"
class b2Fixture;
struct b2Filter;
#endif #endif
namespace cocostudio { namespace cocostudio {
class Bone; class Bone;
@ -56,34 +54,34 @@ public:
virtual ~ColliderFilter() { } virtual ~ColliderFilter() { }
#if ENABLE_PHYSICS_BOX2D_DETECT #if ENABLE_PHYSICS_BOX2D_DETECT
public: public:
ColliderFilter(unsigned short categoryBits = 0x0001, unsigned short maskBits = 0xFFFF, signed short groupIndex = 0); ColliderFilter(uint16 categoryBits = 0x0001, uint16 maskBits = 0xFFFF, int16 groupIndex = 0);
void updateShape(b2Fixture *fixture); void updateShape(b2Fixture *fixture);
virtual void setCategoryBits(unsigned short categoryBits) { _categoryBits = categoryBits; } virtual void setCategoryBits(uint16 categoryBits) { _categoryBits = categoryBits; }
virtual unsigned short getCategoryBits() const { return _categoryBits; } virtual uint16 getCategoryBits() const { return _categoryBits; }
virtual void setMaskBits(unsigned short maskBits) { _maskBits = maskBits; } virtual void setMaskBits(uint16 maskBits) { _maskBits = maskBits; }
virtual unsigned short getMaskBits() const { return _maskBits; } virtual uint16 getMaskBits() const { return _maskBits; }
virtual void setGroupIndex(signed short groupIndex) { _groupIndex = groupIndex; } virtual void setGroupIndex(int16 groupIndex) { _groupIndex = groupIndex; }
virtual signed short getGroupIndex() const { return _groupIndex; } virtual int16 getGroupIndex() const { return _groupIndex; }
protected: protected:
unsigned short _categoryBits; uint16 _categoryBits;
unsigned short _maskBits; uint16 _maskBits;
signed short _groupIndex; int16 _groupIndex;
#elif ENABLE_PHYSICS_CHIPMUNK_DETECT #elif ENABLE_PHYSICS_CHIPMUNK_DETECT
public: public:
ColliderFilter(uintptr_t collisionType = 0, uintptr_t group = 0); ColliderFilter(cpCollisionType collisionType = 0, cpGroup group = 0);
void updateShape(cpShape *shape); void updateShape(cpShape *shape);
virtual void setCollisionType(uintptr_t collisionType) { _collisionType = collisionType; } virtual void setCollisionType(cpCollisionType collisionType) { _collisionType = collisionType; }
virtual uintptr_t getCollisionType() const { return _collisionType; } virtual cpCollisionType getCollisionType() const { return _collisionType; }
virtual void setGroup(uintptr_t group) { _group = group; } virtual void setGroup(cpGroup group) { _group = group; }
virtual uintptr_t getGroup() const { return _group; } virtual cpGroup getGroup() const { return _group; }
protected: protected:
uintptr_t _collisionType; cpCollisionType _collisionType;
uintptr_t _group; cpGroup _group;
#endif #endif
}; };