diff --git a/CocosDenshion/proj.win32/CocosDenshion.vcxproj b/CocosDenshion/proj.win32/CocosDenshion.vcxproj index c5738cf5a2..7a91634027 100644 --- a/CocosDenshion/proj.win32/CocosDenshion.vcxproj +++ b/CocosDenshion/proj.win32/CocosDenshion.vcxproj @@ -65,7 +65,7 @@ Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;"$(ProjectDir)..\..\cocos2dx";"$(ProjectDir)..\..\cocos2dx\include";"$(ProjectDir)..\..\cocos2dx\kazmath\include";"$(ProjectDir)..\..\cocos2dx\platform\win32";"$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES";%(AdditionalIncludeDirectories) + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;$(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 1436cd2cc4..1e9cc1e16a 100644 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3f1cfaf06d95973aa8f2a629582705eb65bb24f6 \ No newline at end of file +29c3c2dfd8b683a800709d085839444c3a304a0d \ No newline at end of file diff --git a/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp b/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp index 4627c02499..5fd8ceb171 100644 --- a/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp +++ b/cocos2dx/physics/chipmunk/CCPhysicsBodyInfo.cpp @@ -38,7 +38,7 @@ PhysicsBodyInfo::~PhysicsBodyInfo() Clonable* PhysicsBodyInfo::clone() const { - + return nullptr; } NS_CC_END diff --git a/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.c b/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.c deleted file mode 100644 index 38b06af1a0..0000000000 --- a/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.c +++ /dev/null @@ -1,446 +0,0 @@ -/* Copyright (c) 2007 Scott Lembcke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include - -#ifdef __APPLE__ - #include "OpenGL/gl.h" - #include "OpenGL/glu.h" - #include -#else - #ifdef WIN32 - #include - #endif - - #include - #include - #include -#endif - -#include "chipmunk_private.h" -#include "ChipmunkDebugDraw.h" - -/* - IMPORTANT - READ ME! - - This file sets up a simple interface that the individual demos can use to get - a Chipmunk space running and draw what's in it. In order to keep the Chipmunk - examples clean and simple, they contain no graphics code. All drawing is done - by accessing the Chipmunk structures at a very low level. It is NOT - recommended to write a game or application this way as it does not scale - beyond simple shape drawing and is very dependent on implementation details - about Chipmunk which may change with little to no warning. -*/ - -const Color LINE_COLOR = {200.0/255.0, 210.0/255.0, 230.0/255.0, 1.0}; -const Color CONSTRAINT_COLOR = {0.0, 0.75, 0.0, 1.0}; -const float SHAPE_ALPHA = 1.0; - -float ChipmunkDebugDrawPointLineScale = 1.0; - -static Color -ColorFromHash(cpHashValue hash, float alpha) -{ - unsigned long val = (unsigned long)hash; - - // scramble the bits up using Robert Jenkins' 32 bit integer hash function - val = (val+0x7ed55d16) + (val<<12); - val = (val^0xc761c23c) ^ (val>>19); - val = (val+0x165667b1) + (val<<5); - val = (val+0xd3a2646c) ^ (val<<9); - val = (val+0xfd7046c5) + (val<<3); - val = (val^0xb55a4f09) ^ (val>>16); - - GLfloat r = (val>>0) & 0xFF; - GLfloat g = (val>>8) & 0xFF; - GLfloat b = (val>>16) & 0xFF; - - GLfloat max = cpfmax(cpfmax(r, g), b); - GLfloat min = cpfmin(cpfmin(r, g), b); - GLfloat intensity = 0.75; - - // Saturate and scale the color - if(min == max){ - return RGBAColor(intensity, 0.0, 0.0, alpha); - } else { - GLfloat coef = alpha*intensity/(max - min); - return RGBAColor( - (r - min)*coef, - (g - min)*coef, - (b - min)*coef, - alpha - ); - } -} - -static inline void -glColor_from_color(Color color){ - glColor4fv((GLfloat *)&color); -} - -static Color -ColorForShape(cpShape *shape) -{ - if(cpShapeGetSensor(shape)){ - return LAColor(1, 0); - } else { - cpBody *body = shape->body; - - if(cpBodyIsSleeping(body)){ - return LAColor(0.2, 1); - } else if(body->node.idleTime > shape->space->sleepTimeThreshold) { - return LAColor(0.66, 1); - } else { - return ColorFromHash(shape->hashid, SHAPE_ALPHA); - } - } -} - -static const GLfloat circleVAR[] = { - 0.0000f, 1.0000f, - 0.2588f, 0.9659f, - 0.5000f, 0.8660f, - 0.7071f, 0.7071f, - 0.8660f, 0.5000f, - 0.9659f, 0.2588f, - 1.0000f, 0.0000f, - 0.9659f, -0.2588f, - 0.8660f, -0.5000f, - 0.7071f, -0.7071f, - 0.5000f, -0.8660f, - 0.2588f, -0.9659f, - 0.0000f, -1.0000f, - -0.2588f, -0.9659f, - -0.5000f, -0.8660f, - -0.7071f, -0.7071f, - -0.8660f, -0.5000f, - -0.9659f, -0.2588f, - -1.0000f, -0.0000f, - -0.9659f, 0.2588f, - -0.8660f, 0.5000f, - -0.7071f, 0.7071f, - -0.5000f, 0.8660f, - -0.2588f, 0.9659f, - 0.0000f, 1.0000f, - 0.0f, 0.0f, // For an extra line to see the rotation. -}; -static const int circleVAR_count = sizeof(circleVAR)/sizeof(GLfloat)/2; - -void ChipmunkDebugDrawCircle(cpVect center, cpFloat angle, cpFloat radius, Color lineColor, Color fillColor) -{ - glVertexPointer(2, GL_FLOAT, 0, circleVAR); - - glPushMatrix(); { - glTranslatef(center.x, center.y, 0.0f); - glRotatef(angle*180.0f/M_PI, 0.0f, 0.0f, 1.0f); - glScalef(radius, radius, 1.0f); - - if(fillColor.a > 0){ - glColor_from_color(fillColor); - glDrawArrays(GL_TRIANGLE_FAN, 0, circleVAR_count - 1); - } - - if(lineColor.a > 0){ - glColor_from_color(lineColor); - glDrawArrays(GL_LINE_STRIP, 0, circleVAR_count); - } - } glPopMatrix(); -} - -static const GLfloat pillVAR[] = { - 0.0000f, 1.0000f, 1.0f, - 0.2588f, 0.9659f, 1.0f, - 0.5000f, 0.8660f, 1.0f, - 0.7071f, 0.7071f, 1.0f, - 0.8660f, 0.5000f, 1.0f, - 0.9659f, 0.2588f, 1.0f, - 1.0000f, 0.0000f, 1.0f, - 0.9659f, -0.2588f, 1.0f, - 0.8660f, -0.5000f, 1.0f, - 0.7071f, -0.7071f, 1.0f, - 0.5000f, -0.8660f, 1.0f, - 0.2588f, -0.9659f, 1.0f, - 0.0000f, -1.0000f, 1.0f, - - 0.0000f, -1.0000f, 0.0f, - -0.2588f, -0.9659f, 0.0f, - -0.5000f, -0.8660f, 0.0f, - -0.7071f, -0.7071f, 0.0f, - -0.8660f, -0.5000f, 0.0f, - -0.9659f, -0.2588f, 0.0f, - -1.0000f, -0.0000f, 0.0f, - -0.9659f, 0.2588f, 0.0f, - -0.8660f, 0.5000f, 0.0f, - -0.7071f, 0.7071f, 0.0f, - -0.5000f, 0.8660f, 0.0f, - -0.2588f, 0.9659f, 0.0f, - 0.0000f, 1.0000f, 0.0f, -}; -static const int pillVAR_count = sizeof(pillVAR)/sizeof(GLfloat)/3; - -void ChipmunkDebugDrawSegment(cpVect a, cpVect b, Color color) -{ - GLfloat verts[] = { - a.x, a.y, - b.x, b.y, - }; - - glVertexPointer(2, GL_FLOAT, 0, verts); - glColor_from_color(color); - glDrawArrays(GL_LINES, 0, 2); -} - -void ChipmunkDebugDrawFatSegment(cpVect a, cpVect b, cpFloat radius, Color lineColor, Color fillColor) -{ - if(radius){ - glVertexPointer(3, GL_FLOAT, 0, pillVAR); - glPushMatrix(); { - cpVect d = cpvsub(b, a); - cpVect r = cpvmult(d, radius/cpvlength(d)); - - const GLfloat matrix[] = { - r.x, r.y, 0.0f, 0.0f, - -r.y, r.x, 0.0f, 0.0f, - d.x, d.y, 0.0f, 0.0f, - a.x, a.y, 0.0f, 1.0f, - }; - glMultMatrixf(matrix); - - if(fillColor.a > 0){ - glColor_from_color(fillColor); - glDrawArrays(GL_TRIANGLE_FAN, 0, pillVAR_count); - } - - if(lineColor.a > 0){ - glColor_from_color(lineColor); - glDrawArrays(GL_LINE_LOOP, 0, pillVAR_count); - } - } glPopMatrix(); - } else { - ChipmunkDebugDrawSegment(a, b, lineColor); - } -} - -void ChipmunkDebugDrawPolygon(int count, cpVect *verts, Color lineColor, Color fillColor) -{ -#if CP_USE_DOUBLES - glVertexPointer(2, GL_DOUBLE, 0, verts); -#else - glVertexPointer(2, GL_FLOAT, 0, verts); -#endif - - if(fillColor.a > 0){ - glColor_from_color(fillColor); - glDrawArrays(GL_TRIANGLE_FAN, 0, count); - } - - if(lineColor.a > 0){ - glColor_from_color(lineColor); - glDrawArrays(GL_LINE_LOOP, 0, count); - } -} - -void ChipmunkDebugDrawPoints(cpFloat size, int count, cpVect *verts, Color color) -{ -#if CP_USE_DOUBLES - glVertexPointer(2, GL_DOUBLE, 0, verts); -#else - glVertexPointer(2, GL_FLOAT, 0, verts); -#endif - - glPointSize(size*ChipmunkDebugDrawPointLineScale); - glColor_from_color(color); - glDrawArrays(GL_POINTS, 0, count); -} - -void ChipmunkDebugDrawBB(cpBB bb, Color color) -{ - cpVect verts[] = { - cpv(bb.l, bb.b), - cpv(bb.l, bb.t), - cpv(bb.r, bb.t), - cpv(bb.r, bb.b), - }; - ChipmunkDebugDrawPolygon(4, verts, color, LAColor(0, 0)); -} - -static void -drawShape(cpShape *shape, void *unused) -{ - cpBody *body = shape->body; - Color color = ColorForShape(shape); - - switch(shape->klass->type){ - case CP_CIRCLE_SHAPE: { - cpCircleShape *circle = (cpCircleShape *)shape; - ChipmunkDebugDrawCircle(circle->tc, body->a, circle->r, LINE_COLOR, color); - break; - } - case CP_SEGMENT_SHAPE: { - cpSegmentShape *seg = (cpSegmentShape *)shape; - ChipmunkDebugDrawFatSegment(seg->ta, seg->tb, seg->r, LINE_COLOR, color); - break; - } - case CP_POLY_SHAPE: { - cpPolyShape *poly = (cpPolyShape *)shape; - ChipmunkDebugDrawPolygon(poly->numVerts, poly->tVerts, LINE_COLOR, color); - break; - } - default: break; - } -} - -void ChipmunkDebugDrawShape(cpShape *shape) -{ - drawShape(shape, NULL); -} - -void ChipmunkDebugDrawShapes(cpSpace *space) -{ - cpSpaceEachShape(space, drawShape, NULL); -} - -static const GLfloat springVAR[] = { - 0.00f, 0.0f, - 0.20f, 0.0f, - 0.25f, 3.0f, - 0.30f,-6.0f, - 0.35f, 6.0f, - 0.40f,-6.0f, - 0.45f, 6.0f, - 0.50f,-6.0f, - 0.55f, 6.0f, - 0.60f,-6.0f, - 0.65f, 6.0f, - 0.70f,-3.0f, - 0.75f, 6.0f, - 0.80f, 0.0f, - 1.00f, 0.0f, -}; -static const int springVAR_count = sizeof(springVAR)/sizeof(GLfloat)/2; - -static void -drawSpring(cpDampedSpring *spring, cpBody *body_a, cpBody *body_b) -{ - cpVect a = cpvadd(body_a->p, cpvrotate(spring->anchr1, body_a->rot)); - cpVect b = cpvadd(body_b->p, cpvrotate(spring->anchr2, body_b->rot)); - - cpVect points[] = {a, b}; - ChipmunkDebugDrawPoints(5, 2, points, CONSTRAINT_COLOR); - - cpVect delta = cpvsub(b, a); - - glVertexPointer(2, GL_FLOAT, 0, springVAR); - glPushMatrix(); { - GLfloat x = a.x; - GLfloat y = a.y; - GLfloat cos = delta.x; - GLfloat sin = delta.y; - GLfloat s = 1.0f/cpvlength(delta); - - const GLfloat matrix[] = { - cos, sin, 0.0f, 0.0f, - -sin*s, cos*s, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - x, y, 0.0f, 1.0f, - }; - - glMultMatrixf(matrix); - glDrawArrays(GL_LINE_STRIP, 0, springVAR_count); - } glPopMatrix(); -} - -static void -drawConstraint(cpConstraint *constraint, void *unused) -{ - cpBody *body_a = constraint->a; - cpBody *body_b = constraint->b; - - const cpConstraintClass *klass = constraint->klass; - if(klass == cpPinJointGetClass()){ - cpPinJoint *joint = (cpPinJoint *)constraint; - - cpVect a = cpvadd(body_a->p, cpvrotate(joint->anchr1, body_a->rot)); - cpVect b = cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)); - - cpVect points[] = {a, b}; - ChipmunkDebugDrawPoints(5, 2, points, CONSTRAINT_COLOR); - ChipmunkDebugDrawSegment(a, b, CONSTRAINT_COLOR); - } else if(klass == cpSlideJointGetClass()){ - cpSlideJoint *joint = (cpSlideJoint *)constraint; - - cpVect a = cpvadd(body_a->p, cpvrotate(joint->anchr1, body_a->rot)); - cpVect b = cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)); - - cpVect points[] = {a, b}; - ChipmunkDebugDrawPoints(5, 2, points, CONSTRAINT_COLOR); - ChipmunkDebugDrawSegment(a, b, CONSTRAINT_COLOR); - } else if(klass == cpPivotJointGetClass()){ - cpPivotJoint *joint = (cpPivotJoint *)constraint; - - cpVect a = cpvadd(body_a->p, cpvrotate(joint->anchr1, body_a->rot)); - cpVect b = cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)); - - cpVect points[] = {a, b}; - ChipmunkDebugDrawPoints(10, 2, points, CONSTRAINT_COLOR); - } else if(klass == cpGrooveJointGetClass()){ - cpGrooveJoint *joint = (cpGrooveJoint *)constraint; - - cpVect a = cpvadd(body_a->p, cpvrotate(joint->grv_a, body_a->rot)); - cpVect b = cpvadd(body_a->p, cpvrotate(joint->grv_b, body_a->rot)); - cpVect c = cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)); - - ChipmunkDebugDrawPoints(5, 1, &c, CONSTRAINT_COLOR); - ChipmunkDebugDrawSegment(a, b, CONSTRAINT_COLOR); - } else if(klass == cpDampedSpringGetClass()){ - drawSpring((cpDampedSpring *)constraint, body_a, body_b); - } -} - -void ChipmunkDebugDrawConstraint(cpConstraint *constraint) -{ - drawConstraint(constraint, NULL); -} - -void ChipmunkDebugDrawConstraints(cpSpace *space) -{ - cpSpaceEachConstraint(space, drawConstraint, NULL); -} - -void ChipmunkDebugDrawCollisionPoints(cpSpace *space) -{ - cpArray *arbiters = space->arbiters; - - glColor3f(1.0f, 0.0f, 0.0f); - glPointSize(4.0f*ChipmunkDebugDrawPointLineScale); - - glBegin(GL_POINTS); { - for(int i=0; inum; i++){ - cpArbiter *arb = (cpArbiter*)arbiters->arr[i]; - - for(int j=0; jnumContacts; j++){ - cpVect v = arb->contacts[j].p; - glVertex2f(v.x, v.y); - } - } - } glEnd(); -} diff --git a/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.h b/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.h deleted file mode 100644 index 9cc0a722fd..0000000000 --- a/cocos2dx/physics/chipmunk/ChipmunkDebugDraw.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2007 Scott Lembcke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -typedef struct Color { - float r, g, b, a; -} Color; - -static inline Color RGBAColor(float r, float g, float b, float a){ - Color color = {r, g, b, a}; - return color; -} - -static inline Color LAColor(float l, float a){ - Color color = {l, l, l, a}; - return color; -} - -extern float ChipmunkDebugDrawPointLineScale; - -void ChipmunkDebugDrawCircle(cpVect center, cpFloat angle, cpFloat radius, Color lineColor, Color fillColor); -void ChipmunkDebugDrawSegment(cpVect a, cpVect b, Color color); -void ChipmunkDebugDrawFatSegment(cpVect a, cpVect b, cpFloat radius, Color lineColor, Color fillColor); -void ChipmunkDebugDrawPolygon(int count, cpVect *verts, Color lineColor, Color fillColor); -void ChipmunkDebugDrawPoints(cpFloat size, int count, cpVect *verts, Color color); -void ChipmunkDebugDrawBB(cpBB bb, Color color); - -void ChipmunkDebugDrawConstraint(cpConstraint *constraint); -void ChipmunkDebugDrawShape(cpShape *shape); - -void ChipmunkDebugDrawShapes(cpSpace *space); -void ChipmunkDebugDrawConstraints(cpSpace *space); -void ChipmunkDebugDrawCollisionPoints(cpSpace *space); diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos2dx/proj.linux/cocos2dx.mk index 3269129024..35955f2990 100644 --- a/cocos2dx/proj.linux/cocos2dx.mk +++ b/cocos2dx/proj.linux/cocos2dx.mk @@ -59,7 +59,8 @@ INCLUDES += \ -I$(COCOS_SRC)/platform/linux \ -I$(COCOS_SRC)/platform/third_party/linux/libjpeg \ -I$(COCOS_SRC)/platform/third_party/linux/libtiff \ - -I$(COCOS_SRC)/platform/third_party/linux/libwebp + -I$(COCOS_SRC)/platform/third_party/linux/libwebp \ + -I$(COCOS_ROOT/external/chipmunk/include/chipmunk LBITS := $(shell getconf LONG_BIT) ifeq ($(LBITS),64) diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj b/cocos2dx/proj.win32/cocos2d.vcxproj index d6efeb7168..a37adf2788 100644 --- a/cocos2dx/proj.win32/cocos2d.vcxproj +++ b/cocos2dx/proj.win32/cocos2d.vcxproj @@ -69,7 +69,7 @@ Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..;$(ProjectDir)..\platform\win32;$(ProjectDir)..\platform\third_party\win32\iconv;$(ProjectDir)..\platform\third_party\win32\zlib;$(ProjectDir)..\platform\third_party\win32\libpng;$(ProjectDir)..\platform\third_party\win32\libjpeg;$(ProjectDir)..\platform\third_party\win32\libtiff;$(ProjectDir)..\platform\third_party\win32\libwebp;$(ProjectDir)..\platform\third_party\win32\libfreetype2;$(ProjectDir)..\platform\third_party\win32\OGLES;..\include;$(ProjectDir)..\kazmath\include;$(ProjectDir)..\platform\third_party\common\etc;%(AdditionalIncludeDirectories) + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(ProjectDir)..;$(ProjectDir)..\platform\win32;$(ProjectDir)..\platform\third_party\win32\iconv;$(ProjectDir)..\platform\third_party\win32\zlib;$(ProjectDir)..\platform\third_party\win32\libpng;$(ProjectDir)..\platform\third_party\win32\libjpeg;$(ProjectDir)..\platform\third_party\win32\libtiff;$(ProjectDir)..\platform\third_party\win32\libwebp;$(ProjectDir)..\platform\third_party\win32\libfreetype2;$(ProjectDir)..\platform\third_party\win32\OGLES;..\include;$(ProjectDir)..\kazmath\include;$(ProjectDir)..\platform\third_party\common\etc;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -211,6 +211,21 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir + + + + + + + + + + + + + + + @@ -365,6 +380,24 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir + + + + + + + + + + + + + + + + + + diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj.filters b/cocos2dx/proj.win32/cocos2d.vcxproj.filters index dcd9961e74..81e2e2a3d0 100644 --- a/cocos2dx/proj.win32/cocos2d.vcxproj.filters +++ b/cocos2dx/proj.win32/cocos2d.vcxproj.filters @@ -103,6 +103,15 @@ {3ff2746c-a91b-4b86-93b7-43a9ec14825b} + + {08593631-5bf5-46aa-9436-62595c4f7bf6} + + + {aeadfa95-9c89-4212-98ae-89ad57db596a} + + + {b9880458-36e5-4f28-a34b-d01d9512a395} + @@ -512,6 +521,51 @@ event_dispatcher + + physics + + + physics + + + physics + + + physics + + + physics + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + @@ -1035,5 +1089,59 @@ event_dispatcher + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + + + physics\Box2D + \ No newline at end of file diff --git a/extensions/Android.mk b/extensions/Android.mk index e5f7924e84..0a1877b23e 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -43,8 +43,8 @@ CocoStudio/Armature/display/CCDisplayFactory.cpp \ CocoStudio/Armature/display/CCDisplayManager.cpp \ CocoStudio/Armature/display/CCSkin.cpp \ CocoStudio/Armature/physics/CCColliderDetector.cpp \ -CocoStudio/Armature/utils/CCArmatureDefine.cpp \ CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ +CocoStudio/Armature/utils/CCArmatureDefine.cpp \ CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ CocoStudio/Armature/utils/CCTransformHelp.cpp \ diff --git a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk index 13989f3cf1..a59a21c7dd 100644 --- a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk @@ -12,10 +12,11 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static chipmunk_static include $(BUILD_SHARED_LIBRARY) $(call import-module,cocos2dx) $(call import-module,CocosDenshion/android) $(call import-module,cocos2dx/platform/android) +$(call import-module,external/chipmunk) diff --git a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj b/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj index 616d9f442d..cc87373ff7 100644 --- a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj +++ b/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj @@ -67,7 +67,7 @@ Disabled - $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;..\Classes;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;..\Classes;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks diff --git a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk b/samples/Cpp/SimpleGame/proj.android/jni/Android.mk index e3f5b5c1ef..d50779e5c4 100644 --- a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk +++ b/samples/Cpp/SimpleGame/proj.android/jni/Android.mk @@ -13,7 +13,7 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static chipmunk_static include $(BUILD_SHARED_LIBRARY) @@ -21,3 +21,4 @@ $(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions) $(call import-module,cocos2dx/platform/android) +$(call import-module,external/chipmunk) diff --git a/samples/Cpp/TestCpp/proj.emscripten/Makefile b/samples/Cpp/TestCpp/proj.emscripten/Makefile index 426cb385e8..e2088a2ab4 100644 --- a/samples/Cpp/TestCpp/proj.emscripten/Makefile +++ b/samples/Cpp/TestCpp/proj.emscripten/Makefile @@ -76,6 +76,7 @@ SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ ../Classes/PerformanceTest/PerformanceTest.cpp \ ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ + ../Classes/PhysicsTest/PhysicsTest.cpp \ ../Classes/RenderTextureTest/RenderTextureTest.cpp \ ../Classes/RotateWorldTest/RotateWorldTest.cpp \ ../Classes/SceneTest/SceneTest.cpp \ diff --git a/samples/Cpp/TestCpp/proj.linux/Makefile b/samples/Cpp/TestCpp/proj.linux/Makefile index aa64af3764..a10cab6883 100644 --- a/samples/Cpp/TestCpp/proj.linux/Makefile +++ b/samples/Cpp/TestCpp/proj.linux/Makefile @@ -82,6 +82,7 @@ SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ ../Classes/PerformanceTest/PerformanceTest.cpp \ ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ + ../Classes/PhysicsTest/PhysicsTest.cpp \ ../Classes/RenderTextureTest/RenderTextureTest.cpp \ ../Classes/RotateWorldTest/RotateWorldTest.cpp \ ../Classes/SceneTest/SceneTest.cpp \ diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj index e38cc2fe68..af1e2fa4cc 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj @@ -160,6 +160,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O + @@ -273,6 +274,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O + diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters index f6dac52c63..bf4d74d5c1 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters @@ -241,6 +241,9 @@ {0b414789-7971-4a4c-86e3-40cc00936684} + + {a83cb042-e3d6-4d3b-a4f6-30a4b3fcb3e9} + @@ -571,6 +574,9 @@ Classes\NewEventDispatcherTest + + Classes\PhysicsTest + @@ -1078,5 +1084,8 @@ Classes\NewEventDispatcherTest + + Classes\PhysicsTest + \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index 7ab70c4ea1..6cc69ba5c8 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -77,7 +77,7 @@ Disabled - $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;%(AdditionalIncludeDirectories) + $(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks diff --git a/scripting/lua/proj.win32/liblua.vcxproj b/scripting/lua/proj.win32/liblua.vcxproj index cc6539600d..a890c7e2dc 100644 --- a/scripting/lua/proj.win32/liblua.vcxproj +++ b/scripting/lua/proj.win32/liblua.vcxproj @@ -62,7 +62,7 @@ Disabled - $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;$(ProjectDir)..\..\external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks