mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3154 from minggo/add-deprecated-header
Add deprecated header
This commit is contained in:
commit
93e75bad9f
|
@ -1 +1 @@
|
||||||
3f4cd506dc44d54f375a2c759a90db69d845b75b
|
16f9fcf29ae0c1b3a14728f0a11518f50355fb18
|
|
@ -113,7 +113,6 @@ sprite_nodes/CCSpriteFrameCache.cpp \
|
||||||
support/ccUTF8.cpp \
|
support/ccUTF8.cpp \
|
||||||
support/CCNotificationCenter.cpp \
|
support/CCNotificationCenter.cpp \
|
||||||
support/CCProfiling.cpp \
|
support/CCProfiling.cpp \
|
||||||
support/CCPointExtension.cpp \
|
|
||||||
support/TransformUtils.cpp \
|
support/TransformUtils.cpp \
|
||||||
support/user_default/CCUserDefaultAndroid.cpp \
|
support/user_default/CCUserDefaultAndroid.cpp \
|
||||||
support/base64.cpp \
|
support/base64.cpp \
|
||||||
|
|
|
@ -38,7 +38,6 @@ THE SOFTWARE.
|
||||||
#include "CCScheduler.h"
|
#include "CCScheduler.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "touch_dispatcher/CCTouchDispatcher.h"
|
#include "touch_dispatcher/CCTouchDispatcher.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/CCNotificationCenter.h"
|
#include "support/CCNotificationCenter.h"
|
||||||
#include "layers_scenes_transitions_nodes/CCTransition.h"
|
#include "layers_scenes_transitions_nodes/CCTransition.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
|
|
|
@ -27,7 +27,6 @@ THE SOFTWARE.
|
||||||
#include "CCAction.h"
|
#include "CCAction.h"
|
||||||
#include "CCActionInterval.h"
|
#include "CCActionInterval.h"
|
||||||
#include "base_nodes/CCNode.h"
|
#include "base_nodes/CCNode.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
* Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada
|
* Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada
|
||||||
*/
|
*/
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCActionCatmullRom.h"
|
#include "CCActionCatmullRom.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
|
@ -23,7 +23,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "CCActionGrid3D.h"
|
#include "CCActionGrid3D.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ THE SOFTWARE.
|
||||||
#include "CCActionInterval.h"
|
#include "CCActionInterval.h"
|
||||||
#include "sprite_nodes/CCSprite.h"
|
#include "sprite_nodes/CCSprite.h"
|
||||||
#include "base_nodes/CCNode.h"
|
#include "base_nodes/CCNode.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCStdC.h"
|
#include "CCStdC.h"
|
||||||
#include "CCActionInstant.h"
|
#include "CCActionInstant.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
|
@ -23,7 +23,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "CCActionPageTurn3D.h"
|
#include "CCActionPageTurn3D.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ THE SOFTWARE.
|
||||||
#include "CCActionTiledGrid.h"
|
#include "CCActionTiledGrid.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "effects/CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "cocoa/CCString.h"
|
#include "cocoa/CCString.h"
|
||||||
#include "CCNode.h"
|
#include "CCNode.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/TransformUtils.h"
|
#include "support/TransformUtils.h"
|
||||||
#include "CCCamera.h"
|
#include "CCCamera.h"
|
||||||
#include "effects/CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
|
|
|
@ -334,31 +334,6 @@ public:
|
||||||
static const Rect ZERO;
|
static const Rect ZERO;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE inline Point CCPointMake(float x, float y)
|
|
||||||
{
|
|
||||||
return Point(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE inline Size CCSizeMake(float width, float height)
|
|
||||||
{
|
|
||||||
return Size(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE inline Rect CCRectMake(float x, float y, float width, float height)
|
|
||||||
{
|
|
||||||
return Rect(x, y, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE const Point PointZero = Point::ZERO;
|
|
||||||
|
|
||||||
/* The "zero" size -- equivalent to Size(0, 0). */
|
|
||||||
CC_DEPRECATED_ATTRIBUTE const Size SizeZero = Size::ZERO;
|
|
||||||
|
|
||||||
/* The "zero" rectangle -- equivalent to Rect(0, 0, 0, 0). */
|
|
||||||
CC_DEPRECATED_ATTRIBUTE const Rect RectZero = Rect::ZERO;
|
|
||||||
|
|
||||||
// end of data_structure group
|
// end of data_structure group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCDrawNode.h"
|
#include "CCDrawNode.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "CCGL.h"
|
#include "CCGL.h"
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ THE SOFTWARE.
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "actions/CCActionCatmullRom.h"
|
#include "actions/CCActionCatmullRom.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ THE SOFTWARE.
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/ccGLStateCache.h"
|
#include "shaders/ccGLStateCache.h"
|
||||||
#include "CCGL.h"
|
#include "CCGL.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/TransformUtils.h"
|
#include "support/TransformUtils.h"
|
||||||
#include "kazmath/kazmath.h"
|
#include "kazmath/kazmath.h"
|
||||||
#include "kazmath/GL/matrix.h"
|
#include "kazmath/GL/matrix.h"
|
||||||
|
|
|
@ -0,0 +1,463 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2013 cocos2d-x.org
|
||||||
|
|
||||||
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
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.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/** Add deprecated global functions and variables here
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __COCOS2D_CCDEPRECATED_H__
|
||||||
|
#define __COCOS2D_CCDEPRECATED_H__
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include "cocoa/CCGeometry.h"
|
||||||
|
#include "ccTypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup data_structures
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Helper macro that creates a Point
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE inline Point ccp(float x, float y)
|
||||||
|
{
|
||||||
|
return Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns opposite of point.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
@deprecated please use Point::-, for example: -v1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpNeg(const Point& v)
|
||||||
|
{
|
||||||
|
return -v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates sum of two points.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
@deprecated please use Point::+, for example: v1 + v2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpAdd(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1 + v2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates difference of two points.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
@deprecated please use Point::-, for example: v1 - v2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpSub(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1 - v2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns point multiplied by given factor.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
@deprecated please use Point::*, for example: v1 * v2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpMult(const Point& v, const float s)
|
||||||
|
{
|
||||||
|
return v * s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates midpoint between two points.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
@deprecated please use it like (v1 + v2) / 2.0f
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpMidpoint(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.getMidpoint(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates dot product of two points.
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float
|
||||||
|
ccpDot(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.dot(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates cross product of two points.
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float
|
||||||
|
ccpCross(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.cross(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpPerp(const Point& v)
|
||||||
|
{
|
||||||
|
return v.getPerp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpRPerp(const Point& v)
|
||||||
|
{
|
||||||
|
return v.getRPerp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates the projection of v1 over v2.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpProject(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.project(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Rotates two points.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpRotate(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.rotate(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Unrotates two points.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point
|
||||||
|
ccpUnrotate(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.unrotate(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates the square length of a Point (not calling sqrt() )
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float
|
||||||
|
ccpLengthSQ(const Point& v)
|
||||||
|
{
|
||||||
|
return v.getLengthSq();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Calculates the square distance between two points (not calling sqrt() )
|
||||||
|
@return float
|
||||||
|
@since v1.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float
|
||||||
|
ccpDistanceSQ(const Point p1, const Point p2)
|
||||||
|
{
|
||||||
|
return (p1 - p2).getLengthSq();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Calculates distance between point an origin
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float ccpLength(const Point& v)
|
||||||
|
{
|
||||||
|
return v.getLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates the distance between two points
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float ccpDistance(const Point& v1, const Point& v2)
|
||||||
|
{
|
||||||
|
return v1.getDistance(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns point multiplied to a length of 1.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpNormalize(const Point& v)
|
||||||
|
{
|
||||||
|
return v.normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts radians to a normalized vector.
|
||||||
|
@return Point
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpForAngle(const float a)
|
||||||
|
{
|
||||||
|
return Point::forAngle(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a vector to radians.
|
||||||
|
@return float
|
||||||
|
@since v0.7.2
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float ccpToAngle(const Point& v)
|
||||||
|
{
|
||||||
|
return v.getAngle();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Clamp a point between from and to.
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpClamp(const Point& p, const Point& from, const Point& to)
|
||||||
|
{
|
||||||
|
return p.getClampPoint(from, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Quickly convert Size to a Point
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpFromSize(const Size& s)
|
||||||
|
{
|
||||||
|
return Point(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Run a math operation function on each point component
|
||||||
|
* absf, fllorf, ceilf, roundf
|
||||||
|
* any function that has the signature: float func(float);
|
||||||
|
* For example: let's try to take the floor of x,y
|
||||||
|
* ccpCompOp(p,floorf);
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpCompOp(const Point& p, float (*opFunc)(float))
|
||||||
|
{
|
||||||
|
return p.compOp(opFunc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Linear Interpolation between two points a and b
|
||||||
|
@returns
|
||||||
|
alpha == 0 ? a
|
||||||
|
alpha == 1 ? b
|
||||||
|
otherwise a value between a..b
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpLerp(const Point& a, const Point& b, float alpha)
|
||||||
|
{
|
||||||
|
return a.lerp(b, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** @returns if points have fuzzy equality which means equal with some degree of variance.
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline bool ccpFuzzyEqual(const Point& a, const Point& b, float variance)
|
||||||
|
{
|
||||||
|
return a.fuzzyEquals(b, variance);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Multiplies a and b components, a.x*b.x, a.y*b.y
|
||||||
|
@returns a component-wise multiplication
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpCompMult(const Point& a, const Point& b)
|
||||||
|
{
|
||||||
|
return Point(a.x * b.x, a.y * b.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @returns the signed angle in radians between two vector directions
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float ccpAngleSigned(const Point& a, const Point& b)
|
||||||
|
{
|
||||||
|
return a.getAngle(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @returns the angle in radians between two vector directions
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline float ccpAngle(const Point& a, const Point& b)
|
||||||
|
{
|
||||||
|
return a.getAngle(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Rotates a point counter clockwise by the angle around a pivot
|
||||||
|
@param v is the point to rotate
|
||||||
|
@param pivot is the pivot, naturally
|
||||||
|
@param angle is the angle of rotation cw in radians
|
||||||
|
@returns the rotated point
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpRotateByAngle(const Point& v, const Point& pivot, float angle)
|
||||||
|
{
|
||||||
|
return v.rotateByAngle(pivot, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A general line-line intersection test
|
||||||
|
@param p1
|
||||||
|
is the startpoint for the first line P1 = (p1 - p2)
|
||||||
|
@param p2
|
||||||
|
is the endpoint for the first line P1 = (p1 - p2)
|
||||||
|
@param p3
|
||||||
|
is the startpoint for the second line P2 = (p3 - p4)
|
||||||
|
@param p4
|
||||||
|
is the endpoint for the second line P2 = (p3 - p4)
|
||||||
|
@param s
|
||||||
|
is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))
|
||||||
|
@param t
|
||||||
|
is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))
|
||||||
|
@return bool
|
||||||
|
indicating successful intersection of a line
|
||||||
|
note that to truly test intersection for segments we have to make
|
||||||
|
sure that s & t lie within [0..1] and for rays, make sure s & t > 0
|
||||||
|
the hit point is p3 + t * (p4 - p3);
|
||||||
|
the hit point also is p1 + s * (p2 - p1);
|
||||||
|
@since v0.99.1
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline bool ccpLineIntersect(const Point& p1, const Point& p2,
|
||||||
|
const Point& p3, const Point& p4,
|
||||||
|
float *s, float *t)
|
||||||
|
{
|
||||||
|
return Point::isLineIntersect(p1, p2, p3, p4, s, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ccpSegmentIntersect returns YES if Segment A-B intersects with segment C-D
|
||||||
|
@since v1.0.0
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)
|
||||||
|
{
|
||||||
|
return Point::isSegmentIntersect(A, B, C, D);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ccpIntersectPoint returns the intersection point of line A-B, C-D
|
||||||
|
@since v1.0.0
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Point ccpIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D)
|
||||||
|
{
|
||||||
|
return Point::getIntersectPoint(A, B, C, D);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE inline Point CCPointMake(float x, float y)
|
||||||
|
{
|
||||||
|
return Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE inline Size CCSizeMake(float width, float height)
|
||||||
|
{
|
||||||
|
return Size(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE inline Rect CCRectMake(float x, float y, float width, float height)
|
||||||
|
{
|
||||||
|
return Rect(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Point PointZero = Point::ZERO;
|
||||||
|
|
||||||
|
/* The "zero" size -- equivalent to Size(0, 0). */
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Size SizeZero = Size::ZERO;
|
||||||
|
|
||||||
|
/* The "zero" rectangle -- equivalent to Rect(0, 0, 0, 0). */
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Rect RectZero = Rect::ZERO;
|
||||||
|
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccWHITE = Color3B::WHITE;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccYELLOW = Color3B::YELLOW;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccGREEN = Color3B::GREEN;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccBLUE = Color3B::BLUE;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccRED = Color3B::RED;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccMAGENTA = Color3B::MAGENTA;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccBLACK = Color3B::BLACK;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccORANGE = Color3B::ORANGE;
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const Color3B ccGRAY = Color3B::GRAY;
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE const BlendFunc kBlendFuncDisable = BlendFunc::BLEND_FUNC_DISABLE;
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color3B ccc3(GLubyte r, GLubyte g, GLubyte b)
|
||||||
|
{
|
||||||
|
return Color3B(r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline bool ccc3BEqual(const Color3B &col1, const Color3B &col2)
|
||||||
|
{
|
||||||
|
return col1.r == col2.r && col1.g == col2.g && col1.b == col2.b;
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color4B
|
||||||
|
ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o)
|
||||||
|
{
|
||||||
|
return Color4B(r, g, b, o);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color4F ccc4FFromccc3B(Color3B c)
|
||||||
|
{
|
||||||
|
return Color4F(c.r/255.f, c.g/255.f, c.b/255.f, 1.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color4F
|
||||||
|
ccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a)
|
||||||
|
{
|
||||||
|
return Color4F(r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color4F ccc4FFromccc4B(Color4B c)
|
||||||
|
{
|
||||||
|
return Color4F(c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline Color4B ccc4BFromccc4F(Color4F c)
|
||||||
|
{
|
||||||
|
return Color4B((GLubyte)(c.r*255), (GLubyte)(c.g*255), (GLubyte)(c.b*255), (GLubyte)(c.a*255));
|
||||||
|
}
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE static inline bool ccc4FEqual(Color4F a, Color4F b)
|
||||||
|
{
|
||||||
|
return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
// end of data_structures group
|
||||||
|
/// @}
|
||||||
|
|
||||||
|
NS_CC_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __COCOS2D_CCDEPRECATED_H__
|
|
@ -85,6 +85,7 @@ THE SOFTWARE.
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "ccTypes.h"
|
#include "ccTypes.h"
|
||||||
|
#include "CCDeprecated.h"
|
||||||
|
|
||||||
// kazmath
|
// kazmath
|
||||||
#include "kazmath/include/kazmath/kazmath.h"
|
#include "kazmath/include/kazmath/kazmath.h"
|
||||||
|
@ -235,7 +236,6 @@ THE SOFTWARE.
|
||||||
// support
|
// support
|
||||||
#include "support/ccUTF8.h"
|
#include "support/ccUTF8.h"
|
||||||
#include "support/CCNotificationCenter.h"
|
#include "support/CCNotificationCenter.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/CCProfiling.h"
|
#include "support/CCProfiling.h"
|
||||||
#include "support/user_default/CCUserDefault.h"
|
#include "support/user_default/CCUserDefault.h"
|
||||||
#include "support/CCVertex.h"
|
#include "support/CCVertex.h"
|
||||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
||||||
#include "CCLabelAtlas.h"
|
#include "CCLabelAtlas.h"
|
||||||
#include "textures/CCTextureAtlas.h"
|
#include "textures/CCTextureAtlas.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "draw_nodes/CCDrawingPrimitives.h"
|
#include "draw_nodes/CCDrawingPrimitives.h"
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
|
|
|
@ -37,7 +37,6 @@ http://www.angelcode.com/products/bmfont/ (Free, Windows only)
|
||||||
#include "CCConfiguration.h"
|
#include "CCConfiguration.h"
|
||||||
#include "draw_nodes/CCDrawingPrimitives.h"
|
#include "draw_nodes/CCDrawingPrimitives.h"
|
||||||
#include "sprite_nodes/CCSprite.h"
|
#include "sprite_nodes/CCSprite.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
|
|
|
@ -30,7 +30,6 @@ THE SOFTWARE.
|
||||||
#include "keypad_dispatcher/CCKeypadDispatcher.h"
|
#include "keypad_dispatcher/CCKeypadDispatcher.h"
|
||||||
#include "CCAccelerometer.h"
|
#include "CCAccelerometer.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "script_support/CCScriptSupport.h"
|
#include "script_support/CCScriptSupport.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
|
|
|
@ -25,7 +25,6 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCScene.h"
|
#include "CCScene.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include "CCTransition.h"
|
#include "CCTransition.h"
|
||||||
#include "CCCamera.h"
|
#include "CCCamera.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "touch_dispatcher/CCTouchDispatcher.h"
|
#include "touch_dispatcher/CCTouchDispatcher.h"
|
||||||
#include "actions/CCActionInterval.h"
|
#include "actions/CCActionInterval.h"
|
||||||
|
|
|
@ -32,7 +32,6 @@ THE SOFTWARE.
|
||||||
#include "CCLayer.h"
|
#include "CCLayer.h"
|
||||||
#include "actions/CCActionInstant.h"
|
#include "actions/CCActionInstant.h"
|
||||||
#include "actions/CCActionProgressTimer.h"
|
#include "actions/CCActionProgressTimer.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ THE SOFTWARE.
|
||||||
#include "CCMenu.h"
|
#include "CCMenu.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "CCApplication.h"
|
#include "CCApplication.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "touch_dispatcher/CCTouchDispatcher.h"
|
#include "touch_dispatcher/CCTouchDispatcher.h"
|
||||||
#include "touch_dispatcher/CCTouch.h"
|
#include "touch_dispatcher/CCTouch.h"
|
||||||
#include "CCStdC.h"
|
#include "CCStdC.h"
|
||||||
|
|
|
@ -25,7 +25,6 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCMenuItem.h"
|
#include "CCMenuItem.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "actions/CCActionInterval.h"
|
#include "actions/CCActionInterval.h"
|
||||||
#include "sprite_nodes/CCSprite.h"
|
#include "sprite_nodes/CCSprite.h"
|
||||||
#include "label_nodes/CCLabelAtlas.h"
|
#include "label_nodes/CCLabelAtlas.h"
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "draw_nodes/CCDrawingPrimitives.h"
|
#include "draw_nodes/CCDrawingPrimitives.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -30,7 +30,6 @@ THE SOFTWARE.
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
|
|
||||||
#include "support/CCVertex.h"
|
#include "support/CCVertex.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/ccGLStateCache.h"
|
#include "shaders/ccGLStateCache.h"
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "effects/CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCParticleSystem.h"
|
#include "CCParticleSystem.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
||||||
#include "CCParticleExamples.h"
|
#include "CCParticleExamples.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "firePngData.h"
|
#include "firePngData.h"
|
||||||
#include "platform/CCImage.h"
|
#include "platform/CCImage.h"
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ THE SOFTWARE.
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "textures/CCTextureAtlas.h"
|
#include "textures/CCTextureAtlas.h"
|
||||||
#include "support/base64.h"
|
#include "support/base64.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
#include "platform/CCImage.h"
|
#include "platform/CCImage.h"
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
|
@ -30,7 +30,6 @@ THE SOFTWARE.
|
||||||
#include "touch_dispatcher/CCTouchDispatcher.h"
|
#include "touch_dispatcher/CCTouchDispatcher.h"
|
||||||
#include "text_input_node/CCIMEDispatcher.h"
|
#include "text_input_node/CCIMEDispatcher.h"
|
||||||
#include "keypad_dispatcher/CCKeypadDispatcher.h"
|
#include "keypad_dispatcher/CCKeypadDispatcher.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCApplication.h"
|
#include "CCApplication.h"
|
||||||
#ifdef CC_KEYBOARD_SUPPORT
|
#ifdef CC_KEYBOARD_SUPPORT
|
||||||
#include "keyboard_dispatcher/CCKeyboardDispatcher.h"
|
#include "keyboard_dispatcher/CCKeyboardDispatcher.h"
|
||||||
|
@ -352,8 +351,8 @@ LRESULT EGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
Point pt(point.x, point.y);
|
Point pt(point.x, point.y);
|
||||||
pt.x /= _frameZoomFactor;
|
pt.x /= _frameZoomFactor;
|
||||||
pt.y /= _frameZoomFactor;
|
pt.y /= _frameZoomFactor;
|
||||||
Point tmp = ccp(pt.x, _screenSize.height - pt.y);
|
Point tmp = Point(pt.x, _screenSize.height - pt.y);
|
||||||
if (_viewPortRect.equals(RectZero) || _viewPortRect.containsPoint(tmp))
|
if (_viewPortRect.equals(Rect::ZERO) || _viewPortRect.containsPoint(tmp))
|
||||||
{
|
{
|
||||||
_captured = true;
|
_captured = true;
|
||||||
SetCapture(_wnd);
|
SetCapture(_wnd);
|
||||||
|
@ -415,8 +414,8 @@ LRESULT EGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
input.y = TOUCH_COORD_TO_PIXEL(ti.y);
|
input.y = TOUCH_COORD_TO_PIXEL(ti.y);
|
||||||
ScreenToClient(_wnd, &input);
|
ScreenToClient(_wnd, &input);
|
||||||
Point pt(input.x, input.y);
|
Point pt(input.x, input.y);
|
||||||
Point tmp = ccp(pt.x, _screenSize.height - pt.y);
|
Point tmp = Point(pt.x, _screenSize.height - pt.y);
|
||||||
if (_viewPortRect.equals(RectZero) || _viewPortRect.containsPoint(tmp))
|
if (_viewPortRect.equals(Rect::ZERO) || _viewPortRect.containsPoint(tmp))
|
||||||
{
|
{
|
||||||
pt.x /= _frameZoomFactor;
|
pt.x /= _frameZoomFactor;
|
||||||
pt.y /= _frameZoomFactor;
|
pt.y /= _frameZoomFactor;
|
||||||
|
|
|
@ -82,7 +82,6 @@ SOURCES = ../actions/CCAction.cpp \
|
||||||
../sprite_nodes/CCSpriteFrame.cpp \
|
../sprite_nodes/CCSpriteFrame.cpp \
|
||||||
../sprite_nodes/CCSpriteFrameCache.cpp \
|
../sprite_nodes/CCSpriteFrameCache.cpp \
|
||||||
../support/ccUTF8.cpp \
|
../support/ccUTF8.cpp \
|
||||||
../support/CCPointExtension.cpp \
|
|
||||||
../support/CCProfiling.cpp \
|
../support/CCProfiling.cpp \
|
||||||
../support/user_default/CCUserDefault.cpp \
|
../support/user_default/CCUserDefault.cpp \
|
||||||
../support/TransformUtils.cpp \
|
../support/TransformUtils.cpp \
|
||||||
|
|
|
@ -76,7 +76,6 @@ SOURCES = ../actions/CCAction.cpp \
|
||||||
../sprite_nodes/CCSpriteFrame.cpp \
|
../sprite_nodes/CCSpriteFrame.cpp \
|
||||||
../sprite_nodes/CCSpriteFrameCache.cpp \
|
../sprite_nodes/CCSpriteFrameCache.cpp \
|
||||||
../support/tinyxml2/tinyxml2.cpp \
|
../support/tinyxml2/tinyxml2.cpp \
|
||||||
../support/CCPointExtension.cpp \
|
|
||||||
../support/CCProfiling.cpp \
|
../support/CCProfiling.cpp \
|
||||||
../support/user_default/CCUserDefault.cpp \
|
../support/user_default/CCUserDefault.cpp \
|
||||||
../support/TransformUtils.cpp \
|
../support/TransformUtils.cpp \
|
||||||
|
|
|
@ -217,7 +217,6 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir
|
||||||
<ClCompile Include="..\sprite_nodes\CCSpriteFrameCache.cpp" />
|
<ClCompile Include="..\sprite_nodes\CCSpriteFrameCache.cpp" />
|
||||||
<ClCompile Include="..\support\base64.cpp" />
|
<ClCompile Include="..\support\base64.cpp" />
|
||||||
<ClCompile Include="..\support\CCNotificationCenter.cpp" />
|
<ClCompile Include="..\support\CCNotificationCenter.cpp" />
|
||||||
<ClCompile Include="..\support\CCPointExtension.cpp" />
|
|
||||||
<ClCompile Include="..\support\CCProfiling.cpp" />
|
<ClCompile Include="..\support\CCProfiling.cpp" />
|
||||||
<ClCompile Include="..\support\ccUTF8.cpp" />
|
<ClCompile Include="..\support\ccUTF8.cpp" />
|
||||||
<ClCompile Include="..\support\ccUtils.cpp" />
|
<ClCompile Include="..\support\ccUtils.cpp" />
|
||||||
|
@ -308,6 +307,7 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir
|
||||||
<ClInclude Include="..\actions\CCActionTiledGrid.h" />
|
<ClInclude Include="..\actions\CCActionTiledGrid.h" />
|
||||||
<ClInclude Include="..\actions\CCActionTween.h" />
|
<ClInclude Include="..\actions\CCActionTween.h" />
|
||||||
<ClInclude Include="..\include\ccConfig.h" />
|
<ClInclude Include="..\include\ccConfig.h" />
|
||||||
|
<ClInclude Include="..\include\CCDeprecated.h" />
|
||||||
<ClInclude Include="..\include\CCEventType.h" />
|
<ClInclude Include="..\include\CCEventType.h" />
|
||||||
<ClInclude Include="..\include\ccMacros.h" />
|
<ClInclude Include="..\include\ccMacros.h" />
|
||||||
<ClInclude Include="..\include\CCProtocols.h" />
|
<ClInclude Include="..\include\CCProtocols.h" />
|
||||||
|
@ -379,7 +379,6 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir
|
||||||
<ClInclude Include="..\sprite_nodes\CCSpriteFrameCache.h" />
|
<ClInclude Include="..\sprite_nodes\CCSpriteFrameCache.h" />
|
||||||
<ClInclude Include="..\support\base64.h" />
|
<ClInclude Include="..\support\base64.h" />
|
||||||
<ClInclude Include="..\support\CCNotificationCenter.h" />
|
<ClInclude Include="..\support\CCNotificationCenter.h" />
|
||||||
<ClInclude Include="..\support\CCPointExtension.h" />
|
|
||||||
<ClInclude Include="..\support\CCProfiling.h" />
|
<ClInclude Include="..\support\CCProfiling.h" />
|
||||||
<ClInclude Include="..\support\ccUTF8.h" />
|
<ClInclude Include="..\support\ccUTF8.h" />
|
||||||
<ClInclude Include="..\support\ccUtils.h" />
|
<ClInclude Include="..\support\ccUtils.h" />
|
||||||
|
|
|
@ -297,9 +297,6 @@
|
||||||
<ClCompile Include="..\support\CCNotificationCenter.cpp">
|
<ClCompile Include="..\support\CCNotificationCenter.cpp">
|
||||||
<Filter>support</Filter>
|
<Filter>support</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\support\CCPointExtension.cpp">
|
|
||||||
<Filter>support</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\support\CCProfiling.cpp">
|
<ClCompile Include="..\support\CCProfiling.cpp">
|
||||||
<Filter>support</Filter>
|
<Filter>support</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -720,9 +717,6 @@
|
||||||
<ClInclude Include="..\support\CCNotificationCenter.h">
|
<ClInclude Include="..\support\CCNotificationCenter.h">
|
||||||
<Filter>support</Filter>
|
<Filter>support</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\support\CCPointExtension.h">
|
|
||||||
<Filter>support</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\support\CCProfiling.h">
|
<ClInclude Include="..\support\CCProfiling.h">
|
||||||
<Filter>support</Filter>
|
<Filter>support</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -971,5 +965,8 @@
|
||||||
<ClInclude Include="..\keyboard_dispatcher\CCKeyboardDispatcher.h">
|
<ClInclude Include="..\keyboard_dispatcher\CCKeyboardDispatcher.h">
|
||||||
<Filter>keyboard_dispatcher</Filter>
|
<Filter>keyboard_dispatcher</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\CCDeprecated.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -37,7 +37,6 @@ THE SOFTWARE.
|
||||||
#include "shaders/ccGLStateCache.h"
|
#include "shaders/ccGLStateCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "cocoa/CCGeometry.h"
|
#include "cocoa/CCGeometry.h"
|
||||||
#include "textures/CCTexture2D.h"
|
#include "textures/CCTexture2D.h"
|
||||||
#include "cocoa/CCAffineTransform.h"
|
#include "cocoa/CCAffineTransform.h"
|
||||||
|
|
|
@ -30,7 +30,6 @@ THE SOFTWARE.
|
||||||
#include "effects/CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
#include "draw_nodes/CCDrawingPrimitives.h"
|
#include "draw_nodes/CCDrawingPrimitives.h"
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "shaders/ccGLStateCache.h"
|
#include "shaders/ccGLStateCache.h"
|
||||||
|
|
|
@ -1,128 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2010-2012 cocos2d-x.org
|
|
||||||
Copyright (c) 2007 Scott Lembcke
|
|
||||||
Copyright (c) 2010 Lam Pham
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
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 "CCPointExtension.h"
|
|
||||||
#include "ccMacros.h" // FLT_EPSILON
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
|
||||||
|
|
||||||
#define kPointEpsilon FLT_EPSILON
|
|
||||||
|
|
||||||
float
|
|
||||||
ccpLength(const Point& v)
|
|
||||||
{
|
|
||||||
return v.getLength();
|
|
||||||
}
|
|
||||||
|
|
||||||
float
|
|
||||||
ccpDistance(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.getDistance(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point
|
|
||||||
ccpNormalize(const Point& v)
|
|
||||||
{
|
|
||||||
return v.normalize();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point
|
|
||||||
ccpForAngle(const float a)
|
|
||||||
{
|
|
||||||
return Point::forAngle(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
float
|
|
||||||
ccpToAngle(const Point& v)
|
|
||||||
{
|
|
||||||
return v.getAngle();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpLerp(const Point& a, const Point& b, float alpha)
|
|
||||||
{
|
|
||||||
return a.lerp(b, alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpClamp(const Point& p, const Point& min_inclusive, const Point& max_inclusive)
|
|
||||||
{
|
|
||||||
return p.getClampPoint(min_inclusive, max_inclusive);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpFromSize(const Size& s)
|
|
||||||
{
|
|
||||||
return Point(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpCompOp(const Point& p, float (*opFunc)(float))
|
|
||||||
{
|
|
||||||
return p.compOp(opFunc);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ccpFuzzyEqual(const Point& a, const Point& b, float var)
|
|
||||||
{
|
|
||||||
return a.fuzzyEquals(b, var);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpCompMult(const Point& a, const Point& b)
|
|
||||||
{
|
|
||||||
return Point(a.x * b.x, a.y * b.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
float ccpAngleSigned(const Point& a, const Point& b)
|
|
||||||
{
|
|
||||||
return a.getAngle(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpRotateByAngle(const Point& v, const Point& pivot, float angle)
|
|
||||||
{
|
|
||||||
return v.rotateByAngle(pivot, angle);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)
|
|
||||||
{
|
|
||||||
return Point::isSegmentIntersect(A, B, C, D);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ccpIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D)
|
|
||||||
{
|
|
||||||
return Point::getIntersectPoint(A, B, C, D);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ccpLineIntersect(const Point& A, const Point& B,
|
|
||||||
const Point& C, const Point& D,
|
|
||||||
float *S, float *T)
|
|
||||||
{
|
|
||||||
return Point::isLineIntersect(A, B, C, D, S, T);
|
|
||||||
}
|
|
||||||
|
|
||||||
float ccpAngle(const Point& a, const Point& b)
|
|
||||||
{
|
|
||||||
return a.getAngle(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_CC_END
|
|
|
@ -1,346 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2010-2012 cocos2d-x.org
|
|
||||||
Copyright (c) 2007 Scott Lembcke
|
|
||||||
Copyright (c) 2010 Lam Pham
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
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.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef __SUPPORT_CGPOINTEXTENSION_H__
|
|
||||||
#define __SUPPORT_CGPOINTEXTENSION_H__
|
|
||||||
|
|
||||||
/**
|
|
||||||
@file
|
|
||||||
Point extensions based on Chipmunk's cpVect file.
|
|
||||||
These extensions work both with Point and cpVect.
|
|
||||||
|
|
||||||
The "ccp" prefix means: "CoCos2d Point"
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
- ccpAdd( Point(1,1), Point(2,2) ); // preferred cocos2d way
|
|
||||||
- ccpAdd( Point(1,1), Point(2,2) ); // also ok but more verbose
|
|
||||||
|
|
||||||
- cpvadd( cpv(1,1), cpv(2,2) ); // way of the chipmunk
|
|
||||||
- ccpAdd( cpv(1,1), cpv(2,2) ); // mixing chipmunk and cocos2d (avoid)
|
|
||||||
- cpvadd( Point(1,1), Point(2,2) ); // mixing chipmunk and CG (avoid)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "cocoa/CCGeometry.h"
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup data_structures
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Helper macro that creates a Point
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE inline Point ccp(float x, float y)
|
|
||||||
{
|
|
||||||
return Point(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns opposite of point.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
@deprecated please use Point::-, for example: -v1
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpNeg(const Point& v)
|
|
||||||
{
|
|
||||||
return -v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates sum of two points.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
@deprecated please use Point::+, for example: v1 + v2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpAdd(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1 + v2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates difference of two points.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
@deprecated please use Point::-, for example: v1 - v2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpSub(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1 - v2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns point multiplied by given factor.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
@deprecated please use Point::*, for example: v1 * v2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpMult(const Point& v, const float s)
|
|
||||||
{
|
|
||||||
return v * s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates midpoint between two points.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
@deprecated please use it like (v1 + v2) / 2.0f
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpMidpoint(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.getMidpoint(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates dot product of two points.
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE float
|
|
||||||
ccpDot(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.dot(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates cross product of two points.
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE float
|
|
||||||
ccpCross(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.cross(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpPerp(const Point& v)
|
|
||||||
{
|
|
||||||
return v.getPerp();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpRPerp(const Point& v)
|
|
||||||
{
|
|
||||||
return v.getRPerp();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates the projection of v1 over v2.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpProject(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.project(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Rotates two points.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpRotate(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.rotate(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Unrotates two points.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE Point
|
|
||||||
ccpUnrotate(const Point& v1, const Point& v2)
|
|
||||||
{
|
|
||||||
return v1.unrotate(v2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calculates the square length of a Point (not calling sqrt() )
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE float
|
|
||||||
ccpLengthSQ(const Point& v)
|
|
||||||
{
|
|
||||||
return v.getLengthSq();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Calculates the square distance between two points (not calling sqrt() )
|
|
||||||
@return float
|
|
||||||
@since v1.1
|
|
||||||
*/
|
|
||||||
static inline CC_DEPRECATED_ATTRIBUTE float
|
|
||||||
ccpDistanceSQ(const Point p1, const Point p2)
|
|
||||||
{
|
|
||||||
return (p1 - p2).getLengthSq();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Calculates distance between point an origin
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE float CC_DLL ccpLength(const Point& v);
|
|
||||||
|
|
||||||
/** Calculates the distance between two points
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE float CC_DLL ccpDistance(const Point& v1, const Point& v2);
|
|
||||||
|
|
||||||
/** Returns point multiplied to a length of 1.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpNormalize(const Point& v);
|
|
||||||
|
|
||||||
/** Converts radians to a normalized vector.
|
|
||||||
@return Point
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpForAngle(const float a);
|
|
||||||
|
|
||||||
/** Converts a vector to radians.
|
|
||||||
@return float
|
|
||||||
@since v0.7.2
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE float CC_DLL ccpToAngle(const Point& v);
|
|
||||||
|
|
||||||
|
|
||||||
/** Clamp a point between from and to.
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpClamp(const Point& p, const Point& from, const Point& to);
|
|
||||||
|
|
||||||
/** Quickly convert Size to a Point
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpFromSize(const Size& s);
|
|
||||||
|
|
||||||
/** Run a math operation function on each point component
|
|
||||||
* absf, fllorf, ceilf, roundf
|
|
||||||
* any function that has the signature: float func(float);
|
|
||||||
* For example: let's try to take the floor of x,y
|
|
||||||
* ccpCompOp(p,floorf);
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpCompOp(const Point& p, float (*opFunc)(float));
|
|
||||||
|
|
||||||
/** Linear Interpolation between two points a and b
|
|
||||||
@returns
|
|
||||||
alpha == 0 ? a
|
|
||||||
alpha == 1 ? b
|
|
||||||
otherwise a value between a..b
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpLerp(const Point& a, const Point& b, float alpha);
|
|
||||||
|
|
||||||
|
|
||||||
/** @returns if points have fuzzy equality which means equal with some degree of variance.
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE bool CC_DLL ccpFuzzyEqual(const Point& a, const Point& b, float variance);
|
|
||||||
|
|
||||||
|
|
||||||
/** Multiplies a and b components, a.x*b.x, a.y*b.y
|
|
||||||
@returns a component-wise multiplication
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpCompMult(const Point& a, const Point& b);
|
|
||||||
|
|
||||||
/** @returns the signed angle in radians between two vector directions
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE float CC_DLL ccpAngleSigned(const Point& a, const Point& b);
|
|
||||||
|
|
||||||
/** @returns the angle in radians between two vector directions
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE float CC_DLL ccpAngle(const Point& a, const Point& b);
|
|
||||||
|
|
||||||
/** Rotates a point counter clockwise by the angle around a pivot
|
|
||||||
@param v is the point to rotate
|
|
||||||
@param pivot is the pivot, naturally
|
|
||||||
@param angle is the angle of rotation cw in radians
|
|
||||||
@returns the rotated point
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpRotateByAngle(const Point& v, const Point& pivot, float angle);
|
|
||||||
|
|
||||||
/** A general line-line intersection test
|
|
||||||
@param p1
|
|
||||||
is the startpoint for the first line P1 = (p1 - p2)
|
|
||||||
@param p2
|
|
||||||
is the endpoint for the first line P1 = (p1 - p2)
|
|
||||||
@param p3
|
|
||||||
is the startpoint for the second line P2 = (p3 - p4)
|
|
||||||
@param p4
|
|
||||||
is the endpoint for the second line P2 = (p3 - p4)
|
|
||||||
@param s
|
|
||||||
is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))
|
|
||||||
@param t
|
|
||||||
is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))
|
|
||||||
@return bool
|
|
||||||
indicating successful intersection of a line
|
|
||||||
note that to truly test intersection for segments we have to make
|
|
||||||
sure that s & t lie within [0..1] and for rays, make sure s & t > 0
|
|
||||||
the hit point is p3 + t * (p4 - p3);
|
|
||||||
the hit point also is p1 + s * (p2 - p1);
|
|
||||||
@since v0.99.1
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE bool CC_DLL ccpLineIntersect(const Point& p1, const Point& p2,
|
|
||||||
const Point& p3, const Point& p4,
|
|
||||||
float *s, float *t);
|
|
||||||
|
|
||||||
/*
|
|
||||||
ccpSegmentIntersect returns YES if Segment A-B intersects with segment C-D
|
|
||||||
@since v1.0.0
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE bool CC_DLL ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D);
|
|
||||||
|
|
||||||
/*
|
|
||||||
ccpIntersectPoint returns the intersection point of line A-B, C-D
|
|
||||||
@since v1.0.0
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE Point CC_DLL ccpIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D);
|
|
||||||
|
|
||||||
// end of data_structures group
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
NS_CC_END
|
|
||||||
|
|
||||||
#endif // __SUPPORT_CGPOINTEXTENSION_H__
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCVertex.h"
|
#include "CCVertex.h"
|
||||||
#include "CCPointExtension.h"
|
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -24,7 +24,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "CCParallaxNode.h"
|
#include "CCParallaxNode.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/data_support/ccCArray.h"
|
#include "support/data_support/ccCArray.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -30,7 +30,6 @@ THE SOFTWARE.
|
||||||
#include "textures/CCTextureCache.h"
|
#include "textures/CCTextureCache.h"
|
||||||
#include "shaders/CCShaderCache.h"
|
#include "shaders/CCShaderCache.h"
|
||||||
#include "shaders/CCGLProgram.h"
|
#include "shaders/CCGLProgram.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/data_support/ccCArray.h"
|
#include "support/data_support/ccCArray.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ THE SOFTWARE.
|
||||||
#include "CCTMXXMLParser.h"
|
#include "CCTMXXMLParser.h"
|
||||||
#include "CCTMXLayer.h"
|
#include "CCTMXLayer.h"
|
||||||
#include "sprite_nodes/CCSprite.h"
|
#include "sprite_nodes/CCSprite.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ THE SOFTWARE.
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
#include "support/zip_support/ZipUtils.h"
|
#include "support/zip_support/ZipUtils.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "support/base64.h"
|
#include "support/base64.h"
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ THE SOFTWARE.
|
||||||
#include "cocoa/CCDictionary.h"
|
#include "cocoa/CCDictionary.h"
|
||||||
#include "cocoa/CCInteger.h"
|
#include "cocoa/CCInteger.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCTouch.h"
|
#include "CCTouch.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include "CCControlButton.h"
|
#include "CCControlButton.h"
|
||||||
#include "CCScale9Sprite.h"
|
#include "CCScale9Sprite.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "label_nodes/CCLabelTTF.h"
|
#include "label_nodes/CCLabelTTF.h"
|
||||||
#include "label_nodes/CCLabelBMFont.h"
|
#include "label_nodes/CCLabelBMFont.h"
|
||||||
#include "actions/CCAction.h"
|
#include "actions/CCAction.h"
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCControlColourPicker.h"
|
#include "CCControlColourPicker.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "sprite_nodes/CCSpriteFrameCache.h"
|
#include "sprite_nodes/CCSpriteFrameCache.h"
|
||||||
#include "sprite_nodes/CCSpriteBatchNode.h"
|
#include "sprite_nodes/CCSpriteBatchNode.h"
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCControlHuePicker.h"
|
#include "CCControlHuePicker.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCControlSaturationBrightnessPicker.h"
|
#include "CCControlSaturationBrightnessPicker.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCControlSlider.h"
|
#include "CCControlSlider.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "touch_dispatcher/CCTouch.h"
|
#include "touch_dispatcher/CCTouch.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCControlUtils.h"
|
#include "CCControlUtils.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@ NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Point& designCoord
|
||||||
EGLViewProtocol* eglView = EGLView::getInstance();
|
EGLViewProtocol* eglView = EGLView::getInstance();
|
||||||
|
|
||||||
Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());
|
Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());
|
||||||
Point screenGLPos = ccpAdd(visiblePos, eglView->getViewPortRect().origin);
|
Point screenGLPos = visiblePos + eglView->getViewPortRect().origin;
|
||||||
|
|
||||||
//TODO: I don't know why here needs to substract `height`.
|
//TODO: I don't know why here needs to substract `height`.
|
||||||
NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);
|
NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "CCTableView.h"
|
#include "CCTableView.h"
|
||||||
#include "CCTableViewCell.h"
|
#include "CCTableViewCell.h"
|
||||||
#include "menu_nodes/CCMenu.h"
|
#include "menu_nodes/CCMenu.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
#include "CCSorting.h"
|
#include "CCSorting.h"
|
||||||
#include "layers_scenes_transitions_nodes/CCLayer.h"
|
#include "layers_scenes_transitions_nodes/CCLayer.h"
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,7 @@ void SIOClientImpl::onOpen(cocos2d::extension::WebSocket* ws) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Director::sharedDirector()->getScheduler()->scheduleSelector(schedule_selector(SIOClientImpl::heartbeat), this, (_heartbeat * .9), false);
|
Director::getInstance()->getScheduler()->scheduleSelector(schedule_selector(SIOClientImpl::heartbeat), this, (_heartbeat * .9), false);
|
||||||
|
|
||||||
CCLog("SIOClientImpl::onOpen socket connected!");
|
CCLog("SIOClientImpl::onOpen socket connected!");
|
||||||
|
|
||||||
|
@ -632,7 +632,8 @@ SocketIO* SocketIO::instance() {
|
||||||
SIOClient* SocketIO::connect(SocketIO::SIODelegate& delegate, const std::string& uri) {
|
SIOClient* SocketIO::connect(SocketIO::SIODelegate& delegate, const std::string& uri) {
|
||||||
|
|
||||||
std::string host = uri;
|
std::string host = uri;
|
||||||
int port, pos;
|
int port = 0;
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
pos = host.find("//");
|
pos = host.find("//");
|
||||||
if(pos >= 0) {
|
if(pos >= 0) {
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CCPhysicsSprite.h"
|
#include "CCPhysicsSprite.h"
|
||||||
#include "support/CCPointExtension.h"
|
|
||||||
|
|
||||||
#if defined(CC_ENABLE_CHIPMUNK_INTEGRATION) && defined(CC_ENABLE_BOX2D_INTEGRATION)
|
#if defined(CC_ENABLE_CHIPMUNK_INTEGRATION) && defined(CC_ENABLE_BOX2D_INTEGRATION)
|
||||||
#error "Either Chipmunk or Box2d should be enabled, but not both at the same time"
|
#error "Either Chipmunk or Box2d should be enabled, but not both at the same time"
|
||||||
|
|
|
@ -25,72 +25,72 @@ SocketIOTestLayer::SocketIOTestLayer(void)
|
||||||
const int SPACE = 35;
|
const int SPACE = 35;
|
||||||
|
|
||||||
LabelTTF *label = LabelTTF::create("SocketIO Extension Test", "Arial", 28);
|
LabelTTF *label = LabelTTF::create("SocketIO Extension Test", "Arial", 28);
|
||||||
label->setPosition(ccp(winSize.width / 2, winSize.height - MARGIN));
|
label->setPosition(Point(winSize.width / 2, winSize.height - MARGIN));
|
||||||
addChild(label, 0);
|
addChild(label, 0);
|
||||||
|
|
||||||
Menu *menuRequest = Menu::create();
|
Menu *menuRequest = Menu::create();
|
||||||
menuRequest->setPosition(PointZero);
|
menuRequest->setPosition(Point::ZERO);
|
||||||
addChild(menuRequest);
|
addChild(menuRequest);
|
||||||
|
|
||||||
// Test to create basic client in the default namespace
|
// Test to create basic client in the default namespace
|
||||||
LabelTTF *labelSIOClient = LabelTTF::create("Open SocketIO Client", "Arial", 22);
|
LabelTTF *labelSIOClient = LabelTTF::create("Open SocketIO Client", "Arial", 22);
|
||||||
MenuItemLabel *itemSIOClient = MenuItemLabel::create(labelSIOClient, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOClientClicked, this));
|
MenuItemLabel *itemSIOClient = MenuItemLabel::create(labelSIOClient, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOClientClicked, this));
|
||||||
itemSIOClient->setPosition(ccp(VisibleRect::left().x + labelSIOClient->getContentSize().width / 2 + 5, winSize.height - MARGIN - SPACE));
|
itemSIOClient->setPosition(Point(VisibleRect::left().x + labelSIOClient->getContentSize().width / 2 + 5, winSize.height - MARGIN - SPACE));
|
||||||
menuRequest->addChild(itemSIOClient);
|
menuRequest->addChild(itemSIOClient);
|
||||||
|
|
||||||
// Test to create a client at the endpoint '/testpoint'
|
// Test to create a client at the endpoint '/testpoint'
|
||||||
LabelTTF *labelSIOEndpoint = LabelTTF::create("Open SocketIO Endpoint", "Arial", 22);
|
LabelTTF *labelSIOEndpoint = LabelTTF::create("Open SocketIO Endpoint", "Arial", 22);
|
||||||
MenuItemLabel *itemSIOEndpoint = MenuItemLabel::create(labelSIOEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOEndpointClicked, this));
|
MenuItemLabel *itemSIOEndpoint = MenuItemLabel::create(labelSIOEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOEndpointClicked, this));
|
||||||
itemSIOEndpoint->setPosition(ccp(VisibleRect::right().x - labelSIOEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - SPACE));
|
itemSIOEndpoint->setPosition(Point(VisibleRect::right().x - labelSIOEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - SPACE));
|
||||||
menuRequest->addChild(itemSIOEndpoint);
|
menuRequest->addChild(itemSIOEndpoint);
|
||||||
|
|
||||||
// Test sending message to default namespace
|
// Test sending message to default namespace
|
||||||
LabelTTF *labelTestMessage = LabelTTF::create("Send Test Message", "Arial", 22);
|
LabelTTF *labelTestMessage = LabelTTF::create("Send Test Message", "Arial", 22);
|
||||||
MenuItemLabel *itemTestMessage = MenuItemLabel::create(labelTestMessage, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageClicked, this));
|
MenuItemLabel *itemTestMessage = MenuItemLabel::create(labelTestMessage, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageClicked, this));
|
||||||
itemTestMessage->setPosition(ccp(VisibleRect::left().x + labelTestMessage->getContentSize().width / 2 + 5, winSize.height - MARGIN - 2 * SPACE));
|
itemTestMessage->setPosition(Point(VisibleRect::left().x + labelTestMessage->getContentSize().width / 2 + 5, winSize.height - MARGIN - 2 * SPACE));
|
||||||
menuRequest->addChild(itemTestMessage);
|
menuRequest->addChild(itemTestMessage);
|
||||||
|
|
||||||
// Test sending message to the endpoint '/testpoint'
|
// Test sending message to the endpoint '/testpoint'
|
||||||
LabelTTF *labelTestMessageEndpoint = LabelTTF::create("Test Endpoint Message", "Arial", 22);
|
LabelTTF *labelTestMessageEndpoint = LabelTTF::create("Test Endpoint Message", "Arial", 22);
|
||||||
MenuItemLabel *itemTestMessageEndpoint = MenuItemLabel::create(labelTestMessageEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageEndpointClicked, this));
|
MenuItemLabel *itemTestMessageEndpoint = MenuItemLabel::create(labelTestMessageEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageEndpointClicked, this));
|
||||||
itemTestMessageEndpoint->setPosition(ccp(VisibleRect::right().x - labelTestMessageEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 2 * SPACE));
|
itemTestMessageEndpoint->setPosition(Point(VisibleRect::right().x - labelTestMessageEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 2 * SPACE));
|
||||||
menuRequest->addChild(itemTestMessageEndpoint);
|
menuRequest->addChild(itemTestMessageEndpoint);
|
||||||
|
|
||||||
// Test sending event 'echotest' to default namespace
|
// Test sending event 'echotest' to default namespace
|
||||||
LabelTTF *labelTestEvent = LabelTTF::create("Send Test Event", "Arial", 22);
|
LabelTTF *labelTestEvent = LabelTTF::create("Send Test Event", "Arial", 22);
|
||||||
MenuItemLabel *itemTestEvent = MenuItemLabel::create(labelTestEvent, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventClicked, this));
|
MenuItemLabel *itemTestEvent = MenuItemLabel::create(labelTestEvent, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventClicked, this));
|
||||||
itemTestEvent->setPosition(ccp(VisibleRect::left().x + labelTestEvent->getContentSize().width / 2 + 5, winSize.height - MARGIN - 3 * SPACE));
|
itemTestEvent->setPosition(Point(VisibleRect::left().x + labelTestEvent->getContentSize().width / 2 + 5, winSize.height - MARGIN - 3 * SPACE));
|
||||||
menuRequest->addChild(itemTestEvent);
|
menuRequest->addChild(itemTestEvent);
|
||||||
|
|
||||||
// Test sending event 'echotest' to the endpoint '/testpoint'
|
// Test sending event 'echotest' to the endpoint '/testpoint'
|
||||||
LabelTTF *labelTestEventEndpoint = LabelTTF::create("Test Endpoint Event", "Arial", 22);
|
LabelTTF *labelTestEventEndpoint = LabelTTF::create("Test Endpoint Event", "Arial", 22);
|
||||||
MenuItemLabel *itemTestEventEndpoint = MenuItemLabel::create(labelTestEventEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventEndpointClicked, this));
|
MenuItemLabel *itemTestEventEndpoint = MenuItemLabel::create(labelTestEventEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventEndpointClicked, this));
|
||||||
itemTestEventEndpoint->setPosition(ccp(VisibleRect::right().x - labelTestEventEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 3 * SPACE));
|
itemTestEventEndpoint->setPosition(Point(VisibleRect::right().x - labelTestEventEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 3 * SPACE));
|
||||||
menuRequest->addChild(itemTestEventEndpoint);
|
menuRequest->addChild(itemTestEventEndpoint);
|
||||||
|
|
||||||
// Test disconnecting basic client
|
// Test disconnecting basic client
|
||||||
LabelTTF *labelTestClientDisconnect = LabelTTF::create("Disconnect Socket", "Arial", 22);
|
LabelTTF *labelTestClientDisconnect = LabelTTF::create("Disconnect Socket", "Arial", 22);
|
||||||
MenuItemLabel *itemClientDisconnect = MenuItemLabel::create(labelTestClientDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestClientDisconnectClicked, this));
|
MenuItemLabel *itemClientDisconnect = MenuItemLabel::create(labelTestClientDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestClientDisconnectClicked, this));
|
||||||
itemClientDisconnect->setPosition(ccp(VisibleRect::left().x + labelTestClientDisconnect->getContentSize().width / 2 + 5, winSize.height - MARGIN - 4 * SPACE));
|
itemClientDisconnect->setPosition(Point(VisibleRect::left().x + labelTestClientDisconnect->getContentSize().width / 2 + 5, winSize.height - MARGIN - 4 * SPACE));
|
||||||
menuRequest->addChild(itemClientDisconnect);
|
menuRequest->addChild(itemClientDisconnect);
|
||||||
|
|
||||||
// Test disconnecting the endpoint '/testpoint'
|
// Test disconnecting the endpoint '/testpoint'
|
||||||
LabelTTF *labelTestEndpointDisconnect = LabelTTF::create("Disconnect Endpoint", "Arial", 22);
|
LabelTTF *labelTestEndpointDisconnect = LabelTTF::create("Disconnect Endpoint", "Arial", 22);
|
||||||
MenuItemLabel *itemTestEndpointDisconnect = MenuItemLabel::create(labelTestEndpointDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEndpointDisconnectClicked, this));
|
MenuItemLabel *itemTestEndpointDisconnect = MenuItemLabel::create(labelTestEndpointDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEndpointDisconnectClicked, this));
|
||||||
itemTestEndpointDisconnect->setPosition(ccp(VisibleRect::right().x - labelTestEndpointDisconnect->getContentSize().width / 2 - 5, winSize.height - MARGIN - 4 * SPACE));
|
itemTestEndpointDisconnect->setPosition(Point(VisibleRect::right().x - labelTestEndpointDisconnect->getContentSize().width / 2 - 5, winSize.height - MARGIN - 4 * SPACE));
|
||||||
menuRequest->addChild(itemTestEndpointDisconnect);
|
menuRequest->addChild(itemTestEndpointDisconnect);
|
||||||
|
|
||||||
// Sahred Status Label
|
// Sahred Status Label
|
||||||
_sioClientStatus = LabelTTF::create("Not connected...", "Arial", 14, CCSizeMake(320, 100), kTextAlignmentLeft);
|
_sioClientStatus = LabelTTF::create("Not connected...", "Arial", 14, Size(320, 100), kTextAlignmentLeft);
|
||||||
_sioClientStatus->setAnchorPoint(ccp(0, 0));
|
_sioClientStatus->setAnchorPoint(Point(0, 0));
|
||||||
_sioClientStatus->setPosition(ccp(VisibleRect::left().x, VisibleRect::rightBottom().y));
|
_sioClientStatus->setPosition(Point(VisibleRect::left().x, VisibleRect::rightBottom().y));
|
||||||
this->addChild(_sioClientStatus);
|
this->addChild(_sioClientStatus);
|
||||||
|
|
||||||
// Back Menu
|
// Back Menu
|
||||||
MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SocketIOTestLayer::toExtensionsMainLayer, this));
|
MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SocketIOTestLayer::toExtensionsMainLayer, this));
|
||||||
itemBack->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25));
|
itemBack->setPosition(Point(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25));
|
||||||
Menu *menuBack = Menu::create(itemBack, NULL);
|
Menu *menuBack = Menu::create(itemBack, NULL);
|
||||||
menuBack->setPosition(PointZero);
|
menuBack->setPosition(Point::ZERO);
|
||||||
addChild(menuBack);
|
addChild(menuBack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue