diff --git a/cocos/2d/CCDeprecated.h b/cocos/2d/CCDeprecated.h index a05eee54fb..d7fc7589fd 100644 --- a/cocos/2d/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -1040,6 +1040,10 @@ CC_DEPRECATED_ATTRIBUTE typedef __Bool CCBool; CC_DEPRECATED_ATTRIBUTE typedef __String CCString; //CC_DEPRECATED_ATTRIBUTE typedef __String String; +CC_DEPRECATED_ATTRIBUTE typedef __RGBAProtocol RGBAProtocol; +CC_DEPRECATED_ATTRIBUTE typedef __NodeRGBA NodeRGBA; +CC_DEPRECATED_ATTRIBUTE typedef __LayerRGBA LayerRGBA; + NS_CC_END diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index 329b6d5b43..0d4f6487b2 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -192,10 +192,10 @@ private: - RGB colors @since 2.1 */ -class CC_DLL CC_DEPRECATED_ATTRIBUTE LayerRGBA : public Layer, public RGBAProtocol +class CC_DLL __LayerRGBA : public Layer, public __RGBAProtocol { public: - CREATE_FUNC(LayerRGBA); + CREATE_FUNC(__LayerRGBA); // @@ -219,11 +219,11 @@ public: virtual bool isOpacityModifyRGB() const override { return Layer::isOpacityModifyRGB(); } protected: - LayerRGBA() {} - virtual ~LayerRGBA() {} + __LayerRGBA() {} + virtual ~__LayerRGBA() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(LayerRGBA); + CC_DISALLOW_COPY_AND_ASSIGN(__LayerRGBA); }; // diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 0cab146b4c..c7ce0c433d 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1523,7 +1523,7 @@ private: Opacity/Color propagates into children that conform to the RGBAProtocol if cascadeOpacity/cascadeColor is enabled. @since v2.1 */ -class CC_DLL CC_DEPRECATED_ATTRIBUTE NodeRGBA : public Node, public RGBAProtocol +class CC_DLL __NodeRGBA : public Node, public __RGBAProtocol { public: // overrides @@ -1545,11 +1545,11 @@ public: virtual bool isOpacityModifyRGB() const override { return Node::isOpacityModifyRGB(); } protected: - NodeRGBA() {} - virtual ~NodeRGBA() {} + CC_DEPRECATED_ATTRIBUTE __NodeRGBA() { CCLOG("NodeRGBA deprecated.");} + virtual ~__NodeRGBA() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(NodeRGBA); + CC_DISALLOW_COPY_AND_ASSIGN(__NodeRGBA); }; // end of base_node group diff --git a/cocos/2d/CCProtocols.h b/cocos/2d/CCProtocols.h index 02d57ea0a2..54282b36f7 100644 --- a/cocos/2d/CCProtocols.h +++ b/cocos/2d/CCProtocols.h @@ -35,10 +35,10 @@ NS_CC_BEGIN /** * RGBA protocol that affects Node's color and opacity */ -class CC_DLL CC_DEPRECATED_ATTRIBUTE RGBAProtocol +class CC_DLL __RGBAProtocol { public: - virtual ~RGBAProtocol() {} + virtual ~__RGBAProtocol() {} /** * Changes the color with R,G,B bytes diff --git a/cocos/scripting/lua/script/DeprecatedClass.lua b/cocos/scripting/lua/script/DeprecatedClass.lua index 8882f65ef4..c06266c319 100644 --- a/cocos/scripting/lua/script/DeprecatedClass.lua +++ b/cocos/scripting/lua/script/DeprecatedClass.lua @@ -279,6 +279,14 @@ end _G["CCNodeRGBA"] = DeprecatedClass.CCNodeRGBA() --CCNodeRGBA class will be Deprecated,end +--NodeRGBA class will be Deprecated,begin +function DeprecatedClass.NodeRGBA() + deprecatedTip("cc.NodeRGBA","cc.Node") + return cc.Node +end +_G["cc"]["NodeRGBA"] = DeprecatedClass.NodeRGBA() +--NodeRGBA class will be Deprecated,end + --CCAnimationCache class will be Deprecated,begin function DeprecatedClass.CCAnimationCache() deprecatedTip("CCAnimationCache","cc.AnimationCache") @@ -1311,6 +1319,14 @@ end _G["CCLayerRGBA"] = DeprecatedClass.CCLayerRGBA() --CCLayerRGBA class will be Deprecated,end +--LayerRGBA class will be Deprecated,begin +function DeprecatedClass.LayerRGBA() + deprecatedTip("cc.LayerRGBA","cc.Layer") + return cc.Layer +end +_G["cc"]["LayerRGBA"] = DeprecatedClass.LayerRGBA() +--LayerRGBA class will be Deprecated,end + --CCBezierTo class will be Deprecated,begin function DeprecatedClass.CCBezierTo() deprecatedTip("CCBezierTo","cc.BezierTo") diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index bd3f409288..fb4950b0f8 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -125,7 +125,10 @@ rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames ge FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup] rename_classes = ParticleSystemQuad::ParticleSystem, - SimpleAudioEngine::AudioEngine + SimpleAudioEngine::AudioEngine, + __RGBAProtocol::RGBAProtocol, + __NodeRGBA::NodeRGBA, + __LayerRGBA::LayerRGBA # for all class names, should we remove something when registering in the target VM? remove_prefix =