CCAccelerometer_platform.h   CCAccelerometer_platform.h 
skipping to change at line 37 skipping to change at line 37
#include "CCPlatformConfig.h" #include "CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE)
#include "wophone/CCAccelerometer_wophone.h" #include "wophone/CCAccelerometer_wophone.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include "win32/CCAccelerometer_win32.h" #include "win32/CCAccelerometer_win32.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "android/CCAccelerometer_android.h" #include "android/CCAccelerometer_android.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "ios/CCAccelerometer_ios.h" #include "ios/CCAccelerometer_ios.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#include "airplay/CCAccelerometer_airplay.h" #include "marmalade/CCAccelerometer_marmalade.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include "Linux/CCAccelerometer_linux.h" #include "linux/CCAccelerometer_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCAccelerometer_bada.h" #include "bada/CCAccelerometer_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCAccelerometer_qnx.h"
#else #else
#error #error
#endif #endif
#endif // __CC_UIACCELEROMETER_PLATFORM_H__ #endif // __CC_UIACCELEROMETER_PLATFORM_H__
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 CCAccelerometer_win32.h   CCAccelerometer_win32.h 
skipping to change at line 28 skipping to change at line 28
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __PLATFORM_WIN32_UIACCELEROMETER_H__ #ifndef __PLATFORM_WIN32_UIACCELEROMETER_H__
#define __PLATFORM_WIN32_UIACCELEROMETER_H__ #define __PLATFORM_WIN32_UIACCELEROMETER_H__
#include "CCAccelerometerDelegate.h"
namespace cocos2d { namespace cocos2d {
class CC_DLL CCAccelerometer class CC_DLL CCAccelerometer
{ {
public: public:
CCAccelerometer(); CCAccelerometer();
~CCAccelerometer(); ~CCAccelerometer();
static CCAccelerometer* sharedAccelerometer() { return NULL; } static CCAccelerometer* sharedAccelerometer();
void setDelegate(CCAccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(p void setDelegate(CCAccelerometerDelegate* pDelegate);
Delegate);} void update( double x,double y,double z,double timestamp );
private:
static CCAccelerometer* m_spCCAccelerometer;
CCAccelerometerDelegate* m_pAccelDelegate;
CCAcceleration m_obAccelerationValue;
}; };
}//namespace cocos2d }//namespace cocos2d
#endif #endif
 End of changes. 2 change blocks. 
3 lines changed or deleted 9 lines changed or added


 CCActionEase.h   CCActionEase.h 
skipping to change at line 422 skipping to change at line 422
{ {
public: public:
virtual void update(ccTime time); virtual void update(ccTime time);
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
public: public:
/** creates the action */ /** creates the action */
static CCEaseBackInOut* actionWithAction(CCActionInterval* pAction); static CCEaseBackInOut* actionWithAction(CCActionInterval* pAction);
}; };
#endif // __ACTION_CCEASE_ACTION_H__
} }
#endif // __ACTION_CCEASE_ACTION_H__
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added


 CCActionInstant.h   CCActionInstant.h 
skipping to change at line 32 skipping to change at line 32
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CCINSTANT_ACTION_H__ #ifndef __CCINSTANT_ACTION_H__
#define __CCINSTANT_ACTION_H__ #define __CCINSTANT_ACTION_H__
#include <string> #include <string>
#include "CCAction.h" #include "CCAction.h"
#include "selector_protocol.h"
namespace cocos2d { namespace cocos2d {
/** /**
@brief Instant actions are immediate actions. They don't have a dura tion like @brief Instant actions are immediate actions. They don't have a dura tion like
the CCIntervalAction actions. the CCIntervalAction actions.
*/ */
class CC_DLL CCActionInstant : public CCFiniteTimeAction //<NSCopyin g> class CC_DLL CCActionInstant : public CCFiniteTimeAction //<NSCopyin g>
{ {
public: public:
skipping to change at line 179 skipping to change at line 178
CCPoint m_tPosition; CCPoint m_tPosition;
}; };
/** @brief Calls a 'callback' /** @brief Calls a 'callback'
*/ */
class CC_DLL CCCallFunc : public CCActionInstant //<NSCopying> class CC_DLL CCCallFunc : public CCActionInstant //<NSCopying>
{ {
public: public:
CCCallFunc() CCCallFunc()
: m_pSelectorTarget(NULL) : m_pSelectorTarget(NULL)
, m_scriptFuncName("")
, m_pCallFunc(NULL) , m_pCallFunc(NULL)
{ {
} }
virtual ~CCCallFunc() virtual ~CCCallFunc()
{ {
if (m_pSelectorTarget) if (m_pSelectorTarget)
{ {
m_pSelectorTarget->selectorProtocolRelease() ; m_pSelectorTarget->release();
} }
} }
/** creates the action with the callback /** creates the action with the callback
typedef void (SelectorProtocol::*SEL_CallFunc)(); typedef void (CCObject::*SEL_CallFunc)();
*/ */
static CCCallFunc * actionWithTarget(SelectorProtocol* pSele static CCCallFunc * actionWithTarget(CCObject* pSelectorTarg
ctorTarget, SEL_CallFunc selector); et, SEL_CallFunc selector);
static CCCallFunc* actionWithScriptFuncName(const char* pszF
uncName);
/** initializes the action with the callback /** initializes the action with the callback
typedef void (SelectorProtocol::*SEL_CallFunc)(); typedef void (CCObject::*SEL_CallFunc)();
*/ */
virtual bool initWithTarget(SelectorProtocol* pSelectorTarge virtual bool initWithTarget(CCObject* pSelectorTarget);
t);
virtual bool initWithScriptFuncName(const char* pszFuncName)
;
/** executes the callback */ /** executes the callback */
virtual void execute(); virtual void execute();
//super methods //super methods
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);
CCObject * copyWithZone(CCZone *pZone); CCObject * copyWithZone(CCZone *pZone);
void registerScriptFunction(const char* pszFunctionName); inline CCObject* getTargetCallback()
inline SelectorProtocol* getTargetCallback()
{ {
return m_pSelectorTarget; return m_pSelectorTarget;
} }
inline void setTargetCallback(SelectorProtocol* pSel) inline void setTargetCallback(CCObject* pSel)
{ {
if (pSel != m_pSelectorTarget) if (pSel != m_pSelectorTarget)
{ {
if (m_pSelectorTarget) if (m_pSelectorTarget)
{ {
m_pSelectorTarget->selectorProtocolR elease(); m_pSelectorTarget->release();
} }
m_pSelectorTarget = pSel; m_pSelectorTarget = pSel;
if (m_pSelectorTarget) if (m_pSelectorTarget)
{ {
m_pSelectorTarget->selectorProtocolR etain(); m_pSelectorTarget->retain();
} }
} }
} }
protected: protected:
/** Target that will be called */ /** Target that will be called */
SelectorProtocol* m_pSelectorTarget; CCObject* m_pSelectorTarget;
/** the script function name to call back */
std::string m_scriptFuncName;
union union
{ {
SEL_CallFunc m_pCallFunc; SEL_CallFunc m_pCallFunc;
SEL_CallFuncN m_pCallFuncN; SEL_CallFuncN m_pCallFuncN;
SEL_CallFuncND m_pCallFuncND; SEL_CallFuncND m_pCallFuncND;
SEL_CallFuncO m_pCallFuncO; SEL_CallFuncO m_pCallFuncO;
}; };
}; };
skipping to change at line 260 skipping to change at line 252
@brief Calls a 'callback' with the node as the first argument @brief Calls a 'callback' with the node as the first argument
N means Node N means Node
*/ */
class CC_DLL CCCallFuncN : public CCCallFunc class CC_DLL CCCallFuncN : public CCCallFunc
{ {
public: public:
CCCallFuncN(){} CCCallFuncN(){}
virtual ~CCCallFuncN(){} virtual ~CCCallFuncN(){}
/** creates the action with the callback /** creates the action with the callback
typedef void (SelectorProtocol::*SEL_CallFuncN)(CCNode*); typedef void (CCObject::*SEL_CallFuncN)(CCNode*);
*/ */
static CCCallFuncN * actionWithTarget(SelectorProtocol* pSel static CCCallFuncN * actionWithTarget(CCObject* pSelectorTar
ectorTarget, SEL_CallFuncN selector); get, SEL_CallFuncN selector);
static CCCallFuncN* actionWithScriptFuncName(const char* psz
FuncName);
/** initializes the action with the callback /** initializes the action with the callback
typedef void (SelectorProtocol::*SEL_CallFuncN)(CCNode*); typedef void (CCObject::*SEL_CallFuncN)(CCNode*);
*/ */
virtual bool initWithTarget(SelectorProtocol* pSelectorTarge t, SEL_CallFuncN selector); virtual bool initWithTarget(CCObject* pSelectorTarget, SEL_C allFuncN selector);
// super methods // super methods
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void execute(); virtual void execute();
}; };
/** /**
@brief Calls a 'callback' with the node as the first argument and th e 2nd argument is data @brief Calls a 'callback' with the node as the first argument and th e 2nd argument is data
* ND means: Node and Data. Data is void *, so it could be anything. * ND means: Node and Data. Data is void *, so it could be anything.
*/ */
class CC_DLL CCCallFuncND : public CCCallFuncN class CC_DLL CCCallFuncND : public CCCallFuncN
{ {
public: public:
/** creates the action with the callback and the data to pas s as an argument */ /** creates the action with the callback and the data to pas s as an argument */
static CCCallFuncND * actionWithTarget(SelectorProtocol* pSe static CCCallFuncND * actionWithTarget(CCObject* pSelectorTa
lectorTarget, SEL_CallFuncND selector, void* d); rget, SEL_CallFuncND selector, void* d);
static CCCallFuncND* actionWithScriptFuncName(const char* ps
zFuncName, void *d);
/** initializes the action with the callback and the data to pass as an argument */ /** initializes the action with the callback and the data to pass as an argument */
virtual bool initWithTarget(SelectorProtocol* pSelectorTarge t, SEL_CallFuncND selector, void* d); virtual bool initWithTarget(CCObject* pSelectorTarget, SEL_C allFuncND selector, void* d);
// super methods // super methods
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void execute(); virtual void execute();
protected: protected:
void *m_pData; void *m_pData;
}; };
/** /**
@brief Calls a 'callback' with an object as the first argument. @brief Calls a 'callback' with an object as the first argument.
O means Object. O means Object.
@since v0.99.5 @since v0.99.5
*/ */
class CC_DLL CCCallFuncO : public CCCallFunc class CC_DLL CCCallFuncO : public CCCallFunc
{ {
public: public:
CCCallFuncO(); CCCallFuncO();
virtual ~CCCallFuncO(); virtual ~CCCallFuncO();
/** creates the action with the callback /** creates the action with the callback
typedef void (SelectorProtocol::*SEL_CallFuncO)(CCObject*); typedef void (CCObject::*SEL_CallFuncO)(CCObject*);
*/ */
static CCCallFuncO * actionWithTarget(SelectorProtocol* pSelectorTa static CCCallFuncO * actionWithTarget(CCObject* pSelectorTarget, SE
rget, SEL_CallFuncO selector, CCObject* pObject); L_CallFuncO selector, CCObject* pObject);
static CCCallFuncO* actionWithScriptFuncName(const char* psz
FuncName);
/** initializes the action with the callback /** initializes the action with the callback
typedef void (SelectorProtocol::*SEL_CallFuncO)(CCObject*); typedef void (CCObject::*SEL_CallFuncO)(CCObject*);
*/ */
virtual bool initWithTarget(SelectorProtocol* pSelectorTarget, SEL_ CallFuncO selector, CCObject* pObject); virtual bool initWithTarget(CCObject* pSelectorTarget, SEL_CallFunc O selector, CCObject* pObject);
// super methods // super methods
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void execute(); virtual void execute();
inline CCObject* getObject() inline CCObject* getObject()
{ {
return m_pObject; return m_pObject;
} }
inline void setObject(CCObject* pObj) inline void setObject(CCObject* pObj)
 End of changes. 22 change blocks. 
41 lines changed or deleted 24 lines changed or added


 CCActionManager.h   CCActionManager.h 
skipping to change at line 34 skipping to change at line 34
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __ACTION_CCACTION_MANAGER_H__ #ifndef __ACTION_CCACTION_MANAGER_H__
#define __ACTION_CCACTION_MANAGER_H__ #define __ACTION_CCACTION_MANAGER_H__
#include "CCAction.h" #include "CCAction.h"
#include "CCMutableArray.h" #include "CCMutableArray.h"
#include "CCObject.h" #include "CCObject.h"
#include "selector_protocol.h"
namespace cocos2d { namespace cocos2d {
struct _hashElement; struct _hashElement;
/** /**
@brief CCActionManager is a singleton that manages all the actions. @brief CCActionManager is a singleton that manages all the actions.
Normally you won't need to use this singleton directly. 99% of the cases y ou will use the CCNode interface, Normally you won't need to use this singleton directly. 99% of the cases y ou will use the CCNode interface,
which uses this singleton. which uses this singleton.
But there are some cases where you might need to use this singleton. But there are some cases where you might need to use this singleton.
Examples: Examples:
- When you want to run an action where the target is different from a CCNode. - When you want to run an action where the target is different from a CCNode.
- When you want to pause / resume the actions - When you want to pause / resume the actions
@since v0.8 @since v0.8
*/ */
class CC_DLL CCActionManager : public CCObject, public SelectorProtocol class CC_DLL CCActionManager : public CCObject
{ {
public: public:
CCActionManager(void); CCActionManager(void);
~CCActionManager(void); ~CCActionManager(void);
bool init(void); bool init(void);
// actions // actions
/** Adds an action with a target. /** Adds an action with a target.
If the target is already present, then the action will be added to the existing target. If the target is already present, then the action will be added to the existing target.
skipping to change at line 108 skipping to change at line 107
/** Resumes the target. All queued actions will be resumed. /** Resumes the target. All queued actions will be resumed.
*/ */
void resumeTarget(CCObject *pTarget); void resumeTarget(CCObject *pTarget);
/** purges the shared action manager. It releases the retained insta nce. /** purges the shared action manager. It releases the retained insta nce.
* because it uses this, so it can not be static * because it uses this, so it can not be static
@since v0.99.0 @since v0.99.0
*/ */
void purgeSharedManager(void); void purgeSharedManager(void);
// SelectorProtocol methods
virtual void selectorProtocolRetain(void);
virtual void selectorProtocolRelease(void);
public: public:
/** returns a shared instance of the CCActionManager */ /** returns a shared instance of the CCActionManager */
static CCActionManager* sharedManager(void); static CCActionManager* sharedManager(void);
protected: protected:
// declared in CCActionManager.m // declared in CCActionManager.m
void removeActionAtIndex(unsigned int uIndex, struct _hashElement *p Element); void removeActionAtIndex(unsigned int uIndex, struct _hashElement *p Element);
void deleteHashElement(struct _hashElement *pElement); void deleteHashElement(struct _hashElement *pElement);
void actionAllocWithHashElement(struct _hashElement *pElement); void actionAllocWithHashElement(struct _hashElement *pElement);
 End of changes. 3 change blocks. 
7 lines changed or deleted 1 lines changed or added


 CCAffineTransform.h   CCAffineTransform.h 
skipping to change at line 29 skipping to change at line 29
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __COCOA_CGAFFINETRANSFORM_H__ #ifndef __COCOA_CGAFFINETRANSFORM_H__
#define __COCOA_CGAFFINETRANSFORM_H__ #define __COCOA_CGAFFINETRANSFORM_H__
#include "CCGeometry.h" #include "CCGeometry.h"
#include "CCPlatformMacros.h"
namespace cocos2d { namespace cocos2d {
struct CCAffineTransform { struct CCAffineTransform {
CGFloat a, b, c, d; CGFloat a, b, c, d;
CGFloat tx, ty; CGFloat tx, ty;
}; };
CCAffineTransform __CCAffineTransformMake(CGFloat a, CGFloat b, CGFloat c, CGFloat d, CGFloat tx, CGFloat ty); CC_DLL CCAffineTransform __CCAffineTransformMake(CGFloat a, CGFloat b, CGFl oat c, CGFloat d, CGFloat tx, CGFloat ty);
#define CCAffineTransformMake __CCAffineTransformMake #define CCAffineTransformMake __CCAffineTransformMake
CCPoint __CCPointApplyAffineTransform(const CCPoint& point, const CCAffineT ransform& t); CC_DLL CCPoint __CCPointApplyAffineTransform(const CCPoint& point, const CC AffineTransform& t);
#define CCPointApplyAffineTransform __CCPointApplyAffineTransform #define CCPointApplyAffineTransform __CCPointApplyAffineTransform
CCSize __CCSizeApplyAffineTransform(const CCSize& size, const CCAffineTrans form& t); CC_DLL CCSize __CCSizeApplyAffineTransform(const CCSize& size, const CCAffi neTransform& t);
#define CCSizeApplyAffineTransform __CCSizeApplyAffineTransform #define CCSizeApplyAffineTransform __CCSizeApplyAffineTransform
CCAffineTransform CCAffineTransformMakeIdentity(); CC_DLL CCAffineTransform CCAffineTransformMakeIdentity();
CCRect CCRectApplyAffineTransform(const CCRect& rect, const CCAffineTransfo CC_DLL CCRect CCRectApplyAffineTransform(const CCRect& rect, const CCAffine
rm& anAffineTransform); Transform& anAffineTransform);
CCAffineTransform CCAffineTransformTranslate(const CCAffineTransform& t, fl CC_DLL CCAffineTransform CCAffineTransformTranslate(const CCAffineTransform
oat tx, float ty); & t, float tx, float ty);
CCAffineTransform CCAffineTransformRotate(const CCAffineTransform& aTransfo CC_DLL CCAffineTransform CCAffineTransformRotate(const CCAffineTransform& a
rm, CGFloat anAngle); Transform, CGFloat anAngle);
CCAffineTransform CCAffineTransformScale(const CCAffineTransform& t, CGFloa CC_DLL CCAffineTransform CCAffineTransformScale(const CCAffineTransform& t,
t sx, CGFloat sy); CGFloat sx, CGFloat sy);
CCAffineTransform CCAffineTransformConcat(const CCAffineTransform& t1, cons CC_DLL CCAffineTransform CCAffineTransformConcat(const CCAffineTransform& t
t CCAffineTransform& t2); 1, const CCAffineTransform& t2);
bool CCAffineTransformEqualToTransform(const CCAffineTransform& t1, const C CC_DLL bool CCAffineTransformEqualToTransform(const CCAffineTransform& t1,
CAffineTransform& t2); const CCAffineTransform& t2);
CCAffineTransform CCAffineTransformInvert(const CCAffineTransform& t); CC_DLL CCAffineTransform CCAffineTransformInvert(const CCAffineTransform& t
);
extern const CCAffineTransform CCAffineTransformIdentity; extern const CCAffineTransform CCAffineTransformIdentity;
}//namespace cocos2d }//namespace cocos2d
#endif // __COCOA_CGAFFINETRANSFORM_H__ #endif // __COCOA_CGAFFINETRANSFORM_H__
 End of changes. 6 change blocks. 
17 lines changed or deleted 20 lines changed or added


 CCApplication_platform.h   CCApplication_platform.h 
skipping to change at line 38 skipping to change at line 38
#include "CCPlatformConfig.h" #include "CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include "win32/CCApplication_win32.h" #include "win32/CCApplication_win32.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "android/CCApplication_android.h" #include "android/CCApplication_android.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
# include "ios/CCApplication_ios.h" # include "ios/CCApplication_ios.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE)
#include "wophone/CCApplication_wophone.h" #include "wophone/CCApplication_wophone.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#include "airplay/CCApplication_airplay.h" #include "marmalade/CCApplication_marmalade.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include "Linux/CCAplication_linux.h" #include "linux/CCAplication_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCApplication_bada.h" #include "bada/CCApplication_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCApplication_qnx.h"
#else #else
#error #error
#endif #endif
#endif // __CC_APPLICATION_PLATFORM_H__ #endif // __CC_APPLICATION_PLATFORM_H__
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 CCArchOptimalParticleSystem.h   CCArchOptimalParticleSystem.h 
skipping to change at line 32 skipping to change at line 32
* THE SOFTWARE. * THE SOFTWARE.
* *
*/ */
#include "CCPlatformConfig.h" #include "CCPlatformConfig.h"
// build each architecture with the optimal particle system // build each architecture with the optimal particle system
// ARMv7, Mac or Simulator use "Quad" particle // ARMv7, Mac or Simulator use "Quad" particle
#if defined(__ARM_NEON__) || \ #if defined(__ARM_NEON__) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_BADA) (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "CCParticleSystemQuad.h" #include "CCParticleSystemQuad.h"
#define ARCH_OPTIMAL_PARTICLE_SYSTEM CCParticleSystemQuad #define ARCH_OPTIMAL_PARTICLE_SYSTEM CCParticleSystemQuad
// ARMv6 use "Point" particle // ARMv6 use "Point" particle
#elif __arm__ #elif __arm__
#include "CCParticleSystemPoint.h" #include "CCParticleSystemPoint.h"
#define ARCH_OPTIMAL_PARTICLE_SYSTEM CCParticleSystemPoint #define ARCH_OPTIMAL_PARTICLE_SYSTEM CCParticleSystemPoint
#else #else
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 CCArray.h   CCArray.h 
skipping to change at line 59 skipping to change at line 59
arr <= end && ((__object__ = *arr) != NULL/* || true*/); \ arr <= end && ((__object__ = *arr) != NULL/* || true*/); \
arr++) arr++)
namespace cocos2d namespace cocos2d
{ {
class CC_DLL CCArray : public CCObject class CC_DLL CCArray : public CCObject
{ {
public: public:
~CCArray(); ~CCArray();
/** Create an array */
static CCArray* array(); static CCArray* array();
/** Create an array with capacity */
static CCArray* arrayWithCapacity(unsigned int capacity); static CCArray* arrayWithCapacity(unsigned int capacity);
/** Create an array with an existing array */
static CCArray* arrayWithArray(CCArray* otherArray); static CCArray* arrayWithArray(CCArray* otherArray);
/** Initializes an array */
bool init(); bool init();
/** Initializes an array with capacity */
bool initWithCapacity(unsigned int capacity); bool initWithCapacity(unsigned int capacity);
/** Initializes an array with an existing array */
bool initWithArray(CCArray* otherArray); bool initWithArray(CCArray* otherArray);
// Querying an Array // Querying an Array
/** Returns element count of the array */
unsigned int count(); unsigned int count();
/** Returns capacity of the array */
unsigned int capacity(); unsigned int capacity();
/** Returns index of a certain object, return UINT_MAX if doesn't co ntain the object */
unsigned int indexOfObject(CCObject* object); unsigned int indexOfObject(CCObject* object);
/** Returns an element with a certain index */
CCObject* objectAtIndex(unsigned int index); CCObject* objectAtIndex(unsigned int index);
/** Returns last element */
CCObject* lastObject(); CCObject* lastObject();
/** Returns a random element */
CCObject* randomObject(); CCObject* randomObject();
/** Returns a Boolean value that indicates whether object is present in array. */
bool containsObject(CCObject* object); bool containsObject(CCObject* object);
// Adding Objects // Adding Objects
/** Add a certain object */
void addObject(CCObject* object); void addObject(CCObject* object);
/** Add all elements of an existing array */
void addObjectsFromArray(CCArray* otherArray); void addObjectsFromArray(CCArray* otherArray);
/** Insert a certain object at a certain index */
void insertObject(CCObject* object, unsigned int index); void insertObject(CCObject* object, unsigned int index);
// Removing Objects // Removing Objects
/** Remove last object */
void removeLastObject(); void removeLastObject();
/** Remove a certain object */
void removeObject(CCObject* object); void removeObject(CCObject* object);
/** Remove an element with a certain index */
void removeObjectAtIndex(unsigned int index); void removeObjectAtIndex(unsigned int index);
/** Remove all elements */
void removeObjectsInArray(CCArray* otherArray); void removeObjectsInArray(CCArray* otherArray);
/** Remove all objects */
void removeAllObjects(); void removeAllObjects();
/** Fast way to remove a certain object */
void fastRemoveObject(CCObject* object); void fastRemoveObject(CCObject* object);
/** Fast way to remove an element with a certain index */
void fastRemoveObjectAtIndex(unsigned int index); void fastRemoveObjectAtIndex(unsigned int index);
// Rearranging Content // Rearranging Content
/** Swap two elements */
void exchangeObject(CCObject* object1, CCObject* object2); void exchangeObject(CCObject* object1, CCObject* object2);
/** Swap two elements with certain indexes */
void exchangeObjectAtIndex(unsigned int index1, unsigned int index2); void exchangeObjectAtIndex(unsigned int index1, unsigned int index2);
/** Revers the array */
void reverseObjects(); void reverseObjects();
/* Shrinks the array so the memory footprint corresponds with the nu mber of items */
void reduceMemoryFootprint(); void reduceMemoryFootprint();
public: public:
ccArray* data; ccArray* data;
private: private:
CCArray() : data(NULL) {}; CCArray() : data(NULL) {};
}; };
} }
 End of changes. 27 change blocks. 
0 lines changed or deleted 31 lines changed or added


 CCAtlasNode.h   CCAtlasNode.h 
skipping to change at line 91 skipping to change at line 91
/** initializes an CCAtlasNode with an Atlas file the width and hei ght of each item and the quantity of items to render*/ /** initializes an CCAtlasNode with an Atlas file the width and hei ght of each item and the quantity of items to render*/
bool initWithTileFile(const char* tile, unsigned int tileWidth, unsi gned int tileHeight, unsigned int itemsToRender); bool initWithTileFile(const char* tile, unsigned int tileWidth, unsi gned int tileHeight, unsigned int itemsToRender);
/** updates the Atlas (indexed vertex array). /** updates the Atlas (indexed vertex array).
* Shall be overriden in subclasses * Shall be overriden in subclasses
*/ */
virtual void updateAtlasValues(); virtual void updateAtlasValues();
virtual void draw(); virtual void draw();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProt
ocol*)this; }
// CC Texture protocol // CC Texture protocol
/** returns the used texture*/ /** returns the used texture*/
virtual CCTexture2D* getTexture(void); virtual CCTexture2D* getTexture(void);
/** sets a new texture. it will be retained*/ /** sets a new texture. it will be retained*/
virtual void setTexture(CCTexture2D *texture); virtual void setTexture(CCTexture2D *texture);
private : private :
void calculateMaxItems(); void calculateMaxItems();
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 CCEGLView_android.h   CCEGLView_android.h 
skipping to change at line 66 skipping to change at line 66
void setTouchDelegate(EGLTouchDelegate * pDelegate); void setTouchDelegate(EGLTouchDelegate * pDelegate);
void swapBuffers(); void swapBuffers();
bool canSetContentScaleFactor(); bool canSetContentScaleFactor();
void setContentScaleFactor(float contentScaleFactor); void setContentScaleFactor(float contentScaleFactor);
void setViewPortInPoints(float x, float y, float w, float h); void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h); void setScissorInPoints(float x, float y, float w, float h);
CCRect getViewPort(); CCRect getViewPort();
float getScreenScaleFactor(); float getScreenScaleFactor();
void setIMEKeyboardState(bool bOpen); void setIMEKeyboardState(bool bOpen);
float getMainScreenScale() { return -1.0f; }
// static function // static function
/** /**
@brief get the shared main open gl window @brief get the shared main open gl window
*/ */
static CCEGLView& sharedOpenGLView(); static CCEGLView& sharedOpenGLView();
private: private:
CCSize m_sSizeInPixel; CCSize m_sSizeInPixel;
CCSize m_sSizeInPoint; CCSize m_sSizeInPoint;
CCRect m_rcViewPort; CCRect m_rcViewPort;
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 CCEGLView_bada.h   CCEGLView_bada.h 
skipping to change at line 33 skipping to change at line 33
*************************************************************************** */ *************************************************************************** */
#ifndef __CCX_EGLVIEW_BADA_H__ #ifndef __CCX_EGLVIEW_BADA_H__
#define __CCX_EGLVIEW_BADA_H__ #define __CCX_EGLVIEW_BADA_H__
#include <FApp.h> #include <FApp.h>
#include <FBase.h> #include <FBase.h>
#include <FUi.h> #include <FUi.h>
#include <FSystem.h> #include <FSystem.h>
#include "CCGeometry.h" #include "CCGeometry.h"
#include <GLES/egl.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
NS_CC_BEGIN; NS_CC_BEGIN;
class CCSet; class CCSet;
class CCTouch; class CCTouch;
class EGLTouchDelegate; class EGLTouchDelegate;
class CCEGL; class CCEGL;
class CC_DLL CCEGLView class CC_DLL CCEGLView
skipping to change at line 72 skipping to change at line 75
void setViewPortInPoints(float x, float y, float w, float h); void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h); void setScissorInPoints(float x, float y, float w, float h);
void setIMEKeyboardState(bool bOpen); void setIMEKeyboardState(bool bOpen);
// static function // static function
/** /**
@brief get the shared main open gl window @brief get the shared main open gl window
*/ */
static CCEGLView& sharedOpenGLView(); static CCEGLView& sharedOpenGLView();
float getMainScreenScale() { return -1.0f; }
/* /*
* param * param
* width[in]: resource width * width[in]: resource width
* height[in]: resource height * height[in]: resource height
*/ */
bool Create(Osp::App::Application* pApp, int width, int height); bool Create(Osp::App::Application* pApp, int width, int height);
void resize(int width, int height); void resize(int width, int height);
virtual result OnInitializing(void); virtual result OnInitializing(void);
virtual result OnTerminating(void); virtual result OnTerminating(void);
skipping to change at line 117 skipping to change at line 122
const Osp::Graphics::Point& currentPosition, const Osp::Ui:: TouchEventInfo & touchInfo); const Osp::Graphics::Point& currentPosition, const Osp::Ui:: TouchEventInfo & touchInfo);
virtual void OnTouchFocusOut(const Osp::Ui::Control& source, virtual void OnTouchFocusOut(const Osp::Ui::Control& source,
const Osp::Graphics::Point& currentPosition, const Osp::Ui:: TouchEventInfo & touchInfo); const Osp::Graphics::Point& currentPosition, const Osp::Ui:: TouchEventInfo & touchInfo);
virtual result OnDraw(void); virtual result OnDraw(void);
virtual void OnTextValueChanged(const Osp::Ui::Control& source); virtual void OnTextValueChanged(const Osp::Ui::Control& source);
virtual void OnTextValueChangeCanceled(const Osp::Ui::Control& sourc e); virtual void OnTextValueChangeCanceled(const Osp::Ui::Control& sourc e);
#ifdef CC_BADA_2_0
// pointer to OES methods from EGL
static PFNGLGENERATEMIPMAPOESPROC glGenerateMipmapOES;
static PFNGLGENFRAMEBUFFERSOESPROC glGenFramebuffersOES;
static PFNGLBINDFRAMEBUFFEROESPROC glBindFramebufferO
ES;
static PFNGLFRAMEBUFFERTEXTURE2DOESPROC glFramebufferTexture2DOES;
static PFNGLDELETEFRAMEBUFFERSOESPROC glDeleteFramebuffersOES;
static PFNGLCHECKFRAMEBUFFERSTATUSOESPROC glCheckFramebufferStatusOE
S;
#endif
private: private:
Osp::Ui::Controls::Keypad *m_pKeypad; Osp::Ui::Controls::Keypad *m_pKeypad;
CCSize m_sSizeInPixel; CCSize m_sSizeInPixel;
CCSize m_sSizeInPoint; CCSize m_sSizeInPoint;
CCRect m_rcViewPort; CCRect m_rcViewPort;
bool m_bNotHVGA; bool m_bNotHVGA;
EGLTouchDelegate *m_pDelegate; EGLTouchDelegate *m_pDelegate;
float m_fScreenScaleFactor; float m_fScreenScaleFactor;
 End of changes. 3 change blocks. 
