diff --git a/AUTHORS b/AUTHORS index dba42eb2d2..e6c188c28a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -414,6 +414,8 @@ Developers: Added some guards to prevent Eclipse to compile twice the same class. Linux Eclipse projects updates Refactored emscripten-build.sh, it's no longer need to be edited to make emscripten work. + Creation of CCDeprecated-ext.h + Use of a single emscripten HTML template file. elmiro Correction of passed buffer size to readlink and verification of result return by readlink. diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 0a71f3ec24..3f771c5290 100644 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3e6fb10656859ac83b22bfa48044ade6213d414d \ No newline at end of file +61930829c286fd6ec795bccee6e841a60e8ba34f \ No newline at end of file diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos2dx/actions/CCActionInstant.cpp index 0ea7a89576..01d0106833 100644 --- a/cocos2dx/actions/CCActionInstant.cpp +++ b/cocos2dx/actions/CCActionInstant.cpp @@ -473,5 +473,138 @@ CallFuncN * CallFuncN::clone() const return a; } +// +// CallFuncND +// +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#pragma warning (push) +#pragma warning (disable: 4996) +#endif +CCCallFuncND * CCCallFuncND::create(Object* selectorTarget, SEL_CallFuncND selector, void* d) +{ + CCCallFuncND* pRet = new CCCallFuncND(); + + if (pRet && pRet->initWithTarget(selectorTarget, selector, d)) { + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + +bool CCCallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d) +{ + if (CallFunc::initWithTarget(selectorTarget)) + { + _data = d; + _callFuncND = selector; + return true; + } + + return false; +} + +void CCCallFuncND::execute() +{ + if (_callFuncND) + { + (_selectorTarget->*_callFuncND)(_target, _data); + } +} + +CCCallFuncND * CCCallFuncND::clone() const +{ + // no copy constructor + auto a = new CCCallFuncND(); + + if( _selectorTarget) + { + a->initWithTarget(_selectorTarget, _callFuncND, _data); + } + + a->autorelease(); + return a; +} + +// +// CallFuncO +// +CCCallFuncO::CCCallFuncO() : +_object(NULL) +{ +} + +CCCallFuncO::~CCCallFuncO() +{ + CC_SAFE_RELEASE(_object); +} + +void CCCallFuncO::execute() +{ + if (_callFuncO) { + (_selectorTarget->*_callFuncO)(_object); + } +} + +CCCallFuncO * CCCallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector, Object* object) +{ + CCCallFuncO *pRet = new CCCallFuncO(); + + if (pRet && pRet->initWithTarget(selectorTarget, selector, object)) { + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + +bool CCCallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object) +{ + if (CallFunc::initWithTarget(selectorTarget)) + { + _object = object; + CC_SAFE_RETAIN(_object); + + _callFuncO = selector; + return true; + } + + return false; +} + +CCCallFuncO * CCCallFuncO::clone() const +{ + // no copy constructor + auto a = new CCCallFuncO(); + + if( _selectorTarget) + { + a->initWithTarget(_selectorTarget, _callFuncO, _object); + } + + a->autorelease(); + return a; +} + +Object* CCCallFuncO::getObject() const +{ + return _object; +} + +void CCCallFuncO::setObject(Object* obj) +{ + if (obj != _object) + { + CC_SAFE_RELEASE(_object); + _object = obj; + CC_SAFE_RETAIN(_object); + } +} + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#pragma warning (pop) +#endif NS_CC_END diff --git a/cocos2dx/actions/CCActionInstant.h b/cocos2dx/actions/CCActionInstant.h index ce494cc635..e034ceae1f 100644 --- a/cocos2dx/actions/CCActionInstant.h +++ b/cocos2dx/actions/CCActionInstant.h @@ -341,6 +341,83 @@ protected: std::function _functionN; }; +/** + @deprecated Please use CallFuncN instead. + @brief Calls a 'callback' with the node as the first argument and the 2nd argument is data + * ND means: Node and Data. Data is void *, so it could be anything. + */ + +class CC_DLL CC_DEPRECATED_ATTRIBUTE CCCallFuncND : public CallFunc +{ +public: + /** creates the action with the callback and the data to pass as an argument */ + static CCCallFuncND * create(Object* selectorTarget, SEL_CallFuncND selector, void* d); + + virtual long getClassTypeInfo() { + static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name()); + return id; + } + + /** initializes the action with the callback and the data to pass as an argument */ + bool initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d); + + // + // Overrides + // + virtual CCCallFuncND* clone() const override; + virtual void execute() override; + +protected: + SEL_CallFuncND _callFuncND; + void* _data; +}; + + +/** + @deprecated Please use CallFuncN instead. + @brief Calls a 'callback' with an object as the first argument. + O means Object. + @since v0.99.5 + */ + +class CC_DLL CC_DEPRECATED_ATTRIBUTE CCCallFuncO : public CallFunc, public TypeInfo +{ +public: + /** creates the action with the callback + + typedef void (Object::*SEL_CallFuncO)(Object*); + */ + static CCCallFuncO * create(Object* selectorTarget, SEL_CallFuncO selector, Object* object); + + CCCallFuncO(); + virtual ~CCCallFuncO(); + + /** initializes the action with the callback + + typedef void (Object::*SEL_CallFuncO)(Object*); + */ + bool initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object); + + virtual long getClassTypeInfo() { + static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name()); + return id; + } + + // + // Overrides + // + virtual CCCallFuncO* clone() const override; + virtual void execute() override; + + Object* getObject() const; + void setObject(Object* obj); + +protected: + /** object to be passed as argument */ + Object* _object; + SEL_CallFuncO _callFuncO; +}; + // end of actions group /// @} diff --git a/cocos2dx/cocos2d.cpp b/cocos2dx/cocos2d.cpp index d109164fe1..859af0a34a 100644 --- a/cocos2dx/cocos2d.cpp +++ b/cocos2dx/cocos2d.cpp @@ -30,7 +30,7 @@ NS_CC_BEGIN const char* cocos2dVersion() { - return "3.0-alpha0-pre"; + return "3.0-pre-alpha0"; } NS_CC_END diff --git a/cocos2dx/include/CCDeprecated.h b/cocos2dx/include/CCDeprecated.h index 5d762353f3..c47c8fd17c 100644 --- a/cocos2dx/include/CCDeprecated.h +++ b/cocos2dx/include/CCDeprecated.h @@ -622,6 +622,7 @@ CC_DEPRECATED_ATTRIBUTE typedef FlipX CCFlipX; CC_DEPRECATED_ATTRIBUTE typedef FlipY CCFlipY; CC_DEPRECATED_ATTRIBUTE typedef Place CCPlace; CC_DEPRECATED_ATTRIBUTE typedef CallFunc CCCallFunc; +CC_DEPRECATED_ATTRIBUTE typedef CallFuncN CCCallFuncN; CC_DEPRECATED_ATTRIBUTE typedef GridAction CCGridAction; CC_DEPRECATED_ATTRIBUTE typedef Grid3DAction CCGrid3DAction; CC_DEPRECATED_ATTRIBUTE typedef TiledGrid3DAction CCTiledGrid3DAction; @@ -760,6 +761,7 @@ CC_DEPRECATED_ATTRIBUTE typedef Timer CCTimer; CC_DEPRECATED_ATTRIBUTE typedef Scheduler CCScheduler; CC_DEPRECATED_ATTRIBUTE typedef EGLView CCEGLView; +CC_DEPRECATED_ATTRIBUTE typedef Component CCComponent; CC_DEPRECATED_ATTRIBUTE typedef AffineTransform CCAffineTransform; CC_DEPRECATED_ATTRIBUTE typedef Point CCPoint; CC_DEPRECATED_ATTRIBUTE typedef Size CCSize; diff --git a/cocos2dx/include/ccTypes.h b/cocos2dx/include/ccTypes.h index 29b7a3b25d..ed55455ac9 100644 --- a/cocos2dx/include/ccTypes.h +++ b/cocos2dx/include/ccTypes.h @@ -83,7 +83,7 @@ struct Color4B a(_a) {} - Color4B(): r(0.f), g(0.f), b(0.f), a(0.f) {} + Color4B(): r(0), g(0), b(0), a(0) {} // This function should use Color4F, so implement it in .cpp file. explicit Color4B(const Color4F &color4F); diff --git a/cocos2dx/misc_nodes/CCRenderTexture.h b/cocos2dx/misc_nodes/CCRenderTexture.h index 4fe49434e5..0aa356113c 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.h +++ b/cocos2dx/misc_nodes/CCRenderTexture.h @@ -104,7 +104,10 @@ public: /* creates a new Image from with the texture's data. Caller is responsible for releasing it by calling delete. */ + Image* newImage(bool flipImage = true); + + CC_DEPRECATED_ATTRIBUTE Image* newCCImage(bool flipImage = true) { return newImage(flipImage); }; /** saves the texture into a file using JPEG format. The file will be saved in the Documents folder. Returns YES if the operation is successful. diff --git a/cocos2dx/proj.emscripten/cocos2dx.mk b/cocos2dx/proj.emscripten/cocos2dx.mk index 348d635dfd..b6893beeea 100644 --- a/cocos2dx/proj.emscripten/cocos2dx.mk +++ b/cocos2dx/proj.emscripten/cocos2dx.mk @@ -97,9 +97,12 @@ STATICLIBS = \ SHAREDLIBS += -L$(LIB_DIR) -Wl,-rpath,$(RPATH_REL)/$(LIB_DIR) LIBS = -lrt -lz +HTMLTPL_DIR = $(COCOS_ROOT)/tools/emscripten-template +HTMLTPL_FILE = index.html + clean: rm -rf $(OBJ_DIR) - rm -f $(TARGET).js $(TARGET).data $(TARGET).data.js $(BIN_DIR)/index.html core + rm -rf $(TARGET).js $(TARGET).data $(TARGET).data.js $(BIN_DIR) core .PHONY: all clean @@ -108,7 +111,7 @@ clean: ifdef EXECUTABLE TARGET := $(BIN_DIR)/$(EXECUTABLE) -all: $(TARGET).js $(TARGET).data $(BIN_DIR)/index.html +all: $(TARGET).js $(TARGET).data $(BIN_DIR)/$(HTMLTPL_FILE) run: $(TARGET) cd $(dir $^) && ./$(notdir $^) diff --git a/cocos2dx/textures/CCTexture2D.h b/cocos2dx/textures/CCTexture2D.h index 85e90b0776..c204e31224 100644 --- a/cocos2dx/textures/CCTexture2D.h +++ b/cocos2dx/textures/CCTexture2D.h @@ -186,6 +186,7 @@ public: @since v0.8 */ void setTexParameters(const ccTexParams& texParams); + CC_DEPRECATED_ATTRIBUTE void setTexParameters(const ccTexParams* texParams) { return setTexParameters(*texParams); }; /** sets antialias texture parameters: - GL_TEXTURE_MIN_FILTER = GL_LINEAR diff --git a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h index 00ed30e664..7a752d4b2d 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h +++ b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h @@ -56,6 +56,9 @@ public: ParallaxNode(); virtual ~ParallaxNode(); + // prevents compiler warning: "Included function hides overloaded virtual functions" + using Node::addChild; + void addChild(Node * child, int z, const Point& parallaxRatio, const Point& positionOffset); /** Sets an array of layers for the Parallax node */ diff --git a/extensions/AssetsManager/AssetsManager.h b/extensions/AssetsManager/AssetsManager.h index 6523e73473..46f50ebe71 100644 --- a/extensions/AssetsManager/AssetsManager.h +++ b/extensions/AssetsManager/AssetsManager.h @@ -213,6 +213,10 @@ public: virtual void onSuccess() {}; }; +// Deprecated declaration +CC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager; +CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol; + NS_CC_EXT_END; #endif /* defined(__AssetsManager__) */ diff --git a/extensions/CCArmature/CCArmature.h b/extensions/CCArmature/CCArmature.h index 0f3c2f4e41..f076a4fa04 100644 --- a/extensions/CCArmature/CCArmature.h +++ b/extensions/CCArmature/CCArmature.h @@ -28,9 +28,45 @@ THE SOFTWARE. #include "utils/CCArmatureDefine.h" #include "CCBone.h" #include "display/CCBatchNode.h" +#include "display/CCShaderNode.h" #include "animation/CCArmatureAnimation.h" +#include "physics/CCPhysicsWorld.h" +#include "utils/CCSpriteFrameCacheHelper.h" +#include "utils/CCArmatureDataManager.h" namespace cocos2d { namespace extension { namespace armature { + +CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; +CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; +CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef ShaderDisplayData CCShaderDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; +CC_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; +CC_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; +CC_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; +CC_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; +CC_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; +CC_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; +CC_DEPRECATED_ATTRIBUTE typedef ShaderNode CCShaderNode; +CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +CC_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; +CC_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; +CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +CC_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; +CC_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; +CC_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; +CC_DEPRECATED_ATTRIBUTE typedef PhysicsWorld CCPhysicsWorld; +CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; +CC_DEPRECATED_ATTRIBUTE typedef TweenFunction CCTweenFunction; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; +CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; +CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; class Armature : public NodeRGBA, public BlendProtocol { diff --git a/extensions/CCBReader/CCBAnimationManager.cpp b/extensions/CCBReader/CCBAnimationManager.cpp index 135ef99368..24476de243 100644 --- a/extensions/CCBReader/CCBAnimationManager.cpp +++ b/extensions/CCBReader/CCBAnimationManager.cpp @@ -617,7 +617,7 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann CCBSelectorResolver* targetAsCCBSelectorResolver = dynamic_cast(target); if(targetAsCCBSelectorResolver != NULL) { - selCallFunc = targetAsCCBSelectorResolver->onResolveCCBCallFuncSelector(target, selectorName.c_str ()); + selCallFunc = targetAsCCBSelectorResolver->onResolveCCBCCCallFuncSelector(target, selectorName.c_str ()); } if(selCallFunc == 0) { CCLOG("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName.c_str()); diff --git a/extensions/CCBReader/CCBSelectorResolver.h b/extensions/CCBReader/CCBSelectorResolver.h index be4d88dbf5..2eb6ae06d8 100644 --- a/extensions/CCBReader/CCBSelectorResolver.h +++ b/extensions/CCBReader/CCBSelectorResolver.h @@ -23,9 +23,9 @@ NS_CC_EXT_BEGIN class CCBSelectorResolver { public: virtual ~CCBSelectorResolver() {}; - virtual SEL_MenuHandler onResolveCCBMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0; - virtual SEL_CallFuncN onResolveCCBCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; }; - virtual SEL_CCControlHandler onResolveCCBControlSelector(Object * pTarget, const char* pSelectorName) = 0; + virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0; + virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; }; + virtual SEL_CCControlHandler onResolveCCBCCControlSelector(Object * pTarget, const char* pSelectorName) = 0; }; diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index a574b25c39..1090787909 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -754,12 +754,12 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast(target); if(targetAsCCBSelectorResolver != NULL) { - selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBMenuItemSelector(target, selectorName.c_str()); + selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str()); } if(selMenuHandler == 0) { CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver(); if(ccbSelectorResolver != NULL) { - selMenuHandler = ccbSelectorResolver->onResolveCCBMenuItemSelector(target, selectorName.c_str()); + selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str()); } } @@ -816,12 +816,12 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast(target); if(targetAsCCBSelectorResolver != NULL) { - selControlHandler = targetAsCCBSelectorResolver->onResolveCCBControlSelector(target, selectorName.c_str()); + selControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str()); } if(selControlHandler == 0) { CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver(); if(ccbSelectorResolver != NULL) { - selControlHandler = ccbSelectorResolver->onResolveCCBControlSelector(target, selectorName.c_str()); + selControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str()); } } diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.cpp b/extensions/CCBReader/CCNodeLoaderLibrary.cpp index 794201ec62..515df267ff 100644 --- a/extensions/CCBReader/CCNodeLoaderLibrary.cpp +++ b/extensions/CCBReader/CCNodeLoaderLibrary.cpp @@ -81,7 +81,7 @@ void NodeLoaderLibrary::purge(bool pReleaseNodeLoaders) { static NodeLoaderLibrary * sSharedNodeLoaderLibrary = NULL; -NodeLoaderLibrary * NodeLoaderLibrary::sharedNodeLoaderLibrary() { +NodeLoaderLibrary * NodeLoaderLibrary::getInstance() { if(sSharedNodeLoaderLibrary == NULL) { sSharedNodeLoaderLibrary = new NodeLoaderLibrary(); @@ -90,7 +90,7 @@ NodeLoaderLibrary * NodeLoaderLibrary::sharedNodeLoaderLibrary() { return sSharedNodeLoaderLibrary; } -void NodeLoaderLibrary::purgeSharedNodeLoaderLibrary() { +void NodeLoaderLibrary::destroyInstance() { CC_SAFE_DELETE(sSharedNodeLoaderLibrary); } diff --git a/extensions/CCBReader/CCNodeLoaderLibrary.h b/extensions/CCBReader/CCNodeLoaderLibrary.h index 914cf99f33..9abd64b660 100644 --- a/extensions/CCBReader/CCNodeLoaderLibrary.h +++ b/extensions/CCBReader/CCNodeLoaderLibrary.h @@ -12,29 +12,39 @@ typedef std::map NodeLoaderMap; typedef std::pair NodeLoaderMapEntry; class NodeLoaderLibrary : public Object { - private: - NodeLoaderMap mNodeLoaders; +private: + NodeLoaderMap mNodeLoaders; - public: - CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(NodeLoaderLibrary, library); +public: + CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(NodeLoaderLibrary, library); - NodeLoaderLibrary(); - virtual ~NodeLoaderLibrary(); + NodeLoaderLibrary(); + virtual ~NodeLoaderLibrary(); - void registerDefaultNodeLoaders(); - void registerNodeLoader(const char * pClassName, NodeLoader * pNodeLoader); - //void registerNodeLoader(String * pClassName, NodeLoader * pNodeLoader); - void unregisterNodeLoader(const char * pClassName); - //void unregisterNodeLoader(String * pClassName); - NodeLoader * getNodeLoader(const char * pClassName); - //CCNodeLoader * getNodeLoader(String * pClassName); - void purge(bool pDelete); + void registerDefaultNodeLoaders(); + void registerNodeLoader(const char * pClassName, NodeLoader * pNodeLoader); + //void registerNodeLoader(String * pClassName, NodeLoader * pNodeLoader); + void unregisterNodeLoader(const char * pClassName); + //void unregisterNodeLoader(String * pClassName); + NodeLoader * getNodeLoader(const char * pClassName); + //CCNodeLoader * getNodeLoader(String * pClassName); + void purge(bool pDelete); - public: - static NodeLoaderLibrary * sharedNodeLoaderLibrary(); - static void purgeSharedNodeLoaderLibrary(); + CC_DEPRECATED_ATTRIBUTE void registerDefaultCCNodeLoaders() { registerDefaultNodeLoaders(); } + CC_DEPRECATED_ATTRIBUTE void registerCCNodeLoader(const char * pClassName, NodeLoader * pNodeLoader) { registerNodeLoader(pClassName, pNodeLoader); }; + CC_DEPRECATED_ATTRIBUTE void unregisterCCNodeLoader(const char * pClassName) { unregisterNodeLoader(pClassName); }; + CC_DEPRECATED_ATTRIBUTE NodeLoader * getCCNodeLoader(const char * pClassName) { return getNodeLoader(pClassName); }; + +public: + static NodeLoaderLibrary * getInstance(); + static void destroyInstance(); - static NodeLoaderLibrary * newDefaultNodeLoaderLibrary(); + static NodeLoaderLibrary * newDefaultNodeLoaderLibrary(); + + CC_DEPRECATED_ATTRIBUTE static NodeLoaderLibrary * sharedNodeLoaderLibrary() { return NodeLoaderLibrary::getInstance(); }; + CC_DEPRECATED_ATTRIBUTE static void purgeSharedNodeLoaderLibrary() { NodeLoaderLibrary::destroyInstance(); }; + + CC_DEPRECATED_ATTRIBUTE static NodeLoaderLibrary * newDefaultCCNodeLoaderLibrary() { return NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); }; }; NS_CC_EXT_END diff --git a/extensions/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h new file mode 100644 index 0000000000..8c93828447 --- /dev/null +++ b/extensions/CCDeprecated-ext.h @@ -0,0 +1,182 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +/** Add deprecated global functions and variables here + */ + +#ifndef COCOS2D_CCDEPRECATED_EXT_H__ +#define COCOS2D_CCDEPRECATED_EXT_H__ + +NS_CC_EXT_BEGIN + +CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; +CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; +CC_DEPRECATED_ATTRIBUTE typedef TableViewDelegate CCTableViewDelegate; +CC_DEPRECATED_ATTRIBUTE typedef TableViewDataSource CCTableViewDataSource; +CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; +CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; +CC_DEPRECATED_ATTRIBUTE typedef ScrollViewDelegate CCScrollViewDelegate; +CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; +CC_DEPRECATED_ATTRIBUTE typedef SortableObject CCSortableObject; +CC_DEPRECATED_ATTRIBUTE typedef ArrayForObjectSorting CCArrayForObjectSorting; +CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; +CC_DEPRECATED_ATTRIBUTE typedef EditBox CCEditBox; +CC_DEPRECATED_ATTRIBUTE typedef EditBoxDelegate CCEditBoxDelegate; + +CC_DEPRECATED_ATTRIBUTE typedef Color3bObject CCColor3bObject; +CC_DEPRECATED_ATTRIBUTE typedef ControlUtils CCControlUtils; +CC_DEPRECATED_ATTRIBUTE typedef Scale9Sprite CCScale9Sprite; +CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; +CC_DEPRECATED_ATTRIBUTE typedef ControlHuePicker CCControlHuePicker; +CC_DEPRECATED_ATTRIBUTE typedef Invocation CCInvocation; +CC_DEPRECATED_ATTRIBUTE typedef ControlSaturationBrightnessPicker CCControlSaturationBrightnessPicker; +CC_DEPRECATED_ATTRIBUTE typedef ControlStepper CCControlStepper; +CC_DEPRECATED_ATTRIBUTE typedef ControlPotentiometer CCControlPotentiometer; +CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; +CC_DEPRECATED_ATTRIBUTE typedef ControlSwitch CCControlSwitch; +CC_DEPRECATED_ATTRIBUTE typedef ControlButton CCControlButton; +CC_DEPRECATED_ATTRIBUTE typedef ControlSlider CCControlSlider; +CC_DEPRECATED_ATTRIBUTE typedef Control CCControl; +CC_DEPRECATED_ATTRIBUTE typedef ControlLoader CCControlLoader; +CC_DEPRECATED_ATTRIBUTE typedef ControlColourPicker CCControlColourPicker; + +CC_DEPRECATED_ATTRIBUTE typedef LabelBMFontLoader CCLabelBMFontLoader; +CC_DEPRECATED_ATTRIBUTE typedef ScrollViewLoader CCScrollViewLoader; +CC_DEPRECATED_ATTRIBUTE typedef SpriteLoader CCSpriteLoader; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoader CCNodeLoader; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderListener CCNodeLoaderListener; +CC_DEPRECATED_ATTRIBUTE typedef LayerLoader CCLayerLoader; +CC_DEPRECATED_ATTRIBUTE typedef MenuLoader CCMenuLoader; +CC_DEPRECATED_ATTRIBUTE typedef Color3BWapper CCColor3BWapper; +CC_DEPRECATED_ATTRIBUTE typedef ParticleSystemQuadLoader CCParticleSystemQuadLoader; +CC_DEPRECATED_ATTRIBUTE typedef MenuItemImageLoader CCMenuItemImageLoader; +CC_DEPRECATED_ATTRIBUTE typedef ControlButtonLoader CCControlButtonLoader; +CC_DEPRECATED_ATTRIBUTE typedef LayerGradientLoader CCLayerGradientLoader; +CC_DEPRECATED_ATTRIBUTE typedef Scale9SpriteLoader CCScale9SpriteLoader; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; +CC_DEPRECATED_ATTRIBUTE typedef MenuItemLoader CCMenuItemLoader; +CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader; +CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader; + + +#if CC_ENABLE_BOX2D_INTEGRATION || CC_ENABLE_CHIPMUNK_INTEGRATION +CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite; +CC_DEPRECATED_ATTRIBUTE typedef PhysicsDebugNode CCPhysicsDebugNode; +#endif + +CC_DEPRECATED_ATTRIBUTE typedef ComController CCComController; +CC_DEPRECATED_ATTRIBUTE typedef ComAttribute CCComAttribute; +CC_DEPRECATED_ATTRIBUTE typedef InputDelegate CCInputDelegate; +CC_DEPRECATED_ATTRIBUTE typedef ComAudio CCComAudio; + +CC_DEPRECATED_ATTRIBUTE typedef HttpClient CCHttpClient; +CC_DEPRECATED_ATTRIBUTE typedef HttpResponse CCHttpResponse; +CC_DEPRECATED_ATTRIBUTE typedef HttpRequest CCHttpRequest; +CC_DEPRECATED_ATTRIBUTE typedef Skin CCSkin; + +CC_DEPRECATED_ATTRIBUTE typedef AtlasFormat CCAtlasFormat; +CC_DEPRECATED_ATTRIBUTE typedef AtlasFilter CCAtlasFilter; +CC_DEPRECATED_ATTRIBUTE typedef AtlasWrap CCAtlasWrap; +CC_DEPRECATED_ATTRIBUTE typedef AtlasPage CCAtlasPage; +CC_DEPRECATED_ATTRIBUTE typedef AtlasRegion CCAtlasRegion; +CC_DEPRECATED_ATTRIBUTE typedef Atlas CCAtlas; +CC_DEPRECATED_ATTRIBUTE typedef AnimationStateData CCAnimationStateData; +CC_DEPRECATED_ATTRIBUTE typedef SlotData CCSlotData; +CC_DEPRECATED_ATTRIBUTE typedef AttachmentLoader CCAttachmentLoader; +CC_DEPRECATED_ATTRIBUTE typedef AnimationState CCAnimationState; +CC_DEPRECATED_ATTRIBUTE typedef SkeletonJson CCSkeletonJson; +CC_DEPRECATED_ATTRIBUTE typedef Timeline CCTimeline; +CC_DEPRECATED_ATTRIBUTE typedef CurveTimeline CCCurveTimeline; +CC_DEPRECATED_ATTRIBUTE typedef RotateTimeline CCRotateTimeline; +CC_DEPRECATED_ATTRIBUTE typedef TranslateTimeline CCTranslateTimeline; +CC_DEPRECATED_ATTRIBUTE typedef ScaleTimeline CCScaleTimeline; +CC_DEPRECATED_ATTRIBUTE typedef ColorTimeline CCColorTimeline; +CC_DEPRECATED_ATTRIBUTE typedef AttachmentTimeline CCAttachmentTimeline; +CC_DEPRECATED_ATTRIBUTE typedef AtlasAttachmentLoader CCAtlasAttachmentLoader; +CC_DEPRECATED_ATTRIBUTE typedef VertexIndex CCVertexIndex; +CC_DEPRECATED_ATTRIBUTE typedef RegionAttachment CCRegionAttachment; +CC_DEPRECATED_ATTRIBUTE typedef ScrollViewDirection CCScrollViewDirection; +CC_DEPRECATED_ATTRIBUTE typedef TableViewVerticalFillOrder CCTableViewVerticalFillOrder; +CC_DEPRECATED_ATTRIBUTE typedef ControlStepperPart CCControlStepperPart; +CC_DEPRECATED_ATTRIBUTE typedef ControlEvent CCControlEvent; +CC_DEPRECATED_ATTRIBUTE typedef ControlState CCControlState; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMap CCNodeLoaderMap; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMapEntry CCNodeLoaderMapEntry; +CC_DEPRECATED_ATTRIBUTE typedef EventRegistry CCEventRegistry; +CC_DEPRECATED_ATTRIBUTE typedef AttachmentType CCAttachmentType; + +#define kCCTableViewFillTopDown kTableViewFillTopDown +#define kCCTableViewFillBottomUp kTableViewFillBottomUp +#define kCCScrollViewDirectionNone kScrollViewDirectionNone +#define kCCScrollViewDirectionHorizontal kScrollViewDirectionHorizontal +#define kCCScrollViewDirectionVertical kScrollViewDirectionVertical +#define kCCScrollViewDirectionBoth kScrollViewDirectionBoth +#define kCCKeyboardReturnTypeDefault kKeyboardReturnTypeDefault +#define kCCKeyboardReturnTypeDone kKeyboardReturnTypeDone +#define kCCKeyboardReturnTypeSend kKeyboardReturnTypeSend +#define kCCKeyboardReturnTypeSearch kKeyboardReturnTypeSearch +#define kCCKeyboardReturnTypeGo kKeyboardReturnTypeGo + +#define kCCEditBoxInputModeAny kEditBoxInputModeAny +#define kCCEditBoxInputModeEmailAddr kEditBoxInputModeEmailAddr +#define kCCEditBoxInputModeNumeric kEditBoxInputModeNumeric +#define kCCEditBoxInputModePhoneNumber kEditBoxInputModePhoneNumber +#define kCCEditBoxInputModeUrl kEditBoxInputModeUrl +#define kCCEditBoxInputModeDecimal kEditBoxInputModeDecimal +#define kCCEditBoxInputModeSingleLine kEditBoxInputModeSingleLine + +#define kCCControlStepperPartMinus kControlStepperPartMinus +#define kCCControlStepperPartPlus kControlStepperPartPlus +#define kCCControlStepperPartNone kControlStepperPartNone + +#define CCControlEventTouchDown ControlEventTouchDown +#define CCControlEventTouchDragInside ControlEventTouchDragInside +#define CCControlEventTouchDragOutside ControlEventTouchDragOutside +#define CCControlEventTouchDragEnter ControlEventTouchDragEnter +#define CCControlEventTouchDragExit ControlEventTouchDragExit +#define CCControlEventTouchUpInside ControlEventTouchUpInside +#define CCControlEventTouchUpOutside ControlEventTouchUpOutside +#define CCControlEventTouchCancel ControlEventTouchCancel +#define CCControlEventValueChanged ControlEventValueChanged + +#define CCControlStateNormal ControlStateNormal +#define CCControlStateHighlighted ControlStateHighlighted +#define CCControlStateDisabled ControlStateDisabled +#define CCControlStateSelected ControlStateSelected + +#define kCCCreateFile kCreateFile +#define kCCNetwork kNetwork +#define kCCNoNewVersion kNoNewVersion +#define kCCUncompress kUncompress + +#define kCCHttpGet kHttpGet +#define kCCHttpPut kHttpPut +#define kCCHttpPost kHttpPost +#define kCCHttpDelete kHttpDelete +#define kCCHttpUnkown kHttpUnkown + +NS_CC_EXT_END + +#endif // COCOS2D_CCDEPRECATED_EXT_H__ diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 13e1c33e97..716f269065 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -39,17 +39,21 @@ #include "network/HttpRequest.h" #include "network/HttpResponse.h" #include "network/HttpClient.h" +#include "network/WebSocket.h" +#include "network/SocketIO.h" // Physics integration #if CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION #include "physics_nodes/CCPhysicsDebugNode.h" #include "physics_nodes/CCPhysicsSprite.h" #endif - + #include "spine/spine-cocos2dx.h" #include "Components/CCComAttribute.h" #include "Components/CCComAudio.h" #include "Components/CCComController.h" +#include "CCDeprecated-ext.h" + #endif /* __COCOS2D_EXT_H__ */ diff --git a/extensions/network/WebSocket.cpp b/extensions/network/WebSocket.cpp index b979776da6..b55d2b34cc 100644 --- a/extensions/network/WebSocket.cpp +++ b/extensions/network/WebSocket.cpp @@ -28,12 +28,15 @@ ****************************************************************************/ #include "WebSocket.h" + #include #include #include #include #include +#include "libwebsockets.h" + NS_CC_EXT_BEGIN class WsMessage @@ -444,7 +447,7 @@ void WebSocket::onSubThreadEnded() int WebSocket::onSocketCallback(struct libwebsocket_context *ctx, struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, + int reason, void *user, void *in, size_t len) { //CCLOG("socket callback for %d reason", reason); diff --git a/extensions/network/WebSocket.h b/extensions/network/WebSocket.h index 1dc262077b..d27afe7736 100644 --- a/extensions/network/WebSocket.h +++ b/extensions/network/WebSocket.h @@ -32,9 +32,12 @@ #include "ExtensionMacros.h" #include "cocos2d.h" -#include "libwebsockets.h" #include +struct libwebsocket; +struct libwebsocket_context; +struct libwebsocket_protocols; + NS_CC_EXT_BEGIN class WsThreadHelper; @@ -132,7 +135,7 @@ private: friend class WebSocketCallbackWrapper; int onSocketCallback(struct libwebsocket_context *ctx, struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, + int reason, void *user, void *in, size_t len); private: diff --git a/plugin/plugins/qh360/proj.android/ForManifest.xml b/plugin/plugins/qh360/proj.android/ForManifest.xml index d7f0c9bc34..a9d5ffdec2 100644 --- a/plugin/plugins/qh360/proj.android/ForManifest.xml +++ b/plugin/plugins/qh360/proj.android/ForManifest.xml @@ -16,6 +16,7 @@ +  diff --git a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java index 949069f1f0..df989be1ef 100644 --- a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java +++ b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java @@ -181,15 +181,15 @@ public class IAPOnlineQH360 implements InterfaceIAP { // optional params : ext, app order id, pay type String ext1 = pInfo.get("QHExtra1"); - if (null == ext1 && ! TextUtils.isEmpty(ext1)) { + if (null != ext1 && ! TextUtils.isEmpty(ext1)) { bundle.putString(ProtocolKeys.APP_EXT_1, ext1); } String ext2 = pInfo.get("QHExtra2"); - if (null == ext2 && ! TextUtils.isEmpty(ext2)) { + if (null != ext2 && ! TextUtils.isEmpty(ext2)) { bundle.putString(ProtocolKeys.APP_EXT_2, ext2); } String appOrderId = pInfo.get("QHAppOrderID"); - if (null == appOrderId && ! TextUtils.isEmpty(appOrderId)) { + if (null != appOrderId && ! TextUtils.isEmpty(appOrderId)) { bundle.putString(ProtocolKeys.APP_ORDER_ID, appOrderId); } diff --git a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java index 6f2365b975..2181036f02 100644 --- a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java +++ b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java @@ -63,13 +63,13 @@ public class QH360Wrapper { Configuration config = ctx.getResources().getConfiguration(); int orientation = config.orientation; - if (orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || - orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + if (orientation != Configuration.ORIENTATION_LANDSCAPE && + orientation != Configuration.ORIENTATION_PORTRAIT) { - orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + orientation = Configuration.ORIENTATION_PORTRAIT; } - return (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + return (orientation == Configuration.ORIENTATION_LANDSCAPE); } private static boolean mLogined = false; diff --git a/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java b/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java index a519688b3f..f6b011d501 100644 --- a/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java +++ b/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java @@ -109,13 +109,13 @@ public class UCWrapper { Configuration config = ctx.getResources().getConfiguration(); int orientation = config.orientation; - if (orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || - orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + if (orientation != Configuration.ORIENTATION_LANDSCAPE && + orientation != Configuration.ORIENTATION_PORTRAIT) { - orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + orientation = Configuration.ORIENTATION_PORTRAIT; } - return (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + return (orientation == Configuration.ORIENTATION_LANDSCAPE); } public static String getSDKVersion() { diff --git a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp index eac0c327f0..45a6459071 100644 --- a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp @@ -89,8 +89,8 @@ bool TestAds::init() Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); - Point posMid = ccp(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2); - Point posBR = ccp(origin.x + visibleSize.width, origin.y); + Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2); + Point posBR = Point(origin.x + visibleSize.width, origin.y); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -99,7 +99,7 @@ bool TestAds::init() // add a "close" icon to exit the progress. it's an autorelease object MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestAds::menuBackCallback, this)); Size backSize = pBackItem->getContentSize(); - pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2))); + pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2)); // create menu, it's an autorelease object Menu* pMenu = Menu::create(pBackItem, NULL); @@ -107,15 +107,15 @@ bool TestAds::init() LabelTTF* label1 = LabelTTF::create("ShowAds", "Arial", 24); MenuItemLabel* pItemShow = MenuItemLabel::create(label1, CC_CALLBACK_1(TestAds::testShow, this)); - pItemShow->setAnchorPoint(ccp(0.5f, 0)); + pItemShow->setAnchorPoint(Point(0.5f, 0)); pMenu->addChild(pItemShow, 0); - pItemShow->setPosition(ccpAdd(posMid, ccp(-100, -120))); + pItemShow->setPosition(posMid + Point(-100, -120)); LabelTTF* label2 = LabelTTF::create("HideAds", "Arial", 24); MenuItemLabel* pItemHide = MenuItemLabel::create(label2, CC_CALLBACK_1(TestAds::testHide, this)); - pItemHide->setAnchorPoint(ccp(0.5f, 0)); + pItemHide->setAnchorPoint(Point(0.5f, 0)); pMenu->addChild(pItemHide, 0); - pItemHide->setPosition(ccpAdd(posMid, ccp(100, -120))); + pItemHide->setPosition(posMid + Point(100, -120)); // create optional menu // cases item @@ -127,7 +127,7 @@ bool TestAds::init() { _caseItem->getSubItems()->addObject( MenuItemFont::create( s_aTestCases[i].c_str() ) ); } - _caseItem->setPosition(ccpAdd(posMid, ccp(-200, 120))); + _caseItem->setPosition(posMid + Point(-200, 120)); pMenu->addChild(_caseItem); // type item @@ -139,7 +139,7 @@ bool TestAds::init() { _typeItem->getSubItems()->addObject( MenuItemFont::create( s_aTestTypes[i].c_str() ) ); } - _typeItem->setPosition(ccpAdd(posMid, ccp(0, 120))); + _typeItem->setPosition(posMid + Point(0, 120)); pMenu->addChild(_typeItem); // poses item @@ -151,7 +151,7 @@ bool TestAds::init() { _posItem->getSubItems()->addObject( MenuItemFont::create( s_aTestPoses[i].c_str() ) ); } - _posItem->setPosition(ccpAdd(posMid, ccp(200, 120))); + _posItem->setPosition(posMid + Point(200, 120)); pMenu->addChild(_posItem); // init options diff --git a/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp b/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp index a27c210b85..a0f110307b 100644 --- a/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp @@ -89,7 +89,7 @@ bool TestAnalytics::init() Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); - Point posBR = ccp(origin.x + visibleSize.width, origin.y); + Point posBR = Point(origin.x + visibleSize.width, origin.y); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -98,7 +98,7 @@ bool TestAnalytics::init() // add a "close" icon to exit the progress. it's an autorelease object MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestAnalytics::menuBackCallback, this)); Size backSize = pBackItem->getContentSize(); - pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2))); + pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2)); // create menu, it's an autorelease object Menu* pMenu = Menu::create(pBackItem, NULL); @@ -111,15 +111,15 @@ bool TestAnalytics::init() MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(TestAnalytics::eventMenuCallback, this)); pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag); yPos = visibleSize.height - 35*i - 100; - pMenuItem->setPosition( ccp(visibleSize.width / 2, yPos)); + pMenuItem->setPosition( Point(visibleSize.width / 2, yPos)); } std::string strName = _pluginAnalytics->getPluginName(); std::string strVer = _pluginAnalytics->getSDKVersion(); char ret[256] = { 0 }; sprintf(ret, "Plugin : %s, Ver : %s", strName.c_str(), strVer.c_str()); - LabelTTF* pLabel = LabelTTF::create(ret, "Arial", 18, CCSizeMake(visibleSize.width, 0), kTextAlignmentCenter); - pLabel->setPosition(ccp(visibleSize.width / 2, yPos - 80)); + LabelTTF* pLabel = LabelTTF::create(ret, "Arial", 18, Point(visibleSize.width, 0), kTextAlignmentCenter); + pLabel->setPosition(Point(visibleSize.width / 2, yPos - 80)); addChild(pLabel); return true; diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp index 0ad6da036c..02dcdb51e7 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp @@ -48,7 +48,7 @@ MyPurchase::~MyPurchase() } } -MyPurchase* MyPurchase::sharedPurchase() +MyPurchase* MyPurchase::getInstance() { if (s_pPurchase == NULL) { s_pPurchase = new MyPurchase(); diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h index a5d2048864..8a52fbe19d 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h +++ b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h @@ -35,7 +35,7 @@ public: class MyPurchase { public: - static MyPurchase* sharedPurchase(); + static MyPurchase* getInstance(); static void purgePurchase(); typedef enum { diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp b/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp index 4d195d2952..217efd6b25 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp @@ -70,28 +70,28 @@ bool TestIAP::init() return false; } - MyPurchase::sharedPurchase()->loadIAPPlugin(); + MyPurchase::getInstance()->loadIAPPlugin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program // you may modify it. EGLView* pEGLView = EGLView::getInstance(); - Point posBR = ccp(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y); - Point posTL = ccp(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height); + Point posBR = Point(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y); + Point posTL = Point(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height); // add a "close" icon to exit the progress. it's an autorelease object MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestIAP::menuBackCallback, this)); Size backSize = pBackItem->getContentSize(); - pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2))); + pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2)); // create menu, it's an autorelease object Menu* pMenu = Menu::create(pBackItem, NULL); pMenu->setPosition( Point::ZERO ); this->addChild(pMenu, 1); - Point posStep = ccp(220, -150); - Point beginPos = ccpAdd(posTL, ccpMult(posStep, 0.5f)); + Point posStep = Point(220, -150); + Point beginPos = posTL + (posStep * 0.5f); int line = 0; int row = 0; for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) { @@ -99,13 +99,13 @@ bool TestIAP::init() CC_CALLBACK_1(TestIAP::eventMenuCallback, this)); pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag); - Point pos = ccpAdd(beginPos, ccp(posStep.x * row, posStep.y * line)); + Point pos = beginPos + Point(posStep.x * row, posStep.y * line); Size itemSize = pMenuItem->getContentSize(); if ((pos.x + itemSize.width / 2) > posBR.x) { line += 1; row = 0; - pos = ccpAdd(beginPos, ccp(posStep.x * row, posStep.y * line)); + pos = beginPos + Point(posStep.x * row, posStep.y * line); } row += 1; pMenuItem->setPosition(pos); @@ -123,7 +123,7 @@ void TestIAP::eventMenuCallback(Object* pSender) pInfo["productPrice"] = "0.01"; pInfo["productDesc"] = "100个金灿灿的游戏币哦"; pInfo["Nd91ProductId"] = "685994"; - MyPurchase::sharedPurchase()->payByMode(pInfo, mode); + MyPurchase::getInstance()->payByMode(pInfo, mode); } void TestIAP::menuBackCallback(Object* pSender) diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp index 50551fda78..83da784f39 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp @@ -49,7 +49,7 @@ MyIAPOLManager::~MyIAPOLManager() } } -MyIAPOLManager* MyIAPOLManager::sharedManager() +MyIAPOLManager* MyIAPOLManager::getInstance() { if (s_pIAPOnline == NULL) { s_pIAPOnline = new MyIAPOLManager(); diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h index b508cef1cf..f64749b01f 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h +++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h @@ -36,7 +36,7 @@ public: class MyIAPOLManager { public: - static MyIAPOLManager* sharedManager(); + static MyIAPOLManager* getInstance(); static void purge(); typedef enum { diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp index e8d59f9953..6d2315b64a 100644 --- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp @@ -74,7 +74,7 @@ bool TestIAPOnline::init() return false; } - MyIAPOLManager::sharedManager()->loadPlugins(); + MyIAPOLManager::getInstance()->loadPlugins(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -153,7 +153,7 @@ void TestIAPOnline::eventMenuCallback(Object* pSender) // pInfo["QHAppOrderID"] = "Order ID in game"; // The order ID in game (Game defined this) } - MyIAPOLManager::sharedManager()->payByMode(pInfo, mode); + MyIAPOLManager::getInstance()->payByMode(pInfo, mode); } void TestIAPOnline::menuBackCallback(Object* pSender) diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp index 97f6d34174..11cd6a70aa 100644 --- a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp @@ -48,7 +48,7 @@ MyShareManager::~MyShareManager() } } -MyShareManager* MyShareManager::sharedManager() +MyShareManager* MyShareManager::getInstance() { if (s_pManager == NULL) { s_pManager = new MyShareManager(); diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h index 4521a57b6c..cd8202f3a3 100755 --- a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h +++ b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h @@ -35,7 +35,7 @@ public: class MyShareManager { public: - static MyShareManager* sharedManager(); + static MyShareManager* getInstance(); static void purgeManager(); typedef enum { diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp b/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp index 1be29f9439..cf2a308f2c 100644 --- a/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp @@ -70,7 +70,7 @@ bool TestShare::init() return false; } - MyShareManager::sharedManager()->loadSharePlugin(); + MyShareManager::getInstance()->loadSharePlugin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -120,7 +120,7 @@ void TestShare::eventMenuCallback(Object* pSender) pInfo["SharedText"] = "Share message : HelloShare!"; // pInfo["SharedImagePath"] = "Full/path/to/image"; MyShareManager::MyShareMode mode = (MyShareManager::MyShareMode) (pMenuItem->getTag() - TAG_SHARE_BY_TWWITER + 1); - MyShareManager::sharedManager()->shareByMode(pInfo, mode); + MyShareManager::getInstance()->shareByMode(pInfo, mode); } void TestShare::menuBackCallback(Object* pSender) diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp index 97ed27f872..21d790296a 100644 --- a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp @@ -41,7 +41,7 @@ MySocialManager::~MySocialManager() unloadPlugins(); } -MySocialManager* MySocialManager::sharedManager() +MySocialManager* MySocialManager::getInstance() { if (s_pManager == NULL) { s_pManager = new MySocialManager(); diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h index 69cfee5bba..4df5026163 100755 --- a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h +++ b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h @@ -29,7 +29,7 @@ THE SOFTWARE. class MySocialManager : public cocos2d::plugin::SocialListener { public: - static MySocialManager* sharedManager(); + static MySocialManager* getInstance(); static void purgeManager(); typedef enum { diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp b/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp index 2415ca6dd9..a8f1c7e9e3 100644 --- a/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp @@ -59,7 +59,7 @@ bool TestSocial::init() return false; } - MySocialManager::sharedManager()->loadPlugins(); + MySocialManager::getInstance()->loadPlugins(); Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); @@ -119,7 +119,7 @@ bool TestSocial::init() void TestSocial::testSubmit(Object* pSender) { int nIdx = _caseItem->getSelectedIndex(); - MySocialManager::sharedManager()->submitScore((MySocialManager::MySocialMode)(nIdx + 1), "0", 30000); + MySocialManager::getInstance()->submitScore((MySocialManager::MySocialMode)(nIdx + 1), "0", 30000); } void TestSocial::testUnlock(Object* pSender) @@ -129,19 +129,19 @@ void TestSocial::testUnlock(Object* pSender) info["AchievementID"] = "MyAchiID"; info["NDDisplayText"] = "Fighter"; info["NDScore"] = "100"; - MySocialManager::sharedManager()->unlockAchievement((MySocialManager::MySocialMode)(nIdx + 1), info); + MySocialManager::getInstance()->unlockAchievement((MySocialManager::MySocialMode)(nIdx + 1), info); } void TestSocial::testLeaderboard(Object* pSender) { int nIdx = _caseItem->getSelectedIndex(); - MySocialManager::sharedManager()->showLeaderboard((MySocialManager::MySocialMode)(nIdx + 1), "0"); + MySocialManager::getInstance()->showLeaderboard((MySocialManager::MySocialMode)(nIdx + 1), "0"); } void TestSocial::testAchievement(Object* pSender) { int nIdx = _caseItem->getSelectedIndex(); - MySocialManager::sharedManager()->showAchievement((MySocialManager::MySocialMode)(nIdx + 1)); + MySocialManager::getInstance()->showAchievement((MySocialManager::MySocialMode)(nIdx + 1)); } void TestSocial::menuBackCallback(Object* pSender) diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp index 8a8836b75f..456b525969 100644 --- a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp @@ -49,7 +49,7 @@ MyUserManager::~MyUserManager() } } -MyUserManager* MyUserManager::sharedManager() +MyUserManager* MyUserManager::getInstance() { if (s_pManager == NULL) { s_pManager = new MyUserManager(); diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h index 721367661d..83ad696372 100755 --- a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h +++ b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h @@ -36,7 +36,7 @@ public: class MyUserManager { public: - static MyUserManager* sharedManager(); + static MyUserManager* getInstance(); static void purgeManager(); typedef enum { diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp b/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp index 20aa643c1a..aebb5d2e0a 100644 --- a/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp +++ b/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp @@ -60,7 +60,7 @@ bool TestUser::init() return false; } - MyUserManager::sharedManager()->loadPlugin(); + MyUserManager::getInstance()->loadPlugin(); Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2); @@ -117,12 +117,12 @@ void TestUser::caseChanged(Object* pSender) void TestUser::testLogin(Object* pSender) { - MyUserManager::sharedManager()->loginByMode((MyUserManager::MyUserMode) (_selectedCase + 1)); + MyUserManager::getInstance()->loginByMode((MyUserManager::MyUserMode) (_selectedCase + 1)); } void TestUser::testLogout(Object* pSender) { - MyUserManager::sharedManager()->logoutByMode((MyUserManager::MyUserMode) (_selectedCase + 1)); + MyUserManager::getInstance()->logoutByMode((MyUserManager::MyUserMode) (_selectedCase + 1)); } void TestUser::menuBackCallback(Object* pSender) diff --git a/samples/Cpp/HelloCpp/proj.emscripten/Makefile b/samples/Cpp/HelloCpp/proj.emscripten/Makefile index 9e47a17ce9..56bb3d7df1 100644 --- a/samples/Cpp/HelloCpp/proj.emscripten/Makefile +++ b/samples/Cpp/HelloCpp/proj.emscripten/Makefile @@ -26,9 +26,9 @@ $(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) ifeq ($(shell uname -s),Darwin) -ARIEL_TTF := /Library/Fonts/Arial.ttf +ARIAL_TTF := /Library/Fonts/Arial.ttf else -ARIEL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf +ARIAL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf endif $(TARGET).data: @@ -39,15 +39,16 @@ $(TARGET).data: (cd $(RESOURCE_PATH) && cp -a $(RESOURCES) $(RESTMP)) (cd $(FONT_PATH) && cp -a * $(RESTMP)/fonts) # NOTE: we copy the system arial.ttf so that there is always a fallback. - cp $(ARIEL_TTF) $(RESTMP)/fonts/arial.ttf + cp $(ARIAL_TTF) $(RESTMP)/fonts/arial.ttf (cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(RESOURCES)) --preload fonts --pre-run > $(EXECUTABLE).data.js) mv $(RESTMP)/$(EXECUTABLE).data $@ mv $(RESTMP)/$(EXECUTABLE).data.js $@.js rm -rf $(RESTMP) -$(BIN_DIR)/index.html: index.html +$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) @mkdir -p $(@D) - cp index.html $(@D) + @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) + @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) $(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) diff --git a/samples/Cpp/HelloCpp/proj.emscripten/index.html b/samples/Cpp/HelloCpp/proj.emscripten/index.html deleted file mode 100644 index b8befe726a..0000000000 --- a/samples/Cpp/HelloCpp/proj.emscripten/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - Emscripten-Generated Code - - - -
-
Downloading...
-
- -
-
- -
-
-
- Resize canvas - Lock/hide mouse pointer -     - -
- -
- -
- - - - - diff --git a/samples/Cpp/SimpleGame/proj.emscripten/Makefile b/samples/Cpp/SimpleGame/proj.emscripten/Makefile index 39559056f2..cc538b4d65 100644 --- a/samples/Cpp/SimpleGame/proj.emscripten/Makefile +++ b/samples/Cpp/SimpleGame/proj.emscripten/Makefile @@ -57,9 +57,10 @@ $(TARGET).data: mv $(RESTMP)/$(EXECUTABLE).data.js $@.js rm -rf $(RESTMP) -$(BIN_DIR)/index.html: index.html +$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) @mkdir -p $(@D) - cp index.html $(@D) + @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) + @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) $(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) diff --git a/samples/Cpp/SimpleGame/proj.emscripten/index.html b/samples/Cpp/SimpleGame/proj.emscripten/index.html deleted file mode 100644 index a78af31af6..0000000000 --- a/samples/Cpp/SimpleGame/proj.emscripten/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - SimpleGame - - - -
-
Downloading...
-
- -
-
- -
-
-
- Resize canvas - Lock/hide mouse pointer -     - -
- -
- -
- - - - - diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp index aefc75f099..a57d3020ee 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp @@ -12,12 +12,12 @@ AnimationsTestLayer::~AnimationsTestLayer() CC_SAFE_RELEASE_NULL(mAnimationManager); } -SEL_MenuHandler AnimationsTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) +SEL_MenuHandler AnimationsTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { return NULL; } -SEL_CCControlHandler AnimationsTestLayer::onResolveCCBControlSelector(Object *pTarget, const char*pSelectorName) { +SEL_CCControlHandler AnimationsTestLayer::onResolveCCBCCControlSelector(Object *pTarget, const char*pSelectorName) { CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonIdleClicked", AnimationsTestLayer::onControlButtonIdleClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonWaveClicked", AnimationsTestLayer::onControlButtonWaveClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonJumpClicked", AnimationsTestLayer::onControlButtonJumpClicked); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index b92d1192fb..16dce83727 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -15,8 +15,8 @@ public: AnimationsTestLayer(); virtual ~AnimationsTestLayer(); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); void onControlButtonIdleClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp index 0b3924e655..ca907cb4ca 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp @@ -12,11 +12,11 @@ ButtonTestLayer::~ButtonTestLayer() CC_SAFE_RELEASE(mControlEventLabel); } -SEL_MenuHandler ButtonTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) { +SEL_MenuHandler ButtonTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { return NULL; } -SEL_CCControlHandler ButtonTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) { +SEL_CCControlHandler ButtonTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonClicked", ButtonTestLayer::onControlButtonClicked); return NULL; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index a8d9c06c86..8f7a3f8a25 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -15,8 +15,8 @@ public: ButtonTestLayer(); virtual ~ButtonTestLayer(); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); void onControlButtonClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 1458d1b5d2..89c5603de0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -68,11 +68,11 @@ void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extens } -SEL_MenuHandler HelloCocosBuilderLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) { +SEL_MenuHandler HelloCocosBuilderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { return NULL; } -SEL_CCControlHandler HelloCocosBuilderLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) { +SEL_CCControlHandler HelloCocosBuilderLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onMenuTestClicked", HelloCocosBuilderLayer::onMenuTestClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onSpriteTestClicked", HelloCocosBuilderLayer::onSpriteTestClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onButtonTestClicked", HelloCocosBuilderLayer::onButtonTestClicked); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index 267a9adad8..55e4d44845 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -28,8 +28,8 @@ class HelloCocosBuilderLayer void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocos2d::extension::NodeLoader * nodeLoader = NULL); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue); virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp index 3d42048cf0..36bcf964e9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp @@ -12,7 +12,7 @@ MenuTestLayer::~MenuTestLayer() CC_SAFE_RELEASE(mMenuItemStatusLabelBMFont); } -SEL_MenuHandler MenuTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) { +SEL_MenuHandler MenuTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemAClicked", MenuTestLayer::onMenuItemAClicked); CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemBClicked", MenuTestLayer::onMenuItemBClicked); CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemCClicked", MenuTestLayer::onMenuItemCClicked); @@ -20,7 +20,7 @@ SEL_MenuHandler MenuTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, co return NULL; } -SEL_CCControlHandler MenuTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) { +SEL_CCControlHandler MenuTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { return NULL; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index 95f3994f59..ba16fbd725 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -15,8 +15,8 @@ class MenuTestLayer MenuTestLayer(); virtual ~MenuTestLayer(); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); void onMenuItemAClicked(cocos2d::Object * pSender); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp index 7de128ab96..6129a5faa8 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp @@ -3,13 +3,13 @@ USING_NS_CC; USING_NS_CC_EXT; -SEL_MenuHandler TestHeaderLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) { +SEL_MenuHandler TestHeaderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onBackClicked", TestHeaderLayer::onBackClicked); return NULL; } -SEL_CCControlHandler TestHeaderLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) { +SEL_CCControlHandler TestHeaderLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { return NULL; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index 40a020bc6e..ddefc46ed3 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -12,8 +12,8 @@ class TestHeaderLayer public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TestHeaderLayer, create); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); void onBackClicked(cocos2d::Object * pSender); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp index 37ed182c6e..fecb8219da 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp @@ -14,11 +14,11 @@ TimelineCallbackTestLayer::~TimelineCallbackTestLayer() CocosDenshion::SimpleAudioEngine::end(); } -SEL_MenuHandler TimelineCallbackTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) { +SEL_MenuHandler TimelineCallbackTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { return NULL; } -SEL_CCControlHandler TimelineCallbackTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) { +SEL_CCControlHandler TimelineCallbackTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { return NULL; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index d9b045fb16..37059f41f9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -15,8 +15,8 @@ class TimelineCallbackTestLayer TimelineCallbackTestLayer(); virtual ~TimelineCallbackTestLayer(); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual cocos2d::SEL_CallFuncN onResolveCCBCallFuncSelector(Object * pTarget, const char* pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp index 8b3ba010ff..2c62142516 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp @@ -35,17 +35,18 @@ void EnemyController::onEnter() // Determine speed of the target - int minDuration = (int)2.0; - int maxDuration = (int)4.0; + int minDuration = 2; + int maxDuration = 4; int rangeDuration = maxDuration - minDuration; // srand( TimGetTicks() ); int actualDuration = ( rand() % rangeDuration ) + minDuration; // Create the actions - FiniteTimeAction* actionMove = MoveTo::create( (float)actualDuration, + FiniteTimeAction* actionMove = MoveTo::create( actualDuration, Point(0 - getOwner()->getContentSize().width/2, actualY) ); - FiniteTimeAction* actionMoveDone = CallFuncN::create(getOwner()->getParent()->getComponent("SceneController"), - callfuncN_selector(SceneController::spriteMoveFinished)); + FiniteTimeAction* actionMoveDone = CallFuncN::create( + CC_CALLBACK_1(SceneController::spriteMoveFinished, static_cast( getOwner()->getParent()->getComponent("SceneController") ))); + _owner->runAction( Sequence::create(actionMove, actionMoveDone, NULL) ); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp index 3a3995f430..61fe94b312 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp @@ -93,6 +93,10 @@ ProjectileController* ProjectileController::create(void) return pRet; } +void freeFunction( Node *ignore ) +{ + log("hello"); +} void ProjectileController::move(float flocationX, float flocationY) { @@ -121,19 +125,25 @@ void ProjectileController::move(float flocationX, float flocationY) float velocity = 480/1; // 480pixels/1sec float realMoveDuration = length/velocity; - // Move projectile to actual endpoint - _owner->runAction( Sequence::create( - MoveTo::create(realMoveDuration, realDest), - CallFuncN::create(getOwner()->getParent()->getComponent("SceneController"), - callfuncN_selector(SceneController::spriteMoveFinished)), - NULL) ); + auto callfunc = CallFuncN::create( + CC_CALLBACK_1( + SceneController::spriteMoveFinished, + static_cast( getOwner()->getParent()->getComponent("SceneController") + ) ) ); + // Move projectile to actual endpoint + _owner->runAction( + Sequence::create( + MoveTo::create(realMoveDuration, realDest), + callfunc, + NULL) + ); } void ProjectileController::die() { Component *com = _owner->getParent()->getComponent("SceneController"); - cocos2d::Array *_projectiles = ((SceneController*)com)->getProjectiles(); + cocos2d::Array *_projectiles = static_cast(com)->getProjectiles(); _projectiles->removeObject(_owner); _owner->removeFromParentAndCleanup(true); } diff --git a/samples/Cpp/TestCpp/proj.emscripten/Makefile b/samples/Cpp/TestCpp/proj.emscripten/Makefile index 6f069f65bd..7673cd7ee5 100644 --- a/samples/Cpp/TestCpp/proj.emscripten/Makefile +++ b/samples/Cpp/TestCpp/proj.emscripten/Makefile @@ -143,9 +143,10 @@ $(TARGET).data: $(CORE_MAKEFILE_LIST) $(patsubst %,$(RESOURCE_PATH)/%,$(RESOURCE cp -av $(RESOURCE_PATH)/* $(shell dirname $@) rm -rf $(RESTMP) -$(BIN_DIR)/index.html: index.html $(CORE_MAKEFILE_LIST) +$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE) $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) - cp index.html $(@D) + @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR) + @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE) ####### Compile $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/scripting/javascript/bindings/js_bindings_ccbreader.cpp index a299746539..19642aa54d 100644 --- a/scripting/javascript/bindings/js_bindings_ccbreader.cpp +++ b/scripting/javascript/bindings/js_bindings_ccbreader.cpp @@ -22,14 +22,14 @@ static void removeSelector(std::string &str) { } } -SEL_MenuHandler CCBScriptCallbackProxy::onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, +SEL_MenuHandler CCBScriptCallbackProxy::onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName) { this->callBackProp = pSelectorName; removeSelector(this->callBackProp); return menu_selector(CCBScriptCallbackProxy::menuItemCallback); } -SEL_CCControlHandler CCBScriptCallbackProxy::onResolveCCBControlSelector(Object * pTarget, +SEL_CCControlHandler CCBScriptCallbackProxy::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) { this->callBackProp = pSelectorName; diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.h b/scripting/javascript/bindings/js_bindings_ccbreader.h index 77e77eb813..ff4b241619 100644 --- a/scripting/javascript/bindings/js_bindings_ccbreader.h +++ b/scripting/javascript/bindings/js_bindings_ccbreader.h @@ -27,10 +27,10 @@ public: virtual ~CCBScriptCallbackProxy() {} CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(CCBScriptCallbackProxy, create); - virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, + virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * pNode); diff --git a/samples/Cpp/TestCpp/proj.emscripten/index.html b/tools/emscripten-template/index.html similarity index 95% rename from samples/Cpp/TestCpp/proj.emscripten/index.html rename to tools/emscripten-template/index.html index d1c4c339e0..c8ddb500e0 100644 --- a/samples/Cpp/TestCpp/proj.emscripten/index.html +++ b/tools/emscripten-template/index.html @@ -3,7 +3,7 @@ - TestCpp + JS_APPLICATION