diff --git a/codegen/src/BindingGen.cpp b/codegen/src/BindingGen.cpp index 527b43ef..17f8de11 100644 --- a/codegen/src/BindingGen.cpp +++ b/codegen/src/BindingGen.cpp @@ -34,7 +34,10 @@ public: static constexpr auto CLASS_NAME = "{class_name}"; )GEN"; - char const* zero_constructor = R"GEN( GEODE_ZERO_CONSTRUCTOR({class_name}, {first_base}) + char const* custom_constructor = R"GEN( GEODE_CUSTOM_CONSTRUCTOR_GD({class_name}, {first_base}) +)GEN"; + + char const* custom_constructor_cutoff = R"GEN( GEODE_CUSTOM_CONSTRUCTOR_CUTOFF({class_name}, {first_base}) )GEN"; char const* function_definition = R"GEN( @@ -177,7 +180,9 @@ std::string generateBindingHeader(Root& root, ghc::filesystem::path const& singl // what. if (!cls.superclasses.empty()) { single_output += fmt::format( - format_strings::zero_constructor, + can_find(cls.superclasses[0], "cocos2d") + ? format_strings::custom_constructor_cutoff + : format_strings::custom_constructor, fmt::arg("class_name", cls.name), fmt::arg("first_base", cls.superclasses[0]) ); diff --git a/codegen/src/SourceGen.cpp b/codegen/src/SourceGen.cpp index 2de69924..83b3f380 100644 --- a/codegen/src/SourceGen.cpp +++ b/codegen/src/SourceGen.cpp @@ -85,13 +85,13 @@ auto {class_name}::{function_name}({parameters}){const} -> decltype({function_na reinterpret_cast(func)(this{parameter_comma}{arguments}); // we need to construct it back so that it uhhh ummm doesnt crash // while going to the child destructors - auto thing = new (this) {class_name}(geode::ZeroConstructor); + auto thing = new (this) {class_name}(geode::CutoffConstructor, sizeof({class_name})); CCDestructor::lock(this) = true; }} )GEN"; char const* declare_constructor = R"GEN( -{class_name}::{function_name}({parameters}) : {class_name}(geode::ZeroConstructor) {{ +{class_name}::{function_name}({parameters}) : {class_name}(geode::CutoffConstructor, sizeof({class_name})) {{ // here we construct it as normal as we can, then destruct it // using the generated functions. this ensures no memory gets leaked // no crashes :pray: diff --git a/loader/include/Geode/DefaultInclude.hpp b/loader/include/Geode/DefaultInclude.hpp index 70d8e2e4..6956f302 100644 --- a/loader/include/Geode/DefaultInclude.hpp +++ b/loader/include/Geode/DefaultInclude.hpp @@ -73,8 +73,28 @@ namespace geode { struct ZeroConstructorType {}; static constexpr auto ZeroConstructor = ZeroConstructorType(); + + struct CutoffConstructorType {}; + + static constexpr auto CutoffConstructor = CutoffConstructorType(); } +#define GEODE_CUSTOM_CONSTRUCTOR_BEGIN(Class_) \ + GEODE_ZERO_CONSTRUCTOR_BEGIN(Class_) \ + GEODE_CUTOFF_CONSTRUCTOR_BEGIN(Class_) + +#define GEODE_CUSTOM_CONSTRUCTOR_COCOS(Class_, Base_) \ + GEODE_ZERO_CONSTRUCTOR(Class_, Base_) \ + GEODE_CUTOFF_CONSTRUCTOR_COCOS(Class_, Base_) + +#define GEODE_CUSTOM_CONSTRUCTOR_GD(Class_, Base_) \ + GEODE_ZERO_CONSTRUCTOR(Class_, Base_) \ + GEODE_CUTOFF_CONSTRUCTOR_GD(Class_, Base_) + +#define GEODE_CUSTOM_CONSTRUCTOR_CUTOFF(Class_, Base_) \ + GEODE_ZERO_CONSTRUCTOR(Class_, Base_) \ + GEODE_CUTOFF_CONSTRUCTOR_CUTOFF(Class_, Base_) + #define GEODE_ZERO_CONSTRUCTOR_BEGIN(Class_) \ Class_(geode::ZeroConstructorType, void*) {} \ Class_(geode::ZeroConstructorType, size_t fill) : \ @@ -85,6 +105,39 @@ namespace geode { Class_(geode::ZeroConstructorType, size_t fill) : Base_(geode::ZeroConstructor, fill) {} \ Class_(geode::ZeroConstructorType) : Base_(geode::ZeroConstructor, sizeof(Class_)) {} +#define GEODE_FILL_CONSTRUCTOR(Class_, Offset_) \ + Class_(geode::CutoffConstructorType, size_t fill) : \ + Class_( \ + geode::CutoffConstructor, \ + std::memset(reinterpret_cast(this) + Offset_, 0, fill - Offset_) \ + ) {} \ + Class_(geode::CutoffConstructorType, void*) + +#define GEODE_CUTOFF_CONSTRUCTOR_BEGIN(Class_) \ + GEODE_MACOS(GEODE_FILL_CONSTRUCTOR(Class_, 0){}) \ + GEODE_IOS(GEODE_FILL_CONSTRUCTOR(Class_, 0){}) + +#define GEODE_CUTOFF_CONSTRUCTOR_COCOS(Class_, Base_) \ + GEODE_MACOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) \ + GEODE_IOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) + +#define GEODE_CUTOFF_CONSTRUCTOR_GD(Class_, Base_) \ + GEODE_WINDOWS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) \ + GEODE_MACOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) \ + GEODE_IOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) + +#define GEODE_CUTOFF_CONSTRUCTOR_CUTOFF(Class_, Base_) \ + GEODE_WINDOWS(GEODE_FILL_CONSTRUCTOR(Class_, sizeof(Base_)) : Base_(){}) \ + GEODE_MACOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) \ + GEODE_IOS(Class_(geode::CutoffConstructorType, size_t fill) \ + : Base_(geode::CutoffConstructor, fill){}) + #define GEODE_NUMBER_OF_ARGS(...) \ GEODE_EXPAND(GEODE_NUMBER_OF_ARGS_(__VA_ARGS__, GEODE_NUMBER_SEQUENCE(), )) #define GEODE_NUMBER_OF_ARGS_(...) GEODE_EXPAND(GEODE_NUMBER_OF_ARGS_N(__VA_ARGS__)) diff --git a/loader/include/Geode/cocos/CCDirector.h b/loader/include/Geode/cocos/CCDirector.h index dce5623c..385a137a 100644 --- a/loader/include/Geode/cocos/CCDirector.h +++ b/loader/include/Geode/cocos/CCDirector.h @@ -121,7 +121,7 @@ public: * @js ctor */ CCDirector(void); - GEODE_ZERO_CONSTRUCTOR(CCDirector, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCDirector, CCObject) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/CCScheduler.h b/loader/include/Geode/cocos/CCScheduler.h index 4c1c4d96..59547521 100644 --- a/loader/include/Geode/cocos/CCScheduler.h +++ b/loader/include/Geode/cocos/CCScheduler.h @@ -141,7 +141,7 @@ class CC_DLL CCScheduler : public CCObject GEODE_FRIEND_MODIFY public: CCScheduler(); - GEODE_ZERO_CONSTRUCTOR(CCScheduler, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCScheduler, CCObject) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/base_nodes/CCNode.h b/loader/include/Geode/cocos/base_nodes/CCNode.h index e2388ba1..eb73462f 100644 --- a/loader/include/Geode/cocos/base_nodes/CCNode.h +++ b/loader/include/Geode/cocos/base_nodes/CCNode.h @@ -140,7 +140,7 @@ public: * @js ctor */ CCNode(void); - GEODE_ZERO_CONSTRUCTOR(CCNode, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCNode, CCObject) /** * Default destructor @@ -1638,7 +1638,7 @@ public: * @js ctor */ CCNodeRGBA(); - GEODE_ZERO_CONSTRUCTOR(CCNodeRGBA, CCNode) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCNodeRGBA, CCNode) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/cocoa/CCObject.h b/loader/include/Geode/cocos/cocoa/CCObject.h index 4719faa0..daeb19bf 100644 --- a/loader/include/Geode/cocos/cocoa/CCObject.h +++ b/loader/include/Geode/cocos/cocoa/CCObject.h @@ -112,7 +112,7 @@ protected: int m_nUnknown; ) public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCObject) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCObject) CCObject(void); /** * @lua NA diff --git a/loader/include/Geode/cocos/cocoa/CCSet.h b/loader/include/Geode/cocos/cocoa/CCSet.h index 366955f2..4ec1c0bf 100644 --- a/loader/include/Geode/cocos/cocoa/CCSet.h +++ b/loader/include/Geode/cocos/cocoa/CCSet.h @@ -46,7 +46,7 @@ public: * @lua NA */ CCSet(void); - GEODE_ZERO_CONSTRUCTOR(CCSet, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSet, CCObject) /** * @lua NA */ diff --git a/loader/include/Geode/cocos/cocoa/CCString.h b/loader/include/Geode/cocos/cocoa/CCString.h index 9cdc2371..713aa0d0 100644 --- a/loader/include/Geode/cocos/cocoa/CCString.h +++ b/loader/include/Geode/cocos/cocoa/CCString.h @@ -47,7 +47,7 @@ class CC_DLL CCString : public CCObject { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR(CCString, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCString, CCObject) /** * @lua NA */ diff --git a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h index fc64ab99..495c52d0 100644 --- a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h +++ b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h @@ -94,7 +94,7 @@ public: void setBlendFunc(const ccBlendFunc &blendFunc); CCDrawNode(); - GEODE_ZERO_CONSTRUCTOR(CCDrawNode, CCNodeRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCDrawNode, CCNodeRGBA) /** listen the event that coming to foreground on Android * @js NA diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h index d6fc4b50..1db66ae5 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h @@ -139,7 +139,7 @@ public: * @js ctor */ CCControl(); - GEODE_ZERO_CONSTRUCTOR(CCControl, CCLayerRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControl, CCLayerRGBA) virtual bool init(void); /** diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h index 9c7d2ca6..2c0a7418 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -58,7 +58,7 @@ public: virtual void setColorValue(ccColor3B const&); ) - GEODE_ZERO_CONSTRUCTOR(CCControlColourPicker, CCControl) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlColourPicker, CCControl) CCControlColourPicker(); virtual ~CCControlColourPicker(); diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h index 76ec289a..43d9c136 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -54,7 +54,7 @@ class CC_DLL CCScale9Sprite : public CCNodeRGBA { public: CCScale9Sprite(); - GEODE_ZERO_CONSTRUCTOR(CCScale9Sprite, CCNodeRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCScale9Sprite, CCNodeRGBA) virtual ~CCScale9Sprite(); public: diff --git a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h index 8476bdec..30918b1d 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h @@ -69,7 +69,7 @@ public: * @js ctor */ CCScrollView(); - GEODE_ZERO_CONSTRUCTOR(CCScrollView, CCLayer) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCScrollView, CCLayer) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h index e812dac6..987c2f99 100644 --- a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h +++ b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h @@ -59,7 +59,7 @@ class CC_DLL CCKeypadHandler : public CCObject { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR(CCKeypadHandler, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCKeypadHandler, CCObject) inline CCKeypadHandler() = default; virtual ~CCKeypadHandler(void); diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h index 5d36195a..1fa7e2ac 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h @@ -198,7 +198,7 @@ public: * @js ctor */ CCLabelBMFont(); - GEODE_ZERO_CONSTRUCTOR(CCLabelBMFont, CCSpriteBatchNode) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLabelBMFont, CCSpriteBatchNode) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h b/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h index fdea5e53..6bb86c77 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h @@ -63,7 +63,7 @@ public: * @js ctor */ CCLabelTTF(); - GEODE_ZERO_CONSTRUCTOR(CCLabelTTF, CCSprite) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLabelTTF, CCSprite) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h index 7305cfb3..7ea96fd0 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h @@ -75,7 +75,7 @@ public: * @js ctor */ CCLayer(); - GEODE_ZERO_CONSTRUCTOR(CCLayer, CCNode) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLayer, CCNode) /** * @js NA * @lua NA @@ -233,7 +233,7 @@ public: * @js ctor */ CCLayerRGBA(); - GEODE_ZERO_CONSTRUCTOR(CCLayerRGBA, CCLayer) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLayerRGBA, CCLayer) /** * @js NA * @lua NA @@ -290,7 +290,7 @@ public: * @js ctor */ CCLayerColor(); - GEODE_ZERO_CONSTRUCTOR(CCLayerColor, CCLayerRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLayerColor, CCLayerRGBA) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCScene.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCScene.h index ed00cdda..433cb390 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCScene.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCScene.h @@ -63,7 +63,7 @@ public: * @js ctor */ CCScene(); - GEODE_ZERO_CONSTRUCTOR(CCScene, CCNode) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCScene, CCNode) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/menu_nodes/CCMenu.h b/loader/include/Geode/cocos/menu_nodes/CCMenu.h index 23e10daa..faecdc79 100644 --- a/loader/include/Geode/cocos/menu_nodes/CCMenu.h +++ b/loader/include/Geode/cocos/menu_nodes/CCMenu.h @@ -64,7 +64,7 @@ public: * @js ctor */ CCMenu() : m_pSelectedItem(NULL) {} - GEODE_ZERO_CONSTRUCTOR(CCMenu, CCLayerRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenu, CCLayerRGBA) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h b/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h index be49aa44..83761988 100644 --- a/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h +++ b/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h @@ -71,7 +71,7 @@ public: , m_pfnSelector(NULL) , m_nScriptTapHandler(0) {} - GEODE_ZERO_CONSTRUCTOR(CCMenuItem, CCNodeRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenuItem, CCNodeRGBA) /** * @js NA * @lua NA @@ -139,7 +139,7 @@ public: : m_pLabel(NULL) , m_fOriginalScale(0.0) {} - GEODE_ZERO_CONSTRUCTOR(CCMenuItemLabel, CCMenuItem) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenuItemLabel, CCMenuItem) /** * @js NA * @lua NA @@ -292,7 +292,7 @@ public: ,m_pSelectedImage(NULL) ,m_pDisabledImage(NULL) {} - GEODE_ZERO_CONSTRUCTOR(CCMenuItemSprite, CCMenuItem) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenuItemSprite, CCMenuItem) /** creates a menu item with a normal, selected and disabled image*/ static CCMenuItemSprite * create(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite = NULL); @@ -337,7 +337,7 @@ public: * @lua NA */ CCMenuItemImage(){} - GEODE_ZERO_CONSTRUCTOR(CCMenuItemImage, CCMenuItemSprite) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenuItemImage, CCMenuItemSprite) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/platform/CCFileUtils.h b/loader/include/Geode/cocos/platform/CCFileUtils.h index 9af4ad8e..0df6c7fc 100644 --- a/loader/include/Geode/cocos/platform/CCFileUtils.h +++ b/loader/include/Geode/cocos/platform/CCFileUtils.h @@ -53,7 +53,7 @@ class CC_DLL CCFileUtils : public TypeInfo friend class CCDictionary; public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCFileUtils) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCFileUtils) /** * Returns an unique ID for this class. * @note It's only used for JSBindings now. diff --git a/loader/include/Geode/cocos/platform/CCImage.h b/loader/include/Geode/cocos/platform/CCImage.h index 6d13d6ae..a71af4e8 100644 --- a/loader/include/Geode/cocos/platform/CCImage.h +++ b/loader/include/Geode/cocos/platform/CCImage.h @@ -46,7 +46,7 @@ public: @js ctor */ CCImage(); - GEODE_ZERO_CONSTRUCTOR(CCImage, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCImage, CCObject) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/platform/ios/CCApplication.h b/loader/include/Geode/cocos/platform/ios/CCApplication.h index f0c4dff0..76b17efd 100644 --- a/loader/include/Geode/cocos/platform/ios/CCApplication.h +++ b/loader/include/Geode/cocos/platform/ios/CCApplication.h @@ -36,7 +36,7 @@ class CC_DLL CCApplication : public CCApplicationProtocol { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCApplication) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCApplication) CCApplication(); /** * @js NA diff --git a/loader/include/Geode/cocos/platform/mac/CCApplication.h b/loader/include/Geode/cocos/platform/mac/CCApplication.h index 139396d9..79c3fc88 100644 --- a/loader/include/Geode/cocos/platform/mac/CCApplication.h +++ b/loader/include/Geode/cocos/platform/mac/CCApplication.h @@ -35,7 +35,7 @@ class CC_DLL CCApplication : public CCApplicationProtocol { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCApplication) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCApplication) CCApplication(); virtual ~CCApplication(); diff --git a/loader/include/Geode/cocos/platform/win32/CCApplication.h b/loader/include/Geode/cocos/platform/win32/CCApplication.h index a6466499..dd5152da 100644 --- a/loader/include/Geode/cocos/platform/win32/CCApplication.h +++ b/loader/include/Geode/cocos/platform/win32/CCApplication.h @@ -15,7 +15,7 @@ class CC_DLL CCApplication : public CCApplicationProtocol { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCApplication) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCApplication) CCApplication(); virtual ~CCApplication(); diff --git a/loader/include/Geode/cocos/platform/win32/CCEGLView.h b/loader/include/Geode/cocos/platform/win32/CCEGLView.h index 91ff5e32..15a0f65f 100644 --- a/loader/include/Geode/cocos/platform/win32/CCEGLView.h +++ b/loader/include/Geode/cocos/platform/win32/CCEGLView.h @@ -45,7 +45,7 @@ protected: RT_ADD( virtual ~CCEGLView(); ) public: CCEGLView(); - GEODE_ZERO_CONSTRUCTOR(CCEGLView, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEGLView, CCObject) RT_REMOVE( virtual ~CCEGLView(); ) /* override functions */ diff --git a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h index e4597085..10005f4e 100644 --- a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h +++ b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h @@ -207,7 +207,7 @@ RT_ADD( class CC_DLL CCKeyboardHandler : public CCObject { public: - GEODE_ZERO_CONSTRUCTOR(CCKeyboardHandler, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCKeyboardHandler, CCObject) inline CCKeyboardHandler() = default; virtual ~CCKeyboardHandler(); diff --git a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h index 5f1e8be2..4d1f1846 100644 --- a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h +++ b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h @@ -22,7 +22,7 @@ RT_ADD( class CC_DLL CCMouseHandler : public CCObject { public: - GEODE_ZERO_CONSTRUCTOR(CCMouseHandler, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMouseHandler, CCObject) inline CCMouseHandler() = default; virtual ~CCMouseHandler(); diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h index 636e7a41..0b4d1702 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h @@ -168,7 +168,7 @@ public: * @js ctor */ CCSprite(void); - GEODE_ZERO_CONSTRUCTOR(CCSprite, CCNodeRGBA) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSprite, CCNodeRGBA) /** * Default destructor diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h index 3233c913..3d2531b3 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h @@ -68,7 +68,7 @@ public: * @js ctor */ CCSpriteBatchNode(); - GEODE_ZERO_CONSTRUCTOR(CCSpriteBatchNode, CCNode) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpriteBatchNode, CCNode) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h b/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h index 6a83a4a3..786d30d4 100644 --- a/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h +++ b/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h @@ -50,7 +50,7 @@ class CC_DLL CCIMEDelegate { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR_BEGIN(CCIMEDelegate) + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCIMEDelegate) virtual ~CCIMEDelegate(); virtual bool attachWithIME(); diff --git a/loader/include/Geode/cocos/textures/CCTexture2D.h b/loader/include/Geode/cocos/textures/CCTexture2D.h index f83c5171..3ad811ea 100644 --- a/loader/include/Geode/cocos/textures/CCTexture2D.h +++ b/loader/include/Geode/cocos/textures/CCTexture2D.h @@ -117,7 +117,7 @@ public: * @js ctor */ CCTexture2D(); - GEODE_ZERO_CONSTRUCTOR(CCTexture2D, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTexture2D, CCObject) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h b/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h index 1671092d..08b29f9d 100644 --- a/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h +++ b/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h @@ -48,7 +48,7 @@ class CC_DLL CCTouchHandler : public CCObject { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR(CCTouchHandler, CCObject) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTouchHandler, CCObject) inline CCTouchHandler() = default; virtual ~CCTouchHandler(void); @@ -86,7 +86,7 @@ class CC_DLL CCStandardTouchHandler : public CCTouchHandler { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR(CCStandardTouchHandler, CCTouchHandler) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCStandardTouchHandler, CCTouchHandler) inline CCStandardTouchHandler() = default; ~CCStandardTouchHandler(void); @@ -110,7 +110,7 @@ class CC_DLL CCTargetedTouchHandler : public CCTouchHandler { GEODE_FRIEND_MODIFY public: - GEODE_ZERO_CONSTRUCTOR(CCTargetedTouchHandler, CCTouchHandler) + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTargetedTouchHandler, CCTouchHandler) inline CCTargetedTouchHandler() = default; ~CCTargetedTouchHandler(void);