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()
{
return "1.0.0.0";
return "1.1.0.0";
}
}

View File

@ -26,11 +26,7 @@ THE SOFTWARE.
#include "cocostudio/CCBone.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;
@ -38,7 +34,7 @@ namespace cocostudio {
#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)
, _maskBits(maskBits)
, _groupIndex(groupIndex)
@ -56,7 +52,7 @@ void ColliderFilter::updateShape(b2Fixture *fixture)
}
#elif ENABLE_PHYSICS_CHIPMUNK_DETECT
ColliderFilter::ColliderFilter(uintptr_t collisionType, uintptr_t group)
ColliderFilter::ColliderFilter(cpCollisionType collisionType, cpGroup group)
: _collisionType(collisionType)
, _group(group)
{

View File

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