0 lines changed or deleted 17 lines changed or added


 CCEGLView_ios.h   CCEGLView_ios.h 
skipping to change at line 59 skipping to change at line 59
void setTouchDelegate(EGLTouchDelegate * pDelegate); void setTouchDelegate(EGLTouchDelegate * pDelegate);
void swapBuffers(); void swapBuffers();
void setViewPortInPoints(float x, float y, float w, float h); void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h); void setScissorInPoints(float x, float y, float w, float h);
void touchesBegan(CCSet *set); void touchesBegan(CCSet *set);
void touchesMoved(CCSet *set); void touchesMoved(CCSet *set);
void touchesEnded(CCSet *set); void touchesEnded(CCSet *set);
void touchesCancelled(CCSet *set); void touchesCancelled(CCSet *set);
float getMainScreenScale();
void setIMEKeyboardState(bool bOpen); void setIMEKeyboardState(bool bOpen);
static CCEGLView& sharedOpenGLView(); static CCEGLView& sharedOpenGLView();
private: private:
EGLTouchDelegate *m_pDelegate; EGLTouchDelegate *m_pDelegate;
}; };
} // end of namespace cocos2d } // end of namespace cocos2d
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 CCEGLView_linux.h   CCEGLView_linux.h 
skipping to change at line 51 skipping to change at line 51
void release(); void release();
void setTouchDelegate(EGLTouchDelegate * pDelegate); void setTouchDelegate(EGLTouchDelegate * pDelegate);
void swapBuffers(); void swapBuffers();
bool canSetContentScaleFactor(); bool canSetContentScaleFactor();
void setContentScaleFactor(float contentScaleFactor); void setContentScaleFactor(float contentScaleFactor);
int setDeviceOrientation(int eOritation); int setDeviceOrientation(int eOritation);
void setViewPortInPoints(float x, float y, float w, float h); void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h); void setScissorInPoints(float x, float y, float w, float h);
float getMainScreenScale() { return 1.0f; }
void setIMEKeyboardState(bool bOpen); void setIMEKeyboardState(bool bOpen);
// void resize(int width, int height); // void resize(int width, int height);
/** /**
* not essential * not essential
*/ */
// void centerWindow(); // void centerWindow();
// void setScreenScale(float factor); // void setScreenScale(float factor);
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 CCEGLView_platform.h   CCEGLView_platform.h 
skipping to change at line 38 skipping to change at line 38
#include "CCPlatformConfig.h" #include "CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE)
#include "wophone/CCEGLView_wophone.h" #include "wophone/CCEGLView_wophone.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include "win32/CCEGLView_win32.h" #include "win32/CCEGLView_win32.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "android/CCEGLView_android.h" #include "android/CCEGLView_android.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "ios/CCEGLView_ios.h" #include "ios/CCEGLView_ios.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#include "airplay/CCEGLView_airplay.h" #include "marmalade/CCEGLView_marmalade.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include "Linux/CCEGLView_linux.h" #include "linux/CCEGLView_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCEGLView_bada.h" #include "bada/CCEGLView_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCEGLView_qnx.h"
#else #else
#error #error
#endif #endif
#endif // end of __CC_EGLVIEW_PLATFORM_H__ #endif // end of __CC_EGLVIEW_PLATFORM_H__
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 CCEGLView_win32.h   CCEGLView_win32.h 
skipping to change at line 56 skipping to change at line 56
virtual ~CCEGLView(); virtual ~CCEGLView();
CCSize getSize(); CCSize getSize();
bool isOpenGLReady(); bool isOpenGLReady();
void release(); void release();
void setTouchDelegate(EGLTouchDelegate * pDelegate); void setTouchDelegate(EGLTouchDelegate * pDelegate);
void swapBuffers(); void swapBuffers();
bool canSetContentScaleFactor(); bool canSetContentScaleFactor();
void setContentScaleFactor(float contentScaleFactor); void setContentScaleFactor(float contentScaleFactor);
float getMainScreenScale() { return 1.0f; }
virtual bool Create(LPCTSTR pTitle, int w, int h); virtual bool Create(LPCTSTR pTitle, int w, int h);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lPara m); virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lPara m);
int setDeviceOrientation(int eOritation); int setDeviceOrientation(int eOritation);
void setViewPortInPoints(float x, float y, float w, float h); void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h); void setScissorInPoints(float x, float y, float w, float h);
void setIMEKeyboardState(bool bOpen); void setIMEKeyboardState(bool bOpen);
// win32 platform function // win32 platform function
HWND getHWnd(); HWND getHWnd();
void resize(int width, int height); void resize(int width, int height);
void centerWindow(); void centerWindow();
void setScreenScale(float factor); void setScreenScale(float factor);
typedef void (*LPFN_ACCELEROMETER_KEYHOOK)( UINT message,WPARAM wPar
am, LPARAM lParam );
void setAccelerometerKeyHook( LPFN_ACCELEROMETER_KEYHOOK lpfnAcceler
ometerKeyHook );
// static function // static function
/** /**
@brief get the shared main open gl window @brief get the shared main open gl window
*/ */
static CCEGLView& sharedOpenGLView(); static CCEGLView& sharedOpenGLView();
protected: protected:
skipping to change at line 97 skipping to change at line 101
EGLTouchDelegate * m_pDelegate; EGLTouchDelegate * m_pDelegate;
CCEGL * m_pEGL; CCEGL * m_pEGL;
HWND m_hWnd; HWND m_hWnd;
int m_eInitOrientation; int m_eInitOrientation;
SIZE m_tSizeInPoints; SIZE m_tSizeInPoints;
float m_fScreenScaleFactor; float m_fScreenScaleFactor;
RECT m_rcViewPort; RECT m_rcViewPort;
LPFN_ACCELEROMETER_KEYHOOK m_lpfnAccelerometerKeyHook;
}; };
NS_CC_END; NS_CC_END;
#endif // end of __CC_EGLVIEW_WIN32_H__ #endif // end of __CC_EGLVIEW_WIN32_H__
 End of changes. 3 change blocks. 
0 lines changed or deleted 7 lines changed or added


 CCImage.h   CCImage.h 
skipping to change at line 43 skipping to change at line 43
{ {
public: public:
CCImage(); CCImage();
~CCImage(); ~CCImage();
typedef enum typedef enum
{ {
kFmtJpg = 0, kFmtJpg = 0,
kFmtPng, kFmtPng,
kFmtRawData, kFmtRawData,
kFmtUnKnown
}EImageFormat; }EImageFormat;
typedef enum typedef enum
{ {
kAlignCenter = 0x33, ///< Horizontal center and vertical cen ter. kAlignCenter = 0x33, ///< Horizontal center and vertical cen ter.
kAlignTop = 0x13, ///< Horizontal center and vertical top . kAlignTop = 0x13, ///< Horizontal center and vertical top .
kAlignTopRight = 0x12, ///< Horizontal right and vertical top. kAlignTopRight = 0x12, ///< Horizontal right and vertical top.
kAlignRight = 0x32, ///< Horizontal right and vertical cent er. kAlignRight = 0x32, ///< Horizontal right and vertical cent er.
kAlignBottomRight = 0x22, ///< Horizontal right and vertical bott om. kAlignBottomRight = 0x22, ///< Horizontal right and vertical bott om.
kAlignBottom = 0x23, ///< Horizontal center and vertical bot tom. kAlignBottom = 0x23, ///< Horizontal center and vertical bot tom.
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 CCKeypadDelegate.h   CCKeypadDelegate.h 
skipping to change at line 35 skipping to change at line 35
#ifndef __CCKEYPAD_DELEGATE_H__ #ifndef __CCKEYPAD_DELEGATE_H__
#define __CCKEYPAD_DELEGATE_H__ #define __CCKEYPAD_DELEGATE_H__
#include "CCObject.h" #include "CCObject.h"
namespace cocos2d { namespace cocos2d {
class CC_DLL CCKeypadDelegate class CC_DLL CCKeypadDelegate
{ {
public: public:
//! call the release() in child layer
virtual void KeypadDestroy() {}
//! call the retain() in child layer
virtual void KeypadKeep() {}
// The back key clicked // The back key clicked
virtual void keyBackClicked() {} virtual void keyBackClicked() {}
// The menu key clicked. only avialble on wophone & android // The menu key clicked. only avialble on wophone & android
virtual void keyMenuClicked() {}; virtual void keyMenuClicked() {};
}; };
/** /**
@brief @brief
CCKeypadHandler CCKeypadHandler
 End of changes. 1 change blocks. 
5 lines changed or deleted 0 lines changed or added


 CCLabelBMFont.h   CCLabelBMFont.h 
skipping to change at line 36 skipping to change at line 36
Use any of these editors to generate BMFonts: Use any of these editors to generate BMFonts:
http://glyphdesigner.71squared.com/ (Commercial, Mac OS X) http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
http://www.n4te.com/hiero/hiero.jnlp (Free, Java) http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java) http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
http://www.angelcode.com/products/bmfont/ (Free, Windows only) http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*************************************************************************** */ *************************************************************************** */
#ifndef __CCBITMAP_FONT_ATLAS_H__ #ifndef __CCBITMAP_FONT_ATLAS_H__
#define __CCBITMAP_FONT_ATLAS_H__ #define __CCBITMAP_FONT_ATLAS_H__
#include "CCSpriteBatchNode.h" #include "CCSpriteBatchNode.h"
#include <map>
namespace cocos2d{ namespace cocos2d{
struct _KerningHashElement; struct _KerningHashElement;
/** /**
@struct ccBMFontDef @struct ccBMFontDef
BMFont definition BMFont definition
*/ */
typedef struct _BMFontDef { typedef struct _BMFontDef {
//! ID of the character //! ID of the character
skipping to change at line 72 skipping to change at line 74
/// padding left /// padding left
int left; int left;
/// padding top /// padding top
int top; int top;
/// padding right /// padding right
int right; int right;
/// padding bottom /// padding bottom
int bottom; int bottom;
} ccBMFontPadding; } ccBMFontPadding;
enum {
// how many characters are supported
kCCBMFontMaxChars = 2048, //256,
};
/** @brief CCBMFontConfiguration has parsed configuration of the the .fnt file /** @brief CCBMFontConfiguration has parsed configuration of the the .fnt file
@since v0.8 @since v0.8
*/ */
class CC_DLL CCBMFontConfiguration : public CCObject class CC_DLL CCBMFontConfiguration : public CCObject
{ {
// XXX: Creating a public interface so that the bitmapFontAr ray[] is accesible // XXX: Creating a public interface so that the bitmapFontAr ray[] is accesible
public://@public public://@public
//! The characters building up the font //! The characters building up the font
ccBMFontDef m_pBitmapFontArray[kCCBMFontMaxChars]; std::map<unsigned int, ccBMFontDef>* m_pBitmapFontArray;
//! FNTConfig: Common Height //! FNTConfig: Common Height
unsigned int m_uCommonHeight; unsigned int m_uCommonHeight;
//! Padding //! Padding
ccBMFontPadding m_tPadding; ccBMFontPadding m_tPadding;
//! atlas name //! atlas name
std::string m_sAtlasName; std::string m_sAtlasName;
//! values for kerning //! values for kerning
struct _KerningHashElement *m_pKerningDictionary; struct _KerningHashElement *m_pKerningDictionary;
public: public:
CCBMFontConfiguration() CCBMFontConfiguration();
: m_uCommonHeight(0)
, m_pKerningDictionary(NULL)
{}
virtual ~CCBMFontConfiguration(); virtual ~CCBMFontConfiguration();
char * description(); char * description();
/** allocates a CCBMFontConfiguration with a FNT file */ /** allocates a CCBMFontConfiguration with a FNT file */
static CCBMFontConfiguration * configurationWithFNTFile(cons t char *FNTfile); static CCBMFontConfiguration * configurationWithFNTFile(cons t char *FNTfile);
/** initializes a BitmapFontConfiguration with a FNT file */ /** initializes a BitmapFontConfiguration with a FNT file */
bool initWithFNTfile(const char *FNTfile); bool initWithFNTfile(const char *FNTfile);
private: private:
void parseConfigFile(const char *controlFile); void parseConfigFile(const char *controlFile);
void parseCharacterDefinition(std::string line, ccBMFontDef *characterDefinition); void parseCharacterDefinition(std::string line, ccBMFontDef *characterDefinition);
void parseInfoArguments(std::string line); void parseInfoArguments(std::string line);
skipping to change at line 183 skipping to change at line 178
/** init a bitmap font altas with an initial string and the FNT file */ /** init a bitmap font altas with an initial string and the FNT file */
bool initWithString(const char *str, const char *fntFile); bool initWithString(const char *str, const char *fntFile);
/** updates the font chars based on the string to render */ /** updates the font chars based on the string to render */
void createFontChars(); void createFontChars();
// super method // super method
virtual void setString(const char *label); virtual void setString(const char *label);
virtual const char* getString(void); virtual const char* getString(void);
virtual void setCString(const char *label); virtual void setCString(const char *label);
virtual void setAnchorPoint(const CCPoint& var); virtual void setAnchorPoint(const CCPoint& var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CC
RGBAProtocol*)this; }
virtual CCLabelProtocol* convertToLabelProtocol() { return (
CCLabelProtocol*)this; }
#if CC_LABELBMFONT_DEBUG_DRAW #if CC_LABELBMFONT_DEBUG_DRAW
virtual void draw(); virtual void draw();
#endif // CC_LABELBMFONT_DEBUG_DRAW #endif // CC_LABELBMFONT_DEBUG_DRAW
private: private:
char * atlasNameFromFntFile(const char *fntFile); char * atlasNameFromFntFile(const char *fntFile);
int kerningAmountForFirst(unsigned short first, unsigned sho rt second); int kerningAmountForFirst(unsigned short first, unsigned sho rt second);
}; };
/** Free function that parses a FNT file a place it on the cache /** Free function that parses a FNT file a place it on the cache
 End of changes. 5 change blocks. 
14 lines changed or deleted 6 lines changed or added


 CCLayer.h   CCLayer.h 
skipping to change at line 39 skipping to change at line 39
#include "CCNode.h" #include "CCNode.h"
#include "CCProtocols.h" #include "CCProtocols.h"
#include "CCTouchDelegateProtocol.h" #include "CCTouchDelegateProtocol.h"
#include "CCAccelerometerDelegate.h" #include "CCAccelerometerDelegate.h"
#include "CCKeypadDelegate.h" #include "CCKeypadDelegate.h"
#include "CCMutableArray.h" #include "CCMutableArray.h"
namespace cocos2d { namespace cocos2d {
class CCTouchScriptHandlerEntry;
// //
// CCLayer // CCLayer
// //
/** @brief CCLayer is a subclass of CCNode that implements the TouchEventsD elegate protocol. /** @brief CCLayer is a subclass of CCNode that implements the TouchEventsD elegate protocol.
All features from CCNode are valid, plus the following new features: All features from CCNode are valid, plus the following new features:
- It can receive iPhone Touches - It can receive iPhone Touches
- It can receive Accelerometer input - It can receive Accelerometer input
*/ */
class CC_DLL CCLayer : public CCNode, public CCTouchDelegate, public CCAcce lerometerDelegate, public CCKeypadDelegate class CC_DLL CCLayer : public CCNode, public CCTouchDelegate, public CCAcce lerometerDelegate, public CCKeypadDelegate
{ {
public: public:
CCLayer(); CCLayer();
virtual ~CCLayer(); virtual ~CCLayer();
bool init(); bool init();
static CCLayer *node(void); static CCLayer *node(void);
virtual void onEnter(); virtual void onEnter();
virtual void onExit(); virtual void onExit();
virtual void onEnterTransitionDidFinish(); virtual void onEnterTransitionDidFinish();
// default implements are used to call script callback if exist
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent);
// default implements are used to call script callback if exist // default implements are used to call script callback if exist
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent);
virtual void destroy(void);
virtual void keep(void);
virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUS ED_PARAM(pAccelerationValue);} virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUS ED_PARAM(pAccelerationValue);}
virtual void KeypadDestroy();
virtual void KeypadKeep();
/** If isTouchEnabled, this method is called onEnter. Override it to change the /** If isTouchEnabled, this method is called onEnter. Override it to change the
way CCLayer receives touch events. way CCLayer receives touch events.
( Default: CCTouchDispatcher::sharedDispatcher()->addStandardDelegat e(this,0); ) ( Default: CCTouchDispatcher::sharedDispatcher()->addStandardDelegat e(this,0); )
Example: Example:
void CCLayer::registerWithTouchDispatcher() void CCLayer::registerWithTouchDispatcher()
{ {
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this,INT_ MIN+1,true); CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this,INT_ MIN+1,true);
} }
@since v0.8.0 @since v0.8.0
*/ */
virtual void registerWithTouchDispatcher(void); virtual void registerWithTouchDispatcher(void);
/** Register script touch events handler */
void registerScriptTouchHandler(int nHandler, bool bIsMultiTouches = fa
lse, int nPriority = INT_MIN, bool bSwallowsTouches = false);
/** Unregister script touch events handler */
void unregisterScriptTouchHandler(void);
/** whether or not it will receive Touch events. /** whether or not it will receive Touch events.
You can enable / disable touch events with this property. You can enable / disable touch events with this property.
Only the touches of this node will be affected. This "method" is not propagated to it's children. Only the touches of this node will be affected. This "method" is not propagated to it's children.
@since v0.8.1 @since v0.8.1
*/ */
CC_PROPERTY(bool, m_bIsTouchEnabled, IsTouchEnabled) CC_PROPERTY(bool, m_bIsTouchEnabled, IsTouchEnabled)
/** whether or not it will receive Accelerometer events /** whether or not it will receive Accelerometer events
You can enable / disable accelerometer events with this property. You can enable / disable accelerometer events with this property.
@since v0.8.1 @since v0.8.1
*/ */
CC_PROPERTY(bool, m_bIsAccelerometerEnabled, IsAccelerometerEnabled) CC_PROPERTY(bool, m_bIsAccelerometerEnabled, IsAccelerometerEnabled)
/** whether or not it will receive keypad events /** whether or not it will receive keypad events
You can enable / disable accelerometer events with this property. You can enable / disable accelerometer events with this property.
it's new in cocos2d-x it's new in cocos2d-x
*/ */
CC_PROPERTY(bool, m_bIsKeypadEnabled, IsKeypadEnabled) CC_PROPERTY(bool, m_bIsKeypadEnabled, IsKeypadEnabled)
private:
// Script touch events handler
CCTouchScriptHandlerEntry* m_pScriptHandlerEntry;
int excuteScriptTouchHandler(int nEventType, CCTouch *pTouch);
int excuteScriptTouchHandler(int nEventType, CCSet *pTouches);
}; };
// for the subclass of CCLayer, each has to implement the static "node" met hod // for the subclass of CCLayer, each has to implement the static "node" met hod
#define LAYER_NODE_FUNC(layer) \ #define LAYER_NODE_FUNC(layer) \
static layer* node() \ static layer* node() \
{ \ { \
layer *pRet = new layer(); \ layer *pRet = new layer(); \
if (pRet && pRet->init()) \ if (pRet && pRet->init()) \
{ \ { \
pRet->autorelease(); \ pRet->autorelease(); \
skipping to change at line 189 skipping to change at line 201
*/ */
void changeWidthAndHeight(GLfloat w ,GLfloat h); void changeWidthAndHeight(GLfloat w ,GLfloat h);
/** Opacity: conforms to CCRGBAProtocol protocol */ /** Opacity: conforms to CCRGBAProtocol protocol */
CC_PROPERTY(GLubyte, m_cOpacity, Opacity) CC_PROPERTY(GLubyte, m_cOpacity, Opacity)
/** Color: conforms to CCRGBAProtocol protocol */ /** Color: conforms to CCRGBAProtocol protocol */
CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color) CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color)
/** BlendFunction. Conforms to CCBlendProtocol protocol */ /** BlendFunction. Conforms to CCBlendProtocol protocol */
CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc) CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc)
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProt virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bVa
ocol*)this; } lue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
LAYER_NODE_FUNC(CCLayerColor); LAYER_NODE_FUNC(CCLayerColor);
protected: protected:
virtual void updateColor(); virtual void updateColor();
}; };
// //
// CCLayerGradient // CCLayerGradient
// //
/** CCLayerGradient is a subclass of CCLayerColor that draws gradients acro ss /** CCLayerGradient is a subclass of CCLayerColor that draws gradients acro ss
 End of changes. 8 change blocks. 
8 lines changed or deleted 22 lines changed or added


 CCMenu.h   CCMenu.h 
skipping to change at line 63 skipping to change at line 63
CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color); CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color);
/** Opacity: conforms with CCRGBAProtocol protocol */ /** Opacity: conforms with CCRGBAProtocol protocol */
CC_PROPERTY(GLubyte, m_cOpacity, Opacity); CC_PROPERTY(GLubyte, m_cOpacity, Opacity);
public: public:
CCMenu() CCMenu()
: m_cOpacity(0) : m_cOpacity(0)
, m_pSelectedItem(NULL) , m_pSelectedItem(NULL)
{} {}
virtual ~CCMenu(){} virtual ~CCMenu(){}
/** creates an empty CCMenu */ /** creates an empty CCMenu */
static CCMenu* node(); static CCMenu* node();
/** creates a CCMenu with it's items */ /** creates a CCMenu with it's items */
static CCMenu* menuWithItems(CCMenuItem* item, ...); static CCMenu* menuWithItems(CCMenuItem* item, ...);
/** creates a CCMenu with it's item, then use addChild() to add /** creates a CCMenu with it's item, then use addChild() to add
* other items. It is used for script, it can't init with u ndetermined * other items. It is used for script, it can't init with u ndetermined
* number of variables. * number of variables.
*/ */
static CCMenu*menuWithItem(CCMenuItem* item); static CCMenu* menuWithItem(CCMenuItem* item);
/** initializes an empty CCMenu */
bool init();
/** initializes an empty CCMenu */
bool init();
/** initializes a CCMenu with it's items */ /** initializes a CCMenu with it's items */
bool initWithItems(CCMenuItem* item, va_list args); bool initWithItems(CCMenuItem* item, va_list args);
/** align items vertically */ /** align items vertically */
void alignItemsVertically(); void alignItemsVertically();
/** align items vertically with padding /** align items vertically with padding
@since v0.7.2 @since v0.7.2
*/ */
void alignItemsVerticallyWithPadding(float padding); void alignItemsVerticallyWithPadding(float padding);
skipping to change at line 115 skipping to change at line 116
virtual void registerWithTouchDispatcher(); virtual void registerWithTouchDispatcher();
/** /**
@brief For phone event handle functions @brief For phone event handle functions
*/ */
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event); virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event); virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
virtual void ccTouchCancelled(CCTouch *touch, CCEvent* event ); virtual void ccTouchCancelled(CCTouch *touch, CCEvent* event );
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event); virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
virtual void destroy(void);
virtual void keep(void);
/** /**
@since v0.99.5 @since v0.99.5
override onExit override onExit
*/ */
virtual void onExit(); virtual void onExit();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CC virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_P
RGBAProtocol*)this; } ARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
protected: protected:
CCMenuItem* itemForTouch(CCTouch * touch); CCMenuItem* itemForTouch(CCTouch * touch);
tCCMenuState m_eState; tCCMenuState m_eState;
CCMenuItem *m_pSelectedItem; CCMenuItem *m_pSelectedItem;
}; };
} }
#endif//__CCMENU_H_ #endif//__CCMENU_H_
 End of changes. 6 change blocks. 
12 lines changed or deleted 11 lines changed or added


 CCMenuItem.h   CCMenuItem.h 
