Version: Cocos2D-X Cpp 3.16
Currently changing the value of CC_ENABLE_SCRIPT_BINDING in ccConfig.h has no effect on the value of CC_CONSTRUCTOR_ACCESS. As long as there is a value assigned to CC_ENABLE_SCRIPT_BINDING, CC_CONSTRUCTOR_ACCESS is always public.
#ifndef CC_ENABLE_SCRIPT_BINDING
#define CC_ENABLE_SCRIPT_BINDING 0 // CC_CONSTRUCTOR_ACCESS is still public
#endif
The problem is the marked line shown below.
#ifndef CC_CONSTRUCTOR_ACCESS
#ifdef CC_ENABLE_SCRIPT_BINDING // #ifdef should be #if
#define CC_CONSTRUCTOR_ACCESS public
#else
#define CC_CONSTRUCTOR_ACCESS protected
#endif
#endif
But changing #ifdef to #if and changing CC_ENABLE_SCRIPT_BINDING to 0 causes a few issues to appear.
- Calling protected destructor of cocos2d::experimental::FrameBuffer in CCDirector.cpp
- Calling protected init of cocos2d::Sprite in UISlider.cpp
- Calling protected destructor of cocos2d::TextureCube in CCCameraBackgroundBrush.cpp
How should these issues be handled?
Related GitHub issue: https://github.com/cocos2d/cocos2d-x/issues/13678