It is for behavior that is common between CCNodeRGBA and CCLayerRGBA. The
function needs to be implemented exactly the same in both, and would have
been a static function. I removed the code duplication by making a global.

If you prefer, I can make it a static function of RGBAProtocol, which would
remove the global.

On Monday, May 20, 2013, James Chen wrote:

> In cocos2dx/include/CCProtocols.h:
>
> > @@ -125,6 +125,9 @@ class CC_DLL CCRGBAProtocol
> >      virtual void updateDisplayedOpacity(GLubyte opacity) = 0;
> >  };
> >
> > +void updateDisplayedColorChildren(CCNode *parent, const ccColor3B &parentColor);
> > +void updateDisplayedOpacityChildren(CCNode *parent, GLubyte parentOpacity);
>
> Is it a good idea to add two global functions?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cocos2d/cocos2d-x/pull/2577/files#r4292670>
> .
>


-- 
Sent from Gmail Mobile