skipping to change at line 32 skipping to change at line 32
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CCMENU_ITEM_H__ #ifndef __CCMENU_ITEM_H__
#define __CCMENU_ITEM_H__ #define __CCMENU_ITEM_H__
#include "CCNode.h" #include "CCNode.h"
#include "CCProtocols.h" #include "CCProtocols.h"
#include "selector_protocol.h"
#include "CCMutableArray.h" #include "CCMutableArray.h"
namespace cocos2d{ namespace cocos2d{
class CCLabelTTF; class CCLabelTTF;
class CCLabelAtlas; class CCLabelAtlas;
class CCSprite; class CCSprite;
#define kCCItemSize 32 #define kCCItemSize 32
/** @brief CCMenuItem base class /** @brief CCMenuItem base class
* *
* Subclass CCMenuItem (or any subclass) to create your custom CCMen * Subclass CCMenuItem (or any subclass) to create your custom CCMenuI
uItem objects. tem objects.
*/ */
class CC_DLL CCMenuItem : public CCNode class CC_DLL CCMenuItem : public CCNode
{ {
/** whether or not the item is selected /** whether or not the item is selected
@since v0.8.2 @since v0.8.2
*/ */
CC_PROPERTY_READONLY(bool, m_bIsSelected, IsSelected); CC_PROPERTY_READONLY(bool, m_bIsSelected, IsSelected);
CC_PROPERTY(bool, m_bIsEnabled, IsEnabled); CC_PROPERTY(bool, m_bIsEnabled, IsEnabled);
public: public:
CCMenuItem() CCMenuItem()
: m_bIsSelected(false) : m_bIsSelected(false)
, m_bIsEnabled(false) , m_bIsEnabled(false)
, m_pListener(NULL) , m_pListener(NULL)
, m_pfnSelector(NULL) , m_pfnSelector(NULL)
{} , m_nScriptHandler(0)
virtual ~CCMenuItem(){} {}
/** Creates a CCMenuItem with a target/selector */ virtual ~CCMenuItem();
static CCMenuItem * itemWithTarget(SelectorProtocol *rec, SE /** Creates a CCMenuItem with a target/selector */
L_MenuHandler selector); static CCMenuItem * itemWithTarget(CCObject *rec, SEL_MenuHandler s
/** Initializes a CCMenuItem with a target/selector */ elector);
bool initWithTarget(SelectorProtocol *rec, SEL_MenuHandler s /** Initializes a CCMenuItem with a target/selector */
elector); bool initWithTarget(CCObject *rec, SEL_MenuHandler selector);
/** Returns the outside box */ /** Returns the outside box */
CCRect rect(); CCRect rect();
/** Activate the item */ /** Activate the item */
virtual void activate(); virtual void activate();
/** The item was selected (not activated), similar to "mouse /** The item was selected (not activated), similar to "mouse-over"
-over" */ */
virtual void selected(); virtual void selected();
/** The item was unselected */ /** The item was unselected */
virtual void unselected(); virtual void unselected();
/** Register a script function, the function is called in ac
tivete /** Register menu handler script function */
* If pszFunctionName is NULL, then unregister it. virtual void registerScriptHandler(int nHandler);
*/ virtual void unregisterScriptHandler(void);
virtual void registerScriptHandler(const char* pszFunctionNa
me); /** set the target/selector of the menu item*/
void setTarget(CCObject *rec, SEL_MenuHandler selector);
/** set the target/selector of the menu item*/ protected:
void setTarget(SelectorProtocol *rec, SEL_MenuHandler selec CCObject* m_pListener;
tor); SEL_MenuHandler m_pfnSelector;
protected: int m_nScriptHandler;
SelectorProtocol* m_pListener; };
SEL_MenuHandler m_pfnSelector;
std::string m_functionName; /** @brief An abstract class for "label" CCMenuItemLabel items
}; Any CCNode that supports the CCLabelProtocol protocol can be added.
Supported nodes:
/** @brief An abstract class for "label" CCMenuItemLabel items - CCBitmapFontAtlas
Any CCNode that supports the CCLabelProtocol protocol can be added. - CCLabelAtlas
Supported nodes: - CCLabelTTF
- CCBitmapFontAtlas */
- CCLabelAtlas class CC_DLL CCMenuItemLabel : public CCMenuItem, public CCRGBAProtocol
- CCLabelTTF {
*/ /** the color that will be used to disable the item */
class CC_DLL CCMenuItemLabel : public CCMenuItem, public CCRGBAProto CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tDisabledColor, DisabledColor)
col ;
{ /** Label that is rendered. It can be any CCNode that implements th
/** the color that will be used to disable the item */ e CCLabelProtocol */
CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tDisabledColor, Disable CC_PROPERTY(CCNode*, m_pLabel, Label);
dColor); public:
/** Label that is rendered. It can be any CCNode that implem CCMenuItemLabel()
ents the CCLabelProtocol */ : m_pLabel(NULL)
CC_PROPERTY(CCNode*, m_pLabel, Label); , m_fOriginalScale(0.0)
public: {}
CCMenuItemLabel() virtual ~CCMenuItemLabel();
: m_pLabel(NULL) /** creates a CCMenuItemLabel with a Label, target and selector */
, m_fOriginalScale(0.0) static CCMenuItemLabel * itemWithLabel(CCNode*label, CCObject* targ
{} et, SEL_MenuHandler selector);
virtual ~CCMenuItemLabel(); /** creates a CCMenuItemLabel with a Label. Target and selector wil
/** creates a CCMenuItemLabel with a Label, target and selec l be nill */
tor */ static CCMenuItemLabel* itemWithLabel(CCNode *label);
static CCMenuItemLabel * itemWithLabel(CCNode*label, Selecto /** initializes a CCMenuItemLabel with a Label, target and selector
rProtocol* target, SEL_MenuHandler selector); */
/** creates a CCMenuItemLabel with a Label. Target and selec bool initWithLabel(CCNode* label, CCObject* target, SEL_MenuHandler
tor will be nill */ selector);
static CCMenuItemLabel* itemWithLabel(CCNode *label); /** sets a new string to the inner label */
/** initializes a CCMenuItemLabel with a Label, target and s void setString(const char * label);
elector */ // super methods
bool initWithLabel(CCNode* label, SelectorProtocol* target, virtual void activate();
SEL_MenuHandler selector); virtual void selected();
/** sets a new string to the inner label */ virtual void unselected();
void setString(const char * label); /** Enable or disabled the CCMenuItemFont
// super methods @warning setIsEnabled changes the RGB color of the font
virtual void activate(); */
virtual void selected(); virtual void setIsEnabled(bool enabled);
virtual void unselected(); virtual void setOpacity(GLubyte opacity);
/** Enable or disabled the CCMenuItemFont virtual GLubyte getOpacity();
@warning setIsEnabled changes the RGB color of the font virtual void setColor(const ccColor3B& color);
*/ virtual const ccColor3B& getColor();
virtual void setIsEnabled(bool enabled);
virtual void setOpacity(GLubyte opacity); virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bV
virtual GLubyte getOpacity(); alue);}
virtual void setColor(const ccColor3B& color); virtual bool getIsOpacityModifyRGB(void) { return false;}
virtual const ccColor3B& getColor(); protected:
ccColor3B m_tColorBackup;
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CC float m_fOriginalScale;
RGBAProtocol*)this; } };
protected:
ccColor3B m_tColorBackup; /** @brief A CCMenuItemAtlasFont
float m_fOriginalScale; Helper class that creates a MenuItemLabel class with a LabelAtlas
}; */
class CC_DLL CCMenuItemAtlasFont : public CCMenuItemLabel
/** @brief A CCMenuItemAtlasFont {
Helper class that creates a MenuItemLabel class with a LabelAtlas public:
*/ CCMenuItemAtlasFont(){}
class CC_DLL CCMenuItemAtlasFont : public CCMenuItemLabel virtual ~CCMenuItemAtlasFont(){}
{ /** creates a menu item from a string and atlas with a target/selec
public: tor */
CCMenuItemAtlasFont(){} static CCMenuItemAtlasFont* itemFromString(const char *value, const
virtual ~CCMenuItemAtlasFont(){} char *charMapFile, int itemWidth, int itemHeight, char startCharMap);
/** creates a menu item from a string and atlas with a targe /** creates a menu item from a string and atlas. Use it with MenuIt
t/selector */ emToggle */
static CCMenuItemAtlasFont* itemFromString(const char *value static CCMenuItemAtlasFont* itemFromString(const char *value, const
, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap char *charMapFile, int itemWidth, int itemHeight, char startCharMap, CCObj
); ect* target, SEL_MenuHandler selector);
/** creates a menu item from a string and atlas. Use it with /** initializes a menu item from a string and atlas with a target/s
MenuItemToggle */ elector */
static CCMenuItemAtlasFont* itemFromString(const char *value bool initFromString(const char *value, const char *charMapFile, int
, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap itemWidth, int itemHeight, char startCharMap, CCObject* target, SEL_MenuHa
, SelectorProtocol* target, SEL_MenuHandler selector); ndler selector);
/** initializes a menu item from a string and atlas with a t };
arget/selector */
bool initFromString(const char *value, const char *charMapFi /** @brief A CCMenuItemFont
le, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol* tar Helper class that creates a CCMenuItemLabel class with a Label
get, SEL_MenuHandler selector); */
}; class CC_DLL CCMenuItemFont : public CCMenuItemLabel
{
/** @brief A CCMenuItemFont public:
Helper class that creates a CCMenuItemLabel class with a Label CCMenuItemFont() : m_uFontSize(0), m_strFontName(""){}
*/ virtual ~CCMenuItemFont(){}
class CC_DLL CCMenuItemFont : public CCMenuItemLabel /** set default font size */
{ static void setFontSize(unsigned int s);
public: /** get default font size */
CCMenuItemFont() : m_uFontSize(0), m_strFontName(""){} static unsigned int fontSize();
virtual ~CCMenuItemFont(){} /** set the default font name */
/** set default font size */ static void setFontName(const char *name);
static void setFontSize(unsigned int s); /** get the default font name */
/** get default font size */ static const char *fontName();
static unsigned int fontSize(); /** creates a menu item from a string without target/selector. To b
/** set the default font name */ e used with CCMenuItemToggle */
static void setFontName(const char *name); static CCMenuItemFont * itemFromString(const char *value);
/** get the default font name */ /** creates a menu item from a string with a target/selector */
static const char *fontName(); static CCMenuItemFont * itemFromString(const char *value, CCObject*
/** creates a menu item from a string without target/selecto target, SEL_MenuHandler selector);
r. To be used with CCMenuItemToggle */ /** initializes a menu item from a string with a target/selector */
static CCMenuItemFont * itemFromString(const char *value); bool initFromString(const char *value, CCObject* target, SEL_MenuHa
/** creates a menu item from a string with a target/selector ndler selector);
*/
static CCMenuItemFont * itemFromString(const char *value, Se /** set font size
lectorProtocol* target, SEL_MenuHandler selector); * c++ can not overload static and non-static member functions with
/** initializes a menu item from a string with a target/sele the same parameter types
ctor */ * so change the name to setFontSizeObj
bool initFromString(const char *value, SelectorProtocol* tar */
get, SEL_MenuHandler selector); void setFontSizeObj(unsigned int s);
/** set font size /** get font size */
* c++ can not overload static and non-static member functi unsigned int fontSizeObj();
ons with the same parameter types
* so change the name to setFontSizeObj /** set the font name
*/ * c++ can not overload static and non-static member functions with
void setFontSizeObj(unsigned int s); the same parameter types
* so change the name to setFontNameObj
/** get font size */ */
unsigned int fontSizeObj(); void setFontNameObj(const char* name);
/** set the font name const char* fontNameObj();
* c++ can not overload static and non-static member functio
ns with the same parameter types protected:
* so change the name to setFontNameObj void recreateLabel();
*/
void setFontNameObj(const char* name); unsigned int m_uFontSize;
std::string m_strFontName;
const char* fontNameObj(); };
protected: /** @brief CCMenuItemSprite accepts CCNode<CCRGBAProtocol> objects as i
void recreateLabel(); tems.
The images has 3 different states:
unsigned int m_uFontSize; - unselected image
std::string m_strFontName; - selected image
}; - disabled image
/** @brief CCMenuItemSprite accepts CCNode<CCRGBAProtocol> objects a @since v0.8.0
s items. */
The images has 3 different states: class CC_DLL CCMenuItemSprite : public CCMenuItem, public CCRGBAProtoco
- unselected image l
- selected image {
- disabled image /** the image used when the item is not selected */
CC_PROPERTY(CCNode*, m_pNormalImage, NormalImage);
@since v0.8.0 /** the image used when the item is selected */
*/ CC_PROPERTY(CCNode*, m_pSelectedImage, SelectedImage);
class CC_DLL CCMenuItemSprite : public CCMenuItem, public CCRGBAProt /** the image used when the item is disabled */
ocol CC_PROPERTY(CCNode*, m_pDisabledImage, DisabledImage);
{ public:
/** the image used when the item is not selected */ CCMenuItemSprite()
CC_PROPERTY(CCNode*, m_pNormalImage, NormalImage); :m_pNormalImage(NULL)
/** the image used when the item is selected */ ,m_pSelectedImage(NULL)
CC_PROPERTY(CCNode*, m_pSelectedImage, SelectedImage); ,m_pDisabledImage(NULL)
/** the image used when the item is disabled */ {}
CC_PROPERTY(CCNode*, m_pDisabledImage, DisabledImage); /** creates a menu item with a normal, selected and disabled image*
public: /
CCMenuItemSprite() static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite
:m_pNormalImage(NULL) , CCNode* selectedSprite, CCNode* disabledSprite = NULL);
,m_pSelectedImage(NULL) /** creates a menu item with a normal and selected image with targe
,m_pDisabledImage(NULL) t/selector */
{} static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite
/** creates a menu item with a normal and selected image*/ , CCNode* selectedSprite, CCObject* target, SEL_MenuHandler selector);
static CCMenuItemSprite * itemFromNormalSprite(CCNode* norma /** creates a menu item with a normal,selected and disabled image
lSprite, CCNode* selectedSprite); with target/selector */
/** creates a menu item with a normal and selected image wit static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite
h target/selector */ , CCNode* selectedSprite, CCNode* disabledSprite, CCObject* target, SEL_Men
static CCMenuItemSprite * itemFromNormalSprite(CCNode* norma uHandler selector);
lSprite, CCNode* selectedSprite, SelectorProtocol* target, SEL_MenuHandler /** initializes a menu item with a normal, selected and disabled i
selector); mage with target/selector */
/** creates a menu item with a normal,selected and disabled bool initFromNormalSprite(CCNode* normalSprite, CCNode* selectedSpr
image with target/selector */ ite, CCNode* disabledSprite, CCObject* target, SEL_MenuHandler selector);
static CCMenuItemSprite * itemFromNormalSprite(CCNode* norma // super methods
lSprite, CCNode* selectedSprite, CCNode* disabledSprite, SelectorProtocol*
target, SEL_MenuHandler selector);
/** initializes a menu item with a normal, selected and dis
abled image with target/selector */
bool initFromNormalSprite(CCNode* normalSprite, CCNode* sele
ctedSprite, CCNode* disabledSprite, SelectorProtocol* target, SEL_MenuHandl
er selector);
// super methods
virtual void setColor(const ccColor3B& color); virtual void setColor(const ccColor3B& color);
virtual const ccColor3B& getColor(); virtual const ccColor3B& getColor();
virtual void setOpacity(GLubyte opacity); virtual void setOpacity(GLubyte opacity);
virtual GLubyte getOpacity(); virtual GLubyte getOpacity();
/** /**
@since v0.99.5 @since v0.99.5
*/ */
virtual void selected(); virtual void selected();
virtual void unselected(); virtual void unselected();
virtual void setIsEnabled(bool bEnabled); virtual void setIsEnabled(bool bEnabled);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CC virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bV
RGBAProtocol*)this; } alue);}
}; virtual bool getIsOpacityModifyRGB(void) { return false;}
};
/** @brief CCMenuItemImage accepts images as items.
The images has 3 different states: /** @brief CCMenuItemImage accepts images as items.
- unselected image The images has 3 different states:
- selected image - unselected image
- disabled image - selected image
- disabled image
For best results try that all images are of the same size
*/ For best results try that all images are of the same size
class CC_DLL CCMenuItemImage : public CCMenuItemSprite */
{ class CC_DLL CCMenuItemImage : public CCMenuItemSprite
public: {
CCMenuItemImage(){} public:
virtual ~CCMenuItemImage(){} CCMenuItemImage(){}
/** creates a menu item with a normal and selected image*/ virtual ~CCMenuItemImage(){}
static CCMenuItemImage* itemFromNormalImage(const char *norm /** creates a menu item with a normal and selected image*/
alImage, const char *selectedImage); static CCMenuItemImage* itemFromNormalImage(const char *normalImage
/** creates a menu item with a normal,selected and disabled , const char *selectedImage);
image*/ /** creates a menu item with a normal,selected and disabled image*
static CCMenuItemImage* itemFromNormalImage(const char *norm /
alImage, const char *selectedImage, const char *disabledImage); static CCMenuItemImage* itemFromNormalImage(const char *normalImage
/** creates a menu item with a normal and selected image wit , const char *selectedImage, const char *disabledImage);
h target/selector */ /** creates a menu item with a normal and selected image with targe
static CCMenuItemImage* itemFromNormalImage(const char *norm t/selector */
alImage, const char *selectedImage, SelectorProtocol* target, SEL_MenuHandl static CCMenuItemImage* itemFromNormalImage(const char *normalImage
er selector); , const char *selectedImage, CCObject* target, SEL_MenuHandler selector);
/** creates a menu item with a normal,selected and disabled /** creates a menu item with a normal,selected and disabled image
image with target/selector */ with target/selector */
static CCMenuItemImage* itemFromNormalImage(const char *norm static CCMenuItemImage* itemFromNormalImage(const char *normalImage
alImage, const char *selectedImage, const char *disabledImage, SelectorProt , const char *selectedImage, const char *disabledImage, CCObject* target, S
ocol* target, SEL_MenuHandler selector); EL_MenuHandler selector);
/** initializes a menu item with a normal, selected and dis /** initializes a menu item with a normal, selected and disabled i
abled image with target/selector */ mage with target/selector */
bool initFromNormalImage(const char *normalImage, const char bool initFromNormalImage(const char *normalImage, const char *selec
*selectedImage, const char *disabledImage, SelectorProtocol* target, SEL_M tedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler sele
enuHandler selector); ctor);
}; };
/** @brief A CCMenuItemToggle /** @brief A CCMenuItemToggle
A simple container class that "toggles" it's inner items A simple container class that "toggles" it's inner items
The inner itmes can be any MenuItem The inner itmes can be any MenuItem
*/ */
class CC_DLL CCMenuItemToggle : public CCMenuItem, public CCRGBAProt class CC_DLL CCMenuItemToggle : public CCMenuItem, public CCRGBAProtoco
ocol l
{ {
/** conforms with CCRGBAProtocol protocol */ /** conforms with CCRGBAProtocol protocol */
CC_PROPERTY(GLubyte, m_cOpacity, Opacity); CC_PROPERTY(GLubyte, m_cOpacity, Opacity);
/** conforms with CCRGBAProtocol protocol */ /** conforms with CCRGBAProtocol protocol */
CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color); CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color);
/** returns the selected item */ /** returns the selected item */
CC_PROPERTY(unsigned int, m_uSelectedIndex, SelectedIndex); CC_PROPERTY(unsigned int, m_uSelectedIndex, SelectedIndex);
/** CCMutableArray that contains the subitems. You can add/r /** CCMutableArray that contains the subitems. You can add/remove i
emove items in runtime, and you can replace the array with a new one. tems in runtime, and you can replace the array with a new one.
@since v0.7.2 @since v0.7.2
*/ */
CC_PROPERTY(CCMutableArray<CCMenuItem*>*, m_pSubItems, SubIt CC_PROPERTY(CCMutableArray<CCMenuItem*>*, m_pSubItems, SubItems);
ems); public:
public: CCMenuItemToggle()
CCMenuItemToggle() : m_cOpacity(0)
: m_cOpacity(0) , m_uSelectedIndex(0)
, m_uSelectedIndex(0) , m_pSubItems(NULL)
, m_pSubItems(NULL) {}
{} virtual ~CCMenuItemToggle();
virtual ~CCMenuItemToggle(); /** creates a menu item from a list of items with a target/selector
/** creates a menu item from a list of items with a target/s */
elector */ static CCMenuItemToggle* itemWithTarget(CCObject* target, SEL_MenuH
static CCMenuItemToggle* itemWithTarget(SelectorProtocol* ta andler selector, CCMenuItem* item, ...);
rget, SEL_MenuHandler selector, CCMenuItem* item, ...); /** initializes a menu item from a list of items with a target sele
/** initializes a menu item from a list of items with a targ ctor */
et selector */ bool initWithTarget(CCObject* target, SEL_MenuHandler selector, CCM
bool initWithTarget(SelectorProtocol* target, SEL_MenuHandle enuItem* item, va_list args);
r selector, CCMenuItem* item, va_list args);
// The follow methods offered to lua
// The follow methods offered to lua /** creates a menu item with a item */
/** creates a menu item with a item */ static CCMenuItemToggle* itemWithItem(CCMenuItem *item);
static CCMenuItemToggle* itemWithItem(CCMenuItem *item); /** initializes a menu item with a item */
/** initializes a menu item with a item */ bool initWithItem(CCMenuItem *item);
bool initWithItem(CCMenuItem *item); /** add more menu item */
/** add more menu item */ void addSubItem(CCMenuItem *item);
void addSubItem(CCMenuItem *item);
/** return the selected item */
/** return the selected item */ CCMenuItem* selectedItem();
CCMenuItem* selectedItem(); // super methods
// super methods virtual void activate();
virtual void activate(); virtual void selected();
virtual void selected(); virtual void unselected();
virtual void unselected(); virtual void setIsEnabled(bool var);
virtual void setIsEnabled(bool var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CC virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bV
RGBAProtocol*)this; } alue);}
}; virtual bool getIsOpacityModifyRGB(void) { return false;}
};
} }
#endif //__CCMENU_ITEM_H__ #endif //__CCMENU_ITEM_H__
 End of changes. 6 change blocks. 
328 lines changed or deleted 319 lines changed or added


 CCMutableArray.h   CCMutableArray.h 
skipping to change at line 61 skipping to change at line 61
virtual ~CCMutableArray(void) virtual ~CCMutableArray(void)
{ {
removeAllObjects(); removeAllObjects();
} }
inline unsigned int count(void) inline unsigned int count(void)
{ {
return (unsigned int)m_array.size(); return (unsigned int)m_array.size();
} }
unsigned int getIndexOfObject(T pObject)
{
if (m_array.empty() || (pObject == 0))
{
return 0;
}
CCMutableArrayIterator iter;
unsigned int uRet = 0;
unsigned int i;
for (iter = m_array.begin(), i = 0; iter != m_array.end(); +
+iter, ++i)
{
if (*iter == pObject)
{
uRet = i;
break;
}
}
return uRet;
}
bool containsObject(T pObject) bool containsObject(T pObject)
{ {
if (m_array.empty() || (! pObject)) if (m_array.empty() || (! pObject))
{ {
return false; return false;
} }
bool bRet = false; bool bRet = false;
CCMutableArrayIterator iter; CCMutableArrayIterator iter;
for (iter = m_array.begin(); iter != m_array.end(); ++iter) for (iter = m_array.begin(); iter != m_array.end(); ++iter)
 End of changes. 1 change blocks. 
23 lines changed or deleted 0 lines changed or added


 CCNode.h   CCNode.h 
/************************************************************************** ** /************************************************************************** **
Copyright (c) 2010-2011 cocos2d-x.org Copyright (c) 2010-2011 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2009 Valentin Milea Copyright (c) 2009 Valentin Milea
Copyright (c) 2011 Zynga Inc. Copyright (c) 2011 Zynga Inc.
http://www.cocos2d-x.org http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a cop Permission is hereby granted, free of charge, to any person obtaining a co
y py
of this software and associated documentation files (the "Software"), to de of this software and associated documentation files (the "Software"), to d
al eal
in the Software without restriction, including without limitation the right in the Software without restriction, including without limitation the righ
s ts
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL TH
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER E
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FR
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OM,
THE SOFTWARE. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*************************************************************************** THE SOFTWARE.
*/ **************************************************************************
**/
#ifndef __PLATFOMR_CCNODE_H__ #ifndef __PLATFOMR_CCNODE_H__
#define __PLATFOMR_CCNODE_H__ #define __PLATFOMR_CCNODE_H__
#include "ccMacros.h" #include "ccMacros.h"
#include "CCAffineTransform.h" #include "CCAffineTransform.h"
#include "CCArray.h" #include "CCArray.h"
#include "selector_protocol.h"
#include "CCGL.h" #include "CCGL.h"
namespace cocos2d { namespace cocos2d {
class CCCamera; class CCCamera;
class CCGridBase; class CCGridBase;
class CCPoint; class CCPoint;
class CCTouch; class CCTouch;
class CCAction; class CCAction;
class CCRGBAProtocol; class CCRGBAProtocol;
class CCLabelProtocol; class CCLabelProtocol;
enum { enum {
kCCNodeTagInvalid = -1, kCCNodeTagInvalid = -1,
}; };
enum {
kCCNodeOnEnter,
kCCNodeOnExit
};
/** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. /** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode.
The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu. The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.
The main features of a CCNode are: The main features of a CCNode are:
- They can contain other CCNode nodes (addChild, getChildByTag, remo - They can contain other CCNode nodes (addChild, getChildByTag, remove
veChild, etc) Child, etc)
- They can schedule periodic callback (schedule, unschedule, etc) - They can schedule periodic callback (schedule, unschedule, etc)
- They can execute actions (runAction, stopAction, etc) - They can execute actions (runAction, stopAction, etc)
Some CCNode nodes provide extra functionality for them or their chil Some CCNode nodes provide extra functionality for them or their childr
dren. en.
Subclassing a CCNode usually means (one/all) of: Subclassing a CCNode usually means (one/all) of:
- overriding init to initialize resources and schedule callbacks - overriding init to initialize resources and schedule callbacks
- create callbacks to handle the advancement of time - create callbacks to handle the advancement of time
- overriding draw to render the node - overriding draw to render the node
Features of CCNode: Features of CCNode:
- position - position
- scale (x, y) - scale (x, y)
- rotation (in degrees, clockwise) - rotation (in degrees, clockwise)
- CCCamera (an interface to gluLookAt ) - CCCamera (an interface to gluLookAt )
- CCGridBase (to do mesh transformations) - CCGridBase (to do mesh transformations)
- anchor point - anchor point
- size - size
- visible - visible
- z-order - z-order
- openGL z position - openGL z position
Default values: Default values:
- rotation: 0 - rotation: 0
- position: (x=0,y=0) - position: (x=0,y=0)
- scale: (x=1,y=1) - scale: (x=1,y=1)
- contentSize: (x=0,y=0) - contentSize: (x=0,y=0)
- anchorPoint: (x=0,y=0) - anchorPoint: (x=0,y=0)
Limitations: Limitations:
- A CCNode is a "void" object. It doesn't have a texture - A CCNode is a "void" object. It doesn't have a texture
Order in transformations with grid disabled Order in transformations with grid disabled
-# The node will be translated (position) -# The node will be translated (position)
-# The node will be rotated (rotation) -# The node will be rotated (rotation)
-# The node will be scaled (scale) -# The node will be scaled (scale)
-# The node will be moved according to the camera values (camera) -# The node will be moved according to the camera values (camera)
Order in transformations with grid enabled Order in transformations with grid enabled
-# The node will be translated (position) -# The node will be translated (position)
-# The node will be rotated (rotation) -# The node will be rotated (rotation)
-# The node will be scaled (scale) -# The node will be scaled (scale)
-# The grid will capture the screen -# The grid will capture the screen
-# The node will be moved according to the camera values (camera) -# The node will be moved according to the camera values (camera)
-# The grid will render the captured screen -# The grid will render the captured screen
Camera: Camera:
- Each node has a camera. By default it points to the center of the - Each node has a camera. By default it points to the center of the CC
CCNode. Node.
*/ */
class CC_DLL CCNode : public SelectorProtocol, public CCObject class CC_DLL CCNode : public CCObject
{ {
// variable property // variable property
/** The z order of the node relative to it's "brothers": chi ldren of the same parent */ /** The z order of the node relative to it's "brothers": chi ldren of the same parent */
CC_PROPERTY_READONLY(int, m_nZOrder, ZOrder) CC_PROPERTY_READONLY(int, m_nZOrder, ZOrder)
/** The real openGL Z vertex. /** The real openGL Z vertex.
Differences between openGL Z vertex and cocos2d Z or Differences between openGL Z vertex and cocos2d Z order:
der: - OpenGL Z modifies the Z vertex, and not the Z order in the relat
- OpenGL Z modifies the Z vertex, and not the Z orde ion between parent-children
r in the relation between parent-children - OpenGL Z might require to set 2D projection
- OpenGL Z might require to set 2D projection - cocos2d Z order works OK if all the nodes uses the same openGL Z
- cocos2d Z order works OK if all the nodes uses the vertex. eg: vertexZ = 0
same openGL Z vertex. eg: vertexZ = 0 @warning: Use it at your own risk since it might break the cocos2d
@warning: Use it at your own risk since it might bre parent-children z order
ak the cocos2d parent-children z order @since v0.8
@since v0.8 */
*/ CC_PROPERTY(float, m_fVertexZ, VertexZ)
CC_PROPERTY(float, m_fVertexZ, VertexZ)
/** The rotation (angle) of the node in degrees. 0 is the default r
/** The rotation (angle) of the node in degrees. 0 i otation angle. Positive values rotate node CW. */
s the default rotation angle. Positive values rotate node CW. */ CC_PROPERTY(float, m_fRotation, Rotation)
CC_PROPERTY(float, m_fRotation, Rotation)
/** Get the scale factor of the node.
/** Get the scale factor of the node. @warning: Assert when m_fScaleX != m_fScaleY.
@warning: Assert when m_fScaleX != m_fScaleY. */
*/ float getScale();
float getScale();
/** The scale factor of the node. 1.0 is the default scale f actor. It modifies the X and Y scale at the same time. */ /** The scale factor of the node. 1.0 is the default scale f actor. It modifies the X and Y scale at the same time. */
void setScale(float scale); void setScale(float scale);
/** The scale factor of the node. 1.0 is the default scale f actor. It only modifies the X scale factor. */ /** The scale factor of the node. 1.0 is the default scale f actor. It only modifies the X scale factor. */
CC_PROPERTY(float, m_fScaleX, ScaleX) CC_PROPERTY(float, m_fScaleX, ScaleX)
/** The scale factor of the node. 1.0 is the default /** The scale factor of the node. 1.0 is the default scale factor.
scale factor. It only modifies the Y scale factor. */ It only modifies the Y scale factor. */
CC_PROPERTY(float, m_fScaleY, ScaleY) CC_PROPERTY(float, m_fScaleY, ScaleY)
/** Position (x,y) of the node in OpenGL coordinates /** Position (x,y) of the node in OpenGL coordinates. (0,0) is the
. (0,0) is the left-bottom corner. */ left-bottom corner. */
CC_PROPERTY_PASS_BY_REF(CCPoint, m_tPosition, Positi CC_PROPERTY_PASS_BY_REF(CCPoint, m_tPosition, Position)
on) CC_PROPERTY_PASS_BY_REF(CCPoint, m_tPositionInPixels, PositionInPix
CC_PROPERTY_PASS_BY_REF(CCPoint, m_tPositionInPixels els)
, PositionInPixels)
/** get/set Position for Lua (pass number faster than CCPoint objec
/** The X skew angle of the node in degrees. t)
This angle describes the shear distortion in the X direction.
Thus, it is the angle between the Y axis and the left edge of t lua code:
he shape local pos = node:getPositionLua() -- return CCPoint object from C
The default skewX angle is 0. Positive values distort the node ++
in a CW direction. local x, y = node:getPosition() -- return x, y values from C++
*/ local x = node:getPositionX()
CC_PROPERTY(float, m_fSkewX, SkewX) local y = node:getPositionY()
node:setPosition(x, y) -- pass x, y values to C++
/** The Y skew angle of the node in degrees. node:setPositionX(x)
This angle describes the shear distortion in the Y direction. node:setPositionY(y)
Thus, it is the angle between the X axis and the bottom edge of node:setPositionInPixels(x, y) -- pass x, y values to C++
the shape */
The default skewY angle is 0. Positive values distort the node const CCPoint& getPositionLua(void);
in a CCW direction. void getPosition(float* x, float* y);
*/ float getPositionX(void);
CC_PROPERTY(float, m_fSkewY, SkewY) float getPositionY(void);
void setPositionX(float x);
CC_PROPERTY_READONLY(CCArray*, m_pChildren, Children void setPositionY(float y);
) void setPosition(float x, float y);
void setPositionInPixels(float x, float y);
/** A CCCamera object that lets you move the node us
ing a gluLookAt /** The X skew angle of the node in degrees.
*/ This angle describes the shear distortion in the X direction.
CC_PROPERTY_READONLY(CCCamera *, m_pCamera, Camera) Thus, it is the angle between the Y axis and the left edge of the
shape
/** A CCGrid object that is used when applying effec The default skewX angle is 0. Positive values distort the node in
ts */ a CW direction.
CC_PROPERTY(CCGridBase *, m_pGrid, Grid) */
CC_PROPERTY(float, m_fSkewX, SkewX)
/** Whether of not the node is visible. Default is t
rue */ /** The Y skew angle of the node in degrees.
CC_PROPERTY(bool, m_bIsVisible, IsVisible) This angle describes the shear distortion in the Y direction.
Thus, it is the angle between the X axis and the bottom edge of th
/** anchorPoint is the point around which all transf e shape
ormations and positioning manipulations take place. The default skewY angle is 0. Positive values distort the node in
It's like a pin in the node where it is "attached" t a CCW direction.
o its parent. */
The anchorPoint is normalized, like a percentage. (0 CC_PROPERTY(float, m_fSkewY, SkewY)
,0) means the bottom-left corner and (1,1) means the top-right corner.
But you can use values higher than (1,1) and lower t CC_PROPERTY_READONLY(CCArray*, m_pChildren, Children)
han (0,0) too.
The default anchorPoint is (0.5,0.5), so it starts i /** Get children count */
n the center of the node. unsigned int getChildrenCount(void);
@since v0.8
*/ /** A CCCamera object that lets you move the node using a gluLookAt
CC_PROPERTY_PASS_BY_REF(CCPoint, m_tAnchorPoint, Anc */
horPoint) CC_PROPERTY_READONLY(CCCamera *, m_pCamera, Camera)
/** The anchorPoint in absolute pixels. /** A CCGrid object that is used when applying effects */
Since v0.8 you can only read it. If you wish to modi CC_PROPERTY(CCGridBase *, m_pGrid, Grid)
fy it, use anchorPoint instead
*/ /** Whether of not the node is visible. Default is true */
CC_PROPERTY_READONLY_PASS_BY_REF(CCPoint, m_tAnchorP CC_PROPERTY(bool, m_bIsVisible, IsVisible)
ointInPixels, AnchorPointInPixels)
/** anchorPoint is the point around which all transformations and p
/** The untransformed size of the node. ositioning manipulations take place.
The contentSize remains the same no matter the node It's like a pin in the node where it is "attached" to its parent.
is scaled or rotated. The anchorPoint is normalized, like a percentage. (0,0) means the
All nodes has a size. Layer and Scene has the same s bottom-left corner and (1,1) means the top-right corner.
ize of the screen. But you can use values higher than (1,1) and lower than (0,0) too.
@since v0.8 The default anchorPoint is (0.5,0.5), so it starts in the center o
*/ f the node.
CC_PROPERTY_PASS_BY_REF(CCSize, m_tContentSize, Cont @since v0.8
entSize) */
CC_PROPERTY_PASS_BY_REF(CCPoint, m_tAnchorPoint, AnchorPoint)
/** The untransformed size of the node in Pixels
The contentSize remains the same no matter the node /** The anchorPoint in absolute pixels.
is scaled or rotated. Since v0.8 you can only read it. If you wish to modify it, use anc
All nodes has a size. Layer and Scene has the same s horPoint instead
ize of the screen. */
@since v0.8 CC_PROPERTY_READONLY_PASS_BY_REF(CCPoint, m_tAnchorPointInPixels, A
*/ nchorPointInPixels)
CC_PROPERTY_PASS_BY_REF(CCSize, m_tContentSizeInPixe
ls, ContentSizeInPixels) /** The untransformed size of the node.
The contentSize remains the same no matter the node is scaled or r
/** whether or not the node is running */ otated.
CC_PROPERTY_READONLY(bool, m_bIsRunning, IsRunning) All nodes has a size. Layer and Scene has the same size of the scr
een.
/** A weak reference to the parent */ @since v0.8
CC_PROPERTY(CCNode *, m_pParent, Parent) */
CC_PROPERTY_PASS_BY_REF(CCSize, m_tContentSize, ContentSize)
/** If true the transformtions will be relative to i
t's anchor point. /** The untransformed size of the node in Pixels
* Sprites, Labels and any other sizeble object use i The contentSize remains the same no matter the node is scaled or r
t have it enabled by default. otated.
* Scenes, Layers and other "whole screen" object don All nodes has a size. Layer and Scene has the same size of the scr
't use it, have it disabled by default. een.
*/ @since v0.8
CC_PROPERTY(bool, m_bIsRelativeAnchorPoint, IsRelati */
veAnchorPoint) CC_PROPERTY_PASS_BY_REF(CCSize, m_tContentSizeInPixels, ContentSize
InPixels)
/** whether or not the node is running */
CC_PROPERTY_READONLY(bool, m_bIsRunning, IsRunning)
/** A weak reference to the parent */
CC_PROPERTY(CCNode *, m_pParent, Parent)
/** If true the transformtions will be relative to it's anchor poin
t.
* Sprites, Labels and any other sizeble object use it have it enab
led by default.
* Scenes, Layers and other "whole screen" object don't use it, hav
e it disabled by default.
*/
CC_PROPERTY(bool, m_bIsRelativeAnchorPoint, IsRelativeAnchorPoint)
/** A tag used to identify the node easily */ /** A tag used to identify the node easily */
CC_PROPERTY(int, m_nTag, Tag) CC_PROPERTY(int, m_nTag, Tag)
/** A custom user data pointer */ /** A custom user data pointer */
CC_PROPERTY(void *, m_pUserData, UserData) CC_PROPERTY(void *, m_pUserData, UserData)
protected: protected:
// transform // transform
CCAffineTransform m_tTransform, m_tInverse; CCAffineTransform m_tTransform, m_tInverse;
#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX #ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
GLfloat m_pTransformGL[16]; GLfloat m_pTransformGL[16];
#endif #endif
// To reduce memory, place bools that are not properties her e: // To reduce memory, place bools that are not properties her e:
bool m_bIsTransformDirty; bool m_bIsTransformDirty;
bool m_bIsInverseDirty; bool m_bIsInverseDirty;
#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX #ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
bool m_bIsTransformGLDirty; bool m_bIsTransformGLDirty;
#endif #endif
int m_nScriptHandler;
private: private:
//! lazy allocs //! lazy allocs
void childrenAlloc(void); void childrenAlloc(void);
//! helper that reorder a child //! helper that reorder a child
void insertChild(CCNode* child, int z); void insertChild(CCNode* child, int z);
//! used internally to alter the zOrder variable. DON'T call this method manually //! used internally to alter the zOrder variable. DON'T call this method manually
void setZOrder(int z); void setZOrder(int z);
skipping to change at line 253 skipping to change at line 282
void detachChild(CCNode *child, bool doCleanup); void detachChild(CCNode *child, bool doCleanup);
typedef void (CCNode::*callbackFunc)(void); typedef void (CCNode::*callbackFunc)(void);
void arrayMakeObjectsPerformSelector(CCArray* pArray, callba ckFunc func); void arrayMakeObjectsPerformSelector(CCArray* pArray, callba ckFunc func);
CCPoint convertToWindowSpace(const CCPoint& nodePoint); CCPoint convertToWindowSpace(const CCPoint& nodePoint);
public: public:
CCNode(); CCNode(void);
virtual ~CCNode(); virtual ~CCNode(void);
char * description(void); char * description(void);
/** allocates and initializes a node. /** allocates and initializes a node.
The node will be created as "autorelease". The node will be created as "autorelease".
*/ */
static CCNode * node(void); static CCNode * node(void);
//scene managment //scene managment
/** callback that is called every time the CCNode enters the 'stage'. /** callback that is called every time the CCNode enters the 'stage'.
If the CCNode enters the 'stage' with a transition, this cal If the CCNode enters the 'stage' with a transition, this callback
lback is called when the transition starts. is called when the transition starts.
During onEnter you can't a "sister/brother" node. During onEnter you can't a "sister/brother" node.
*/ */
virtual void onEnter(); virtual void onEnter();
/** callback that is called when the CCNode enters in the 's tage'. /** callback that is called when the CCNode enters in the 's tage'.
If the CCNode enters the 'stage' with a transition, this cal If the CCNode enters the 'stage' with a transition, this callback
lback is called when the transition finishes. is called when the transition finishes.
@since v0.8 @since v0.8
*/ */
virtual void onEnterTransitionDidFinish(); virtual void onEnterTransitionDidFinish();
/** callback that is called every time the CCNode leaves the 'stage'. /** callback that is called every time the CCNode leaves the 'stage'.
If the CCNode leaves the 'stage' with a transition, this cal If the CCNode leaves the 'stage' with a transition, this callback
lback is called when the transition finishes. is called when the transition finishes.
During onExit you can't access a sibling node. During onExit you can't access a sibling node.
*/ */
virtual void onExit(); virtual void onExit();
/** Register onEnter/onExit handler script function
Script handler auto unregister after onEnter().
*/
virtual void registerScriptHandler(int nHandler);
virtual void unregisterScriptHandler(void);
// composition: ADD // composition: ADD
/** Adds a child to the container with z-order as 0. /** Adds a child to the container with z-order as 0.
If the child is added to a 'running' node, then 'onEnter' an If the child is added to a 'running' node, then 'onEnter' and 'onE
d 'onEnterTransitionDidFinish' will be called immediately. nterTransitionDidFinish' will be called immediately.
@since v0.7.1 @since v0.7.1
*/ */
virtual void addChild(CCNode * child); virtual void addChild(CCNode * child);
/** Adds a child to the container with a z-order /** Adds a child to the container with a z-order
If the child is added to a 'running' node, then 'onEnter' an If the child is added to a 'running' node, then 'onEnter' and 'onE
d 'onEnterTransitionDidFinish' will be called immediately. nterTransitionDidFinish' will be called immediately.
@since v0.7.1 @since v0.7.1
*/ */
virtual void addChild(CCNode * child, int zOrder); virtual void addChild(CCNode * child, int zOrder);
/** Adds a child to the container with z order and tag /** Adds a child to the container with z order and tag
If the child is added to a 'running' node, then 'onEnter' an If the child is added to a 'running' node, then 'onEnter' and 'onE
d 'onEnterTransitionDidFinish' will be called immediately. nterTransitionDidFinish' will be called immediately.
@since v0.7.1 @since v0.7.1
*/ */
virtual void addChild(CCNode * child, int zOrder, int tag); virtual void addChild(CCNode * child, int zOrder, int tag);
// composition: REMOVE // composition: REMOVE
/** Remove itself from its parent node. If cleanup is true, then also remove all actions and callbacks. /** Remove itself from its parent node. If cleanup is true, then also remove all actions and callbacks.
If the node orphan, then nothing happens. If the node orphan, then nothing happens.
@since v0.99.3 @since v0.99.3
*/ */
void removeFromParentAndCleanup(bool cleanup); void removeFromParentAndCleanup(bool cleanup);
/** Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter. /** Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.
@since v0.7.1 @since v0.7.1
*/ */
virtual void removeChild(CCNode* child, bool cleanup); virtual void removeChild(CCNode* child, bool cleanup);
/** Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter /** Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter
@since v0.7.1 @since v0.7.1
*/ */
void removeChildByTag(int tag, bool cleanup); void removeChildByTag(int tag, bool cleanup);
/** Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter. /** Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
@since v0.7.1 @since v0.7.1
*/ */
virtual void removeAllChildrenWithCleanup(bool cleanup); virtual void removeAllChildrenWithCleanup(bool cleanup);
// composition: GET // composition: GET
/** Gets a child from the container given its tag /** Gets a child from the container given its tag
@return returns a CCNode object @return returns a CCNode object
@since v0.7.1 @since v0.7.1
*/ */
CCNode * getChildByTag(int tag); CCNode * getChildByTag(int tag);
/** Reorders a child according to a new z value. /** Reorders a child according to a new z value.
* The child MUST be already added. * The child MUST be already added.
*/ */
virtual void reorderChild(CCNode * child, int zOrder); virtual void reorderChild(CCNode * child, int zOrder);
/** Stops all running actions and schedulers /** Stops all running actions and schedulers
@since v0.8 @since v0.8
*/ */
virtual void cleanup(void); virtual void cleanup(void);
// draw // draw
/** Override this method to draw your own node. /** Override this method to draw your own node.
The following GL states will be enabled by default: The following GL states will be enabled by default:
- glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY); - glEnableClientState(GL_COLOR_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnable(GL_TEXTURE_2D); - glEnable(GL_TEXTURE_2D);
AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE
But if you enable any other GL state, you should disable it But if you enable any other GL state, you should disable it after
after drawing your node. drawing your node.
*/ */
virtual void draw(void); virtual void draw(void);
/** recursive method that visit its children and draw them * / /** recursive method that visit its children and draw them * /
virtual void visit(void); virtual void visit(void);
// transformations // transformations
/** performs OpenGL view-matrix transformation based on posi tion, scale, rotation and other attributes. */ /** performs OpenGL view-matrix transformation based on posi tion, scale, rotation and other attributes. */
void transform(void); void transform(void);
/** performs OpenGL view-matrix transformation of it's ances tors. /** performs OpenGL view-matrix transformation of it's ances tors.
Generally the ancestors are already transformed, but in cert Generally the ancestors are already transformed, but in certain ca
ain cases (eg: attaching a FBO) ses (eg: attaching a FBO)
it's necessary to transform the ancestors again. it's necessary to transform the ancestors again.
@since v0.7.2 @since v0.7.2
*/ */
void transformAncestors(void); void transformAncestors(void);
/** returns a "local" axis aligned bounding box of the node. /** returns a "local" axis aligned bounding box of the node.
The returned box is relative only to its parent. The returned box is relative only to its parent.
@since v0.8.2 @since v0.8.2
*/ */
CCRect boundingBox(void); CCRect boundingBox(void);
/** returns a "local" axis aligned bounding box of the node in pixels. /** returns a "local" axis aligned bounding box of the node in pixels.
The returned box is relative only to its parent. The returned box is relative only to its parent.
The returned box is in Points. The returned box is in Points.
@since v0.99.5 @since v0.99.5
*/ */
CCRect boundingBoxInPixels(void); CCRect boundingBoxInPixels(void);
// actions // actions
/** Executes an action, and returns the action that is execu ted. /** Executes an action, and returns the action that is execu ted.
The node becomes the action's target. The node becomes the action's target.
@warning Starting from v0.8 actions don't retain their targe @warning Starting from v0.8 actions don't retain their target anym
t anymore. ore.
@since v0.7.1 @since v0.7.1
@return An Action pointer @return An Action pointer
*/ */
CCAction* runAction(CCAction* action); CCAction* runAction(CCAction* action);
/** Removes all actions from the running action list */ /** Removes all actions from the running action list */
void stopAllActions(void); void stopAllActions(void);
/** Removes an action from the running action list */ /** Removes an action from the running action list */
void stopAction(CCAction* action); void stopAction(CCAction* action);
/** Removes an action from the running action list given its tag /** Removes an action from the running action list given its tag
@since v0.7.1 @since v0.7.1
*/ */
void stopActionByTag(int tag); void stopActionByTag(int tag);
/** Gets an action from the running action list given its ta g /** Gets an action from the running action list given its ta g
@since v0.7.1 @since v0.7.1
@return the Action the with the given tag @return the Action the with the given tag
*/ */
CCAction* getActionByTag(int tag); CCAction* getActionByTag(int tag);
/** Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays) . /** Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays) .
* Composable actions are counted as 1 action. Example: * Composable actions are counted as 1 action. Example:
* If you are running 1 Sequence of 7 actions, it will ret * If you are running 1 Sequence of 7 actions, it will return 1.
urn 1. * If you are running 7 Sequences of 2 actions, it will return 7
* If you are running 7 Sequences of 2 actions, it will re .
turn 7. */
*/
unsigned int numberOfRunningActions(void); unsigned int numberOfRunningActions(void);
// timers // timers
/** check whether a selector is scheduled. */ /** check whether a selector is scheduled. */
bool isScheduled(SEL_SCHEDULE selector); bool isScheduled(SEL_SCHEDULE selector);
/** schedules the "update" method. It will use the order num ber 0. This method will be called every frame. /** schedules the "update" method. It will use the order num ber 0. This method will be called every frame.
Scheduled methods with a lower order value will be called be Scheduled methods with a lower order value will be called before t
fore the ones that have a higher order value. he ones that have a higher order value.
Only one "update" method could be scheduled per node. Only one "update" method could be scheduled per node.
@since v0.99.3 @since v0.99.3
*/ */
void scheduleUpdate(void); void scheduleUpdate(void);
/** schedules the "update" selector with a custom priority. This selector will be called every frame. /** schedules the "update" selector with a custom priority. This selector will be called every frame.
Scheduled selectors with a lower priority will be called bef Scheduled selectors with a lower priority will be called before th
ore the ones that have a higher value. e ones that have a higher value.
Only one "update" selector could be scheduled per node (You Only one "update" selector could be scheduled per node (You can't
can't have 2 'update' selectors). have 2 'update' selectors).
@since v0.99.3 @since v0.99.3
*/ */
void scheduleUpdateWithPriority(int priority); void scheduleUpdateWithPriority(int priority);
/* unschedules the "update" method. /* unschedules the "update" method.
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleUpdate(void); void unscheduleUpdate(void);
/** schedules a selector. /** schedules a selector.
The scheduled selector will be ticked every frame The scheduled selector will be ticked every frame
*/ */
void schedule(SEL_SCHEDULE selector); void schedule(SEL_SCHEDULE selector);
/** schedules a custom selector with an interval time in sec onds. /** schedules a custom selector with an interval time in sec onds.
If time is 0 it will be ticked every frame. If time is 0 it will be ticked every frame.
If time is 0, it is recommended to use 'scheduleUpdate' inst If time is 0, it is recommended to use 'scheduleUpdate' instead.
ead. If the selector is already scheduled, then the interval parameter
If the selector is already scheduled, then the interval para will be updated without scheduling it again.
meter */
will be updated without scheduling it again.
*/
void schedule(SEL_SCHEDULE selector, ccTime interval); void schedule(SEL_SCHEDULE selector, ccTime interval);
/** unschedules a custom selector.*/ /** unschedules a custom selector.*/
void unschedule(SEL_SCHEDULE selector); void unschedule(SEL_SCHEDULE selector);
/** unschedule all scheduled selectors: custom selectors, an d the 'update' selector. /** unschedule all scheduled selectors: custom selectors, an d the 'update' selector.
Actions are not affected by this method. Actions are not affected by this method.
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleAllSelectors(void); void unscheduleAllSelectors(void);
/** resumes all scheduled selectors and actions. /** resumes all scheduled selectors and actions.
Called internally by onEnter Called internally by onEnter
*/ */
void resumeSchedulerAndActions(void); void resumeSchedulerAndActions(void);
/** pauses all scheduled selectors and actions. /** pauses all scheduled selectors and actions.
Called internally by onExit Called internally by onExit
*/ */
void pauseSchedulerAndActions(void); void pauseSchedulerAndActions(void);
// SelecterProtocol methods
virtual void selectorProtocolRetain(void);
virtual void selectorProtocolRelease(void);
virtual CCRGBAProtocol* convertToRGBAProtocol(void) { return
NULL; }
virtual CCLabelProtocol* convertToLabelProtocol(void) { retu
rn NULL; }
// transformation methods // transformation methods
/** Returns the matrix that transform the node's (local) spa ce coordinates into the parent's space coordinates. /** Returns the matrix that transform the node's (local) spa ce coordinates into the parent's space coordinates.
The matrix is in Pixels. The matrix is in Pixels.
@since v0.7.1 @since v0.7.1
*/ */
CCAffineTransform nodeToParentTransform(void); CCAffineTransform nodeToParentTransform(void);
/** Returns the matrix that transform parent's space coordin ates to the node's (local) space coordinates. /** Returns the matrix that transform parent's space coordin ates to the node's (local) space coordinates.
The matrix is in Pixels. The matrix is in Pixels.
@since v0.7.1 @since v0.7.1
*/ */
CCAffineTransform parentToNodeTransform(void); CCAffineTransform parentToNodeTransform(void);
/** Retrusn the world affine transform matrix. The matrix is in Pixels. /** Retrusn the world affine transform matrix. The matrix is in Pixels.
@since v0.7.1 @since v0.7.1
*/ */
CCAffineTransform nodeToWorldTransform(void); CCAffineTransform nodeToWorldTransform(void);
/** Returns the inverse world affine transform matrix. The m atrix is in Pixels. /** Returns the inverse world affine transform matrix. The m atrix is in Pixels.
@since v0.7.1 @since v0.7.1
*/ */
CCAffineTransform worldToNodeTransform(void); CCAffineTransform worldToNodeTransform(void);
/** Converts a Point to node (local) space coordinates. The result is in Points. /** Converts a Point to node (local) space coordinates. The result is in Points.
@since v0.7.1 @since v0.7.1
*/ */
CCPoint convertToNodeSpace(const CCPoint& worldPoint); CCPoint convertToNodeSpace(const CCPoint& worldPoint);
/** Converts a Point to world space coordinates. The result is in Points. /** Converts a Point to world space coordinates. The result is in Points.
@since v0.7.1 @since v0.7.1
*/ */
CCPoint convertToWorldSpace(const CCPoint& nodePoint); CCPoint convertToWorldSpace(const CCPoint& nodePoint);
/** Converts a Point to node (local) space coordinates. The result is in Points. /** Converts a Point to node (local) space coordinates. The result is in Points.
treating the returned/received node point as anchor relative treating the returned/received node point as anchor relative.
. @since v0.7.1
@since v0.7.1 */
*/
CCPoint convertToNodeSpaceAR(const CCPoint& worldPoint); CCPoint convertToNodeSpaceAR(const CCPoint& worldPoint);
/** Converts a local Point to world space coordinates.The re sult is in Points. /** Converts a local Point to world space coordinates.The re sult is in Points.
treating the returned/received node point as anchor relative treating the returned/received node point as anchor relative.
. @since v0.7.1
@since v0.7.1 */
*/
CCPoint convertToWorldSpaceAR(const CCPoint& nodePoint); CCPoint convertToWorldSpaceAR(const CCPoint& nodePoint);
/** convenience methods which take a CCTouch instead of CCPo int /** convenience methods which take a CCTouch instead of CCPo int
@since v0.7.1 @since v0.7.1
*/ */
CCPoint convertTouchToNodeSpace(CCTouch * touch); CCPoint convertTouchToNodeSpace(CCTouch * touch);
/** converts a CCTouch (world coordinates) into a local coor diante. This method is AR (Anchor Relative). /** converts a CCTouch (world coordinates) into a local coor diante. This method is AR (Anchor Relative).
@since v0.7.1 @since v0.7.1
*/ */
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch); CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
}; };
}//namespace cocos2d }//namespace cocos2d
#endif // __PLATFOMR_CCNODE_H__ #endif // __PLATFOMR_CCNODE_H__
 End of changes. 62 change blocks. 
362 lines changed or deleted 375 lines changed or added


 CCObject.h   CCObject.h 
skipping to change at line 29 skipping to change at line 29
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __COCOA_NSOBJECT_H__ #ifndef __COCOA_NSOBJECT_H__
#define __COCOA_NSOBJECT_H__ #define __COCOA_NSOBJECT_H__
#include "CCCommon.h" #include "CCCommon.h"
#include "ccTypes.h"
namespace cocos2d { namespace cocos2d {
class CCZone; class CCZone;
class CCObject; class CCObject;
class CCString; class CCString;
class CCNode;
class CCEvent;
class CC_DLL CCCopying class CC_DLL CCCopying
{ {
public: public:
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
}; };
class CC_DLL CCObject : public CCCopying class CC_DLL CCObject : public CCCopying
{ {
protected: public:
// object id // object id, CCScriptSupport need public m_uID
unsigned int m_uID; unsigned int m_uID;
// count of refrence // Lua reference id
unsigned int m_uReference; int m_nLuaID;
// is the object autoreleased protected:
bool m_bManaged; // count of refrence
unsigned int m_uReference;
// is the object autoreleased
bool m_bManaged;
public: public:
CCObject(void); CCObject(void);
virtual ~CCObject(void); virtual ~CCObject(void);
virtual void release(void); void release(void);
virtual void retain(void); void retain(void);
CCObject* autorelease(void); CCObject* autorelease(void);
CCObject* copy(void); CCObject* copy(void);
bool isSingleRefrence(void); bool isSingleRefrence(void);
unsigned int retainCount(void); unsigned int retainCount(void);
bool isEqual(const CCObject* pObject); virtual bool isEqual(const CCObject* pObject);
friend class CCAutoreleasePool; virtual void update(ccTime dt) {CC_UNUSED_PARAM(dt);};
friend class CCAutoreleasePool;
}; };
typedef void (CCObject::*SEL_SCHEDULE)(ccTime);
typedef void (CCObject::*SEL_CallFunc)();
typedef void (CCObject::*SEL_CallFuncN)(CCNode*);
typedef void (CCObject::*SEL_CallFuncND)(CCNode*, void*);
typedef void (CCObject::*SEL_CallFuncO)(CCObject*);
typedef void (CCObject::*SEL_MenuHandler)(CCObject*);
typedef void (CCObject::*SEL_EventHandler)(CCEvent*);
#define schedule_selector(_SELECTOR) (SEL_SCHEDULE)(&_SELECTOR)
#define callfunc_selector(_SELECTOR) (SEL_CallFunc)(&_SELECTOR)
#define callfuncN_selector(_SELECTOR) (SEL_CallFuncN)(&_SELECTOR)
#define callfuncND_selector(_SELECTOR) (SEL_CallFuncND)(&_SELECTOR)
#define callfuncO_selector(_SELECTOR) (SEL_CallFuncO)(&_SELECTOR)
#define menu_selector(_SELECTOR) (SEL_MenuHandler)(&_SELECTOR)
#define event_selector(_SELECTOR) (SEL_EventHandler)(&_SELECTOR)
}//namespace cocos2d }//namespace cocos2d
#endif // __COCOA_NSOBJECT_H__ #endif // __COCOA_NSOBJECT_H__
 End of changes. 9 change blocks. 
17 lines changed or deleted 42 lines changed or added


 CCParticleSystemPoint.h   CCParticleSystemPoint.h 
skipping to change at line 31 skipping to change at line 31
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CC_PARTICLE_SYSTEM_POINT_MOBILE_H__ #ifndef __CC_PARTICLE_SYSTEM_POINT_MOBILE_H__
#define __CC_PARTICLE_SYSTEM_POINT_MOBILE_H__ #define __CC_PARTICLE_SYSTEM_POINT_MOBILE_H__
/*#include "Availability.h"*/ /*#include "Availability.h"*/
#include "CCParticleSystem.h" #include "CCParticleSystem.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_ PLATFORM_QNX)
#include "CCParticleSystemQuad.h" #include "CCParticleSystemQuad.h"
#endif #endif
namespace cocos2d { namespace cocos2d {
#define CC_MAX_PARTICLE_SIZE 64 #define CC_MAX_PARTICLE_SIZE 64
/** @brief CCParticleSystemPoint is a subclass of CCParticleSystem /** @brief CCParticleSystemPoint is a subclass of CCParticleSystem
Attributes of a Particle System: Attributes of a Particle System:
* All the attributes of Particle System * All the attributes of Particle System
Features: Features:
* consumes small memory: uses 1 vertex (x,y) per particle, no need to assig n tex coordinates * consumes small memory: uses 1 vertex (x,y) per particle, no need to assig n tex coordinates
* size can't be bigger than 64 * size can't be bigger than 64
* the system can't be scaled since the particles are rendered using GL_POIN T_SPRITE * the system can't be scaled since the particles are rendered using GL_POIN T_SPRITE
Limitations: Limitations:
* On 3rd gen iPhone devices and iPads, this node performs MUCH slower than CCParticleSystemQuad. * On 3rd gen iPhone devices and iPads, this node performs MUCH slower than CCParticleSystemQuad.
*/ */
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_ PLATFORM_QNX)
class CC_DLL CCParticleSystemPoint : public CCParticleSystemQuad{ class CC_DLL CCParticleSystemPoint : public CCParticleSystemQuad{
//nothing to do //nothing to do
}; };
#else #else
class CC_DLL CCParticleSystemPoint : public CCParticleSystem class CC_DLL CCParticleSystemPoint : public CCParticleSystem
{ {
public: public:
CCParticleSystemPoint() CCParticleSystemPoint()
:m_pVertices(NULL) :m_pVertices(NULL)
{} {}
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 CCPlatformConfig.h   CCPlatformConfig.h 
skipping to change at line 45 skipping to change at line 45
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// pre configure // pre configure
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// define supported target platform macro which CC uses. // define supported target platform macro which CC uses.
#define CC_PLATFORM_UNKNOWN 0 #define CC_PLATFORM_UNKNOWN 0
#define CC_PLATFORM_IOS 1 #define CC_PLATFORM_IOS 1
#define CC_PLATFORM_ANDROID 2 #define CC_PLATFORM_ANDROID 2
#define CC_PLATFORM_WOPHONE 3 #define CC_PLATFORM_WOPHONE 3
#define CC_PLATFORM_WIN32 4 #define CC_PLATFORM_WIN32 4
#define CC_PLATFORM_AIRPLAY 5 #define CC_PLATFORM_MARMALADE 5
#define CC_PLATFORM_LINUX 7 #define CC_PLATFORM_LINUX 6
#define CC_PLATFORM_BADA 7
#define CC_PLATFORM_QNX 8
#define CC_PLATFORM_BADA 6
// Determine tartet platform by compile environment macro. // Determine tartet platform by compile environment macro.
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN #define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
// iphone // iphone
#if ! CC_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IP HONE_SIMULATOR)) #if ! CC_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IP HONE_SIMULATOR))
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_IOS #define CC_TARGET_PLATFORM CC_PLATFORM_IOS
#define CC_SUPPORT_MULTITHREAD 0 #define CC_SUPPORT_MULTITHREAD 0
#define CC_SUPPORT_UNICODE 0 #define CC_SUPPORT_UNICODE 0
#define CC_SUPPORT_PVRTC #define CC_SUPPORT_PVRTC
skipping to change at line 92 skipping to change at line 93
#define CC_SUPPORT_UNICODE 0 #define CC_SUPPORT_UNICODE 0
#endif #endif
#endif #endif
// linux // linux
#if ! CC_TARGET_PLATFORM && defined(LINUX) #if ! CC_TARGET_PLATFORM && defined(LINUX)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_LINUX #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX
#endif #endif
// airplay // marmalade
#if ! CC_TARGET_PLATFORM && defined(AIRPLAY) #if ! CC_TARGET_PLATFORM && defined(MARMALADE)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_AIRPLAY #define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE
#endif #endif
// bada // bada
#if ! CC_TARGET_PLATFORM && defined(SHP) #if ! CC_TARGET_PLATFORM && defined(SHP)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_BADA #define CC_TARGET_PLATFORM CC_PLATFORM_BADA
#endif #endif
// qnx
#if ! CC_TARGET_PLATFORM && defined(__QNX__)
#undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_QNX
#endif
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// user configure // user configure
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Check user assigned target platform. // Check user assigned target platform.
#if defined(CC_UNDER_IOS) #if defined(CC_UNDER_IOS)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_IOS #define CC_TARGET_PLATFORM CC_PLATFORM_IOS
#endif #endif
skipping to change at line 127 skipping to change at line 135
#if defined(CC_UNDER_WOPHONE) #if defined(CC_UNDER_WOPHONE)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_WOPHONE #define CC_TARGET_PLATFORM CC_PLATFORM_WOPHONE
#endif #endif
#if defined(CC_UNDER_WIN32) #if defined(CC_UNDER_WIN32)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32
#endif #endif
#if defined(CC_UNDER_AIRPLAY) #if defined(CC_UNDER_MARMALADE)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_AIRPLAY #define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE
#endif #endif
#if defined(CC_UNDER_LINUX) #if defined(CC_UNDER_LINUX)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_LINUX #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX
#endif #endif
#if defined(CC_UNDER_BADA) #if defined(CC_UNDER_BADA)
#undef CC_TARGET_PLATFORM #undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_BADA #define CC_TARGET_PLATFORM CC_PLATFORM_BADA
#endif #endif
#if defined(CC_UNDER_QNX)
#undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_QNX
#endif
// Check user assigned supportive of multi-thread // Check user assigned supportive of multi-thread
#if defined(CC_ENABLE_MULTITHREAD) #if defined(CC_ENABLE_MULTITHREAD)
#undef CC_SUPPORT_MULTITHREAD #undef CC_SUPPORT_MULTITHREAD
#define CC_SUPPORT_MULTITHREAD 1 #define CC_SUPPORT_MULTITHREAD 1
#elif defined(CC_DISABLE_MULTITHREAD) #elif defined(CC_DISABLE_MULTITHREAD)
#undef CC_SUPPORT_MULTITHREAD #undef CC_SUPPORT_MULTITHREAD
#define CC_SUPPORT_MULTITHREAD 0 #define CC_SUPPORT_MULTITHREAD 0
#endif #endif
// Check user assigned supportive of unicode // Check user assigned supportive of unicode
 End of changes. 8 change blocks. 
8 lines changed or deleted 21 lines changed or added


 CCPlatformMacros.h   CCPlatformMacros.h 
skipping to change at line 103 skipping to change at line 103
We can use getter to read the variable. We can use getter to read the variable.
@param varType : the type of variable. @param varType : the type of variable.
@param varName : variable name. @param varName : variable name.
@param funName : "get + funName" is the name of the getter. @param funName : "get + funName" is the name of the getter.
@warning : The getter is a public inline function. @warning : The getter is a public inline function.
The variables and methods declared after CC_SYNTHESIZE_READONLY are all pu blic. The variables and methods declared after CC_SYNTHESIZE_READONLY are all pu blic.
If you need protected or private, please declare. If you need protected or private, please declare.
*/ */
#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\ #define CC_SYNTHESIZE_READONLY(varType, varName, funName)\
protected: varType varName;\ protected: varType varName;\
public: inline varType get##funName(void) const { return varName; } public: virtual varType get##funName(void) const { return varName; }
#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\ #define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\ protected: varType varName;\
public: inline const varType& get##funName(void) const { return varName; } public: virtual const varType& get##funName(void) const { return varName; }
/** CC_SYNTHESIZE is used to declare a protected variable. /** CC_SYNTHESIZE is used to declare a protected variable.
We can use getter to read the variable, and use the setter to change the v ariable. We can use getter to read the variable, and use the setter to change the v ariable.
@param varType : the type of variable. @param varType : the type of variable.
@param varName : variable name. @param varName : variable name.
@param funName : "get + funName" is the name of the getter. @param funName : "get + funName" is the name of the getter.
"set + funName" is the name of the setter. "set + funName" is the name of the setter.
@warning : The getter and setter are public inline functions. @warning : The getter and setter are public inline functions.
The variables and methods declared after CC_SYNTHESIZE are all public. The variables and methods declared after CC_SYNTHESIZE are all public.
If you need protected or private, please declare. If you need protected or private, please declare.
*/ */
#define CC_SYNTHESIZE(varType, varName, funName)\ #define CC_SYNTHESIZE(varType, varName, funName)\
protected: varType varName;\ protected: varType varName;\
public: inline varType get##funName(void) const { return varName; }\ public: virtual varType get##funName(void) const { return varName; }\
public: inline void set##funName(varType var){ varName = var; } public: virtual void set##funName(varType var){ varName = var; }
#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\ #define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\ protected: varType varName;\
public: inline const varType& get##funName(void) const { return varName; }\ public: virtual const varType& get##funName(void) const { return varName; }
public: inline void set##funName(const varType& var){ varName = var; } \
public: virtual void set##funName(const varType& var){ varName = var; }
#define CC_SAFE_DELETE(p) if(p) { delete p; p = 0; } #define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \
#define CC_SAFE_DELETE_ARRAY(p) if(p) { delete[] p; p = 0; } protected: varType varName; \
#define CC_SAFE_FREE(p) if(p) { free(p); p = 0; } public: virtual varType get##funName(void) const { return varName; } \
#define CC_SAFE_RELEASE(p) if(p) { p->release(); } public: virtual void set##funName(varType var) \
#define CC_SAFE_RELEASE_NULL(p) if(p) { p->release(); p = 0; } { \
#define CC_SAFE_RETAIN(p) if(p) { p->retain(); } CC_SAFE_RETAIN(var); \
CC_SAFE_RELEASE(varName); \
varName = var; \
}
#define CC_SAFE_DELETE(p) if(p) { delete (p); (p) = 0;
}
#define CC_SAFE_DELETE_ARRAY(p) if(p) { delete[] (p); (p) = 0; }
#define CC_SAFE_FREE(p) if(p) { free(p); (p) = 0; }
#define CC_SAFE_RELEASE(p) if(p) { (p)->release(); }
#define CC_SAFE_RELEASE_NULL(p) if(p) { (p)->release(); (p) = 0; }
#define CC_SAFE_RETAIN(p) if(p) { (p)->retain(); }
#define CC_BREAK_IF(cond) if(cond) break; #define CC_BREAK_IF(cond) if(cond) break;
// cocos2d debug // cocos2d debug
#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0
#define CCLOG(...) #define CCLOG(...)
#define CCLOGINFO(...) #define CCLOGINFO(...)
#define CCLOGERROR(...) #define CCLOGERROR(...)
#elif COCOS2D_DEBUG == 1 #elif COCOS2D_DEBUG == 1
#define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
#define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
#define CCLOGINFO(format,...) do {} while (0) #define CCLOGINFO(format,...) do {} while (0)
#elif COCOS2D_DEBUG > 1 #elif COCOS2D_DEBUG > 1
#define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
#define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
#define CCLOGINFO(format,...) cocos2d::CCLog(format, ##__VA_ARGS__) #define CCLOGINFO(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
#endif // COCOS2D_DEBUG #endif // COCOS2D_DEBUG
// Lua engine debug
#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG ==
0
#define LUALOG(...)
#else
#define LUALOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
#endif // Lua engine debug
// shared library declartor // shared library declartor
#define CC_DLL #define CC_DLL
#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA)
// assertion // assertion
#include <assert.h> #include <assert.h>
#define CC_ASSERT(cond) assert(cond) #define CC_ASSERT(cond) assert(cond)
#else #else
// bada platform // bada platform
 End of changes. 6 change blocks. 
12 lines changed or deleted 32 lines changed or added


 CCProtocols.h   CCProtocols.h 
skipping to change at line 66 skipping to change at line 66
virtual void setOpacity(GLubyte opacity) = 0; virtual void setOpacity(GLubyte opacity) = 0;
// optional // optional
/** sets the premultipliedAlphaOpacity property. /** sets the premultipliedAlphaOpacity property.
If set to NO then opacity will be applied as: glColor(R,G,B,opacity ); If set to NO then opacity will be applied as: glColor(R,G,B,opacity );
If set to YES then oapcity will be applied as: glColor(opacity, opa city, opacity, opacity ); If set to YES then oapcity will be applied as: glColor(opacity, opa city, opacity, opacity );
Textures with premultiplied alpha will have this property by defaul t on YES. Otherwise the default value is NO Textures with premultiplied alpha will have this property by defaul t on YES. Otherwise the default value is NO
@since v0.8 @since v0.8
*/ */
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bVa lue);} virtual void setIsOpacityModifyRGB(bool bValue) = 0;
/** returns whether or not the opacity will be applied using glColor (R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity); /** returns whether or not the opacity will be applied using glColor (R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
@since v0.8 @since v0.8
*/ */
virtual bool getIsOpacityModifyRGB(void) { return false;} virtual bool getIsOpacityModifyRGB(void) = 0;
}; };
/** /**
@brief You can specify the blending fuction. @brief You can specify the blending fuction.
@since v0.99.0 @since v0.99.0
*/ */
class CC_DLL CCBlendProtocol class CC_DLL CCBlendProtocol
{ {
public: public:
// set the source blending function for the texture // set the source blending function for the texture
skipping to change at line 104 skipping to change at line 104
But you can change the blending funtion at any time. But you can change the blending funtion at any time.
@since v0.8.0 @since v0.8.0
*/ */
class CC_DLL CCTextureProtocol : public CCBlendProtocol class CC_DLL CCTextureProtocol : public CCBlendProtocol
{ {
public: public:
// returns the used texture // returns the used texture
virtual CCTexture2D* getTexture(void) = 0; virtual CCTexture2D* getTexture(void) = 0;
// sets a new texture. it will be retained // sets a new texture. it will be retained
virtual void setTexture(CCTexture2D *texture) {CC_UNUSED_PARAM(texture) ;} virtual void setTexture(CCTexture2D *texture) = 0;
}; };
//! @brief Common interface for Labels //! @brief Common interface for Labels
class CC_DLL CCLabelProtocol class CC_DLL CCLabelProtocol
{ {
public: public:
// sets a new label using an string // sets a new label using an string
virtual void setString(const char *label) = 0; virtual void setString(const char *label) = 0;
/** returns the string that is rendered */ /** returns the string that is rendered */
virtual const char* getString(void) = 0; virtual const char* getString(void) = 0;
}; };
/** OpenGL projection protocol */ /** OpenGL projection protocol */
class CC_DLL CCProjectionProtocol : public CCObject class CC_DLL CCProjectionProtocol
{ {
public: public:
/** Called by CCDirector when the porjection is updated, and "custom " projection is used /** Called by CCDirector when the porjection is updated, and "custom " projection is used
@since v0.99.5 @since v0.99.5
*/ */
virtual void updateProjection(void) = 0; virtual void updateProjection(void) = 0;
}; };
}//namespace cocos2d }//namespace cocos2d
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 CCSAXParser.h   CCSAXParser.h 
skipping to change at line 32 skipping to change at line 32
************************************************************************** **/ ************************************************************************** **/
#ifndef __CCSAXPARSER_H__ #ifndef __CCSAXPARSER_H__
#define __CCSAXPARSER_H__ #define __CCSAXPARSER_H__
#include "CCPlatformConfig.h" #include "CCPlatformConfig.h"
#include "CCCommon.h" #include "CCCommon.h"
NS_CC_BEGIN; NS_CC_BEGIN;
// libxml2 on most platforms are using "unsigned char" as type of string, w
hile on airplay sdk using "char"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
typedef unsigned char CC_XML_CHAR; typedef unsigned char CC_XML_CHAR;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY)
typedef char CC_XML_CHAR;
#else
#error
#endif
class CC_DLL CCSAXDelegator class CC_DLL CCSAXDelegator
{ {
public: public:
virtual void startElement(void *ctx, const char *name, const char ** atts) = 0; virtual void startElement(void *ctx, const char *name, const char ** atts) = 0;
virtual void endElement(void *ctx, const char *name) = 0; virtual void endElement(void *ctx, const char *name) = 0;
virtual void textHandler(void *ctx, const char *s, int len) = 0; virtual void textHandler(void *ctx, const char *s, int len) = 0;
}; };
class CC_DLL CCSAXParser class CC_DLL CCSAXParser
 End of changes. 2 change blocks. 
