From f02d15d71f1e938896d99bfa53da68e7b3fd33e8 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 6 Dec 2013 11:46:13 +0800 Subject: [PATCH] initialize static member variable in cpp --- cocos/physics/CCPhysicsWorld.cpp | 6 ++++++ cocos/physics/CCPhysicsWorld.h | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index 70bae33eff..41d6f08f9c 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -55,6 +55,12 @@ NS_CC_BEGIN const float PHYSICS_INFINITY = INFINITY; extern const char* PHYSICSCONTACT_EVENT_NAME; +const int PhysicsWorld::DEBUGDRAW_NONE = 0x00; +const int PhysicsWorld::DEBUGDRAW_SHAPE = 0x01; +const int PhysicsWorld::DEBUGDRAW_JOINT = 0x02; +const int PhysicsWorld::DEBUGDRAW_CONTACT = 0x04; +const int PhysicsWorld::DEBUGDRAW_ALL = DEBUGDRAW_SHAPE | DEBUGDRAW_JOINT | DEBUGDRAW_CONTACT; + namespace { typedef struct RayCastCallbackInfo diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index 384ee6250e..05999d990d 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -83,11 +83,11 @@ typedef PhysicsRectQueryCallbackFunc PhysicsPointQueryCallbackFunc; class PhysicsWorld { public: - static const int DEBUGDRAW_NONE = 0x00; - static const int DEBUGDRAW_SHAPE = 0x01; - static const int DEBUGDRAW_JOINT = 0x02; - static const int DEBUGDRAW_CONTACT = 0x04; - static const int DEBUGDRAW_ALL = DEBUGDRAW_SHAPE | DEBUGDRAW_JOINT | DEBUGDRAW_CONTACT; + static const int DEBUGDRAW_NONE; + static const int DEBUGDRAW_SHAPE; + static const int DEBUGDRAW_JOINT; + static const int DEBUGDRAW_CONTACT; + static const int DEBUGDRAW_ALL; public: /** Adds a joint to the physics world.*/