diff --git a/cocos2d-win32.vc2008.sln b/cocos2d-win32.vc2008.sln index ca500ac82e..a21437128a 100644 --- a/cocos2d-win32.vc2008.sln +++ b/cocos2d-win32.vc2008.sln @@ -35,6 +35,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" ProjectSection(ProjectDependencies) = postProject + {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} @@ -53,6 +54,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "samples\TestLua\ EndProjectSection EndProject Global + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 @@ -106,7 +110,4 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection EndGlobal diff --git a/cocos2d-win32.vc2010.sln b/cocos2d-win32.vc2010.sln index 79ba236ca0..ddc9efe7a0 100644 --- a/cocos2d-win32.vc2010.sln +++ b/cocos2d-win32.vc2010.sln @@ -19,6 +19,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" ProjectSection(ProjectDependencies) = postProject + {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} EndProjectSection EndProject diff --git a/extensions/CCBReader/CCBAnimationManager.h b/extensions/CCBReader/CCBAnimationManager.h index 7bec78474b..1c6aa0db88 100644 --- a/extensions/CCBReader/CCBAnimationManager.h +++ b/extensions/CCBReader/CCBAnimationManager.h @@ -15,15 +15,15 @@ public: virtual void completedAnimationSequenceNamed(const char *name) = 0; }; -class CCBAnimationManager : public cocos2d::CCObject +class CCBAnimationManager : public CCObject { private: - cocos2d::CCArray *mSequences; - cocos2d::CCDictionary *mNodeSequences; - cocos2d::CCDictionary *mBaseValues; + CCArray *mSequences; + CCDictionary *mNodeSequences; + CCDictionary *mBaseValues; int mAutoPlaySequenceId; - cocos2d::CCNode *mRootNode; + CCNode *mRootNode; CCSize mRootContainerSize; CCBAnimationManagerDelegate *mDelegate; @@ -35,26 +35,26 @@ public: virtual bool init(); - cocos2d::CCArray* getSequences(); + CCArray* getSequences(); int getAutoPlaySequenceId(); void setAutoPlaySequenceId(int autoPlaySequenceId); - cocos2d::CCNode* getRootNode(); - void setRootNode(cocos2d::CCNode* pRootNode); // retain + CCNode* getRootNode(); + void setRootNode(CCNode* pRootNode); // retain - const cocos2d::CCSize& getRootContainerSize(); - void setRootContainerSize(const cocos2d::CCSize &rootContainerSize); + const CCSize& getRootContainerSize(); + void setRootContainerSize(const CCSize &rootContainerSize); CCBAnimationManagerDelegate* getDelegate(); void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain const char* getRunningSequenceName(); - const CCSize& getContainerSize(cocos2d::CCNode* pNode); + const CCSize& getContainerSize(CCNode* pNode); - void addNode(cocos2d::CCNode *pNode, cocos2d::CCDictionary *pSeq); - void setBaseValue(cocos2d::CCObject *pValue, cocos2d::CCNode *pNode, const char *pPropName); + void addNode(CCNode *pNode, CCDictionary *pSeq); + void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName); void runAnimations(const char *pName, float fTweenDuration); void runAnimations(const char *pName); @@ -63,33 +63,33 @@ public: void debug(); private: - cocos2d::CCObject* getBaseValue(cocos2d::CCNode *pNode, const char* pPropName); + CCObject* getBaseValue(CCNode *pNode, const char* pPropName); int getSequenceId(const char* pSequenceName); CCBSequence* getSequence(int nSequenceId); - cocos2d::CCActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *pPropName, cocos2d::CCNode *pNode); - void setAnimatedProperty(const char *pPropName, cocos2d::CCNode *pNode, cocos2d::CCObject *pValue, float fTweenDuraion); - void setFirstFrame(cocos2d::CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); - cocos2d::CCActionInterval* getEaseAction(cocos2d::CCActionInterval *pAction, int nEasingType, float fEasingOpt); - void runAction(cocos2d::CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + CCActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *pPropName, CCNode *pNode); + void setAnimatedProperty(const char *pPropName, CCNode *pNode, CCObject *pValue, float fTweenDuraion); + void setFirstFrame(CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + CCActionInterval* getEaseAction(CCActionInterval *pAction, int nEasingType, float fEasingOpt); + void runAction(CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); void sequenceCompleted(); }; -class CCBSetSpriteFrame : public cocos2d::CCActionInstant +class CCBSetSpriteFrame : public CCActionInstant { private: - cocos2d::CCSpriteFrame *mSpriteFrame; + CCSpriteFrame *mSpriteFrame; public: ~CCBSetSpriteFrame(); /** creates a Place action with a position */ - static CCBSetSpriteFrame* create(cocos2d::CCSpriteFrame *pSpriteFrame); - bool initWithSpriteFrame(cocos2d::CCSpriteFrame *pSpriteFrame); + static CCBSetSpriteFrame* create(CCSpriteFrame *pSpriteFrame); + bool initWithSpriteFrame(CCSpriteFrame *pSpriteFrame); virtual void update(float time); - virtual cocos2d::CCObject* copyWithZone(cocos2d::CCZone *pZone); + virtual CCObject* copyWithZone(CCZone *pZone); }; -class CCBRotateTo : public cocos2d::CCActionInterval +class CCBRotateTo : public CCActionInterval { private: float mStartAngle; @@ -100,8 +100,8 @@ public: static CCBRotateTo* create(float fDuration, float fAngle); bool initWithDuration(float fDuration, float fAngle); virtual void update(float time); - virtual cocos2d::CCObject* copyWithZone(cocos2d::CCZone *pZone); - virtual void startWithTarget(cocos2d::CCNode *pNode); + virtual CCObject* copyWithZone(CCZone *pZone); + virtual void startWithTarget(CCNode *pNode); }; NS_CC_EXT_END diff --git a/extensions/CCBReader/CCBFileLoader.cpp b/extensions/CCBReader/CCBFileLoader.cpp index dabe5c955c..d51136d0d8 100644 --- a/extensions/CCBReader/CCBFileLoader.cpp +++ b/extensions/CCBReader/CCBFileLoader.cpp @@ -1,6 +1,6 @@ #include "CCBFileLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN diff --git a/extensions/CCBReader/CCBKeyframe.h b/extensions/CCBReader/CCBKeyframe.h index 6a53760551..76d54ed02a 100644 --- a/extensions/CCBReader/CCBKeyframe.h +++ b/extensions/CCBReader/CCBKeyframe.h @@ -6,10 +6,10 @@ NS_CC_EXT_BEGIN -class CCBKeyframe : public cocos2d::CCObject +class CCBKeyframe : public CCObject { private: - cocos2d::CCObject *mValue; + CCObject *mValue; float mTime; int mEasingType; float mEasingOpt; @@ -18,8 +18,8 @@ public: CCBKeyframe(); ~CCBKeyframe(); - cocos2d::CCObject* getValue(); - void setValue(cocos2d::CCObject *pValue); // retain + CCObject* getValue(); + void setValue(CCObject *pValue); // retain float getTime(); void setTime(float fTime); diff --git a/extensions/CCBReader/CCBMemberVariableAssigner.h b/extensions/CCBReader/CCBMemberVariableAssigner.h index 41801d7980..9ca7cd8c8b 100644 --- a/extensions/CCBReader/CCBMemberVariableAssigner.h +++ b/extensions/CCBReader/CCBMemberVariableAssigner.h @@ -21,7 +21,7 @@ class CCBMemberVariableAssigner { public: virtual ~CCBMemberVariableAssigner() {}; - virtual bool onAssignCCBMemberVariable(CCObject * pTarget, cocos2d::CCString * pMemberVariableName, CCNode * pNode) = 0; + virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode) = 0; }; NS_CC_EXT_END diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index 814952232c..7b43222d40 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -20,7 +20,7 @@ #endif using namespace std; -USING_NS_CC; + NS_CC_EXT_BEGIN; /************************************************************************* diff --git a/extensions/CCBReader/CCBReader.h b/extensions/CCBReader/CCBReader.h index 091f2a1007..406b128663 100644 --- a/extensions/CCBReader/CCBReader.h +++ b/extensions/CCBReader/CCBReader.h @@ -128,7 +128,7 @@ enum kCCBScaleTypeMultiplyResolution }; -USING_NS_CC; + NS_CC_EXT_BEGIN /** diff --git a/extensions/CCBReader/CCBSelectorResolver.h b/extensions/CCBReader/CCBSelectorResolver.h index 97d5c5df5b..b71cff9426 100644 --- a/extensions/CCBReader/CCBSelectorResolver.h +++ b/extensions/CCBReader/CCBSelectorResolver.h @@ -5,7 +5,7 @@ #include "ExtensionMacros.h" #include "../GUI/CCControlExtension/CCInvocation.h" -USING_NS_CC; + NS_CC_EXT_BEGIN #define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \ @@ -19,9 +19,9 @@ NS_CC_EXT_BEGIN class CCBSelectorResolver { public: virtual ~CCBSelectorResolver() {}; - virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0; + virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0; - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0; + virtual extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0; }; diff --git a/extensions/CCBReader/CCBSequence.h b/extensions/CCBReader/CCBSequence.h index b253f19888..80e4f6ce2c 100644 --- a/extensions/CCBReader/CCBSequence.h +++ b/extensions/CCBReader/CCBSequence.h @@ -7,7 +7,7 @@ NS_CC_EXT_BEGIN -class CCBSequence : public cocos2d::CCObject +class CCBSequence : public CCObject { private: float mDuration; diff --git a/extensions/CCBReader/CCBSequenceProperty.h b/extensions/CCBReader/CCBSequenceProperty.h index 4e790eeff4..0680700e39 100644 --- a/extensions/CCBReader/CCBSequenceProperty.h +++ b/extensions/CCBReader/CCBSequenceProperty.h @@ -7,7 +7,7 @@ NS_CC_EXT_BEGIN -class CCBSequenceProperty : public cocos2d::CCObject +class CCBSequenceProperty : public CCObject { private: std::string mName; diff --git a/extensions/CCBReader/CCBValue.cpp b/extensions/CCBReader/CCBValue.cpp index 3be6398bc1..79c93fb409 100644 --- a/extensions/CCBReader/CCBValue.cpp +++ b/extensions/CCBReader/CCBValue.cpp @@ -6,7 +6,7 @@ NS_CC_EXT_BEGIN // Implementation of ccColor3BWapper -ccColor3BWapper* ccColor3BWapper::create(const cocos2d::ccColor3B& color) +ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color) { ccColor3BWapper *ret = new ccColor3BWapper(); if (ret) diff --git a/extensions/CCBReader/CCBValue.h b/extensions/CCBReader/CCBValue.h index 2e760eb765..4c4c67332f 100644 --- a/extensions/CCBReader/CCBValue.h +++ b/extensions/CCBReader/CCBValue.h @@ -10,15 +10,15 @@ NS_CC_EXT_BEGIN -class ccColor3BWapper : public cocos2d::CCObject +class ccColor3BWapper : public CCObject { private: - cocos2d::ccColor3B color; + ccColor3B color; public: - static ccColor3BWapper* create(const cocos2d::ccColor3B& color); + static ccColor3BWapper* create(const ccColor3B& color); - const cocos2d::ccColor3B& getColor(); + const ccColor3B& getColor(); }; enum @@ -30,7 +30,7 @@ enum kUnsignedCharValue, }; -class CCBValue : public cocos2d::CCObject +class CCBValue : public CCObject { private: union diff --git a/extensions/CCBReader/CCControlButtonLoader.cpp b/extensions/CCBReader/CCControlButtonLoader.cpp index 4c439cbed0..07ac8b28c9 100644 --- a/extensions/CCBReader/CCControlButtonLoader.cpp +++ b/extensions/CCBReader/CCControlButtonLoader.cpp @@ -1,6 +1,6 @@ #include "CCControlButtonLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN; #define PROPERTY_ZOOMONTOUCHDOWN "zoomOnTouchDown" diff --git a/extensions/CCBReader/CCControlLoader.cpp b/extensions/CCBReader/CCControlLoader.cpp index 8def017a8f..65566cce8e 100644 --- a/extensions/CCBReader/CCControlLoader.cpp +++ b/extensions/CCBReader/CCControlLoader.cpp @@ -1,6 +1,6 @@ #include "CCControlLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN #define PROPERTY_ENABLED "enabled" diff --git a/extensions/CCBReader/CCData.h b/extensions/CCBReader/CCData.h index 5861339ab5..22b5dd967c 100644 --- a/extensions/CCBReader/CCData.h +++ b/extensions/CCBReader/CCData.h @@ -7,7 +7,7 @@ NS_CC_EXT_BEGIN -class CCData : public cocos2d::CCObject +class CCData : public CCObject { public: CCData(unsigned char *pBytes, const unsigned long nSize); diff --git a/extensions/CCBReader/CCLabelBMFontLoader.cpp b/extensions/CCBReader/CCLabelBMFontLoader.cpp index 51fe5cb13b..628d70fb5e 100644 --- a/extensions/CCBReader/CCLabelBMFontLoader.cpp +++ b/extensions/CCBReader/CCLabelBMFontLoader.cpp @@ -1,6 +1,6 @@ #include "CCLabelBMFontLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN diff --git a/extensions/CCBReader/CCLabelTTFLoader.cpp b/extensions/CCBReader/CCLabelTTFLoader.cpp index 0ad2265e9a..db9545bfcd 100644 --- a/extensions/CCBReader/CCLabelTTFLoader.cpp +++ b/extensions/CCBReader/CCLabelTTFLoader.cpp @@ -1,6 +1,6 @@ #include "CCLabelTTFLoader.h" -USING_NS_CC; + #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" diff --git a/extensions/CCBReader/CCLayerColorLoader.cpp b/extensions/CCBReader/CCLayerColorLoader.cpp index 6d98beac21..ed8cb50726 100644 --- a/extensions/CCBReader/CCLayerColorLoader.cpp +++ b/extensions/CCBReader/CCLayerColorLoader.cpp @@ -1,6 +1,6 @@ #include "CCLayerColorLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN diff --git a/extensions/CCBReader/CCLayerGradientLoader.cpp b/extensions/CCBReader/CCLayerGradientLoader.cpp index eef3cbccf4..4f560b673f 100644 --- a/extensions/CCBReader/CCLayerGradientLoader.cpp +++ b/extensions/CCBReader/CCLayerGradientLoader.cpp @@ -1,6 +1,6 @@ #include "CCLayerGradientLoader.h" -USING_NS_CC; + #define PROPERTY_STARTCOLOR "startColor" #define PROPERTY_ENDCOLOR "endColor" diff --git a/extensions/CCBReader/CCLayerLoader.cpp b/extensions/CCBReader/CCLayerLoader.cpp index 9442f7da99..7ae52430c4 100644 --- a/extensions/CCBReader/CCLayerLoader.cpp +++ b/extensions/CCBReader/CCLayerLoader.cpp @@ -1,6 +1,6 @@ #include "CCLayerLoader.h" -USING_NS_CC; + #define PROPERTY_TOUCH_ENABLED "isTouchEnabled" diff --git a/extensions/CCBReader/CCMenuItemImageLoader.cpp b/extensions/CCBReader/CCMenuItemImageLoader.cpp index c8a8f6d24d..10d65300d3 100644 --- a/extensions/CCBReader/CCMenuItemImageLoader.cpp +++ b/extensions/CCBReader/CCMenuItemImageLoader.cpp @@ -1,6 +1,6 @@ #include "CCMenuItemImageLoader.h" -USING_NS_CC; + #define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame" #define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame" diff --git a/extensions/CCBReader/CCMenuItemLoader.cpp b/extensions/CCBReader/CCMenuItemLoader.cpp index a68bf881ac..08cc487e91 100644 --- a/extensions/CCBReader/CCMenuItemLoader.cpp +++ b/extensions/CCBReader/CCMenuItemLoader.cpp @@ -1,6 +1,6 @@ #include "CCMenuItemLoader.h" -USING_NS_CC; + #define PROPERTY_BLOCK "block" #define PROPERTY_ISENABLED "isEnabled" diff --git a/extensions/CCBReader/CCNode+CCBRelativePositioning.h b/extensions/CCBReader/CCNode+CCBRelativePositioning.h index 066fb6202c..5de79563ea 100644 --- a/extensions/CCBReader/CCNode+CCBRelativePositioning.h +++ b/extensions/CCBReader/CCNode+CCBRelativePositioning.h @@ -6,9 +6,9 @@ NS_CC_EXT_BEGIN -extern cocos2d::CCPoint getAbsolutePosition(const cocos2d::CCPoint &pt, int nType, const cocos2d::CCSize &containerSize, const char *pPropName); +extern CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName); -extern void setRelativeScale(cocos2d::CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName); +extern void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName); NS_CC_EXT_END diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index a482a867ad..c5729b7aa2 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -7,8 +7,6 @@ using namespace std; -USING_NS_CC; - NS_CC_EXT_BEGIN CCNode * CCNodeLoader::loadCCNode(CCNode * pParent, CCBReader * pCCBReader) { diff --git a/extensions/CCBReader/CCNodeLoader.h b/extensions/CCBReader/CCNodeLoader.h index 175e96f0aa..f59134ebc9 100644 --- a/extensions/CCBReader/CCNodeLoader.h +++ b/extensions/CCBReader/CCNodeLoader.h @@ -19,11 +19,11 @@ NS_CC_EXT_BEGIN #define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) CCLog("Unexpected property: '%s'!\n", PROPERTY->getCString()); assert(false) #define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) CCLog("Unexpected property type: '%d'!\n", PROPERTYTYPE); assert(false) -#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(cocos2d::CCNode * pParent, cocos2d::extension::CCBReader * pCCBReader) { \ +#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(CCNode * pParent, extension::CCBReader * pCCBReader) { \ return T::create(); \ } -#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(cocos2d::CCNode * pParent, cocos2d::extension::CCBReader * pCCBReader) = 0 +#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(CCNode * pParent, extension::CCBReader * pCCBReader) = 0 struct BlockData { SEL_MenuHandler mSELMenuHandler; diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.cpp b/extensions/CCBReader/CCNodeLoaderLibrary.cpp index 736f66b0df..35c791cc81 100644 --- a/extensions/CCBReader/CCNodeLoaderLibrary.cpp +++ b/extensions/CCBReader/CCNodeLoaderLibrary.cpp @@ -15,7 +15,7 @@ #include "CCParticleSystemQuadLoader.h" #include "CCScrollViewLoader.h" -USING_NS_CC; + NS_CC_EXT_BEGIN diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.h b/extensions/CCBReader/CCNodeLoaderLibrary.h index 13e2bcb095..e7fb01bd94 100644 --- a/extensions/CCBReader/CCNodeLoaderLibrary.h +++ b/extensions/CCBReader/CCNodeLoaderLibrary.h @@ -6,6 +6,8 @@ NS_CC_EXT_BEGIN +class CCNodeLoader; + typedef std::map CCNodeLoaderMap; typedef std::pair CCNodeLoaderMapEntry; diff --git a/extensions/CCBReader/CCParticleSystemQuadLoader.cpp b/extensions/CCBReader/CCParticleSystemQuadLoader.cpp index ac8fbe3340..1c525a5431 100644 --- a/extensions/CCBReader/CCParticleSystemQuadLoader.cpp +++ b/extensions/CCBReader/CCParticleSystemQuadLoader.cpp @@ -1,6 +1,6 @@ #include "CCParticleSystemQuadLoader.h" -USING_NS_CC; + #define PROPERTY_EMITERMODE "emitterMode" #define PROPERTY_POSVAR "posVar" diff --git a/extensions/CCBReader/CCScale9SpriteLoader.cpp b/extensions/CCBReader/CCScale9SpriteLoader.cpp index 2eac14fa5a..4027e93b98 100644 --- a/extensions/CCBReader/CCScale9SpriteLoader.cpp +++ b/extensions/CCBReader/CCScale9SpriteLoader.cpp @@ -1,6 +1,6 @@ #include "CCScale9SpriteLoader.h" -USING_NS_CC; + #define PROPERTY_CONTENTSIZE "contentSize" #define PROPERTY_SPRITEFRAME "spriteFrame" diff --git a/extensions/CCBReader/CCScrollViewLoader.cpp b/extensions/CCBReader/CCScrollViewLoader.cpp index 387b01ada8..48b21410ca 100644 --- a/extensions/CCBReader/CCScrollViewLoader.cpp +++ b/extensions/CCBReader/CCScrollViewLoader.cpp @@ -1,6 +1,6 @@ #include "CCScrollViewLoader.h" -USING_NS_CC; + #define PROPERTY_CONTAINER "container" #define PROPERTY_DIRECTION "direction" diff --git a/extensions/CCBReader/CCSpriteLoader.cpp b/extensions/CCBReader/CCSpriteLoader.cpp index 6c487b54d1..dc29774a05 100644 --- a/extensions/CCBReader/CCSpriteLoader.cpp +++ b/extensions/CCBReader/CCSpriteLoader.cpp @@ -1,7 +1,5 @@ #include "CCSpriteLoader.h" -USING_NS_CC; - #define PROPERTY_FLIP "flip" #define PROPERTY_DISPLAYFRAME "displayFrame" #define PROPERTY_COLOR "color" diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 034e57ea48..9aa88ad2d7 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -19,20 +19,20 @@ NS_CC_EXT_BEGIN typedef unsigned int CCControlEvent; -typedef void (cocos2d::CCObject::*SEL_CCControlHandler)(cocos2d::CCObject*, CCControlEvent); +typedef void (CCObject::*SEL_CCControlHandler)(CCObject*, CCControlEvent); #define cccontrol_selector(_SELECTOR) (SEL_CCControlHandler)(&_SELECTOR) -class CCInvocation : public cocos2d::CCObject +class CCInvocation : public CCObject { CC_SYNTHESIZE_READONLY(SEL_CCControlHandler, m_action, Action); CC_SYNTHESIZE_READONLY(CCObject*, m_target, Target); CC_SYNTHESIZE_READONLY(CCControlEvent, m_controlEvent, ControlEvent); public: - CCInvocation(cocos2d::CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent); + CCInvocation(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent); - void invoke(cocos2d::CCObject* sender); + void invoke(CCObject* sender); }; // end of GUI group diff --git a/extensions/network/HttpClient.h b/extensions/network/HttpClient.h index c63d32042a..41a227a83a 100644 --- a/extensions/network/HttpClient.h +++ b/extensions/network/HttpClient.h @@ -43,7 +43,7 @@ NS_CC_EXT_BEGIN /** @brief Singleton that handles asynchrounous http requests * Once the request completed, a callback will issued in main thread when it provided during make request */ -class CCHttpClient : public cocos2d::CCObject +class CCHttpClient : public CCObject { public: /** Return the shared instance **/ diff --git a/extensions/network/HttpRequest.h b/extensions/network/HttpRequest.h index 89c1a3f812..c6dd2a8781 100644 --- a/extensions/network/HttpRequest.h +++ b/extensions/network/HttpRequest.h @@ -35,7 +35,7 @@ NS_CC_EXT_BEGIN Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample @since v2.0.2 */ -class CCHttpRequest : public cocos2d::CCObject +class CCHttpRequest : public CCObject { public: /** Use this enum type as param in setReqeustType(param) */ @@ -155,7 +155,7 @@ public: /** Required field. You should set the callback selector function at ack the http request completed */ - inline void setResponseCallback(cocos2d::CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector) + inline void setResponseCallback(CCObject* pTarget, SEL_CallFuncND pSelector) { _pTarget = pTarget; _pSelector = pSelector; @@ -171,7 +171,7 @@ public: return _pTarget; } /** Get the selector function pointer, mainly used by CCHttpClient */ - inline cocos2d::SEL_CallFuncND getSelector() + inline SEL_CallFuncND getSelector() { return _pSelector; } @@ -182,8 +182,8 @@ protected: std::string _url; /// target url that this request is sent to std::vector _requestData; /// used for POST std::string _tag; /// user defined tag, to identify different requests in response callback - cocos2d::CCObject* _pTarget; /// callback target of pSelector function - cocos2d::SEL_CallFuncND _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(CCObject *sender, void *data) + CCObject* _pTarget; /// callback target of pSelector function + SEL_CallFuncND _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(CCObject *sender, void *data) void* _pUserData; /// You can add your customed data here }; diff --git a/extensions/network/HttpResponse.h b/extensions/network/HttpResponse.h index 4a5921221f..d0321451fb 100644 --- a/extensions/network/HttpResponse.h +++ b/extensions/network/HttpResponse.h @@ -36,7 +36,7 @@ NS_CC_EXT_BEGIN Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample @since v2.0.2 */ -class CCHttpResponse : public cocos2d::CCObject +class CCHttpResponse : public CCObject { public: /** Constructor, it's used by CCHttpClient internal, users don't need to create HttpResponse manually diff --git a/samples/TestJavascript/Classes/AppDelegate.cpp b/samples/TestJavascript/Classes/AppDelegate.cpp index d49d23112b..15a4ba180e 100644 --- a/samples/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/TestJavascript/Classes/AppDelegate.cpp @@ -3,7 +3,7 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "cocos2dx.hpp" +#include "generated/cocos2dx.hpp" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_manual.hpp" diff --git a/samples/TestJavascript/Resources/js/PerformanceTest/PerformanceSpriteTest.js b/samples/TestJavascript/Resources/js/PerformanceTest/PerformanceSpriteTest.js index 7bef5f9652..c69ce71cb7 100644 --- a/samples/TestJavascript/Resources/js/PerformanceTest/PerformanceSpriteTest.js +++ b/samples/TestJavascript/Resources/js/PerformanceTest/PerformanceSpriteTest.js @@ -429,7 +429,7 @@ function performanceActions20(sprite) { var growDuration = 0.5 + (Math.random() * 1000) / 500.0; var grow = cc.ScaleBy.create(growDuration, 0.5, 0.5); - var permanentScaleLoop = cc.RepeatForever.create(cc.Sequence._actionOneTwo(grow, grow.reverse())); + var permanentScaleLoop = cc.RepeatForever.create(cc.Sequence.create(grow, grow.reverse())); sprite.runAction(permanentScaleLoop); } diff --git a/samples/TestJavascript/Resources/js/test-easeactions.js b/samples/TestJavascript/Resources/js/test-easeactions.js index e88fc2d050..b9c64ac035 100644 --- a/samples/TestJavascript/Resources/js/test-easeactions.js +++ b/samples/TestJavascript/Resources/js/test-easeactions.js @@ -12,6 +12,8 @@ director = cc.Director.getInstance(); winSize = director.getWinSize(); centerPos = cc.p( winSize.width/2, winSize.height/2 ); +var TAG_ACTION1_EASE_ACTIONS = 1001; + var scenes = [] var currentScene = 0; diff --git a/samples/TestJavascript/proj.win32/TestJavascript.vcproj b/samples/TestJavascript/proj.win32/TestJavascript.vcproj index 1e44d6a6df..8af9dac184 100644 --- a/samples/TestJavascript/proj.win32/TestJavascript.vcproj +++ b/samples/TestJavascript/proj.win32/TestJavascript.vcproj @@ -49,7 +49,7 @@ + + + + + + + + + + Disabled - .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) + .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -85,7 +85,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O - libcocos2d.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) + libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) true Windows @@ -106,7 +106,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O testjs_p.c - .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) + .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -129,7 +129,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O - libcocos2d.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) + libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) Windows MachineX86 @@ -137,8 +137,10 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O - + + + @@ -148,8 +150,10 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O - + + + diff --git a/samples/TestJavascript/proj.win32/TestJavascript.vcxproj.filters b/samples/TestJavascript/proj.win32/TestJavascript.vcxproj.filters index 8fb8c38806..93bc5303f2 100644 --- a/samples/TestJavascript/proj.win32/TestJavascript.vcxproj.filters +++ b/samples/TestJavascript/proj.win32/TestJavascript.vcxproj.filters @@ -14,6 +14,9 @@ {e93a77e1-af1e-4400-87d3-504b62ebdbb0} + + {146f26cf-13e1-4106-891b-4b0118ceac2b} + @@ -22,15 +25,6 @@ Classes - - bindings - - - bindings - - - bindings - bindings @@ -43,6 +37,21 @@ bindings + + bindings + + + bindings + + + bindings + + + bindings + + + bindings\generated + @@ -54,13 +63,7 @@ Classes - - bindings - - - bindings - - + bindings @@ -81,6 +84,18 @@ bindings + + bindings + + + bindings + + + bindings + + + bindings\generated + diff --git a/scripting/javascript/bindings/CCPhysicsSprite.h b/scripting/javascript/bindings/CCPhysicsSprite.h index 27b9d50270..f849b4520b 100644 --- a/scripting/javascript/bindings/CCPhysicsSprite.h +++ b/scripting/javascript/bindings/CCPhysicsSprite.h @@ -1,3 +1,6 @@ +#ifndef __CCPHYSICSSPRITE_H__ +#define __CCPHYSICSSPRITE_H__ + #include "sprite_nodes/CCSprite.h" #include "chipmunk.h" @@ -24,3 +27,4 @@ public: virtual void setRotation(float rotation); }; +#endif /* __CCPHYSICSSPRITE_H__ */ diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index 550bc9adfe..b4c6878578 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -421,7 +421,7 @@ JSBool ScriptingCore::forceGC(JSContext *cx, uint32_t argc, jsval *vp) static void dumpNamedRoot(const char *name, void *addr, JSGCRootType type, void *data) { - printf("Root: '%s' at %p\n", name, addr); + CCLOG("Root: '%s' at %p", name, addr); } JSBool ScriptingCore::dumpRoot(JSContext *cx, uint32_t argc, jsval *vp) diff --git a/scripting/javascript/bindings/cocosjs_manual_conversions.h b/scripting/javascript/bindings/cocosjs_manual_conversions.h index 7a32f4c7a9..444deb1e68 100644 --- a/scripting/javascript/bindings/cocosjs_manual_conversions.h +++ b/scripting/javascript/bindings/cocosjs_manual_conversions.h @@ -1,3 +1,6 @@ +#ifndef __COCOSJS_MANUAL_CONVERSIONS_H__ +#define __COCOSJS_MANUAL_CONVERSIONS_H__ + #include "chipmunk.h" #include "cocos2d.h" #include "js_manual_conversions.h" @@ -17,3 +20,6 @@ jsval cpBB_to_jsval(JSContext *cx, cpBB bb ); #define cpVect_to_jsval CGPoint_to_jsval #define jsval_to_cpVect jsval_to_CGPoint + +#endif /* __COCOSJS_MANUAL_CONVERSIONS_H__ */ + diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/scripting/javascript/bindings/js_bindings_ccbreader.cpp index 50e7e98a35..0244706f0f 100644 --- a/scripting/javascript/bindings/js_bindings_ccbreader.cpp +++ b/scripting/javascript/bindings/js_bindings_ccbreader.cpp @@ -8,7 +8,6 @@ #include "js_bindings_ccbreader.h" #include "ScriptingCore.h" -#include "CCNodeLoaderLibrary.h" USING_NS_CC; USING_NS_CC_EXT; diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.h b/scripting/javascript/bindings/js_bindings_ccbreader.h index 2ddc9f60c0..a847cf3e44 100644 --- a/scripting/javascript/bindings/js_bindings_ccbreader.h +++ b/scripting/javascript/bindings/js_bindings_ccbreader.h @@ -5,14 +5,11 @@ // Created by Rohan Kuruvilla on 14/08/2012. // // -#include "jsapi.h" -#include "CCBReader.h" -#include "CCBSelectorResolver.h" -#include "CCBMemberVariableAssigner.h" -#include "CCInvocation.h" -#include "ExtensionMacros.h" -#include "CCLayerLoader.h" +#ifndef __JS_BINDINGS_CCBREADER_H__ +#define __JS_BINDINGS_CCBREADER_H__ +#include "jsapi.h" +#include "cocos-ext.h" #include "cocos2d_specifics.hpp" @@ -60,3 +57,6 @@ protected: void register_CCBuilderReader(JSContext *cx, JSObject *global); JSBool js_CocosBuilder_Run(JSContext *cx, uint32_t argc, jsval *vp); + +#endif /* __JS_BINDINGS_CCBREADER_H__ */ + diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_functions.hpp b/scripting/javascript/bindings/js_bindings_chipmunk_functions.hpp index b8baf60267..21bd2b0d61 100644 --- a/scripting/javascript/bindings/js_bindings_chipmunk_functions.hpp +++ b/scripting/javascript/bindings/js_bindings_chipmunk_functions.hpp @@ -2,7 +2,8 @@ // Created by Rohan Kuruvilla // Copyright (c) 2012 Zynga Inc. All rights reserved. // - +#ifndef __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__ +#define __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__ JSBool JSPROXY_cpArbiterGetCount(JSContext *cx, uint32_t argc, jsval *vp); JSBool JSPROXY_cpArbiterGetDepth(JSContext *cx, uint32_t argc, jsval *vp); @@ -280,3 +281,6 @@ JSBool JSPROXY_cpvslerpconst(JSContext *cx, uint32_t argc, jsval *vp); JSBool JSPROXY_cpvsub(JSContext *cx, uint32_t argc, jsval *vp); JSBool JSPROXY_cpvtoangle(JSContext *cx, uint32_t argc, jsval *vp); JSBool JSPROXY_cpvunrotate(JSContext *cx, uint32_t argc, jsval *vp); + +#endif /* __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__ */ + diff --git a/scripting/javascript/bindings/js_manual_conversions.h b/scripting/javascript/bindings/js_manual_conversions.h index e67da4de09..c815bc04cf 100644 --- a/scripting/javascript/bindings/js_manual_conversions.h +++ b/scripting/javascript/bindings/js_manual_conversions.h @@ -2,6 +2,8 @@ // Created by Rohan Kuruvilla // Copyright (c) 2012 Zynga Inc. All rights reserved. // +#ifndef __JS_MANUAL_CONVERSIONS_H__ +#define __JS_MANUAL_CONVERSIONS_H__ #include "jsapi.h" @@ -21,3 +23,6 @@ jsval opaque_to_jsval( JSContext *cx, void* opaque); #ifdef __cplusplus } #endif + +#endif /* __JS_MANUAL_CONVERSIONS_H__ */ +