13 lines changed or deleted 0 lines changed or added


 CCScene.h   CCScene.h 
skipping to change at line 34 skipping to change at line 34
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CCSCENE_H__ #ifndef __CCSCENE_H__
#define __CCSCENE_H__ #define __CCSCENE_H__
#include "CCNode.h" #include "CCNode.h"
namespace cocos2d { namespace cocos2d {
typedef enum
{
ccNormalScene = 1 << 0,
ccTransitionScene = 1 << 1,
} ccSceneFlag;
/** @brief CCScene is a subclass of CCNode that is used only as an abstract concept. /** @brief CCScene is a subclass of CCNode that is used only as an abstract concept.
CCScene an CCNode are almost identical with the difference that CCScene has it's CCScene an CCNode are almost identical with the difference that CCScene has it's
anchor point (by default) at the center of the screen. anchor point (by default) at the center of the screen.
For the moment CCScene has no other logic than that, but in future releases it might have For the moment CCScene has no other logic than that, but in future releases it might have
additional logic. additional logic.
It is a good practice to use and CCScene as the parent of all your nodes. It is a good practice to use and CCScene as the parent of all your nodes.
*/ */
class CC_DLL CCScene : public CCNode class CC_DLL CCScene : public CCNode
{ {
public: public:
CCScene(); CCScene();
virtual ~CCScene(); virtual ~CCScene();
bool init(); bool init();
static CCScene *node(void); static CCScene *node(void);
inline ccSceneFlag getSceneType(void) { return m_eSceneType; }
protected:
ccSceneFlag m_eSceneType;
}; };
}//namespace cocos2d }//namespace cocos2d
// for the subclass of CCScene, each has to implement the static "node" met hod // for the subclass of CCScene, each has to implement the static "node" met hod
#define SCENE_NODE_FUNC(scene) \ #define SCENE_NODE_FUNC(scene) \
static scene* node() \ static scene* node() \
{ \ { \
scene *pRet = new scene(); \ scene *pRet = new scene(); \
if (pRet && pRet->init()) \ if (pRet && pRet->init()) \
{ \ { \
 End of changes. 2 change blocks. 
10 lines changed or deleted 0 lines changed or added


 CCScheduler.h   CCScheduler.h 
skipping to change at line 30 skipping to change at line 30
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CCSCHEDULER_H__ #ifndef __CCSCHEDULER_H__
#define __CCSCHEDULER_H__ #define __CCSCHEDULER_H__
#include <string>
#include "CCObject.h" #include "CCObject.h"
#include "selector_protocol.h"
#include "support/data_support/uthash.h" #include "support/data_support/uthash.h"
namespace cocos2d { namespace cocos2d {
// //
// CCTimer // CCTimer
// //
/** @brief Light weight timer */ /** @brief Light weight timer */
class CC_DLL CCTimer : public CCObject class CC_DLL CCTimer : public CCObject
{ {
public: public:
CCTimer(void); CCTimer(void);
/** get interval in seconds */ /** get interval in seconds */
inline ccTime getInterval(void) { return m_fInterval; } inline ccTime getInterval(void) { return m_fInterval; }
/** set interval in seconds */ /** set interval in seconds */
inline void setInterval(ccTime fInterval){ m_fInterval = fInterval; } inline void setInterval(ccTime fInterval){ m_fInterval = fInterval; }
/** Initializes a timer with a target and a selector. */ /** Initializes a timer with a target and a selector. */
bool initWithTarget(SelectorProtocol *pTarget, SEL_SCHEDULE pfnSelec tor); bool initWithTarget(CCObject *pTarget, SEL_SCHEDULE pfnSelector);
/** Initializes a timer with a target, a selector and an interval in seconds. */ /** Initializes a timer with a target, a selector and an interval in seconds. */
bool initWithTarget(SelectorProtocol *pTarget, SEL_SCHEDULE pfnSelector , ccTime fSeconds); bool initWithTarget(CCObject *pTarget, SEL_SCHEDULE pfnSelector, ccTime fSeconds);
bool initWithScriptFuncName(const char *pszFuncName, ccTime fSeconds /** Initializes a timer with a script callback function and an interval
); in seconds. */
bool initWithScriptHandler(int nHandler, ccTime fSeconds);
/** triggers the timer */ /** triggers the timer */
void update(ccTime dt); void update(ccTime dt);
public: public:
/** Allocates a timer with a target and a selector. */ /** Allocates a timer with a target and a selector. */
static CCTimer* timerWithTarget(SelectorProtocol *pTarget, SEL_SCHED static CCTimer* timerWithTarget(CCObject *pTarget, SEL_SCHEDULE pfnS
ULE pfnSelector); elector);
/** Allocates a timer with a script function name. */
static CCTimer* timerWithScriptFuncName(const char* pszFuncName, ccT
ime fSeconds);
/** Allocates a timer with a target, a selector and an interval in s econds. */ /** Allocates a timer with a target, a selector and an interval in s econds. */
static CCTimer* timerWithTarget(SelectorProtocol *pTarget, SEL_SCHED static CCTimer* timerWithTarget(CCObject *pTarget, SEL_SCHEDULE pfnS
ULE pfnSelector, ccTime fSeconds); elector, ccTime fSeconds);
/** Allocates a timer with a script callback function and an interval i
n seconds. */
static CCTimer* timerWithScriptHandler(int nHandler, ccTime fSeconds);
public: public:
SEL_SCHEDULE m_pfnSelector; SEL_SCHEDULE m_pfnSelector;
ccTime m_fInterval; ccTime m_fInterval;
std::string m_scriptFunc;
protected: protected:
SelectorProtocol *m_pTarget; CCObject *m_pTarget;
ccTime m_fElapsed; ccTime m_fElapsed;
int m_nScriptHandler;
}; };
// //
// CCScheduler // CCScheduler
// //
struct _listEntry; struct _listEntry;
struct _hashSelectorEntry; struct _hashSelectorEntry;
struct _hashUpdateEntry; struct _hashUpdateEntry;
struct _hashScriptFuncEntry;
class CCArray;
/** @brief Scheduler is responsible of triggering the scheduled callbacks. /** @brief Scheduler is responsible of triggering the scheduled callbacks.
You should not use NSTimer. Instead use this class. You should not use NSTimer. Instead use this class.
There are 2 different types of callbacks (selectors): There are 2 different types of callbacks (selectors):
- update selector: the 'update' selector will be called every frame. You ca n customize the priority. - update selector: the 'update' selector will be called every frame. You ca n customize the priority.
- custom selector: A custom selector will be called every frame, or with a custom interval of time - custom selector: A custom selector will be called every frame, or with a custom interval of time
The 'custom selectors' should be avoided when possible. It is faster, and c onsumes less memory to use the 'update selector'. The 'custom selectors' should be avoided when possible. It is faster, and c onsumes less memory to use the 'update selector'.
skipping to change at line 128 skipping to change at line 128
*/ */
void tick(ccTime dt); void tick(ccTime dt);
/** The scheduled method will be called every 'interval' seconds. /** The scheduled method will be called every 'interval' seconds.
If paused is YES, then it won't be called until it is resumed. If paused is YES, then it won't be called until it is resumed.
If 'interval' is 0, it will be called every frame, but if so, it re commened to use 'scheduleUpdateForTarget:' instead. If 'interval' is 0, it will be called every frame, but if so, it re commened to use 'scheduleUpdateForTarget:' instead.
If the selector is already scheduled, then only the interval parame ter will be updated without re-scheduling it again. If the selector is already scheduled, then only the interval parame ter will be updated without re-scheduling it again.
@since v0.99.3 @since v0.99.3
*/ */
void scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pT void scheduleSelector(SEL_SCHEDULE pfnSelector, CCObject *pTarget, c
arget, ccTime fInterval, bool bPaused); cTime fInterval, bool bPaused);
/** Schedule the script function
*/
void scheduleScriptFunc(const char *pszFuncName, ccTime fInterval, b
ool bPaused);
/** Schedules the 'update' selector for a given target with a given priority. /** Schedules the 'update' selector for a given target with a given priority.
The 'update' selector will be called every frame. The 'update' selector will be called every frame.
The lower the priority, the earlier it is called. The lower the priority, the earlier it is called.
@since v0.99.3 @since v0.99.3
*/ */
void scheduleUpdateForTarget(SelectorProtocol *pTarget, int nPriorit y, bool bPaused); void scheduleUpdateForTarget(CCObject *pTarget, int nPriority, bool bPaused);
/** Unschedule a selector for a given target. /** Unschedule a selector for a given target.
If you want to unschedule the "update", use unscheudleUpdateForTarg et. If you want to unschedule the "update", use unscheudleUpdateForTarg et.
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol * void unscheduleSelector(SEL_SCHEDULE pfnSelector, CCObject *pTarget)
pTarget); ;
/** Unschedule the script function
*/
void unscheduleScriptFunc(const char *pszFuncName);
/** Unschedules the update selector for a given target /** Unschedules the update selector for a given target
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleUpdateForTarget(const SelectorProtocol *pTarget); void unscheduleUpdateForTarget(const CCObject *pTarget);
/** Unschedules all selectors for a given target. /** Unschedules all selectors for a given target.
This also includes the "update" selector. This also includes the "update" selector.
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleAllSelectorsForTarget(SelectorProtocol *pTarget); void unscheduleAllSelectorsForTarget(CCObject *pTarget);
/** Unschedules all selectors from all targets. /** Unschedules all selectors from all targets.
You should NEVER call this method, unless you know what you are doi ng. You should NEVER call this method, unless you know what you are doi ng.
@since v0.99.3 @since v0.99.3
*/ */
void unscheduleAllSelectors(void); void unscheduleAllSelectors(void);
/** The scheduled script callback will be called every 'interval' secon
ds.
If paused is YES, then it won't be called until it is resumed.
If 'interval' is 0, it will be called every frame.
return schedule script entry ID, used for unscheduleScriptFunc().
*/
unsigned int scheduleScriptFunc(unsigned int nHandler, ccTime fInterval
, bool bPaused);
/** Unschedule a script entry. */
void unscheduleScriptEntry(unsigned int uScheduleScriptEntryID);
/** Pauses the target. /** Pauses the target.
All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed. All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed.
If the target is not present, nothing happens. If the target is not present, nothing happens.
@since v0.99.3 @since v0.99.3
*/ */
void pauseTarget(SelectorProtocol *pTarget); void pauseTarget(CCObject *pTarget);
/** Resumes the target. /** Resumes the target.
The 'target' will be unpaused, so all schedule selectors/update wil l be 'ticked' again. The 'target' will be unpaused, so all schedule selectors/update wil l be 'ticked' again.
If the target is not present, nothing happens. If the target is not present, nothing happens.
@since v0.99.3 @since v0.99.3
*/ */
void resumeTarget(SelectorProtocol *pTarget); void resumeTarget(CCObject *pTarget);
/** Returns whether or not the target is paused /** Returns whether or not the target is paused
@since v1.0.0 @since v1.0.0
*/ */
bool isTargetPaused(SelectorProtocol *pTarget); bool isTargetPaused(CCObject *pTarget);
public: public:
/** returns a shared instance of the Scheduler */ /** returns a shared instance of the Scheduler */
static CCScheduler* sharedScheduler(void); static CCScheduler* sharedScheduler(void);
/** purges the shared scheduler. It releases the retained instance. /** purges the shared scheduler. It releases the retained instance.
@since v0.99.0 @since v0.99.0
*/ */
static void purgeSharedScheduler(void); static void purgeSharedScheduler(void);
private: private:
void removeHashElement(struct _hashSelectorEntry *pElement); void removeHashElement(struct _hashSelectorEntry *pElement);
void removeUpdateFromHash(struct _listEntry *entry); void removeUpdateFromHash(struct _listEntry *entry);
CCScheduler(); CCScheduler();
bool init(void); bool init(void);
// update specific // update specific
void priorityIn(struct _listEntry **ppList, SelectorProtocol *pTarge void priorityIn(struct _listEntry **ppList, CCObject *pTarget, int n
t, int nPriority, bool bPaused); Priority, bool bPaused);
void appendIn(struct _listEntry **ppList, SelectorProtocol *pTarget, void appendIn(struct _listEntry **ppList, CCObject *pTarget, bool bP
bool bPaused); aused);
protected: protected:
ccTime m_fTimeScale; ccTime m_fTimeScale;
// //
// "updates with priority" stuff // "updates with priority" stuff
// //
struct _listEntry *m_pUpdatesNegList; // list of priority < 0 struct _listEntry *m_pUpdatesNegList; // list of priority < 0
struct _listEntry *m_pUpdates0List; // list prio rity == 0 struct _listEntry *m_pUpdates0List; // list prio rity == 0
struct _listEntry *m_pUpdatesPosList; // list priority > 0 struct _listEntry *m_pUpdatesPosList; // list priority > 0
struct _hashUpdateEntry *m_pHashForUpdates; // hash used to fetch qu ickly the list entries for pause,delete,etc struct _hashUpdateEntry *m_pHashForUpdates; // hash used to fetch qu ickly the list entries for pause,delete,etc
// Used for "selectors with interval" // Used for "selectors with interval"
struct _hashSelectorEntry *m_pHashForSelectors; struct _hashSelectorEntry *m_pHashForSelectors;
struct _hashSelectorEntry *m_pCurrentTarget; struct _hashSelectorEntry *m_pCurrentTarget;
bool m_bCurrentTargetSalvaged; bool m_bCurrentTargetSalvaged;
// If true unschedule will not remove anything from a hash. Elements will only be marked for deletion. // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion.
bool m_bUpdateHashLocked; bool m_bUpdateHashLocked;
CCArray* m_pScriptHandlerEntries;
// Used for "script function call back with interval"
struct _hashScriptFuncEntry *m_pHashForScriptFunctions;
}; };
}//namespace cocos2d }//namespace cocos2d
#endif // __CCSCHEDULER_H__ #endif // __CCSCHEDULER_H__
 End of changes. 22 change blocks. 
41 lines changed or deleted 44 lines changed or added


 CCScriptSupport.h   CCScriptSupport.h 
skipping to change at line 28 skipping to change at line 28
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __SCRIPT_SUPPORT_H__ #ifndef __SCRIPT_SUPPORT_H__
#define __SCRIPT_SUPPORT_H__ #define __SCRIPT_SUPPORT_H__
#include <string>
#include <vector>
#include <map>
#include "CCCommon.h" #include "CCCommon.h"
#include "CCTouch.h" #include "CCTouch.h"
#include "CCSet.h" #include "CCSet.h"
#include "CCNode.h"
/* typedef struct lua_State lua_State;
* Only one script is support at a time.
* Should we use more than one script at a time? NS_CC_BEGIN
*/
NS_CC_BEGIN; class CCTimer;
class CC_DLL CCScriptEngineProtocol // Lua support for CCScheduler
class CCSchedulerScriptHandlerEntry : public CCObject
{ {
public: public:
CCScriptEngineProtocol(); // nHandler return by tolua_ref_function(), called from LuaCocos2d.cpp
static CCSchedulerScriptHandlerEntry* entryWithHandler(int nHandler, cc
Time fInterval, bool bPaused);
~CCSchedulerScriptHandlerEntry(void);
inline cocos2d::CCTimer* getTimer(void) {
return m_pTimer;
}
inline bool isPaused(void) {
return m_bPaused;
}
inline int getEntryID(void) {
return m_nEntryID;
}
inline void markedForDeletion(void) {
m_bMarkedForDeletion = true;
}
inline bool isMarkedForDeletion(void) {
return m_bMarkedForDeletion;
}
private:
CCSchedulerScriptHandlerEntry(void);
bool initWithHandler(int nHandler, ccTime fInterval, bool bPaused);
// functions for excute touch event cocos2d::CCTimer* m_pTimer;
virtual bool executeTouchEvent(const char *pszFuncName, CCTouch *pTo bool m_bPaused;
uch) = 0; bool m_bMarkedForDeletion;
virtual bool executeTouchesEvent(const char *pszFuncName, CCSet *pTo int m_nHandler;
uches) = 0; int m_nEntryID;
};
// functions for CCCallFuncX
virtual bool executeCallFunc(const char *pszFuncName) = 0; // Lua support for touch events
virtual bool executeCallFuncN(const char *pszFuncName, CCNode *pNode class CCTouchScriptHandlerEntry : public CCObject
) = 0; {
virtual bool executeCallFuncND(const char *pszFuncName, CCNode *pNod public:
e, void *pData) = 0; static CCTouchScriptHandlerEntry* entryWithHandler(int nHandler, bool b
virtual bool executeCallFunc0(const char *pszFuncName, CCObject *pOb IsMultiTouches, int nPriority, bool bSwallowsTouches);
ject) = 0; ~CCTouchScriptHandlerEntry(void);
// excute a script function without params inline int getHandler(void) {
virtual int executeFuction(const char *pszFuncName) = 0; return m_nHandler;
// excute a script file }
virtual bool executeScriptFile(const char* pszFileName) = 0;
// excute script from string inline bool getIsMultiTouches(void) {
virtual bool executeString(const char* pszCodes) = 0; return m_bIsMultiTouches;
}
// execute a schedule function
virtual bool executeSchedule(const char* pszFuncName, ccTime t) = 0; inline int getPriority(void) {
// add a search path return m_nPriority;
virtual bool addSearchPath(const char* pszPath) = 0; }
inline bool getSwallowsTouches(void) {
return m_bSwallowsTouches;
}
private:
CCTouchScriptHandlerEntry(void);
bool initWithHandler(int nHandler, bool bIsMultiTouches, int nPriority,
bool bSwallowsTouches);
int m_nHandler;
bool m_bIsMultiTouches;
int m_nPriority;
bool m_bSwallowsTouches;
};
class CC_DLL CCScriptEngineProtocol : public CCObject
{
public:
/**
@brief Method used to get a pointer to the lua_State that the script m
odule is attached to.
@return A pointer to the lua_State that the script module is attached
to.
*/
virtual lua_State* getLuaState(void) = 0;
/**
@brief Remove CCObject from lua state
@param object to remove
*/
virtual void removeCCObjectByID(int nLuaID) = 0;
/**
@brief Remove Lua function reference
*/
virtual void removeLuaHandler(int nHandler) = 0;
/**
@brief Add a path to find lua files in
@param path to be added to the Lua path
*/
virtual void addSearchPath(const char* path) = 0;
/**
@brief Execute script code contained in the given string.
@param codes holding the valid script code that should be executed.
@return 0 if the string is excuted correctly.
@return other if the string is excuted wrongly.
*/
virtual int executeString(const char* codes) = 0;
/**
@brief Execute a script file.
@param filename String object holding the filename of the script file
that is to be executed
*/
virtual int executeScriptFile(const char* filename) = 0;
/**
@brief Execute a scripted global function.
@brief The function should not take any parameters and should return a
n integer.
@param functionName String object holding the name of the function, in
the global script environment, that is to be executed.
@return The integer value returned from the script function.
*/
virtual int executeGlobalFunction(const char* functionName) = 0;
/**
@brief Execute a function by ref id
@param The function ref id
@param Number of parameters
@return The integer value returned from the script function.
*/
virtual int executeFunctionByRefID(int nHandler, int numArgs = 0) = 0;
virtual int executeFunctionWithIntegerData(int nHandler, int data) = 0;
virtual int executeFunctionWithFloatData(int nHandler, float data) = 0;
virtual int executeFunctionWithBooleanData(int nHandler, bool data) = 0
;
// functions for excute touch event
virtual int executeTouchEvent(int nHandler, int eventType, CCTouch *pTo
uch) = 0;
virtual int executeTouchesEvent(int nHandler, int eventType, CCSet *pTo
uches) = 0;
// execute a schedule function
virtual int executeSchedule(int nHandler, ccTime dt) = 0;
}; };
/** /**
CCScriptEngineManager is a singleton which holds an object instance of CCS criptEngineProtocl CCScriptEngineManager is a singleton which holds an object instance of CCS criptEngineProtocl
It helps cocos2d-x and the user code to find back LuaEngine object It helps cocos2d-x and the user code to find back LuaEngine object
@since v0.99.5-x-0.8.5 @since v0.99.5-x-0.8.5
*/ */
class CC_DLL CCScriptEngineManager class CC_DLL CCScriptEngineManager
{ {
public: public:
static CCScriptEngineManager* sharedScriptEngineManager(); ~CCScriptEngineManager(void);
CCScriptEngineProtocol* getScriptEngine(void) {
return m_pScriptEngine;
}
void setScriptEngine(CCScriptEngineProtocol *pScriptEngine); void setScriptEngine(CCScriptEngineProtocol *pScriptEngine);
CCScriptEngineProtocol* getScriptEngine(); void removeScriptEngine(void);
void removeScriptEngine();
static CCScriptEngineManager* sharedManager(void);
static void purgeSharedManager(void);
private: private:
CCScriptEngineManager(); CCScriptEngineManager(void)
virtual ~CCScriptEngineManager(); : m_pScriptEngine(NULL)
{
}
CCScriptEngineProtocol *m_pScriptEngine; CCScriptEngineProtocol *m_pScriptEngine;
}; };
NS_CC_END; NS_CC_END
#endif // __SCRIPT_SUPPORT_H__ #endif // __SCRIPT_SUPPORT_H__
 End of changes. 12 change blocks. 
44 lines changed or deleted 162 lines changed or added


 CCSet.h   CCSet.h 
skipping to change at line 83 skipping to change at line 83
CCSetIterator end(); CCSetIterator end();
/** /**
*@brief Return the first element if it contains elements, or null if it doesn't contain any element. *@brief Return the first element if it contains elements, or null if it doesn't contain any element.
*/ */
CCObject* anyObject(); CCObject* anyObject();
private: private:
std::set<CCObject *> *m_pSet; std::set<CCObject *> *m_pSet;
}; };
typedef CCSet NSMutableSet;
}//namespace cocos2d }//namespace cocos2d
#endif // __NS_SET_H__ #endif // __NS_SET_H__
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 CCSprite.h   CCSprite.h 
skipping to change at line 200 skipping to change at line 200
/** Creates an sprite with an image filename and a rect. /** Creates an sprite with an image filename and a rect.
The offset will be (0,0). The offset will be (0,0).
*/ */
static CCSprite* spriteWithFile(const char *pszFileName, const CCRec t& rect); static CCSprite* spriteWithFile(const char *pszFileName, const CCRec t& rect);
/** Creates an sprite with an CCBatchNode and a rect /** Creates an sprite with an CCBatchNode and a rect
*/ */
static CCSprite* spriteWithBatchNode(CCSpriteBatchNode *batchNode, c onst CCRect& rect); static CCSprite* spriteWithBatchNode(CCSpriteBatchNode *batchNode, c onst CCRect& rect);
public: public:
virtual bool init(void); CCSprite(void);
virtual ~CCSprite(void); virtual ~CCSprite(void);
CCSprite(); virtual bool init(void);
virtual void removeChild(CCNode* pChild, bool bCleanup); virtual void removeChild(CCNode* pChild, bool bCleanup);
virtual void removeAllChildrenWithCleanup(bool bCleanup); virtual void removeAllChildrenWithCleanup(bool bCleanup);
virtual void reorderChild(CCNode *pChild, int zOrder); virtual void reorderChild(CCNode *pChild, int zOrder);
virtual void addChild(CCNode *pChild); virtual void addChild(CCNode *pChild);
virtual void addChild(CCNode *pChild, int zOrder); virtual void addChild(CCNode *pChild, int zOrder);
virtual void addChild(CCNode *pChild, int zOrder, int tag); virtual void addChild(CCNode *pChild, int zOrder, int tag);
virtual void setDirtyRecursively(bool bValue); virtual void setDirtyRecursively(bool bValue);
virtual void setPosition(const CCPoint& pos); virtual void setPosition(const CCPoint& pos);
skipping to change at line 249 skipping to change at line 249
sprite->setScaleY(sprite->getScaleY() * -1); sprite->setScaleY(sprite->getScaleY() * -1);
*/ */
bool isFlipY(void); bool isFlipY(void);
void updateColor(void); void updateColor(void);
// RGBAProtocol // RGBAProtocol
/** opacity: conforms to CCRGBAProtocol protocol */ /** opacity: conforms to CCRGBAProtocol protocol */
virtual void setIsOpacityModifyRGB(bool bValue); virtual void setIsOpacityModifyRGB(bool bValue);
virtual bool getIsOpacityModifyRGB(void); virtual bool getIsOpacityModifyRGB(void);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProt
ocol *)this; }
// CCTextureProtocol // CCTextureProtocol
virtual void setTexture(CCTexture2D *texture); virtual void setTexture(CCTexture2D *texture);
virtual CCTexture2D* getTexture(void); virtual CCTexture2D* getTexture(void);
/** Initializes an sprite with a texture. /** Initializes an sprite with a texture.
The rect used will be the size of the texture. The rect used will be the size of the texture.
The offset will be (0,0). The offset will be (0,0).
*/ */
bool initWithTexture(CCTexture2D *pTexture); bool initWithTexture(CCTexture2D *pTexture);
 End of changes. 3 change blocks. 
