From 6d358cfad7de078d40d772212829dd3205ef20f3 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 29 Sep 2011 02:14:17 -0700 Subject: [PATCH 1/3] make linux template work ok --- template/linux/mycopy_files.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/template/linux/mycopy_files.sh b/template/linux/mycopy_files.sh index 84cc4c7fca..06c553cb0b 100755 --- a/template/linux/mycopy_files.sh +++ b/template/linux/mycopy_files.sh @@ -58,8 +58,7 @@ move_eclipse_configures_into(){ sed -i "s/HelloWorld/$projName/" $APP_DIR/Linux/.project - sed -i "s:../../../:$COCOS2DX_ROOT:;s:helloworld:$projName:" $APP_DIR/Linux/.cproject - #sed -i "s/helloworld/$projName/" $APP_DIR/Linux/.cproject + sed -i "s:\.\./\.\./\.\./:$COCOS2DX_ROOT:;s:helloworld:$projName:" $APP_DIR/Linux/.cproject } #copy main sources @@ -71,6 +70,9 @@ copy_cpp_h_from_helloworld(){ cp $file $APP_DIR/Classes fi done + + # load resources from Resources, not Resource + sed -i "s:\.\./Resource/:\.\./Resources/:" $APP_DIR/Classes/AppDelegate.cpp } # copy resources From d23b0447823de7b8bb9d964d8eff3b2a255e2dd3 Mon Sep 17 00:00:00 2001 From: Eli Yukelzon Date: Wed, 5 Oct 2011 10:50:00 +0200 Subject: [PATCH 2/3] fill for polygon drawing --- cocos2dx/CCDrawingPrimitives.cpp | 10 ++++++---- cocos2dx/include/CCDrawingPrimitives.h | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cocos2dx/CCDrawingPrimitives.cpp b/cocos2dx/CCDrawingPrimitives.cpp index 9c413abf1f..f97c928969 100644 --- a/cocos2dx/CCDrawingPrimitives.cpp +++ b/cocos2dx/CCDrawingPrimitives.cpp @@ -136,8 +136,10 @@ void ccDrawLine(CCPoint origin, CCPoint destination) glEnable(GL_TEXTURE_2D); } - -void ccDrawPoly(const CCPoint *poli, int numberOfPoints, bool closePolygon) +void ccDrawPoly(const CCPoint *poli, int numberOfPoints, bool closePolygon){ + ccDrawPoly(poli,numberOfPoints,closePolygon,false); +} +void ccDrawPoly(const CCPoint *poli, int numberOfPoints, bool closePolygon, bool fill) { ccVertex2F* newPoint = new ccVertex2F[numberOfPoints]; if (! newPoint) @@ -190,11 +192,11 @@ void ccDrawPoly(const CCPoint *poli, int numberOfPoints, bool closePolygon) if( closePolygon ) { - glDrawArrays(GL_LINE_LOOP, 0, (GLsizei)numberOfPoints); + glDrawArrays(fill? GL_TRIANGLE_FAN : GL_LINE_LOOP, 0, numberOfPoints); } else { - glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)numberOfPoints); + glDrawArrays(fill? GL_TRIANGLE_FAN : GL_LINE_STRIP, 0, numberOfPoints); } // restore default state diff --git a/cocos2dx/include/CCDrawingPrimitives.h b/cocos2dx/include/CCDrawingPrimitives.h index 2283c1c38a..f883e0fec5 100644 --- a/cocos2dx/include/CCDrawingPrimitives.h +++ b/cocos2dx/include/CCDrawingPrimitives.h @@ -63,6 +63,11 @@ The polygon can be closed or open */ void CC_DLL ccDrawPoly( const CCPoint *vertices, int numOfVertices, bool closePolygon ); +/** draws a poligon given a pointer to CCPoint coordiantes and the number of vertices measured in points. +The polygon can be closed or open and optionally filled with current GL color +*/ +void CC_DLL ccDrawPoly( const CCPoint *vertices, int numOfVertices, bool closePolygon , bool fill); + /** draws a circle given the center, radius and number of segments. */ void CC_DLL ccDrawCircle( CCPoint center, float radius, float angle, int segments, bool drawLineToCenter); From 9695b6df8680ebb2262d7b49ab325288490a296c Mon Sep 17 00:00:00 2001 From: minggo Date: Sun, 9 Oct 2011 10:19:12 +0800 Subject: [PATCH 3/3] fixed #745: export CCTime to dll --- cocos2dx/platform/platform.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/platform.h b/cocos2dx/platform/platform.h index d5c0d8859c..3e16e99f4f 100644 --- a/cocos2dx/platform/platform.h +++ b/cocos2dx/platform/platform.h @@ -26,16 +26,17 @@ THE SOFTWARE. #define __PLATFORM_H__ #include "CCThread.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN; -struct cc_timeval +struct CC_DLL cc_timeval { long tv_sec; // seconds long tv_usec; // microSeconds }; -class CCTime +class CC_DLL CCTime { public: static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp);