issue #1731:change CCSize, CCPoint and CCRect to struct in pkg files

This commit is contained in:
minggo 2013-02-19 10:08:25 +08:00
parent 414343dc44
commit 1b743b37c9
3 changed files with 13 additions and 15 deletions

View File

@ -1 +1 @@
981b8356bc8bd77f7380a9c0a4ba82e4116f7404
4e29f8ee3a6b5f2a9da96b64d4a44e977f1dec73

View File

@ -1,7 +1,5 @@
typedef float CGFloat;
class CCPoint : public CCObject
struct CCPoint
{
float x;
float y;
@ -11,7 +9,7 @@ class CCPoint : public CCObject
bool equals(const CCPoint & target) const ;
};
class CCSize : public CCObject
struct CCSize
{
float width;
float height;
@ -21,7 +19,7 @@ class CCSize : public CCObject
bool equals(const CCSize & target) const;
};
class CCRect : public CCObject
struct CCRect
{
CCPoint origin;
CCSize size;

View File

@ -2,22 +2,22 @@
static CCPoint ccpNeg(const CCPoint& v);
static CCPoint ccpAdd(const CCPoint& v1, const CCPoint& v2);
static CCPoint ccpSub(const CCPoint& v1, const CCPoint& v2);
static CCPoint ccpMult(const CCPoint& v, const CGFloat s);
static CCPoint ccpMult(const CCPoint& v, const float s);
static CCPoint ccpMidpoint(const CCPoint& v1, const CCPoint& v2);
static CGFloat ccpDot(const CCPoint& v1, const CCPoint& v2);
static CGFloat ccpCross(const CCPoint& v1, const CCPoint& v2);
static float ccpDot(const CCPoint& v1, const CCPoint& v2);
static float ccpCross(const CCPoint& v1, const CCPoint& v2);
static CCPoint ccpPerp(const CCPoint& v);
static CCPoint ccpRPerp(const CCPoint& v);
static CCPoint ccpProject(const CCPoint& v1, const CCPoint& v2);
static CCPoint ccpRotate(const CCPoint& v1, const CCPoint& v2);
static CCPoint ccpUnrotate(const CCPoint& v1, const CCPoint& v2);
static CGFloat ccpLengthSQ(const CCPoint& v);
static CGFloat ccpDistanceSQ(const CCPoint p1, const CCPoint p2);
CGFloat ccpLength(const CCPoint& v);
CGFloat ccpDistance(const CCPoint& v1, const CCPoint& v2);
static float ccpLengthSQ(const CCPoint& v);
static float ccpDistanceSQ(const CCPoint p1, const CCPoint p2);
float ccpLength(const CCPoint& v);
float ccpDistance(const CCPoint& v1, const CCPoint& v2);
CCPoint ccpNormalize(const CCPoint& v);
CCPoint ccpForAngle(const CGFloat a);
CGFloat ccpToAngle(const CCPoint& v);
CCPoint ccpForAngle(const float a);
float ccpToAngle(const CCPoint& v);
float clampf(float value, float min_inclusive, float max_inclusive);
CCPoint ccpClamp(const CCPoint& p, const CCPoint& from, const CCPoint& to);
CCPoint ccpFromSize(const CCSize& s);