5 lines changed or deleted 2 lines changed or added


 CCStdC.h   CCStdC.h 
skipping to change at line 90 skipping to change at line 90
struct timezone struct timezone
{ {
int tz_minuteswest; int tz_minuteswest;
int tz_dsttime; int tz_dsttime;
}; };
int CC_DLL gettimeofday(struct timeval *, struct timezone *); int CC_DLL gettimeofday(struct timeval *, struct timezone *);
#endif // CC_PLATFORM_WIN32 #endif // CC_PLATFORM_WIN32
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLAT FORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLAT FORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFO RM == CC_PLATFORM_QNX)
#include <sys/time.h> #include <sys/time.h>
#ifndef MIN #ifndef MIN
#define MIN(x,y) (((x) > (y)) ? (y) : (x)) #define MIN(x,y) (((x) > (y)) ? (y) : (x))
#endif // MIN #endif // MIN
#ifndef MAX #ifndef MAX
#define MAX(x,y) (((x) < (y)) ? (y) : (x)) #define MAX(x,y) (((x) < (y)) ? (y) : (x))
#endif // MAX #endif // MAX
skipping to change at line 114 skipping to change at line 114
// some function linux do not have // some function linux do not have
#define tanf tan #define tanf tan
#define sqrtf sqrt #define sqrtf sqrt
#define cosf cos #define cosf cos
#define sinf sin #define sinf sin
#endif #endif
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == C C_PLATFORM_ANDROID #endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == C C_PLATFORM_ANDROID
#if (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) #if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#include <s3e.h> #include <s3e.h>
#include <sys/time.h> #include <sys/time.h>
#ifndef MIN #ifndef MIN
#define MIN(x,y) (((x) > (y)) ? (y) : (x)) #define MIN(x,y) (((x) > (y)) ? (y) : (x))
#endif // MIN #endif // MIN
#ifndef MAX #ifndef MAX
#define MAX(x,y) (((x) < (y)) ? (y) : (x)) #define MAX(x,y) (((x) < (y)) ? (y) : (x))
#endif // MAX #endif // MAX
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY #endif // CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) #if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include <FSysSystemTime.h> #include <FSysSystemTime.h>
struct timeval struct timeval
{ {
long tv_sec; // seconds long tv_sec; // seconds
long tv_usec; // microSeconds long tv_usec; // microSeconds
}; };
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 CCString.h   CCString.h 
skipping to change at line 66 skipping to change at line 66
} }
std::string toStdString() std::string toStdString()
{ {
return m_sString; return m_sString;
} }
bool isEmpty() bool isEmpty()
{ {
return m_sString.empty(); return m_sString.empty();
} }
virtual bool isEqual(const CCObject* pObject)
{
bool bRet = false;
const CCString* pStr = dynamic_cast<const CCString*>(pObject);
if (pStr != NULL)
{
if (0 == m_sString.compare(pStr->m_sString))
{
bRet = true;
}
}
return bRet;
}
}; };
}// namespace cocos2d }// namespace cocos2d
#endif //__CCSTRING_H__ #endif //__CCSTRING_H__
 End of changes. 1 change blocks. 
0 lines changed or deleted 14 lines changed or added


 CCTexture2D.h   CCTexture2D.h 
skipping to change at line 205 skipping to change at line 205
It only works if the texture size is POT (power of 2). It only works if the texture size is POT (power of 2).
@since v0.99.0 @since v0.99.0
*/ */
void generateMipmap(); void generateMipmap();
/** returns the bits-per-pixel of the in-memory OpenGL texture /** returns the bits-per-pixel of the in-memory OpenGL texture
@since v1.0 @since v1.0
*/ */
unsigned int bitsPerPixelForFormat(); unsigned int bitsPerPixelForFormat();
void setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); /** sets the default pixel format for UIImagescontains alpha channel
.
/** sets the default pixel format for UIImages that contains alpha c
hannel.
If the UIImage contains alpha channel, then the options are: If the UIImage contains alpha channel, then the options are:
- generate 32-bit textures: kCCTexture2DPixelFormat_RGBA8888 (defaul t one) - generate 32-bit textures: kCCTexture2DPixelFormat_RGBA8888 (defaul t one)
- generate 24-bit textures: kCCTexture2DPixelFormat_RGB888 - generate 24-bit textures: kCCTexture2DPixelFormat_RGB888
- generate 16-bit textures: kCCTexture2DPixelFormat_RGBA4444 - generate 16-bit textures: kCCTexture2DPixelFormat_RGBA4444
- generate 16-bit textures: kCCTexture2DPixelFormat_RGB5A1 - generate 16-bit textures: kCCTexture2DPixelFormat_RGB5A1
- generate 16-bit textures: kCCTexture2DPixelFormat_RGB565 - generate 16-bit textures: kCCTexture2DPixelFormat_RGB565
- generate 8-bit textures: kCCTexture2DPixelFormat_A8 (only use it i f you use just 1 color) - generate 8-bit textures: kCCTexture2DPixelFormat_A8 (only use it i f you use just 1 color)
How does it work ? How does it work ?
- If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture) - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture)
skipping to change at line 229 skipping to change at line 227
@since v0.8 @since v0.8
*/ */
static void setDefaultAlphaPixelFormat(CCTexture2DPixelFormat format ); static void setDefaultAlphaPixelFormat(CCTexture2DPixelFormat format );
/** returns the alpha pixel format /** returns the alpha pixel format
@since v0.8 @since v0.8
*/ */
static CCTexture2DPixelFormat defaultAlphaPixelFormat(); static CCTexture2DPixelFormat defaultAlphaPixelFormat();
/** treats (or not) PVR files as if they have alpha premultiplied.
Since it is impossible to know at runtime if the PVR images have th
e alpha channel premultiplied, it is
possible load them as if they have (or not) the alpha channel premu
ltiplied.
By default it is disabled.
@since v0.99.5
*/
static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultipl
ied);
private: private:
bool initPremultipliedATextureWithImage(CCImage * image, unsigned in t pixelsWide, unsigned int pixelsHigh); bool initPremultipliedATextureWithImage(CCImage * image, unsigned in t pixelsWide, unsigned int pixelsHigh);
// By default PVR images are treated as if they don't have the alpha ch annel premultiplied // By default PVR images are treated as if they don't have the alpha ch annel premultiplied
bool m_bPVRHaveAlphaPremultiplied; bool m_bPVRHaveAlphaPremultiplied;
}; };
}//namespace cocos2d }//namespace cocos2d
#endif //__CCTEXTURE2D_H__ #endif //__CCTEXTURE2D_H__
 End of changes. 2 change blocks. 
4 lines changed or deleted 15 lines changed or added


 CCTextureCache.h   CCTextureCache.h 
skipping to change at line 34 skipping to change at line 34
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __CCTEXTURE_CACHE_H__ #ifndef __CCTEXTURE_CACHE_H__
#define __CCTEXTURE_CACHE_H__ #define __CCTEXTURE_CACHE_H__
#include <string> #include <string>
#include "CCObject.h" #include "CCObject.h"
#include "CCMutableDictionary.h" #include "CCMutableDictionary.h"
#include "CCTexture2D.h" #include "CCTexture2D.h"
#include "selector_protocol.h"
#if CC_ENABLE_CACHE_TEXTTURE_DATA #if CC_ENABLE_CACHE_TEXTTURE_DATA
#include "CCImage.h" #include "CCImage.h"
#include <list> #include <list>
#endif #endif
namespace cocos2d { namespace cocos2d {
class CCLock; class CCLock;
class CCImage; class CCImage;
/** @brief Singleton that handles the loading of textures /** @brief Singleton that handles the loading of textures
* Once the texture is loaded, the next time it will return * Once the texture is loaded, the next time it will return
* a reference of the previously loaded texture reducing GPU & CPU memory * a reference of the previously loaded texture reducing GPU & CPU memory
*/ */
class CC_DLL CCTextureCache : public SelectorProtocol, public CCObject class CC_DLL CCTextureCache : public CCObject
{ {
protected: protected:
CCMutableDictionary<std::string, CCTexture2D*> * m_pTextures; CCMutableDictionary<std::string, CCTexture2D*> * m_pTextures;
//pthread_mutex_t *m_pDictLock; //pthread_mutex_t *m_pDictLock;
private: private:
// @todo void addImageWithAsyncObject(CCAsyncObject* async); // @todo void addImageWithAsyncObject(CCAsyncObject* async);
void addImageAsyncCallBack(ccTime dt); void addImageAsyncCallBack(ccTime dt);
public: public:
skipping to change at line 90 skipping to change at line 89
CCTexture2D* addImage(const char* fileimage); CCTexture2D* addImage(const char* fileimage);
/* Returns a Texture2D object given a file image /* Returns a Texture2D object given a file image
* If the file image was not previously loaded, it will create a new CCTexture2D object and it will return it. * If the file image was not previously loaded, it will create a new CCTexture2D object and it will return it.
* Otherwise it will load a texture in a new thread, and when the ima ge is loaded, the callback will be called with the Texture2D as a parameter . * Otherwise it will load a texture in a new thread, and when the ima ge is loaded, the callback will be called with the Texture2D as a parameter .
* The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback. * The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback.
* Supported image extensions: .png, .jpg * Supported image extensions: .png, .jpg
* @since v0.8 * @since v0.8
*/ */
void addImageAsync(const char *path, SelectorProtocol *target, SEL_C allFuncO selector); void addImageAsync(const char *path, CCObject *target, SEL_CallFuncO selector);
/* Returns a Texture2D object given an CGImageRef image /* Returns a Texture2D object given an CGImageRef image
* If the image was not previously loaded, it will create a new CCTex ture2D object and it will return it. * If the image was not previously loaded, it will create a new CCTex ture2D object and it will return it.
* Otherwise it will return a reference of a previously loaded image * Otherwise it will return a reference of a previously loaded image
* The "key" parameter will be used as the "key" for the cache. * The "key" parameter will be used as the "key" for the cache.
* If "key" is nil, then a new texture will be created each time. * If "key" is nil, then a new texture will be created each time.
* @since v0.8 * @since v0.8
*/ */
// @todo CGImageRef CCTexture2D* addCGImage(CGImageRef image, string & key); // @todo CGImageRef CCTexture2D* addCGImage(CGImageRef image, string & key);
/** Returns a Texture2D object given an UIImage image /** Returns a Texture2D object given an UIImage image
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added


 CCTouch.h   CCTouch.h 
skipping to change at line 42 skipping to change at line 42
class CCTouch : public CCObject class CCTouch : public CCObject
{ {
public: public:
CCTouch() {} CCTouch() {}
CCTouch(int nViewId, float x, float y) : m_nViewId(nViewId), m_point(x, y), m_prevPoint(x, y) {} CCTouch(int nViewId, float x, float y) : m_nViewId(nViewId), m_point(x, y), m_prevPoint(x, y) {}
CCPoint locationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m _point; } CCPoint locationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m _point; }
CCPoint previousLocationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_prevPoint; } CCPoint previousLocationInView(int nViewId) {CC_UNUSED_PARAM(nViewId); return m_prevPoint; }
int view() { return m_nViewId; } int view() { return m_nViewId; }
int id(){ return m_iID; }
void SetTouchInfo(int nViewId, float x, float y) void SetTouchInfo(int nViewId, float x, float y, int iID=0)
{ {
m_nViewId = nViewId; m_nViewId = nViewId;
m_prevPoint = m_point; m_prevPoint = m_point;
m_point.x = x; m_point.x = x;
m_point.y = y; m_point.y = y;
m_iID = iID;
} }
private: private:
int m_nViewId; int m_nViewId;
CCPoint m_point; CCPoint m_point;
CCPoint m_prevPoint; CCPoint m_prevPoint;
int m_iID;
}; };
class CCEvent : public CCObject class CCEvent : public CCObject
{ {
}; };
} // end of namespace cocos2d } // end of namespace cocos2d
#endif // __PLATFORM_TOUCH_H__ #endif // __PLATFORM_TOUCH_H__
 End of changes. 4 change blocks. 
1 lines changed or deleted 4 lines changed or added


 CCTouchDelegateProtocol.h   CCTouchDelegateProtocol.h 
skipping to change at line 29 skipping to change at line 29
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO M,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*************************************************************************** */ *************************************************************************** */
#ifndef __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ #ifndef __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__
#define __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ #define __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__
#include <string>
#include <map>
#include "CCObject.h" #include "CCObject.h"
#include "ccConfig.h" #include "ccConfig.h"
#include "CCScriptSupport.h"
namespace cocos2d { namespace cocos2d {
typedef enum
{
ccTouchDelegateStandardBit = 1 << 0,
ccTouchDelegateTargetedBit = 1 << 1,
ccTouchDelegateAllBit = (ccTouchDelegateStandardBit | ccTouchDe
legateTargetedBit),
} ccTouchDelegateFlag;
class CCTouch; class CCTouch;
class CCEvent; class CCEvent;
class CCSet; class CCSet;
class CCTouchDispatcher; class CCTouchDispatcher;
class CC_DLL CCTouchDelegate class CC_DLL CCTouchDelegate
{ {
protected:
ccTouchDelegateFlag m_eTouchDelegateType;
std::map<int, std::string> *m_pEventTypeFuncMap;
public: public:
friend class CCTouchDispatcher; // only CCTouchDispatcher & children
can change m_eTouchDelegateType
inline ccTouchDelegateFlag getTouchDelegateType(void) { return m_eTo
uchDelegateType; }
CCTouchDelegate() : m_pEventTypeFuncMap(NULL) {} CCTouchDelegate() {}
virtual ~CCTouchDelegate() virtual ~CCTouchDelegate()
{ {
CC_SAFE_DELETE(m_pEventTypeFuncMap);
} }
//! call the release() in child(layer or menu)
virtual void destroy(void) {}
//! call the retain() in child (layer or menu)
virtual void keep(void) {}
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;};
// optional // optional
virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_ UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_ UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
// optional // optional
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {C C_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {C C_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
// functions for script call back
inline void registerScriptTouchHandler(int eventType, const char* ps
zScriptFunctionName)
{
if (m_pEventTypeFuncMap == NULL)
{
m_pEventTypeFuncMap = new std::map<int, std::string>
();
}
(*m_pEventTypeFuncMap)[eventType] = pszScriptFunctionName;
}
inline bool isScriptHandlerExist(int eventType)
{
if (m_pEventTypeFuncMap)
{
return (*m_pEventTypeFuncMap)[eventType].size() != 0
;
}
return false;
}
inline void excuteScriptTouchHandler(int eventType, CCTouch *pTouch)
{
if (m_pEventTypeFuncMap && CCScriptEngineManager::sharedScri
ptEngineManager()->getScriptEngine())
{
CCScriptEngineManager::sharedScriptEngineManager()->
getScriptEngine()->executeTouchEvent((*m_pEventTypeFuncMap)[eventType].c_st
r(),
pTouch);
}
}
inline void excuteScriptTouchesHandler(int eventType, CCSet *pTouche
s)
{
if (m_pEventTypeFuncMap && CCScriptEngineManager::sharedScri
ptEngineManager()->getScriptEngine())
{
CCScriptEngineManager::sharedScriptEngineManager()->
getScriptEngine()->executeTouchesEvent((*m_pEventTypeFuncMap)[eventType].c_
str(),
pTouches);
}
}
}; };
/** /**
@brief @brief
Using this type of delegate results in two benefits: Using this type of delegate results in two benefits:
- 1. You don't need to deal with CCSets, the dispatcher does the job of sp litting - 1. You don't need to deal with CCSets, the dispatcher does the job of sp litting
them. You get exactly one UITouch per call. them. You get exactly one UITouch per call.
- 2. You can *claim* a UITouch by returning YES in ccTouchBegan. Updates o f claimed - 2. You can *claim* a UITouch by returning YES in ccTouchBegan. Updates o f claimed
touches are sent only to the delegate(s) that claimed them. So if you get a move/ touches are sent only to the delegate(s) that claimed them. So if you get a move/
ended/cancelled update you're sure it's your touch. This frees you from do ing a ended/cancelled update you're sure it's your touch. This frees you from do ing a
lot of checks when doing multi-touch. lot of checks when doing multi-touch.
(The name TargetedTouchDelegate relates to updates "targeting" their speci fic (The name TargetedTouchDelegate relates to updates "targeting" their speci fic
handler, without bothering the other handlers.) handler, without bothering the other handlers.)
@since v0.8 @since v0.8
*/ */
class CC_DLL CCTargetedTouchDelegate : public CCTouchDelegate class CC_DLL CCTargetedTouchDelegate : public CCTouchDelegate
{ {
public: public:
CCTargetedTouchDelegate() { m_eTouchDelegateType = ccTouchDelegateTa rgetedBit; }
/** Return YES to claim the touch. /** Return YES to claim the touch.
@since v0 @since v0
*/ */
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { CC_UNU SED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;}; virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { CC_UNU SED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;};
// optional // optional
virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {CC_UNUS ED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_ UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {CC_ UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
}; };
/** @brief /** @brief
This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Cancelled). This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Cancelled).
@since v0.8 @since v0.8
*/ */
class CC_DLL CCStandardTouchDelegate : public CCTouchDelegate class CC_DLL CCStandardTouchDelegate : public CCTouchDelegate
{ {
public: public:
CCStandardTouchDelegate() { m_eTouchDelegateType = ccTouchDelegateSt andardBit; }
// optional // optional
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UN USED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_U NUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_U NUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
}; };
}//namespace cocos2d }//namespace cocos2d
#endif // __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ #endif // __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__
 End of changes. 11 change blocks. 
79 lines changed or deleted 1 lines changed or added


 CCTouchDispatcher.h   CCTouchDispatcher.h 
skipping to change at line 150 skipping to change at line 150
public: public:
/** singleton of the CCTouchDispatcher */ /** singleton of the CCTouchDispatcher */
static CCTouchDispatcher* sharedDispatcher(); static CCTouchDispatcher* sharedDispatcher();
CCTouchHandler* findHandler(CCTouchDelegate *pDelegate); CCTouchHandler* findHandler(CCTouchDelegate *pDelegate);
protected: protected:
void forceRemoveDelegate(CCTouchDelegate *pDelegate); void forceRemoveDelegate(CCTouchDelegate *pDelegate);
void forceAddHandler(CCTouchHandler *pHandler, CCMutableArray<CCTouc hHandler*> *pArray); void forceAddHandler(CCTouchHandler *pHandler, CCMutableArray<CCTouc hHandler*> *pArray);
void forceRemoveAllDelegates(void); void forceRemoveAllDelegates(void);
void rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray); void rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray);
CCTouchHandler* findHandler(CCMutableArray<CCTouchHandler*> *pArray, CCTouchDelegate *pDelegate);
protected: protected:
CCMutableArray<CCTouchHandler*> *m_pTargetedHandlers; CCMutableArray<CCTouchHandler*> *m_pTargetedHandlers;
CCMutableArray<CCTouchHandler*> *m_pStandardHandlers; CCMutableArray<CCTouchHandler*> *m_pStandardHandlers;
bool m_bLocked; bool m_bLocked;
bool m_bToAdd; bool m_bToAdd;
bool m_bToRemove; bool m_bToRemove;
CCMutableArray<CCTouchHandler*> *m_pHandlersToAdd; CCMutableArray<CCTouchHandler*> *m_pHandlersToAdd;
struct _ccCArray *m_pHandlersToRemove; struct _ccCArray *m_pHandlersToRemove;
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 CCTouchHandler.h   CCTouchHandler.h 
skipping to change at line 98 skipping to change at line 98
class CC_DLL CCTargetedTouchHandler : public CCTouchHandler class CC_DLL CCTargetedTouchHandler : public CCTouchHandler
{ {
public: public:
~CCTargetedTouchHandler(void); ~CCTargetedTouchHandler(void);
/** whether or not the touches are swallowed */ /** whether or not the touches are swallowed */
bool isSwallowsTouches(void); bool isSwallowsTouches(void);
void setSwallowsTouches(bool bSwallowsTouches); void setSwallowsTouches(bool bSwallowsTouches);
/** MutableSet that contains the claimed touches */ /** MutableSet that contains the claimed touches */
NSMutableSet* getClaimedTouches(void); CCSet* getClaimedTouches(void);
/** initializes a TargetedTouchHandler with a delegate, a priority a nd whether or not it swallows touches or not */ /** initializes a TargetedTouchHandler with a delegate, a priority a nd whether or not it swallows touches or not */
bool initWithDelegate(CCTouchDelegate *pDelegate, int nPriority, boo l bSwallow); bool initWithDelegate(CCTouchDelegate *pDelegate, int nPriority, boo l bSwallow);
public: public:
/** allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ /** allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */
static CCTargetedTouchHandler* handlerWithDelegate(CCTouchDelegate * pDelegate, int nPriority, bool bSwallow); static CCTargetedTouchHandler* handlerWithDelegate(CCTouchDelegate * pDelegate, int nPriority, bool bSwallow);
protected: protected:
bool m_bSwallowsTouches; bool m_bSwallowsTouches;
NSMutableSet *m_pClaimedTouches; CCSet *m_pClaimedTouches;
}; };
}//namespace cocos2d }//namespace cocos2d
#endif // __TOUCH_DISPATCHER_CCTOUCH_HANDLER_H__ #endif // __TOUCH_DISPATCHER_CCTOUCH_HANDLER_H__
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 CCUserDefault.h   CCUserDefault.h 
skipping to change at line 96 skipping to change at line 96
*/ */
void setFloatForKey(const char* pKey, float value); void setFloatForKey(const char* pKey, float value);
/** /**
@brief Set double value by key. @brief Set double value by key.
*/ */
void setDoubleForKey(const char* pKey, double value); void setDoubleForKey(const char* pKey, double value);
/** /**
@brief Set string value by key. @brief Set string value by key.
*/ */
void setStringForKey(const char* pKey, const std::string & value) ; void setStringForKey(const char* pKey, const std::string & value) ;
/**
@brief Save content to xml file
*/
void flush();
static CCUserDefault* sharedUserDefault(); static CCUserDefault* sharedUserDefault();
static void purgeSharedUserDefault(); static void purgeSharedUserDefault();
const static std::string& getXMLFilePath(); const static std::string& getXMLFilePath();
private: private:
CCUserDefault() {} CCUserDefault();
static bool createXMLFile(); static bool createXMLFile();
static bool isXMLFileExist(); static bool isXMLFileExist();
static void initXMLFilePath(); static void initXMLFilePath();
static CCUserDefault* m_spUserDefault; static CCUserDefault* m_spUserDefault;
static std::string m_sFilePath; static std::string m_sFilePath;
static bool m_sbIsFilePathInitialized; static bool m_sbIsFilePathInitialized;
}; };
NS_CC_END; NS_CC_END;
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 FontLabelStringDrawing.h   FontLabelStringDrawing.h 
skipping to change at line 78 skipping to change at line 78
- (CGSize)drawInRect:(CGRect)rect withLineBreakMode:(UILineBreakMode)lineBr eakMode alignment:(UITextAlignment)alignment - (CGSize)drawInRect:(CGRect)rect withLineBreakMode:(UILineBreakMode)lineBr eakMode alignment:(UITextAlignment)alignment
numberOfLines:(NSUInteger)numberOfLines; numberOfLines:(NSUInteger)numberOfLines;
@end @end
// This class is used to invoke in .mm file. // This class is used to invoke in .mm file.
// Can not invoke FontLabelStringDrawing directly in .mm. // Can not invoke FontLabelStringDrawing directly in .mm.
// It seems that, in .mm it can not support category. // It seems that, in .mm it can not support category.
@interface FontLabelStringDrawingHelper : NSObject { @interface FontLabelStringDrawingHelper : NSObject {
} }
+ (CGSize)sizeWithZFont:(NSString*)string zfont:(ZFont *)font; + (CGSize)sizeWithZFont:(NSString*)string zfont:(ZFont *)font;
+ (CGSize)sizeWithZFont:(NSString *)string zfont:(ZFont *)font constrainedT oSize:(CGSize)size;
+ (CGSize)drawInRect:(NSString*)string rect:(CGRect)rect withZFont:(ZFont * )font + (CGSize)drawInRect:(NSString*)string rect:(CGRect)rect withZFont:(ZFont * )font
lineBreakMode:(UILineBreakMode)lineBreakMode lineBreakMode:(UILineBreakMode)lineBreakMode
alignment:(UITextAlignment)alignment; alignment:(UITextAlignment)alignment;
@end @end
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 LabelTest.h   LabelTest.h 
skipping to change at line 186 skipping to change at line 186
virtual std::string subtitle(); virtual std::string subtitle();
}; };
class LabelTTFChinese : public AtlasDemo class LabelTTFChinese : public AtlasDemo
{ {
public: public:
LabelTTFChinese(); LabelTTFChinese();
virtual std::string title(); virtual std::string title();
}; };
class LabelBMFontChinese : public AtlasDemo
{
public:
LabelBMFontChinese();
virtual std::string title();
};
// we don't support linebreak mode // we don't support linebreak mode
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 LuaCocos2d.h   LuaCocos2d.h 
skipping to change at line 26 skipping to change at line 26
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL TH E FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL TH E
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FR OM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FR OM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
************************************************************************** **/ ************************************************************************** **/
#ifndef LUACOCOS2D_H #ifndef __LUACOCOS2D_H
#define LUACOCOS2D_H #define __LUACOCOS2D_H
#include "cocos2d.h"
#include "tolua++.h"
#include <stdio.h> #if defined(_WIN32) && defined(_DEBUG)
#include "CCKeypadDispatcher.h"
#include "CCRibbon.h"
#include "CCParallaxNode.h"
#include "CCAutoreleasePool.h"
#include "CCIMEDispatcher.h"
#include "CCMutableArray.h"
//#define TOLUA_RELEASE
#if defined(_WIN32) && defined(_DEBUG)
#pragma warning (disable:4800) #pragma warning (disable:4800)
#endif #endif
int tolua_Cocos2d_open(lua_State* tolua_S);
#define TOLUA_RELEASE #define TOLUA_RELEASE
#endif//LUACOCOS2D_H #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0
#define TOLUA_RELEASE
#endif
#include "tolua++.h"
int tolua_Cocos2d_open(lua_State* tolua_S);
#endif // __LUACOCOS2D_H
 End of changes. 4 change blocks. 
14 lines changed or deleted 3 lines changed or added


