From 36065400bcd4acc11452ac39ee0d729449e4cd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 22 Jul 2013 14:47:32 +0200 Subject: [PATCH 01/28] Created CCDeprecated-ext --- extensions/CCDeprecated-ext.h | 349 ++++++++++++++++++++++++++++++++++ extensions/cocos-ext.h | 18 +- 2 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 extensions/CCDeprecated-ext.h diff --git a/extensions/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h new file mode 100644 index 0000000000..a98fb02f76 --- /dev/null +++ b/extensions/CCDeprecated-ext.h @@ -0,0 +1,349 @@ +/**************************************************************************** + 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 SkeletonAnimation CCSkeletonAnimation; +CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView ; + +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 EditBoxImpl CCEditBoxImpl ; +CC_DEPRECATED_ATTRIBUTE typedef EditBoxDelegate CCEditBoxDelegate ; + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplWin CCEditBoxImplWin ; +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) +CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplTizen CCEditBoxImplTizen ; +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplMac CCEditBoxImplMac ; +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplIOS CCEditBoxImplIOS ; +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplAndroid CCEditBoxImplAndroid ; +#endif + +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 LabelBMFontLoader CCLabelBMFontLoader ; +//CC_DEPRECATED_ATTRIBUTE typedef BMemberVariableAssigner CCBMemberVariableAssigner ; +//CC_DEPRECATED_ATTRIBUTE typedef BSequence CCBSequence ; +//CC_DEPRECATED_ATTRIBUTE typedef BFileLoader CCBFileLoader ; +//CC_DEPRECATED_ATTRIBUTE typedef BReader CCBReader ; +//CC_DEPRECATED_ATTRIBUTE typedef BAnimationManagerDelegate CCBAnimationManagerDelegate ; +//CC_DEPRECATED_ATTRIBUTE typedef BAnimationManager CCBAnimationManager ; +//CC_DEPRECATED_ATTRIBUTE typedef BSetSpriteFrame CCBSetSpriteFrame ; +//CC_DEPRECATED_ATTRIBUTE typedef BSoundEffect CCBSoundEffect ; +//CC_DEPRECATED_ATTRIBUTE typedef BRotateTo CCBRotateTo ; +//CC_DEPRECATED_ATTRIBUTE typedef BRotateXTo CCBRotateXTo ; +//CC_DEPRECATED_ATTRIBUTE typedef BRotateYTo CCBRotateYTo ; +//CC_DEPRECATED_ATTRIBUTE typedef BEaseInstant CCBEaseInstant ; +CC_DEPRECATED_ATTRIBUTE typedef ScrollViewLoader CCScrollViewLoader ; +//CC_DEPRECATED_ATTRIBUTE typedef BKeyframe CCBKeyframe ; +CC_DEPRECATED_ATTRIBUTE typedef SpriteLoader CCSpriteLoader ; +//CC_DEPRECATED_ATTRIBUTE typedef BFile CCBFile ; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoader CCNodeLoader ; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary ; +CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderListener CCNodeLoaderListener ; +//CC_DEPRECATED_ATTRIBUTE typedef BMemberVariableAssigner CCBMemberVariableAssigner ; +//CC_DEPRECATED_ATTRIBUTE typedef BSelectorResolver CCBSelectorResolver ; +//CC_DEPRECATED_ATTRIBUTE typedef BAnimationManager CCBAnimationManager ; +//CC_DEPRECATED_ATTRIBUTE typedef BKeyframe CCBKeyframe ; +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 ; +CC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager ; +CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol ; +CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite ; +CC_DEPRECATED_ATTRIBUTE typedef PhysicsDebugNode CCPhysicsDebugNode ; +CC_DEPRECATED_ATTRIBUTE typedef ComController CCComController ; +CC_DEPRECATED_ATTRIBUTE typedef ComAttribute CCComAttribute ; +CC_DEPRECATED_ATTRIBUTE typedef InputDelegate CCInputDelegate ; +CC_DEPRECATED_ATTRIBUTE typedef ComAudio CCComAudio ; + +#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) +CC_DEPRECATED_ATTRIBUTE typedef WsMessage CCWsMessage ; +CC_DEPRECATED_ATTRIBUTE typedef WsThreadHelper CCWsThreadHelper ; +CC_DEPRECATED_ATTRIBUTE typedef WebSocketCallbackWrapper CCWebSocketCallbackWrapper ; +#endif + +CC_DEPRECATED_ATTRIBUTE typedef SIOClient CCSIOClient ; +CC_DEPRECATED_ATTRIBUTE typedef SIOClientImpl CCSIOClientImpl ; +CC_DEPRECATED_ATTRIBUTE typedef SIOEvent CCSIOEvent ; +CC_DEPRECATED_ATTRIBUTE typedef HttpClient CCHttpClient ; +CC_DEPRECATED_ATTRIBUTE typedef HttpResponse CCHttpResponse ; +CC_DEPRECATED_ATTRIBUTE typedef HttpRequest CCHttpRequest ; +CC_DEPRECATED_ATTRIBUTE typedef Skin CCSkin ; + +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 GLESDebugDraw CCGLESDebugDraw ; +CC_DEPRECATED_ATTRIBUTE typedef PhysicsWorld CCPhysicsWorld ; +CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper ; +CC_DEPRECATED_ATTRIBUTE typedef TweenFunction CCTweenFunction ; +CC_DEPRECATED_ATTRIBUTE typedef TransformHelp CCTransformHelp ; +CC_DEPRECATED_ATTRIBUTE typedef DataReaderHelper CCDataReaderHelper ; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager ; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData ; +CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone ; +CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation ; +CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature ; +} + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +CC_DEPRECATED_ATTRIBUTE typedef CWin32InputBox CCCWin32InputBox ; +#endif + +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 kCCBPropTypePosition kCCBPropTypePosition +#define kCCBPropTypeSize kCCBPropTypeSize +#define kCCBPropTypePoint kCCBPropTypePoint +#define kCCBPropTypePointLock kCCBPropTypePointLock +#define kCCBPropTypeScaleLock kCCBPropTypeScaleLock +#define kCCBPropTypeDegrees kCCBPropTypeDegrees +#define kCCBPropTypeInteger kCCBPropTypeInteger +#define kCCBPropTypeFloat kCCBPropTypeFloat +#define kCCBPropTypeFloatVar kCCBPropTypeFloatVar +#define kCCBPropTypeCheck kCCBPropTypeCheck +#define kCCBPropTypeSpriteFrame kCCBPropTypeSpriteFrame +#define kCCBPropTypeTexture kCCBPropTypeTexture +#define kCCBPropTypeByte kCCBPropTypeByte +#define kCCBPropTypeColor3 kCCBPropTypeColor3 +#define kCCBPropTypeColor4FVar kCCBPropTypeColor4FVar +#define kCCBPropTypeFlip kCCBPropTypeFlip +#define kCCBPropTypeBlendmode kCCBPropTypeBlendmode +#define kCCBPropTypeFntFile kCCBPropTypeFntFile +#define kCCBPropTypeText kCCBPropTypeText +#define kCCBPropTypeFontTTF kCCBPropTypeFontTTF +#define kCCBPropTypeIntegerLabeled kCCBPropTypeIntegerLabeled +#define kCCBPropTypeBlock kCCBPropTypeBlock +#define kCCBPropTypeAnimation kCCBPropTypeAnimation +#define kCCBPropTypeCCBFile kCCBPropTypeCCBFile +#define kCCBPropTypeString kCCBPropTypeString +#define kCCBPropTypeBlockControl kCCBPropTypeBlockControl +#define kCCBPropTypeFloatScale kCCBPropTypeFloatScale +#define kCCBPropTypeFloatXY kCCBPropTypeFloatXY + +#define kCCBFloat0 kCCBFloat0 +#define kCCBFloat1 kCCBFloat1 +#define kCCBFloatMinus1 kCCBFloatMinus1 +#define kCCBFloat05 kCCBFloat05 +#define kCCBFloatInteger kCCBFloatInteger +#define kCCBFloatFull kCCBFloatFull + +#define kCCBPlatformAll kCCBPlatformAll +#define kCCBPlatformIOS kCCBPlatformIOS +#define kCCBPlatformMac kCCBPlatformMac + +#define kCCBTargetTypeNone kCCBTargetTypeNone +#define kCCBTargetTypeDocumentRoot kCCBTargetTypeDocumentRoot +#define kCCBTargetTypeOwner kCCBTargetTypeOwner + +#define kCCBKeyframeEasingInstant kCCBKeyframeEasingInstant +#define kCCBKeyframeEasingLinear kCCBKeyframeEasingLinear +#define kCCBKeyframeEasingCubicIn kCCBKeyframeEasingCubicIn +#define kCCBKeyframeEasingCubicOut kCCBKeyframeEasingCubicOut +#define kCCBKeyframeEasingCubicInOut kCCBKeyframeEasingCubicInOut +#define kCCBKeyframeEasingElasticIn kCCBKeyframeEasingElasticIn +#define kCCBKeyframeEasingElasticOut kCCBKeyframeEasingElasticOut +#define kCCBKeyframeEasingElasticInOut kCCBKeyframeEasingElasticInOut +#define kCCBKeyframeEasingBounceIn kCCBKeyframeEasingBounceIn +#define kCCBKeyframeEasingBounceOut kCCBKeyframeEasingBounceOut +#define kCCBKeyframeEasingBounceInOut kCCBKeyframeEasingBounceInOut +#define kCCBKeyframeEasingBackIn kCCBKeyframeEasingBackIn +#define kCCBKeyframeEasingBackOut kCCBKeyframeEasingBackOut +#define kCCBKeyframeEasingBackInOut kCCBKeyframeEasingBackInOut + +#define kCCBPositionTypeRelativeBottomLeft kCCBPositionTypeRelativeBottomLeft +#define kCCBPositionTypeRelativeTopLeft kCCBPositionTypeRelativeTopLeft +#define kCCBPositionTypeRelativeTopRight kCCBPositionTypeRelativeTopRight +#define kCCBPositionTypeRelativeBottomRight kCCBPositionTypeRelativeBottomRight +#define kCCBPositionTypePercent kCCBPositionTypePercent +#define kCCBPositionTypeMultiplyResolution kCCBPositionTypeMultiplyResolution + +#define kCCBSizeTypeAbsolute kCCBSizeTypeAbsolute +#define kCCBSizeTypePercent kCCBSizeTypePercent +#define kCCBSizeTypeRelativeContainer kCCBSizeTypeRelativeContainer +#define kCCBSizeTypeHorizontalPercent kCCBSizeTypeHorizontalPercent +#define kCCBSizeTypeVerticalPercent kCCBSizeTypeVerticalPercent +#define kCCBSizeTypeMultiplyResolution kCCBSizeTypeMultiplyResolution + +#define kCCBScaleTypeAbsolute kCCBScaleTypeAbsolute +#define kCCBScaleTypeMultiplyResolution kCCBScaleTypeMultiplyResolution +*/ + +#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 + +#define kCCErrorTimeout kErrorTimeout +#define kCCErrorConnectionFailure kErrorConnectionFailure +#define kCCErrorUnknown kErrorUnknown + +NS_CC_EXT_END + +#endif diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 13e1c33e97..dfc9d0ffaa 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -3,6 +3,19 @@ #include "ExtensionMacros.h" +#include "AssetsManager/AssetsManager.h" + +#include "CCArmature/CCArmature.h" +#include "CCArmature/CCBone.h" +#include "CCArmature/utils/CCArmatureDataManager.h" +#include "CCArmature/utils/CCDataReaderHelper.h" +#include "CCArmature/utils/CCTweenFunction.h" +#include "CCArmature/utils/CCTransformHelp.h" +#include "CCArmature/utils/CCSpriteFrameCacheHelper.h" +#include "CCArmature/physics/CCPhysicsWorld.h" +#include "CCArmature/physics/CCColliderDetector.h" +#include "CCArmature/display/CCShaderNode.h" + #include "CCBReader/CCBFileLoader.h" #include "CCBReader/CCBMemberVariableAssigner.h" #include "CCBReader/CCBReader.h" @@ -39,17 +52,20 @@ #include "network/HttpRequest.h" #include "network/HttpResponse.h" #include "network/HttpClient.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__ */ From 2545f75b5faf7f36622c4c3a685aa3ef81387c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 22 Jul 2013 15:05:05 +0200 Subject: [PATCH 02/28] CCCallFuncN deprecation --- cocos2dx/include/CCDeprecated.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2dx/include/CCDeprecated.h b/cocos2dx/include/CCDeprecated.h index 1543c3abcb..674b1dec8f 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; From 28752848824e2e64ecdc4149a75e0978faa0c4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 22 Jul 2013 16:54:26 +0200 Subject: [PATCH 03/28] emscripten bugfix --- extensions/CCDeprecated-ext.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h index a98fb02f76..e724bda150 100644 --- a/extensions/CCDeprecated-ext.h +++ b/extensions/CCDeprecated-ext.h @@ -119,14 +119,18 @@ CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader ; CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader ; CC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager ; CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol ; + +#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 ; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) && (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) CC_DEPRECATED_ATTRIBUTE typedef WsMessage CCWsMessage ; CC_DEPRECATED_ATTRIBUTE typedef WsThreadHelper CCWsThreadHelper ; CC_DEPRECATED_ATTRIBUTE typedef WebSocketCallbackWrapper CCWebSocketCallbackWrapper ; From da23893821835236b91361b498a390a6d5b02220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 22 Jul 2013 16:57:38 +0200 Subject: [PATCH 04/28] Updated AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 1d70fcaeb5..dd67ff8ba3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -414,6 +414,7 @@ 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 elmiro Correction of passed buffer size to readlink and verification of result return by readlink. From a718f8ba81a05682d3d80772a3bebf9e5109a877 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 24 Jul 2013 15:29:54 +0800 Subject: [PATCH 05/28] Resolve the bug : login UI of 360 & UC can't be landscape. --- plugin/plugins/qh360/proj.android/ForManifest.xml | 1 + .../src/org/cocos2dx/plugin/QH360Wrapper.java | 8 ++++---- .../proj.android/src/org/cocos2dx/plugin/UCWrapper.java | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) 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/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() { From 9944a5d18634600fa422c7c906ad0bf87c189ce0 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 24 Jul 2013 15:31:20 +0800 Subject: [PATCH 06/28] Rename the singleton methods name in sample project of plugin. Remove the deprecated methods. --- .../Classes/TestAds/TestAdsScene.cpp | 20 +++++++++---------- .../TestAnalytics/TestAnalyticsScene.cpp | 10 +++++----- .../Classes/TestIAP/MyPurchase.cpp | 2 +- .../HelloPlugins/Classes/TestIAP/MyPurchase.h | 2 +- .../Classes/TestIAP/TestIAPScene.cpp | 18 ++++++++--------- .../Classes/TestIAPOnline/MyIAPOLManager.cpp | 2 +- .../Classes/TestIAPOnline/MyIAPOLManager.h | 2 +- .../TestIAPOnline/TestIAPOnlineScene.cpp | 4 ++-- .../Classes/TestShare/MyShareManager.cpp | 2 +- .../Classes/TestShare/MyShareManager.h | 2 +- .../Classes/TestShare/TestShareScene.cpp | 4 ++-- .../Classes/TestSocial/MySocialManager.cpp | 2 +- .../Classes/TestSocial/MySocialManager.h | 2 +- .../Classes/TestSocial/TestSocialScene.cpp | 10 +++++----- .../Classes/TestUser/MyUserManager.cpp | 2 +- .../Classes/TestUser/MyUserManager.h | 2 +- .../Classes/TestUser/TestUserScene.cpp | 6 +++--- 17 files changed, 46 insertions(+), 46 deletions(-) diff --git a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp index 40a85b0ffe..0ebfaa5840 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 b24d7b409f..a5e20d1584 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 0d631924a8..7dc0460263 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 d0f5e653ec..3c63bd8091 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) From 44a338f63c55094c0913f1916d629d6abaaa2704 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 16:45:11 +0800 Subject: [PATCH 07/28] issue #2404: Re-add CallFuncND and CallFuncO and mark them as deprecated class. --- cocos2dx/actions/CCActionInstant.cpp | 111 +++++++++++++++++++++++++++ cocos2dx/actions/CCActionInstant.h | 88 +++++++++++++++++++++ cocos2dx/include/CCDeprecated.h | 2 + 3 files changed, 201 insertions(+) diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos2dx/actions/CCActionInstant.cpp index 0ea7a89576..532e909823 100644 --- a/cocos2dx/actions/CCActionInstant.cpp +++ b/cocos2dx/actions/CCActionInstant.cpp @@ -473,5 +473,116 @@ CallFuncN * CallFuncN::clone() const return a; } +// +// CallFuncND +// + +CallFuncND * CallFuncND::create(Object* selectorTarget, SEL_CallFuncND selector, void* d) +{ + CallFuncND* pRet = new CallFuncND(); + + if (pRet && pRet->initWithTarget(selectorTarget, selector, d)) { + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + +bool CallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d) +{ + if (CallFunc::initWithTarget(selectorTarget)) + { + _data = d; + _callFuncND = selector; + return true; + } + + return false; +} + +void CallFuncND::execute() +{ + if (_callFuncND) + { + (_selectorTarget->*_callFuncND)(_target, _data); + } +} + +CallFuncND * CallFuncND::clone() const +{ + // no copy constructor + auto a = new CallFuncND(); + + if( _selectorTarget) + { + a->initWithTarget(_selectorTarget, _callFuncND, _data); + } + + a->autorelease(); + return a; +} + +// +// CallFuncO +// +CallFuncO::CallFuncO() : +_object(NULL) +{ +} + +CallFuncO::~CallFuncO() +{ + CC_SAFE_RELEASE(_object); +} + +void CallFuncO::execute() +{ + if (_callFuncO) { + (_selectorTarget->*_callFuncO)(_object); + } +} + +CallFuncO * CallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector, Object* object) +{ + CallFuncO *pRet = new CallFuncO(); + + if (pRet && pRet->initWithTarget(selectorTarget, selector, object)) { + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + +bool CallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object) +{ + if (CallFunc::initWithTarget(selectorTarget)) + { + _object = object; + CC_SAFE_RETAIN(_object); + + _callFuncO = selector; + return true; + } + + return false; +} + +CallFuncO * CallFuncO::clone() const +{ + // no copy constructor + auto a = new CallFuncO(); + + if( _selectorTarget) + { + a->initWithTarget(_selectorTarget, _callFuncO, _object); + } + + a->autorelease(); + return a; +} NS_CC_END diff --git a/cocos2dx/actions/CCActionInstant.h b/cocos2dx/actions/CCActionInstant.h index ce494cc635..9f479e8337 100644 --- a/cocos2dx/actions/CCActionInstant.h +++ b/cocos2dx/actions/CCActionInstant.h @@ -341,6 +341,94 @@ 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 CallFuncND : public CallFuncN +{ +public: + /** creates the action with the callback and the data to pass as an argument */ + static CallFuncND * 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 CallFuncND* 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 CallFuncO : public CallFunc, public TypeInfo +{ +public: + /** creates the action with the callback + + typedef void (Object::*SEL_CallFuncO)(Object*); + */ + static CallFuncO * create(Object* selectorTarget, SEL_CallFuncO selector, Object* object); + + CallFuncO(); + virtual ~CallFuncO(); + + /** 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 CallFuncO* clone() const override; + virtual void execute() override; + + inline Object* getObject() + { + return _object; + } + + inline void setObject(Object* obj) + { + if (obj != _object) + { + CC_SAFE_RELEASE(_object); + _object = obj; + CC_SAFE_RETAIN(_object); + } + } + +protected: + /** object to be passed as argument */ + Object* _object; + SEL_CallFuncO _callFuncO; +}; + // end of actions group /// @} diff --git a/cocos2dx/include/CCDeprecated.h b/cocos2dx/include/CCDeprecated.h index 708b97c862..5c65d5b493 100644 --- a/cocos2dx/include/CCDeprecated.h +++ b/cocos2dx/include/CCDeprecated.h @@ -622,6 +622,8 @@ 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 CallFuncND CCCallFuncND; CC_DEPRECATED_ATTRIBUTE typedef GridAction CCGridAction; CC_DEPRECATED_ATTRIBUTE typedef Grid3DAction CCGrid3DAction; CC_DEPRECATED_ATTRIBUTE typedef TiledGrid3DAction CCTiledGrid3DAction; From 7fd0a923e93292e74ff7bdc5aef2c0657e57a1ba Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 17:52:00 +0800 Subject: [PATCH 08/28] issue #2404: Updating CCDeprecated.h, CC_DEPRECATED_ATTRIBUTE typedef Component CCComponent; --- cocos2dx/include/CCDeprecated.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2dx/include/CCDeprecated.h b/cocos2dx/include/CCDeprecated.h index 5c65d5b493..ef0ebf72ac 100644 --- a/cocos2dx/include/CCDeprecated.h +++ b/cocos2dx/include/CCDeprecated.h @@ -762,6 +762,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; From d42ff355b63195286f3ec8686bec3d8546da42b6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 17:53:34 +0800 Subject: [PATCH 09/28] issue #2404: Mark RenderTexture:: newCCImage as deprecated. --- cocos2dx/misc_nodes/CCRenderTexture.h | 3 +++ 1 file changed, 3 insertions(+) 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. From e5c2ad0cb8873a8f3e079bf1f81e662785b04b0b Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 17:54:17 +0800 Subject: [PATCH 10/28] issue #2404: Mark Texture2D::setTexParameters(const ccTexParams* texParams) as deprecated. --- cocos2dx/textures/CCTexture2D.h | 1 + 1 file changed, 1 insertion(+) 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 From 00999b464ed82d2cd89cad09929c5eea0287c879 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 17:59:21 +0800 Subject: [PATCH 11/28] issue #2404: Reverting callback interface for CCBReader. --- extensions/CCBReader/CCBAnimationManager.cpp | 2 +- extensions/CCBReader/CCBSelectorResolver.h | 6 +++--- extensions/CCBReader/CCNodeLoader.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) 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()); } } From fb1b510557029b5aa6ac637388b48e35264c139f Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 18:00:02 +0800 Subject: [PATCH 12/28] issue #2404: Deprecated some methods in NodeLoaderLibrary.h/.cpp. --- extensions/CCBReader/CCNodeLoaderLibrary.cpp | 4 +- extensions/CCBReader/CCNodeLoaderLibrary.h | 46 ++++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) 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..15a51d0548 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) { 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 From 762b987ae7ad9c46662f84c36b85b8c6ae8ec010 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 18:00:40 +0800 Subject: [PATCH 13/28] issue #2404: [Extensions] Updating the file for deprecated methods. --- extensions/CCArmature/CCArmature.h | 36 ++++++++++++++ extensions/CCDeprecated-ext.h | 75 ++---------------------------- 2 files changed, 39 insertions(+), 72 deletions(-) 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/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h index 9b23edb851..6f73471d03 100644 --- a/extensions/CCDeprecated-ext.h +++ b/extensions/CCDeprecated-ext.h @@ -31,7 +31,7 @@ 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; @@ -42,29 +42,8 @@ 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 EditBoxImpl CCEditBoxImpl; CC_DEPRECATED_ATTRIBUTE typedef EditBoxDelegate CCEditBoxDelegate; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplWin CCEditBoxImplWin; -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) -CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplTizen CCEditBoxImplTizen; -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) -CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplMac CCEditBoxImplMac; -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplIOS CCEditBoxImplIOS; -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -CC_DEPRECATED_ATTRIBUTE typedef EditBoxImplAndroid CCEditBoxImplAndroid; -#endif - CC_DEPRECATED_ATTRIBUTE typedef Color3bObject CCColor3bObject; CC_DEPRECATED_ATTRIBUTE typedef ControlUtils CCControlUtils; CC_DEPRECATED_ATTRIBUTE typedef Scale9Sprite CCScale9Sprite; @@ -80,6 +59,8 @@ 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; @@ -111,61 +92,11 @@ CC_DEPRECATED_ATTRIBUTE typedef ComAttribute CCComAttribute; CC_DEPRECATED_ATTRIBUTE typedef InputDelegate CCInputDelegate; CC_DEPRECATED_ATTRIBUTE typedef ComAudio CCComAudio; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) && (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) -CC_DEPRECATED_ATTRIBUTE typedef WsMessage CCWsMessage; -CC_DEPRECATED_ATTRIBUTE typedef WsThreadHelper CCWsThreadHelper; -CC_DEPRECATED_ATTRIBUTE typedef WebSocketCallbackWrapper CCWebSocketCallbackWrapper; -#endif - CC_DEPRECATED_ATTRIBUTE typedef HttpClient CCHttpClient; CC_DEPRECATED_ATTRIBUTE typedef HttpResponse CCHttpResponse; CC_DEPRECATED_ATTRIBUTE typedef HttpRequest CCHttpRequest; CC_DEPRECATED_ATTRIBUTE typedef Skin CCSkin; -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 GLESDebugDraw CCGLESDebugDraw; -CC_DEPRECATED_ATTRIBUTE typedef PhysicsWorld CCPhysicsWorld; -CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; -CC_DEPRECATED_ATTRIBUTE typedef TweenFunction CCTweenFunction; -CC_DEPRECATED_ATTRIBUTE typedef TransformHelp CCTransformHelp; -CC_DEPRECATED_ATTRIBUTE typedef DataReaderHelper CCDataReaderHelper; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; -CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; -CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; - -} // namespace armature { - - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -CC_DEPRECATED_ATTRIBUTE typedef CWin32InputBox CCCWin32InputBox; -#endif - CC_DEPRECATED_ATTRIBUTE typedef AtlasFormat CCAtlasFormat; CC_DEPRECATED_ATTRIBUTE typedef AtlasFilter CCAtlasFilter; CC_DEPRECATED_ATTRIBUTE typedef AtlasWrap CCAtlasWrap; From e0f9ac82da7ced8753841b2f3e1d8954c52fd859 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Jul 2013 18:17:20 +0800 Subject: [PATCH 14/28] issue #2404: Updating ExtensionsTest/CocosBuilderTest. --- .../CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp | 4 ++-- .../CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h | 4 ++-- .../CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp | 4 ++-- .../CocosBuilderTest/ButtonTest/ButtonTestLayer.h | 4 ++-- .../HelloCocosBuilder/HelloCocosBuilderLayer.cpp | 4 ++-- .../HelloCocosBuilder/HelloCocosBuilderLayer.h | 4 ++-- .../CocosBuilderTest/MenuTest/MenuTestLayer.cpp | 4 ++-- .../ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h | 4 ++-- .../CocosBuilderTest/TestHeader/TestHeaderLayer.cpp | 4 ++-- .../CocosBuilderTest/TestHeader/TestHeaderLayer.h | 4 ++-- .../TimelineCallbackTest/TimelineCallbackTestLayer.cpp | 4 ++-- .../TimelineCallbackTest/TimelineCallbackTestLayer.h | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) 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); From ed5c1afaf6de671e6292063c8be7022897daba98 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 24 Jul 2013 18:23:21 +0800 Subject: [PATCH 15/28] Resolve the bug in plugin qh360 --- .../src/org/cocos2dx/plugin/IAPOnlineQH360.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } From 682a1238faadff2dec1d2c979cb0a0b9f8da3cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 24 Jul 2013 17:58:42 +0200 Subject: [PATCH 16/28] Use of a single emscripten HTML template file. --- AUTHORS | 1 + cocos2dx/proj.emscripten/cocos2dx.mk | 7 +- samples/Cpp/HelloCpp/proj.emscripten/Makefile | 11 ++- .../Cpp/HelloCpp/proj.emscripten/index.html | 93 ------------------- .../Cpp/SimpleGame/proj.emscripten/Makefile | 5 +- .../Cpp/SimpleGame/proj.emscripten/index.html | 93 ------------------- samples/Cpp/TestCpp/proj.emscripten/Makefile | 5 +- .../emscripten-template}/index.html | 6 +- 8 files changed, 21 insertions(+), 200 deletions(-) delete mode 100644 samples/Cpp/HelloCpp/proj.emscripten/index.html delete mode 100644 samples/Cpp/SimpleGame/proj.emscripten/index.html rename {samples/Cpp/TestCpp/proj.emscripten => tools/emscripten-template}/index.html (95%) diff --git a/AUTHORS b/AUTHORS index dba42eb2d2..59204c5e69 100644 --- a/AUTHORS +++ b/AUTHORS @@ -414,6 +414,7 @@ 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. + 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/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/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/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/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