From b076711b699b3b37ec44f014e017a3af440e670e Mon Sep 17 00:00:00 2001 From: 2youyou2 <501251991@qq.com> Date: Tue, 5 Nov 2013 13:42:27 +0800 Subject: [PATCH] fix compile error --- cocos/editor-support/cocostudio/CCColliderDetector.cpp | 2 +- cocos/editor-support/cocostudio/CCColliderDetector.h | 7 +++---- .../CocoStudioArmatureTest/ArmatureScene.cpp | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/CCColliderDetector.cpp index cceb1a9b72..21cf39e486 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/CCColliderDetector.cpp @@ -56,7 +56,7 @@ void ColliderFilter::updateShape(b2Fixture *fixture) } #elif ENABLE_PHYSICS_CHIPMUNK_DETECT -ColliderFilter::ColliderFilter(cpCollisionType collisionType, cpGroup group) +ColliderFilter::ColliderFilter(uintptr_t collisionType, uintptr_t group) : _collisionType(collisionType) , _group(group) { diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h index e2da724c80..0b9c058aa8 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -34,7 +34,6 @@ THE SOFTWARE. #if ENABLE_PHYSICS_CHIPMUNK_DETECT -#include "chipmunk.h" struct cpBody; struct cpShape; #elif ENABLE_PHYSICS_BOX2D_DETECT @@ -62,11 +61,11 @@ protected: CC_SYNTHESIZE(signed short, _groupIndex, GroupIndex); #elif ENABLE_PHYSICS_CHIPMUNK_DETECT public: - ColliderFilter(cpCollisionType collisionType = 0, cpGroup group = 0); + ColliderFilter(uintptr_t collisionType = 0, uintptr_t group = 0); void updateShape(cpShape *shape); protected: - CC_SYNTHESIZE(cpCollisionType, _collisionType, CollisionType); - CC_SYNTHESIZE(cpGroup, _group, Group); + CC_SYNTHESIZE(uintptr_t, _collisionType, CollisionType); + CC_SYNTHESIZE(uintptr_t, _group, Group); #endif }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index a6dfd04092..0b662d9c15 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1008,7 +1008,8 @@ void TestColliderDetector::initWorld() cpSpaceAddBody(space, body); armature2->setBody(body); - armature2->setColliderFilter(&ColliderFilter(eEnemyTag)); + ColliderFilter filter = ColliderFilter(eEnemyTag); + armature2->setColliderFilter(&filter); cpSpaceAddCollisionHandler(space, eEnemyTag, eBulletTag, beginHit, NULL, NULL, endHit, NULL); }