 MainPage.h   MainPage.h 
/*! /*!
@mainpage cocos2d-x @mainpage cocos2d-x
@image html Official-cocos2d-Icon-Happy.png @image html cocos2dx_portrait.png
@section sec1 About cocos2d-x @section sec1 About cocos2d-x
cocos2d-x open source project is designed to be a cross-platform 2D game en gine for building 2D games, demos and other graphical/interactive mobile ap plications. cocos2d-x open source project is designed to be a cross-platform 2D game en gine for building 2D games, demos and other graphical/interactive mobile ap plications.
It runs on OpenGL ES 1.1, and is written in C++ language, provides C++ API. \n It runs on OpenGL ES 1.1, and is written in C++ language, provides C++ API. \n
This project is based on the famous <A HREF="http://www.cocos2d-iphone.org" >"cocos2d-iphone"</A> project, and will keep pace with it. \n This project is based on the famous <A HREF="http://www.cocos2d-iphone.org" >"cocos2d-iphone"</A> project, and will keep pace with it. \n
- website: http://www.cocos2d-x.org/ - website: http://www.cocos2d-x.org/
- forum: http://forum.cocos2d-x.org/ - forum: http://forum.cocos2d-x.org/
- twitter: http://twitter.com/cocos2dx/ - twitter: http://twitter.com/cocos2dx/
- weibo: http://weibo.com/cocos2dx/ - weibo: http://weibo.com/cocos2dx/
- wiki: http://wiki.cocos2d-x.org/ - wiki: http://wiki.cocos2d-x.org/
- show cases: http://www.cocos2d-x.org/projects/cocos 2d-x/apps - show cases: http://www.cocos2d-x.org/projects/cocos 2d-x/apps
- <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials">Tuto rials of Cocos2dxSimpleGame</A> - <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials">Tuto rials of Cocos2dxSimpleGame</A>
- <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Installation_an d_First_run">Installation and First run</A> - <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Installation_an d_First_run">Installation and First run</A>
- <A HREF="http://www.cocos2d-x.org/boards/6/topics/567">DEVELOP FAQ</A> - <A HREF="http://www.cocos2d-x.org/boards/6/topics/567">DEVELOP FAQ</A>
\n \n
@section sec2 License @section sec2 License
Copyright (c) 2010 cocos2d-x.org \n Copyright (c) 2010-2012 cocos2d-x.org \n
\n \n
Permission is hereby granted, free of charge, to any person obtaining a cop y \n Permission is hereby granted, free of charge, to any person obtaining a cop y \n
of this software and associated documentation files (the "Software"), to de al \n of this software and associated documentation files (the "Software"), to de al \n
in the Software without restriction, including without limitation the right s \n in the Software without restriction, including without limitation the right s \n
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ n
copies of the Software, and to permit persons to whom the Software is \n copies of the Software, and to permit persons to whom the Software is \n
furnished to do so, subject to the following conditions: \n furnished to do so, subject to the following conditions: \n
\n \n
The above copyright notice and this permission notice shall be included in \n The above copyright notice and this permission notice shall be included in \n
all copies or substantial portions of the Software. \n all copies or substantial portions of the Software. \n
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Paddle.h   Paddle.h 
skipping to change at line 31 skipping to change at line 31
CCRect rect(); CCRect rect();
bool initWithTexture(CCTexture2D* aTexture); bool initWithTexture(CCTexture2D* aTexture);
virtual void onEnter(); virtual void onEnter();
virtual void onExit(); virtual void onExit();
bool containsTouchLocation(CCTouch* touch); bool containsTouchLocation(CCTouch* touch);
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event); virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event); virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event); virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
virtual void touchDelegateRetain();
virtual void touchDelegateRelease();
static Paddle* paddleWithTexture(CCTexture2D* aTexture); static Paddle* paddleWithTexture(CCTexture2D* aTexture);
}; };
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 b2Math.h   b2Math.h 
skipping to change at line 33 skipping to change at line 33
#include <cmath> #include <cmath>
#ifndef SHP #ifndef SHP
#include <cfloat> #include <cfloat>
#else #else
#include <float.h> #include <float.h>
#endif #endif
#include <cstddef> #include <cstddef>
#include <limits> #include <limits>
using namespace std;
/// This function is used to ensure that a floating point number is /// This function is used to ensure that a floating point number is
/// not a NaN or infinity. /// not a NaN or infinity.
inline bool b2IsValid(float32 x) inline bool b2IsValid(float32 x)
{ {
if (x != x) if (x != x)
{ {
// NaN. // NaN.
return false; return false;
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 ccConfig.h   ccConfig.h 
skipping to change at line 150 skipping to change at line 150
/** @def CC_USES_VBO /** @def CC_USES_VBO
If enabled, batch nodes (texture atlas and particle system) will use VBO in stead of vertex list (VBO is recommended by Apple) If enabled, batch nodes (texture atlas and particle system) will use VBO in stead of vertex list (VBO is recommended by Apple)
To enable set it to 1. To enable set it to 1.
Enabled by default on iPhone with ARMv7 processors, iPhone Simulator and Ma c Enabled by default on iPhone with ARMv7 processors, iPhone Simulator and Ma c
Disabled by default on iPhone with ARMv6 processors. Disabled by default on iPhone with ARMv6 processors.
@since v0.99.5 @since v0.99.5
*/ */
#ifndef CC_USES_VBO #ifndef CC_USES_VBO
#if (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) #if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#define CC_USES_VBO 0 #define CC_USES_VBO 0
#else #else
#define CC_USES_VBO 1 #define CC_USES_VBO 1
#endif #endif
#endif #endif
/** @def CC_NODE_TRANSFORM_USING_AFFINE_MATRIX /** @def CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
If enabled, CCNode will transform the nodes using a cached Affine matrix. If enabled, CCNode will transform the nodes using a cached Affine matrix.
If disabled, the node will be transformed using glTranslate,glRotate,glSca le. If disabled, the node will be transformed using glTranslate,glRotate,glSca le.
Using the affine matrix only requires 2 GL calls. Using the affine matrix only requires 2 GL calls.
skipping to change at line 324 skipping to change at line 324
#ifndef CC_ENABLE_PROFILERS #ifndef CC_ENABLE_PROFILERS
#define CC_ENABLE_PROFILERS 0 #define CC_ENABLE_PROFILERS 0
#endif #endif
#if CC_RETINA_DISPLAY_SUPPORT #if CC_RETINA_DISPLAY_SUPPORT
#define CC_IS_RETINA_DISPLAY_SUPPORTED 1 #define CC_IS_RETINA_DISPLAY_SUPPORTED 1
#else #else
#define CC_IS_RETINA_DISPLAY_SUPPORTED 0 #define CC_IS_RETINA_DISPLAY_SUPPORTED 0
#endif #endif
/** Enable Lua engine debug log */
#ifndef CC_LUA_ENGINE_DEBUG
#define CC_LUA_ENGINE_DEBUG 0
#endif
#endif // __CCCONFIG_H__ #endif // __CCCONFIG_H__
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added


 cocos2d.h   cocos2d.h 
skipping to change at line 91 skipping to change at line 91
#include "CCTransitionPageTurn.h" #include "CCTransitionPageTurn.h"
#include "CCTexture2D.h" #include "CCTexture2D.h"
#include "CCTexturePVR.h" #include "CCTexturePVR.h"
#include "CCTransitionRadial.h" #include "CCTransitionRadial.h"
#include "CCActionProgressTimer.h" #include "CCActionProgressTimer.h"
#include "CCTouchHandler.h" #include "CCTouchHandler.h"
#include "CCTouchDispatcher.h" #include "CCTouchDispatcher.h"
#include "CCDrawingPrimitives.h" #include "CCDrawingPrimitives.h"
#include "CCScheduler.h" #include "CCScheduler.h"
// havn't implement on wophone and airplay // havn't implement on wophone
#if (CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY) #if (CC_TARGET_PLATFORM != CC_PLATFORM_WOPHONE)
#include "CCTextFieldTTF.h" #include "CCTextFieldTTF.h"
#endif #endif
// //
// cocoa includes // cocoa includes
// //
#include "CCSet.h" #include "CCSet.h"
#include "CCMutableArray.h" #include "CCMutableArray.h"
#include "CCMutableDictionary.h" #include "CCMutableDictionary.h"
#include "CCObject.h" #include "CCObject.h"
#include "CCZone.h" #include "CCZone.h"
#include "CCGeometry.h" #include "CCGeometry.h"
#include "CCAffineTransform.h" #include "CCAffineTransform.h"
#include "selector_protocol.h"
#include "CCTouch.h" #include "CCTouch.h"
#include "CCPointExtension.h" #include "CCPointExtension.h"
// //
// platform specific // platform specific
// //
#include "CCApplication.h" #include "CCApplication.h"
#include "CCEGLView.h" #include "CCEGLView.h"
#include "CCImage.h" #include "CCImage.h"
#include "CCFileUtils.h" #include "CCFileUtils.h"
#include "CCAccelerometer.h" #include "CCAccelerometer.h"
// extensions
#include "extensions/CCNotificationCenter.h"
// //
// cocos2d macros // cocos2d macros
// //
#include "ccTypes.h" #include "ccTypes.h"
#include "ccMacros.h" #include "ccMacros.h"
namespace cocos2d { namespace cocos2d {
const char* cocos2dVersion(); const char* cocos2dVersion();
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 controller.h   controller.h 
skipping to change at line 22 skipping to change at line 22
~TestController(); ~TestController();
void menuCallback(CCObject * pSender); void menuCallback(CCObject * pSender);
void closeCallback(CCObject * pSender); void closeCallback(CCObject * pSender);
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent); virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
private: private:
CCPoint m_tBeginPos; CCPoint m_tBeginPos;
CCMenu* m_pItmeMenu; CCMenu* m_pItemMenu;
}; };
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 deflate.h   deflate.h 
/* deflate.h -- internal compression state /* deflate.h -- internal compression state
* Copyright (C) 1995-2004 Jean-loup Gailly * Copyright (C) 1995-2010 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
/* @(#) $Id$ */ /* @(#) $Id$ */
skipping to change at line 262 skipping to change at line 262
ush bi_buf; ush bi_buf;
/* Output buffer. bits are inserted starting at the bottom (least /* Output buffer. bits are inserted starting at the bottom (least
* significant bits). * significant bits).
*/ */
int bi_valid; int bi_valid;
/* Number of valid bits in bi_buf. All bits above the last valid bit /* Number of valid bits in bi_buf. All bits above the last valid bit
* are always zero. * are always zero.
*/ */
ulg high_water;
/* High water mark offset in window for initialized bytes -- bytes abov
e
* this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
} FAR deflate_state; } FAR deflate_state;
/* Output a byte on the stream. /* Output a byte on the stream.
* IN assertion: there is enough room in pending_buf. * IN assertion: there is enough room in pending_buf.
*/ */
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} #define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file. /* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1. * See deflate.c for comments about the MIN_MATCH+1.
*/ */
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) #define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
/* In order to simplify the code, particularly on 16 bit machines, match /* In order to simplify the code, particularly on 16 bit machines, match
* distances are limited to MAX_DIST instead of WSIZE. * distances are limited to MAX_DIST instead of WSIZE.
*/ */
#define WIN_INIT MAX_MATCH
/* Number of bytes after end of data in window to initialize in order to av
oid
memory checker errors from longest match routines */
/* in trees.c */ /* in trees.c */
void _tr_init OF((deflate_state *s)); void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned l
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, c));
int eof)); void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
void _tr_align OF((deflate_state *s)); ulg stored_len, int last));
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
int eof)); void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
#define d_code(dist) \ #define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
/* Mapping from a distance to a distance code. dist is the distance - 1 and /* Mapping from a distance to a distance code. dist is the distance - 1 and
* must not have side effects. _dist_code[256] and _dist_code[257] are neve r * must not have side effects. _dist_code[256] and _dist_code[257] are neve r
* used. * used.
*/ */
#ifndef DEBUG #ifndef DEBUG
/* Inline versions of _tr_tally for speed: */ /* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC) #if defined(GEN_TREES_H) || !defined(STDC)
extern uch _length_code[]; extern uch ZLIB_INTERNAL _length_code[];
extern uch _dist_code[]; extern uch ZLIB_INTERNAL _dist_code[];
#else #else
extern const uch _length_code[]; extern const uch ZLIB_INTERNAL _length_code[];
extern const uch _dist_code[]; extern const uch ZLIB_INTERNAL _dist_code[];
#endif #endif
# define _tr_tally_lit(s, c, flush) \ # define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \ { uch cc = (c); \
s->d_buf[s->last_lit] = 0; \ s->d_buf[s->last_lit] = 0; \
s->l_buf[s->last_lit++] = cc; \ s->l_buf[s->last_lit++] = cc; \
s->dyn_ltree[cc].Freq++; \ s->dyn_ltree[cc].Freq++; \
flush = (s->last_lit == s->lit_bufsize-1); \ flush = (s->last_lit == s->lit_bufsize-1); \
} }
# define _tr_tally_dist(s, distance, length, flush) \ # define _tr_tally_dist(s, distance, length, flush) \
 End of changes. 6 change blocks. 
12 lines changed or deleted 26 lines changed or added


 encoding.h   encoding.h 
skipping to change at line 30 skipping to change at line 30
*/ */
#ifndef __XML_CHAR_ENCODING_H__ #ifndef __XML_CHAR_ENCODING_H__
#define __XML_CHAR_ENCODING_H__ #define __XML_CHAR_ENCODING_H__
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#ifdef LIBXML_ICONV_ENABLED #ifdef LIBXML_ICONV_ENABLED
#include <iconv.h> #include <iconv.h>
#endif #endif
#ifdef LIBXML_ICU_ENABLED
#include <unicode/ucnv.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* xmlCharEncoding: * xmlCharEncoding:
* *
* Predefined values for some standard encodings. * Predefined values for some standard encodings.
* Libxml does not do beforehand translation on UTF8 and ISOLatinX. * Libxml does not do beforehand translation on UTF8 and ISOLatinX.
* It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default. * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
skipping to change at line 126 skipping to change at line 129
* if the return value is positive, else unpredictiable. * if the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of octets produced. * The value of @outlen after return is the number of octets produced.
*/ */
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inl en); const unsigned char *in, int *inl en);
/* /*
* Block defining the handlers for non UTF-8 encodings. * Block defining the handlers for non UTF-8 encodings.
* If iconv is supported, there are two extra fields. * If iconv is supported, there are two extra fields.
*/ */
#ifdef LIBXML_ICU_ENABLED
struct _uconv_t {
UConverter *uconv; /* for conversion between an encoding and UTF-16 */
UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
};
typedef struct _uconv_t uconv_t;
#endif
typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
struct _xmlCharEncodingHandler { struct _xmlCharEncodingHandler {
char *name; char *name;
xmlCharEncodingInputFunc input; xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output; xmlCharEncodingOutputFunc output;
#ifdef LIBXML_ICONV_ENABLED #ifdef LIBXML_ICONV_ENABLED
iconv_t iconv_in; iconv_t iconv_in;
iconv_t iconv_out; iconv_t iconv_out;
#endif /* LIBXML_ICONV_ENABLED */ #endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
uconv_t *uconv_in;
uconv_t *uconv_out;
#endif /* LIBXML_ICU_ENABLED */
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include <libxml/tree.h> #include <libxml/tree.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
 End of changes. 3 change blocks. 
0 lines changed or deleted 14 lines changed or added


 inffast.h   inffast.h 
/* inffast.h -- header to use inffast.c /* inffast.h -- header to use inffast.c
* Copyright (C) 1995-2003 Mark Adler * Copyright (C) 1995-2003, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
void inflate_fast OF((z_streamp strm, unsigned start)); void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 inflate.h   inflate.h 
/* inflate.h -- internal inflate state definition /* inflate.h -- internal inflate state definition
* Copyright (C) 1995-2004 Mark Adler * Copyright (C) 1995-2009 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
/* define NO_GZIP when compiling if you want to disable gzip header and /* define NO_GZIP when compiling if you want to disable gzip header and
trailer decoding by inflate(). NO_GZIP would be used to avoid linking i n trailer decoding by inflate(). NO_GZIP would be used to avoid linking i n
skipping to change at line 35 skipping to change at line 35
EXLEN, /* i: waiting for extra length (gzip) */ EXLEN, /* i: waiting for extra length (gzip) */
EXTRA, /* i: waiting for extra bytes (gzip) */ EXTRA, /* i: waiting for extra bytes (gzip) */
NAME, /* i: waiting for end of file name (gzip) */ NAME, /* i: waiting for end of file name (gzip) */
COMMENT, /* i: waiting for end of comment (gzip) */ COMMENT, /* i: waiting for end of comment (gzip) */
HCRC, /* i: waiting for header crc (gzip) */ HCRC, /* i: waiting for header crc (gzip) */
DICTID, /* i: waiting for dictionary check value */ DICTID, /* i: waiting for dictionary check value */
DICT, /* waiting for inflateSetDictionary() call */ DICT, /* waiting for inflateSetDictionary() call */
TYPE, /* i: waiting for type bits, including last-flag bit */ TYPE, /* i: waiting for type bits, including last-flag bit */
TYPEDO, /* i: same, but skip check to exit inflate on new block */ TYPEDO, /* i: same, but skip check to exit inflate on new block */
STORED, /* i: waiting for stored size (length and complement) * / STORED, /* i: waiting for stored size (length and complement) * /
COPY_, /* i/o: same as COPY below, but only first time in */
COPY, /* i/o: waiting for input or output to copy stored bloc k */ COPY, /* i/o: waiting for input or output to copy stored bloc k */
TABLE, /* i: waiting for dynamic block table lengths */ TABLE, /* i: waiting for dynamic block table lengths */
LENLENS, /* i: waiting for code length code lengths */ LENLENS, /* i: waiting for code length code lengths */
CODELENS, /* i: waiting for length/lit and distance code lengths */ CODELENS, /* i: waiting for length/lit and distance code lengths */
LEN, /* i: waiting for length/lit code */ LEN_, /* i: same as LEN below, but only first time in */
LEN, /* i: waiting for length/lit/eob code */
LENEXT, /* i: waiting for length extra bits */ LENEXT, /* i: waiting for length extra bits */
DIST, /* i: waiting for distance code */ DIST, /* i: waiting for distance code */
DISTEXT, /* i: waiting for distance extra bits */ DISTEXT, /* i: waiting for distance extra bits */
MATCH, /* o: waiting for output space to copy string */ MATCH, /* o: waiting for output space to copy string */
LIT, /* o: waiting for output space to write literal */ LIT, /* o: waiting for output space to write literal */
CHECK, /* i: waiting for 32-bit check value */ CHECK, /* i: waiting for 32-bit check value */
LENGTH, /* i: waiting for 32-bit length (gzip) */ LENGTH, /* i: waiting for 32-bit length (gzip) */
DONE, /* finished check, done -- remain here until reset */ DONE, /* finished check, done -- remain here until reset */
BAD, /* got a data error -- remain here until reset */ BAD, /* got a data error -- remain here until reset */
MEM, /* got an inflate() memory error -- remain here until reset */ MEM, /* got an inflate() memory error -- remain here until reset */
SYNC /* looking for synchronization bytes to restart inflate() * / SYNC /* looking for synchronization bytes to restart inflate() * /
} inflate_mode; } inflate_mode;
/* /*
State transitions between above modes - State transitions between above modes -
(most modes can go to the BAD or MEM mode -- not shown for clarity) (most modes can go to BAD or MEM on error -- not shown for clarity)
Process header: Process header:
HEAD -> (gzip) or (zlib) HEAD -> (gzip) or (zlib) or (raw)
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT
NAME -> COMMENT -> HCRC -> TYPE ->
HCRC -> TYPE
(zlib) -> DICTID or TYPE (zlib) -> DICTID or TYPE
DICTID -> DICT -> TYPE DICTID -> DICT -> TYPE
(raw) -> TYPEDO
Read deflate blocks: Read deflate blocks:
TYPE -> STORED or TABLE or LEN or CHECK TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
STORED -> COPY -> TYPE STORED -> COPY_ -> COPY -> TYPE
TABLE -> LENLENS -> CODELENS -> LEN TABLE -> LENLENS -> CODELENS -> LEN_
Read deflate codes: LEN_ -> LEN
Read deflate codes in fixed or dynamic block:
LEN -> LENEXT or LIT or TYPE LEN -> LENEXT or LIT or TYPE
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
LIT -> LEN LIT -> LEN
Process trailer: Process trailer:
CHECK -> LENGTH -> DONE CHECK -> LENGTH -> DONE
*/ */
/* state maintained between inflate() calls. Approximately 7K bytes. */ /* state maintained between inflate() calls. Approximately 10K bytes. */
struct inflate_state { struct inflate_state {
inflate_mode mode; /* current inflate mode */ inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */ int last; /* true if processing last block */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
int havedict; /* true if dictionary provided */ int havedict; /* true if dictionary provided */
int flags; /* gzip header method and flags (0 if zlib) */ int flags; /* gzip header method and flags (0 if zlib) */
unsigned dmax; /* zlib header max distance (INFLATE_STRICT ) */ unsigned dmax; /* zlib header max distance (INFLATE_STRICT ) */
unsigned long check; /* protected copy of check value */ unsigned long check; /* protected copy of check value */
unsigned long total; /* protected copy of output count */ unsigned long total; /* protected copy of output count */
gz_headerp head; /* where to save gzip header information */ gz_headerp head; /* where to save gzip header information */
/* sliding window */ /* sliding window */
unsigned wbits; /* log base 2 of requested window size */ unsigned wbits; /* log base 2 of requested window size */
unsigned wsize; /* window size or zero if not using window */ unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */ unsigned whave; /* valid bytes in the window */
unsigned write; /* window write index */ unsigned wnext; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if needed */ unsigned char FAR *window; /* allocated sliding window, if needed */
/* bit accumulator */ /* bit accumulator */
unsigned long hold; /* input bit accumulator */ unsigned long hold; /* input bit accumulator */
unsigned bits; /* number of bits in "in" */ unsigned bits; /* number of bits in "in" */
/* for string and stored block copying */ /* for string and stored block copying */
unsigned length; /* literal or length of data to copy */ unsigned length; /* literal or length of data to copy */
unsigned offset; /* distance back to copy string from */ unsigned offset; /* distance back to copy string from */
/* for table and code decoding */ /* for table and code decoding */
unsigned extra; /* extra bits needed */ unsigned extra; /* extra bits needed */
/* fixed and dynamic code tables */ /* fixed and dynamic code tables */
skipping to change at line 115 skipping to change at line 119
unsigned distbits; /* index bits for distcode */ unsigned distbits; /* index bits for distcode */
/* dynamic table building */ /* dynamic table building */
unsigned ncode; /* number of code length code lengths */ unsigned ncode; /* number of code length code lengths */
unsigned nlen; /* number of length code lengths */ unsigned nlen; /* number of length code lengths */
unsigned ndist; /* number of distance code lengths */ unsigned ndist; /* number of distance code lengths */
unsigned have; /* number of code lengths in lens[] */ unsigned have; /* number of code lengths in lens[] */
code FAR *next; /* next available space in codes[] */ code FAR *next; /* next available space in codes[] */
unsigned short lens[320]; /* temporary storage for code lengths */ unsigned short lens[320]; /* temporary storage for code lengths */
unsigned short work[288]; /* work area for code table building */ unsigned short work[288]; /* work area for code table building */
code codes[ENOUGH]; /* space for code tables */ code codes[ENOUGH]; /* space for code tables */
int sane; /* if false, allow invalid distance too far
*/
int back; /* bits back of last unprocessed length/lit
*/
unsigned was; /* initial length of match */
}; };
 End of changes. 10 change blocks. 
12 lines changed or deleted 22 lines changed or added


 inftrees.h   inftrees.h 
/* inftrees.h -- header to use inftrees.c /* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2005 Mark Adler * Copyright (C) 1995-2005, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
/* Structure for decoding tables. Each entry provides either the /* Structure for decoding tables. Each entry provides either the
information needed to do the operation requested by the code that information needed to do the operation requested by the code that
skipping to change at line 38 skipping to change at line 38
} code; } code;
/* op values as set by inflate_table(): /* op values as set by inflate_table():
00000000 - literal 00000000 - literal
0000tttt - table link, tttt != 0 is the number of table index bits 0000tttt - table link, tttt != 0 is the number of table index bits
0001eeee - length or distance, eeee is the number of extra bits 0001eeee - length or distance, eeee is the number of extra bits
01100000 - end of block 01100000 - end of block
01000000 - invalid code 01000000 - invalid code
*/ */
/* Maximum size of dynamic tree. The maximum found in a long but non- /* Maximum size of the dynamic table. The maximum number of code structure
exhaustive search was 1444 code structures (852 for length/literals s is
and 592 for distances, the latter actually the result of an 1444, which is the sum of 852 for literal/length codes and 592 for dista
exhaustive search). The true maximum is not known, but the value nce
below is more than safe. */ codes. These values were found by exhaustive searches using the program
#define ENOUGH 2048 examples/enough.c found in the zlib distribtution. The arguments to tha
#define MAXD 592 t
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length code
s
returns returns 852, and "enough 30 6 15" for distance codes returns 592
.
The initial root table size (9 or 6) is found in the fifth argument of t
he
inflate_table() calls in inflate.c and infback.c. If the root table siz
e is
changed, then these maximum sizes would be need to be recalculated and
updated. */
#define ENOUGH_LENS 852
#define ENOUGH_DISTS 592
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
/* Type of code to build for inftable() */ /* Type of code to build for inflate_table() */
typedef enum { typedef enum {
CODES, CODES,
LENS, LENS,
DISTS DISTS
} codetype; } codetype;
extern int inflate_table OF((codetype type, unsigned short FAR *lens, int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens ,
unsigned codes, code FAR * FAR *table, unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work)) ; unsigned FAR *bits, unsigned short FAR *work)) ;
 End of changes. 4 change blocks. 
10 lines changed or deleted 24 lines changed or added


 internal.h   internal.h 
/* internal.h /**************************************************************************
*/
/*
*/
/* internal.h
*/
/*
*/
/* Internal header files (specification only).
*/
/*
*/
/* Copyright 1996-2001, 2002, 2003, 2004 by
*/
/* David Turner, Robert Wilhelm, and Werner Lemberg.
*/
/*
*/
/* This file is part of the FreeType project, and may only be used,
*/
/* modified, and distributed under the terms of the FreeType project
*/
/* license, LICENSE.TXT. By continuing to use, modify, or distribute
*/
/* this file you indicate that you have read the license and
*/
/* understand and accept it fully.
*/
/*
*/
/**************************************************************************
*/
/************************************************************************
*/
/*
*/
/* This file is automatically included by `ft2build.h'.
*/
/* Do not include it manually!
*/
/*
*/
/************************************************************************
*/
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h>
#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h>
#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h>
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
Internal definitions used by Expat. This is not needed to compile #define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
client code.
The following calling convention macros are defined for frequently /* END */
called functions:
FASTCALL - Used for those internal functions that have a simple
body and a low number of arguments and local variables.
PTRCALL - Used for functions called though function pointers.
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
inline - Used for selected internal functions for which inlining
may improve performance on some platforms.
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
*/
#if defined(__GNUC__) && defined(__i386__)
/* We'll use this version by default only where we know it helps.
regparm() generates warnings on Solaris boxes. See SF bug #692878.
Instability reported with egcs on a RedHat Linux 7.3.
Let's comment out:
#define FASTCALL __attribute__((stdcall, regparm(3)))
and let's try this:
*/
#define FASTCALL __attribute__((regparm(3)))
#define PTRFASTCALL __attribute__((regparm(3)))
#endif
/* Using __fastcall seems to have an unexpected negative effect under
MS VC++, especially for function pointers, so we won't use it for
now on that platform. It may be reconsidered for a future release
if it can be made more effective.
Likely reason: __fastcall on Windows is like stdcall, therefore
the compiler cannot perform stack optimizations for call clusters.
*/
/* Make sure all of these are defined if they aren't already. */
#ifndef FASTCALL
#define FASTCALL
#endif
#ifndef PTRCALL
#define PTRCALL
#endif
#ifndef PTRFASTCALL
#define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif /* __GNUC__ */
#endif
#endif /* XML_MIN_SIZE */
#ifdef __cplusplus
#define inline inline
#else
#ifndef inline
#define inline
#endif
#endif
 End of changes. 3 change blocks. 
3 lines changed or deleted 67 lines changed or added


 parser.h   parser.h 
