Merge branch 'master' into bada

This commit is contained in:
dumganhar 2011-10-10 13:47:16 +08:00
commit 64388023f6
4 changed files with 18 additions and 8 deletions

View File

@ -136,8 +136,10 @@ void ccDrawLine(const CCPoint& origin, const CCPoint& destination)
glEnable(GL_TEXTURE_2D); 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]; ccVertex2F* newPoint = new ccVertex2F[numberOfPoints];
if (! newPoint) if (! newPoint)
@ -190,11 +192,11 @@ void ccDrawPoly(const CCPoint *poli, int numberOfPoints, bool closePolygon)
if( closePolygon ) if( closePolygon )
{ {
glDrawArrays(GL_LINE_LOOP, 0, (GLsizei)numberOfPoints); glDrawArrays(fill? GL_TRIANGLE_FAN : GL_LINE_LOOP, 0, numberOfPoints);
} }
else else
{ {
glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)numberOfPoints); glDrawArrays(fill? GL_TRIANGLE_FAN : GL_LINE_STRIP, 0, numberOfPoints);
} }
// restore default state // restore default state

View File

@ -63,6 +63,11 @@ The polygon can be closed or open
*/ */
void CC_DLL ccDrawPoly( const CCPoint *vertices, int numOfVertices, bool closePolygon ); 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. */ /** draws a circle given the center, radius and number of segments. */
void CC_DLL ccDrawCircle( const CCPoint& center, float radius, float angle, int segments, bool drawLineToCenter); void CC_DLL ccDrawCircle( const CCPoint& center, float radius, float angle, int segments, bool drawLineToCenter);

View File

@ -26,16 +26,17 @@ THE SOFTWARE.
#define __PLATFORM_H__ #define __PLATFORM_H__
#include "CCThread.h" #include "CCThread.h"
#include "CCPlatformMacros.h"
NS_CC_BEGIN; NS_CC_BEGIN;
struct cc_timeval struct CC_DLL cc_timeval
{ {
long tv_sec; // seconds long tv_sec; // seconds
long tv_usec; // microSeconds long tv_usec; // microSeconds
}; };
class CCTime class CC_DLL CCTime
{ {
public: public:
static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp); static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp);

View File

@ -58,8 +58,7 @@ move_eclipse_configures_into(){
sed -i "s/HelloWorld/$projName/" $APP_DIR/Linux/.project sed -i "s/HelloWorld/$projName/" $APP_DIR/Linux/.project
sed -i "s:../../../:$COCOS2DX_ROOT:;s:helloworld:$projName:" $APP_DIR/Linux/.cproject sed -i "s:\.\./\.\./\.\./:$COCOS2DX_ROOT:;s:helloworld:$projName:" $APP_DIR/Linux/.cproject
#sed -i "s/helloworld/$projName/" $APP_DIR/Linux/.cproject
} }
#copy main sources #copy main sources
@ -71,6 +70,9 @@ copy_cpp_h_from_helloworld(){
cp $file $APP_DIR/Classes cp $file $APP_DIR/Classes
fi fi
done done
# load resources from Resources, not Resource
sed -i "s:\.\./Resource/:\.\./Resources/:" $APP_DIR/Classes/AppDelegate.cpp
} }
# copy resources # copy resources