skipping to change at line 1222 skipping to change at line 1222
XML_WITH_REGEXP = 22, XML_WITH_REGEXP = 22,
XML_WITH_AUTOMATA = 23, XML_WITH_AUTOMATA = 23,
XML_WITH_EXPR = 24, XML_WITH_EXPR = 24,
XML_WITH_SCHEMAS = 25, XML_WITH_SCHEMAS = 25,
XML_WITH_SCHEMATRON = 26, XML_WITH_SCHEMATRON = 26,
XML_WITH_MODULES = 27, XML_WITH_MODULES = 27,
XML_WITH_DEBUG = 28, XML_WITH_DEBUG = 28,
XML_WITH_DEBUG_MEM = 29, XML_WITH_DEBUG_MEM = 29,
XML_WITH_DEBUG_RUN = 30, XML_WITH_DEBUG_RUN = 30,
XML_WITH_ZLIB = 31, XML_WITH_ZLIB = 31,
XML_WITH_ICU = 32,
XML_WITH_NONE = 99999 /* just to be sure of allocation size */ XML_WITH_NONE = 99999 /* just to be sure of allocation size */
} xmlFeature; } xmlFeature;
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlHasFeature (xmlFeature feature); xmlHasFeature (xmlFeature feature);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __XML_PARSER_H__ */ #endif /* __XML_PARSER_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 pngpriv.h   pngpriv.h 
/* pngpriv.h - private declarations for use inside libpng /* pngpriv.h - private declarations for use inside libpng
* *
* libpng version 1.4.8 - July 7, 2011 * libpng version 1.4.5 - December 9, 2010
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. ) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. )
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * For conditions of distribution and use, see the disclaimer
* and license in png.h * and license in png.h
*/ */
/* The symbols declared in this file (including the functions declared /* The symbols declared in this file (including the functions declared
* as PNG_EXTERN) are PRIVATE. They are not part of the libpng public * as PNG_EXTERN) are PRIVATE. They are not part of the libpng public
skipping to change at line 29 skipping to change at line 29
* change in an incompatible way, or even disappear. * change in an incompatible way, or even disappear.
* Although the libpng users are not forbidden to include this header, * Although the libpng users are not forbidden to include this header,
* they should be well aware of the issues that may arise from doing so. * they should be well aware of the issues that may arise from doing so.
*/ */
#ifndef PNGPRIV_H #ifndef PNGPRIV_H
#define PNGPRIV_H #define PNGPRIV_H
#ifndef PNG_VERSION_INFO_ONLY #ifndef PNG_VERSION_INFO_ONLY
#if defined(_AIX) && defined(_ALL_SOURCE)
/* On AIX if _ALL_SOURCE is defined standard header files (including
* stdlib.h) define identifiers that are not permitted by the ANSI and
* POSIX standards. In particular 'jmpbuf' is #defined and this will
* prevent compilation of libpng. The following prevents this:
*/
# undef _ALL_SOURCE
#endif
#include <stdlib.h> #include <stdlib.h>
#ifndef PNG_EXTERN #ifndef PNG_EXTERN
/* The functions exported by PNG_EXTERN are internal functions, which /* The functions exported by PNG_EXTERN are internal functions, which
* aren't usually used outside the library (as far as I know), so it is * aren't usually used outside the library (as far as I know), so it is
* debatable if they should be exported at all. In the future, when it * debatable if they should be exported at all. In the future, when it
* is possible to have run-time registry of chunk-handling functions, * is possible to have run-time registry of chunk-handling functions,
* some of these will be made available again. * some of these will be made available again.
# define PNG_EXTERN extern # define PNG_EXTERN extern
*/ */
skipping to change at line 86 skipping to change at line 77
#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
# define PNG_ALWAYS_EXTERN # define PNG_ALWAYS_EXTERN
#endif #endif
/* This provides the non-ANSI (far) memory allocation routines. */ /* This provides the non-ANSI (far) memory allocation routines. */
#if defined(__TURBOC__) && defined(__MSDOS__) #if defined(__TURBOC__) && defined(__MSDOS__)
# include <mem.h> # include <mem.h>
# include <alloc.h> # include <alloc.h>
#endif #endif
#ifndef SHP
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
defined(_WIN32) || defined(__WIN32__) defined(_WIN32) || defined(__WIN32__)
# include <windows.h> /* defines _WINDOWS_ macro */ # include <windows.h> /* defines _WINDOWS_ macro */
#endif #endif
#endif
/* Various modes of operation. Note that after an init, mode is set to /* Various modes of operation. Note that after an init, mode is set to
* zero automatically when the structure is created. * zero automatically when the structure is created.
*/ */
#define PNG_HAVE_IHDR 0x01 #define PNG_HAVE_IHDR 0x01
#define PNG_HAVE_PLTE 0x02 #define PNG_HAVE_PLTE 0x02
#define PNG_HAVE_IDAT 0x04 #define PNG_HAVE_IDAT 0x04
#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream * / #define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream * /
#define PNG_HAVE_IEND 0x10 #define PNG_HAVE_IEND 0x10
#define PNG_HAVE_gAMA 0x20 #define PNG_HAVE_gAMA 0x20
#define PNG_HAVE_cHRM 0x40 #define PNG_HAVE_cHRM 0x40
 End of changes. 5 change blocks. 
12 lines changed or deleted 4 lines changed or added


 tests.h   tests.h 
skipping to change at line 24 skipping to change at line 24
#include "CocosNodeTest/CocosNodeTest.h" #include "CocosNodeTest/CocosNodeTest.h"
#include "TouchesTest/TouchesTest.h" #include "TouchesTest/TouchesTest.h"
#include "MenuTest/MenuTest.h" #include "MenuTest/MenuTest.h"
#include "ActionManagerTest/ActionManagerTest.h" #include "ActionManagerTest/ActionManagerTest.h"
#include "LayerTest/LayerTest.h" #include "LayerTest/LayerTest.h"
#include "SceneTest/SceneTest.h" #include "SceneTest/SceneTest.h"
#include "ParallaxTest/ParallaxTest.h" #include "ParallaxTest/ParallaxTest.h"
#include "TileMapTest/TileMapTest.h" #include "TileMapTest/TileMapTest.h"
#include "IntervalTest/IntervalTest.h" #include "IntervalTest/IntervalTest.h"
#include "LabelTest/LabelTest.h" #include "LabelTest/LabelTest.h"
// havn't implement on airplay // havn't implement on marmalade
#if (CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY) //#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#include "TextInputTest/TextInputTest.h" #include "TextInputTest/TextInputTest.h"
#endif //#endif
#include "SpriteTest/SpriteTest.h" #include "SpriteTest/SpriteTest.h"
#include "SchedulerTest/SchedulerTest.h" #include "SchedulerTest/SchedulerTest.h"
#include "RenderTextureTest/RenderTextureTest.h" #include "RenderTextureTest/RenderTextureTest.h"
#include "Box2DTest/Box2dTest.h" #include "Box2DTest/Box2dTest.h"
#include "Box2DTestBed/Box2dView.h" #include "Box2DTestBed/Box2dView.h"
#include "EffectsAdvancedTest/EffectsAdvancedTest.h" #include "EffectsAdvancedTest/EffectsAdvancedTest.h"
#include "HiResTest/HiResTest.h" #include "HiResTest/HiResTest.h"
#include "AccelerometerTest/AccelerometerTest.h" #include "AccelerometerTest/AccelerometerTest.h"
#include "KeypadTest/KeypadTest.h" #include "KeypadTest/KeypadTest.h"
#include "PerformanceTest/PerformanceTest.h" #include "PerformanceTest/PerformanceTest.h"
skipping to change at line 49 skipping to change at line 49
#include "CocosDenshionTest/CocosDenshionTest.h" #include "CocosDenshionTest/CocosDenshionTest.h"
#include "CurlTest/CurlTest.h" #include "CurlTest/CurlTest.h"
#include "UserDefaultTest/UserDefaultTest.h" #include "UserDefaultTest/UserDefaultTest.h"
#include "DirectorTest/DirectorTest.h" #include "DirectorTest/DirectorTest.h"
#include "BugsTest/BugsTest.h" #include "BugsTest/BugsTest.h"
#include "Texture2dTest/Texture2dTest.h" #include "Texture2dTest/Texture2dTest.h"
#include "FontTest/FontTest.h" #include "FontTest/FontTest.h"
#include "CurrentLanguageTest/CurrentLanguageTest.h" #include "CurrentLanguageTest/CurrentLanguageTest.h"
#include "TextureCacheTest/TextureCacheTest.h" #include "TextureCacheTest/TextureCacheTest.h"
#if (CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY) #if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#include "ChipmunkTest/cocos2dChipmunkDemo.h" #include "ChipmunkTest/cocos2dChipmunkDemo.h"
#else #else
#ifdef AIRPLAYUSECHIPMUNK #ifdef MARMALADEUSECHIPMUNK
#if (AIRPLAYUSECHIPMUNK == 1) #if (MARMALADEUSECHIPMUNK == 1)
#include "ChipmunkTest/cocos2dChipmunkDemo.h" #include "ChipmunkTest/cocos2dChipmunkDemo.h"
#endif #endif
#endif #endif
#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY) #endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#include "ExtensionsTest/ExtensionsTest.h"
enum enum
{ {
TEST_ACTIONS = 0, TEST_ACTIONS = 0,
TEST_TRANSITIONS, TEST_TRANSITIONS,
TEST_PROGRESS_ACTIONS, TEST_PROGRESS_ACTIONS,
TEST_EFFECTS, TEST_EFFECTS,
TEST_CLICK_AND_MOVE, TEST_CLICK_AND_MOVE,
TEST_ROTATE_WORLD, TEST_ROTATE_WORLD,
TEST_PARTICLE, TEST_PARTICLE,
skipping to change at line 103 skipping to change at line 105
TEST_COCOSDENSHION, TEST_COCOSDENSHION,
TEST_PERFORMANCE, TEST_PERFORMANCE,
TEST_ZWOPTEX, TEST_ZWOPTEX,
TEST_CURL, TEST_CURL,
TEST_USERDEFAULT, TEST_USERDEFAULT,
TEST_DIRECTOR, TEST_DIRECTOR,
TEST_BUGS, TEST_BUGS,
TEST_FONTS, TEST_FONTS,
TEST_CURRENT_LANGUAGE, TEST_CURRENT_LANGUAGE,
TEST_TEXTURECACHE, TEST_TEXTURECACHE,
TEST_EXTENSIONS,
TESTS_COUNT, TESTS_COUNT,
}; };
const std::string g_aTestNames[TESTS_COUNT] = { const std::string g_aTestNames[TESTS_COUNT] = {
"ActionsTest", "ActionsTest",
"TransitionsTest", "TransitionsTest",
"ProgressActionsTest", "ProgressActionsTest",
"EffectsTest", "EffectsTest",
"ClickAndMoveTest", "ClickAndMoveTest",
"RotateWorldTest", "RotateWorldTest",
skipping to change at line 149 skipping to change at line 151
"KeypadTest", "KeypadTest",
"CocosDenshionTest", "CocosDenshionTest",
"PerformanceTest", "PerformanceTest",
"ZwoptexTest", "ZwoptexTest",
"CurlTest", "CurlTest",
"UserDefaultTest", "UserDefaultTest",
"DirectorTest", "DirectorTest",
"BugsTest", "BugsTest",
"FontTest", "FontTest",
"CurrentLanguageTest", "CurrentLanguageTest",
"TextureCacheTest" "TextureCacheTest",
"ExtensionsTest"
}; };
#endif #endif
 End of changes. 7 change blocks. 
9 lines changed or deleted 12 lines changed or added


 tolua++.h   tolua++.h 
skipping to change at line 22 skipping to change at line 22
** enhancements, or modifications. ** enhancements, or modifications.
*/ */
#ifndef TOLUA_H #ifndef TOLUA_H
#define TOLUA_H #define TOLUA_H
#ifndef TOLUA_API #ifndef TOLUA_API
#define TOLUA_API extern #define TOLUA_API extern
#endif #endif
#define TOLUA_VERSION "tolua++-1.0.92" #define TOLUA_VERSION "tolua++-1.0.93"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define tolua_pushcppstring(x,y) tolua_pushstring(x,y.c_str()) #define tolua_pushcppstring(x,y) tolua_pushstring(x,y.c_str(
#define tolua_iscppstring tolua_isstring ))
#define tolua_iscppstring tolua_isstring
#define tolua_iscppstringarray tolua_isstringarray #define tolua_iscppstringarray tolua_isstringarray
#define tolua_pushfieldcppstring(L,lo,idx,s) tolua_pushfieldstring(L, lo, i #define tolua_pushfieldcppstring(L,lo,idx,s) tolua_pushfieldstring(L, lo
dx, s.c_str()) , idx, s.c_str())
#ifndef TEMPLATE_BIND #ifndef TEMPLATE_BIND
#define TEMPLATE_BIND(p) #define TEMPLATE_BIND(p)
#endif #endif
#define TOLUA_TEMPLATE_BIND(p) #define TOLUA_TEMPLATE_BIND(p)
#define TOLUA_PROTECTED_DESTRUCTOR #define TOLUA_PROTECTED_DESTRUCTOR
#define TOLUA_PROPERTY_TYPE(p) #define TOLUA_PROPERTY_TYPE(p)
typedef int lua_Object; typedef int lua_Object;
#include "lua.h" #include "lua.h"
#include "lauxlib.h" #include "lauxlib.h"
struct tolua_Error struct tolua_Error
{ {
int index; int index;
int array; int array;
const char* type; const char* type;
}; };
typedef struct tolua_Error tolua_Error; typedef struct tolua_Error tolua_Error;
#define TOLUA_NOPEER LUA_REGISTRYINDEX /* for lua 5.1 */ #define TOLUA_NOPEER LUA_REGISTRYINDEX /* for lua 5.1 */
TOLUA_API const char* tolua_typename (lua_State* L, int lo); TOLUA_API const char* tolua_typename (lua_State* L, int lo);
TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err ); TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err );
TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err); TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err);
TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* er r); TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* er r);
TOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err); TOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err);
TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err);
TOLUA_API int tolua_isnumber (lua_State* L, int lo, int def, tolua_Error* e rr); TOLUA_API int tolua_isnumber (lua_State* L, int lo, int def, tolua_Error* e rr);
TOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* e rr); TOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* e rr);
TOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* er r); TOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* er r);
TOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, in t def, tolua_Error* err); TOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, in t def, tolua_Error* err);
TOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err);
TOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err); TOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err);
TOLUA_API int tolua_isvaluearray TOLUA_API int tolua_isvaluearray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_isbooleanarray TOLUA_API int tolua_isbooleanarray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_isnumberarray TOLUA_API int tolua_isnumberarray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_isstringarray TOLUA_API int tolua_isstringarray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_istablearray TOLUA_API int tolua_istablearray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_isuserdataarray TOLUA_API int tolua_isuserdataarray
(lua_State* L, int lo, int dim, int def, tolua_Error* err); (lua_State* L, int lo, int dim, int def, tolua_Error* err);
TOLUA_API int tolua_isusertypearray TOLUA_API int tolua_isusertypearray
(lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* er r); (lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* err );
TOLUA_API void tolua_open (lua_State* L); TOLUA_API void tolua_open (lua_State* L);
TOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size); TOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size);
TOLUA_API int tolua_register_gc (lua_State* L, int lo); TOLUA_API int tolua_register_gc (lua_State* L, int lo);
TOLUA_API int tolua_default_collect (lua_State* tolua_S); TOLUA_API int tolua_default_collect (lua_State* tolua_S);
TOLUA_API void tolua_usertype (lua_State* L, const char* type); TOLUA_API void tolua_usertype (lua_State* L, const char* type);
TOLUA_API void tolua_beginmodule (lua_State* L, const char* name); TOLUA_API void tolua_beginmodule (lua_State* L, const char* name);
TOLUA_API void tolua_endmodule (lua_State* L); TOLUA_API void tolua_endmodule (lua_State* L);
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar); TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar);
TOLUA_API void tolua_class (lua_State* L, const char* name, const char* bas e); TOLUA_API void tolua_class (lua_State* L, const char* name, const char* bas e);
TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* n ame, const char* base, lua_CFunction col); TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* n ame, const char* base, lua_CFunction col);
TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunctio n func); TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunctio n func);
TOLUA_API void tolua_constant (lua_State* L, const char* name, lua_Number v alue); TOLUA_API void tolua_constant (lua_State* L, const char* name, lua_Number v alue);
TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunctio n get, lua_CFunction set); TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunctio n get, lua_CFunction set);
TOLUA_API void tolua_array (lua_State* L,const char* name, lua_CFunction ge t, lua_CFunction set); TOLUA_API void tolua_array (lua_State* L,const char* name, lua_CFunction ge t, lua_CFunction set);
/* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, ch ar* type); */ /* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, ch ar* type); */
TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base); TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base);
TOLUA_API void tolua_pushvalue (lua_State* L, int lo); TOLUA_API void tolua_pushvalue (lua_State* L, int lo);
TOLUA_API void tolua_pushboolean (lua_State* L, int value); TOLUA_API void tolua_pushboolean (lua_State* L, int value);
TOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value); TOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value);
TOLUA_API void tolua_pushstring (lua_State* L, const char* value); TOLUA_API void tolua_pushstring (lua_State* L, const char* value);
TOLUA_API void tolua_pushuserdata (lua_State* L, void* value); TOLUA_API void tolua_pushuserdata (lua_State* L, void* value);
TOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* t ype); TOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* t ype);
TOLUA_API void tolua_pushusertype_and_takeownership(lua_State* L, void* val ue, const char* type); TOLUA_API void tolua_pushusertype_and_takeownership(lua_State* L, void* val ue, const char* type);
TOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v ); TOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v );
TOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v); TOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v);
skipping to change at line 140 skipping to change at line 140
TOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def) ; TOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def) ;
TOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int d ef); TOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int d ef);
TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, con st char* name); TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, con st char* name);
TOLUA_API int class_gc_event (lua_State* L); TOLUA_API int class_gc_event (lua_State* L);
#ifdef __cplusplus #ifdef __cplusplus
static inline const char* tolua_tocppstring (lua_State* L, int narg, const char* def) { static inline const char* tolua_tocppstring (lua_State* L, int narg, const char* def) {
const char* s = tolua_tostring(L, narg, def); const char* s = tolua_tostring(L, narg, def);
return s?s:""; return s?s:"";
}; };
static inline const char* tolua_tofieldcppstring (lua_State* L, int lo, int index, const char* def) { static inline const char* tolua_tofieldcppstring (lua_State* L, int lo, int index, const char* def) {
const char* s = tolua_tofieldstring(L, lo, index, def); const char* s = tolua_tofieldstring(L, lo, index, def);
return s?s:""; return s?s:"";
}; };
#else #else
#define tolua_tocppstring tolua_tostring #define tolua_tocppstring tolua_tostring
#define tolua_tofieldcppstring tolua_tofieldstring #define tolua_tofieldcppstring tolua_tofieldstring
#endif #endif
TOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, in t super_index); TOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, in t super_index);
#ifndef Mtolua_new #ifndef Mtolua_new
 End of changes. 15 change blocks. 
22 lines changed or deleted 23 lines changed or added


 trees.h   trees.h 
skipping to change at line 73 skipping to change at line 73
local const ct_data static_dtree[D_CODES] = { local const ct_data static_dtree[D_CODES] = {
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
}; };
const uch _dist_code[DIST_CODE_LEN] = { const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
skipping to change at line 102 skipping to change at line 102
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
}; };
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 xmlversion.h   xmlversion.h 
skipping to change at line 32 skipping to change at line 32
*/ */
#ifndef LIBXML2_COMPILING_MSCCDEF #ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void XMLCALL xmlCheckVersion(int version); XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */ #endif /* LIBXML2_COMPILING_MSCCDEF */
/** /**
* LIBXML_DOTTED_VERSION: * LIBXML_DOTTED_VERSION:
* *
* the version string like "1.2.3" * the version string like "1.2.3"
*/ */
#define LIBXML_DOTTED_VERSION "2.7.8" #define LIBXML_DOTTED_VERSION "2.7.7"
/** /**
* LIBXML_VERSION: * LIBXML_VERSION:
* *
* the version number: 1.2.3 value is 10203 * the version number: 1.2.3 value is 10203
*/ */
#define LIBXML_VERSION 20708 #define LIBXML_VERSION 20707
/** /**
* LIBXML_VERSION_STRING: * LIBXML_VERSION_STRING:
* *
* the version number string, 1.2.3 value is "10203" * the version number string, 1.2.3 value is "10203"
*/ */
#define LIBXML_VERSION_STRING "20708" #define LIBXML_VERSION_STRING "20707"
/** /**
* LIBXML_VERSION_EXTRA: * LIBXML_VERSION_EXTRA:
* *
* extra version information, used to show a CVS compilation * extra version information, used to show a CVS compilation
*/ */
#define LIBXML_VERSION_EXTRA "" #define LIBXML_VERSION_EXTRA ""
/** /**
* LIBXML_TEST_VERSION: * LIBXML_TEST_VERSION:
* *
* Macro to check that the libxml version in use is compatible with * Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against * the version the software has been compiled against
*/ */
#define LIBXML_TEST_VERSION xmlCheckVersion(20708); #define LIBXML_TEST_VERSION xmlCheckVersion(20707);
#ifndef VMS #ifndef VMS
#if 0 #if 0
/** /**
* WITH_TRIO: * WITH_TRIO:
* *
* defined if the trio support need to be configured in * defined if the trio support need to be configured in
*/ */
#define WITH_TRIO #define WITH_TRIO
#else #else
skipping to change at line 272 skipping to change at line 272
/** /**
* LIBXML_ICONV_ENABLED: * LIBXML_ICONV_ENABLED:
* *
* Whether iconv support is available * Whether iconv support is available
*/ */
#if 1 #if 1
#define LIBXML_ICONV_ENABLED #define LIBXML_ICONV_ENABLED
#endif #endif
/** /**
* LIBXML_ICU_ENABLED:
*
* Whether icu support is available
*/
#if 0
#define LIBXML_ICU_ENABLED
#endif
/**
* LIBXML_ISO8859X_ENABLED: * LIBXML_ISO8859X_ENABLED:
* *
* Whether ISO-8859-* support is made available in case iconv is not * Whether ISO-8859-* support is made available in case iconv is not
*/ */
#if 1 #if 0
#define LIBXML_ISO8859X_ENABLED #define LIBXML_ISO8859X_ENABLED
#endif #endif
/** /**
* LIBXML_DEBUG_ENABLED: * LIBXML_DEBUG_ENABLED:
* *
* Whether Debugging module is configured in * Whether Debugging module is configured in
*/ */
#if 1 #if 1
#define LIBXML_DEBUG_ENABLED #define LIBXML_DEBUG_ENABLED
skipping to change at line 382 skipping to change at line 373
* *
* Whether the module interfaces are compiled in * Whether the module interfaces are compiled in
*/ */
#if 1 #if 1
#define LIBXML_MODULES_ENABLED #define LIBXML_MODULES_ENABLED
/** /**
* LIBXML_MODULE_EXTENSION: * LIBXML_MODULE_EXTENSION:
* *
* the string suffix used by dynamic modules (usually shared libraries) * the string suffix used by dynamic modules (usually shared libraries)
*/ */
#define LIBXML_MODULE_EXTENSION ".so" #define LIBXML_MODULE_EXTENSION ".dll"
#endif #endif
/** /**
* LIBXML_ZLIB_ENABLED: * LIBXML_ZLIB_ENABLED:
* *
* Whether the Zlib support is compiled in * Whether the Zlib support is compiled in
*/ */
#if 1 #if 1
#define LIBXML_ZLIB_ENABLED #define LIBXML_ZLIB_ENABLED
#endif #endif
 End of changes. 7 change blocks. 
15 lines changed or deleted 6 lines changed or added


 zutil.h   zutil.h 
/* zutil.h -- internal interface and configuration of the compression libra ry /* zutil.h -- internal interface and configuration of the compression libra ry
* Copyright (C) 1995-2005 Jean-loup Gailly. * Copyright (C) 1995-2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
/* @(#) $Id$ */ /* @(#) $Id$ */
#ifndef ZUTIL_H #ifndef ZUTIL_H
#define ZUTIL_H #define ZUTIL_H
#define ZLIB_INTERNAL #if 0//cjh ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
#endif
#include "zlib.h" #include "zlib.h"
#ifdef STDC #ifdef STDC
# ifndef _WIN32_WCE # if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h> # include <stddef.h>
# endif # endif
# include <string.h> # include <string.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif
#ifdef NO_ERRNO_H
# ifdef _WIN32_WCE
/* The Microsoft C Run-Time Library for Windows CE doesn't have
* errno. We define it as a global variable to simplify porting.
* Its value is always 0 and should not be used. We rename it to
* avoid conflict with other libraries that use the same workaround.
*/
# define errno z_errno
# endif
extern int errno;
#else
# ifndef _WIN32_WCE
# include <errno.h>
# endif
#endif
#ifndef local #ifndef local
# define local static # define local static
#endif #endif
/* compile with -Dlocal if your debugger can't find static symbols */ /* compile with -Dlocal if your debugger can't find static symbols */
typedef unsigned char uch; typedef unsigned char uch;
typedef uch FAR uchf; typedef uch FAR uchf;
typedef unsigned short ush; typedef unsigned short ush;
typedef ush FAR ushf; typedef ush FAR ushf;
skipping to change at line 92 skipping to change at line 82
#define MAX_MATCH 258 #define MAX_MATCH 258
/* The minimum and maximum match lengths */ /* The minimum and maximum match lengths */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
/* target dependencies */ /* target dependencies */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00 # define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__) # if defined(__TURBOC__) || defined(__BORLANDC__)
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */ /* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block ); void _Cdecl farfree( void *block );
void *_Cdecl farmalloc( unsigned long nbytes ); void *_Cdecl farmalloc( unsigned long nbytes );
# else # else
# include <alloc.h> # include <alloc.h>
# endif # endif
# else /* MSC or DJGPP */ # else /* MSC or DJGPP */
# include <malloc.h> # include <malloc.h>
# endif # endif
#endif #endif
skipping to change at line 121 skipping to change at line 111
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif #endif
#if defined(ATARI) || defined(atarist) #if defined(ATARI) || defined(atarist)
# define OS_CODE 0x05 # define OS_CODE 0x05
#endif #endif
#ifdef OS2 #ifdef OS2
# define OS_CODE 0x06 # define OS_CODE 0x06
# ifdef M_I86 # ifdef M_I86
#include <malloc.h> # include <malloc.h>
# endif # endif
#endif #endif
#if defined(MACOS) || defined(TARGET_OS_MAC) #if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07 # define OS_CODE 0x07
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_o s # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_o s
# include <unix.h> /* for fdopen */ # include <unix.h> /* for fdopen */
# else # else
# ifndef fdopen # ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */ # define fdopen(fd,mode) NULL /* No fdopen() */
skipping to change at line 154 skipping to change at line 144
#endif #endif
#ifdef __50SERIES /* Prime/PRIMOS */ #ifdef __50SERIES /* Prime/PRIMOS */
# define OS_CODE 0x0f # define OS_CODE 0x0f
#endif #endif
#if defined(_BEOS_) || defined(RISCOS) #if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */ # define fdopen(fd,mode) NULL /* No fdopen() */
#endif #endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
# if defined(_WIN32_WCE) # if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */ # define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED # ifndef _PTRDIFF_T_DEFINED
typedef int ptrdiff_t; typedef int ptrdiff_t;
# define _PTRDIFF_T_DEFINED # define _PTRDIFF_T_DEFINED
# endif # endif
# else # else
# define fdopen(fd,type) _fdopen(fd,type) # define fdopen(fd,type) _fdopen(fd,type)
# endif # endif
#endif #endif
#if defined(__BORLANDC__)
#pragma warn -8004
#pragma warn -8008
#pragma warn -8066
#endif
/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
/* common defaults */ /* common defaults */
#ifndef OS_CODE #ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */ # define OS_CODE 0x03 /* assume Unix */
#endif #endif
#ifndef F_OPEN #ifndef F_OPEN
# define F_OPEN(name, mode) fopen((name), (mode)) # define F_OPEN(name, mode) fopen((name), (mode))
#endif #endif
skipping to change at line 200 skipping to change at line 202
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
but for now we just assume it doesn't. */ but for now we just assume it doesn't. */
# define NO_vsnprintf # define NO_vsnprintf
# endif # endif
# ifdef __TURBOC__ # ifdef __TURBOC__
# define NO_vsnprintf # define NO_vsnprintf
# endif # endif
# ifdef WIN32 # ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf) # if !defined(vsnprintf) && !defined(NO_vsnprintf)
# define vsnprintf _vsnprintf # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
# define vsnprintf _vsnprintf
# endif
# endif # endif
# endif # endif
# ifdef __SASC # ifdef __SASC
# define NO_vsnprintf # define NO_vsnprintf
# endif # endif
#endif #endif
#ifdef VMS #ifdef VMS
# define NO_vsnprintf # define NO_vsnprintf
#endif #endif
skipping to change at line 235 skipping to change at line 239
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ # ifdef SMALL_MEDIUM /* MSDOS small or medium model */
# define zmemcpy _fmemcpy # define zmemcpy _fmemcpy
# define zmemcmp _fmemcmp # define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len) # define zmemzero(dest, len) _fmemset(dest, 0, len)
# else # else
# define zmemcpy memcpy # define zmemcpy memcpy
# define zmemcmp memcmp # define zmemcmp memcmp
# define zmemzero(dest, len) memset(dest, 0, len) # define zmemzero(dest, len) memset(dest, 0, len)
# endif # endif
#else #else
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt le
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); n));
extern void zmemzero OF((Bytef* dest, uInt len)); int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len
));
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
#endif #endif
/* Diagnostic functions */ /* Diagnostic functions */
#ifdef DEBUG #ifdef DEBUG
# include <stdio.h> # include <stdio.h>
extern int z_verbose; extern int ZLIB_INTERNAL z_verbose;
extern void z_error OF((char *m)); extern void ZLIB_INTERNAL z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;}
# define Tracevv(x) {if (z_verbose>1) fprintf x ;} # define Tracevv(x) {if (z_verbose>1) fprintf x ;}
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
#else #else
# define Assert(cond,msg) # define Assert(cond,msg)
# define Trace(x) # define Trace(x)
# define Tracev(x) # define Tracev(x)
# define Tracevv(x) # define Tracevv(x)
# define Tracec(c,x) # define Tracec(c,x)
# define Tracecv(c,x) # define Tracecv(c,x)
#endif #endif
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
void zcfree OF((voidpf opaque, voidpf ptr)); unsigned size));
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
#define ZALLOC(strm, items, size) \ #define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size)) (*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr )) #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr ))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
#endif /* ZUTIL_H */ #endif /* ZUTIL_H */
 End of changes. 12 change blocks. 
29 lines changed or deleted 36 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/