Clean up type registration
This commit is contained in:
2
SCsub
2
SCsub
@@ -4,7 +4,7 @@ import os
|
|||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
# Define the context constant for module build
|
# Define the context constant for module build
|
||||||
env.Append(CPPDEFINES=["GODOT_MODULE_BUILD"])
|
env.Append(CPPDEFINES=["REDOT_MODULE_BUILD"])
|
||||||
|
|
||||||
# Sources to include in the module
|
# Sources to include in the module
|
||||||
module_sources = Glob("*.cpp")
|
module_sources = Glob("*.cpp")
|
||||||
|
|||||||
@@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef REDOT_MODULE_BUILD
|
||||||
|
|
||||||
|
#include "core/objects/class_db.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void initialize_module(ModuleInitializationLevel p_level) {
|
void initialize_module(ModuleInitializationLevel p_level) {
|
||||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
return;
|
return;
|
||||||
@@ -21,6 +29,8 @@ void uninitialize_module(ModuleInitializationLevel p_level) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GD_EXTENSION_BUILD
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||||
@@ -34,13 +44,4 @@ GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_g
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(GODOT_MODULE_BUILD)
|
#endif
|
||||||
#include "register_types.h"
|
|
||||||
|
|
||||||
void register_types() {
|
|
||||||
// Register classes here
|
|
||||||
}
|
|
||||||
|
|
||||||
void unregister_types() {
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -4,7 +4,10 @@
|
|||||||
#ifdef GD_EXTENSION_BUILD
|
#ifdef GD_EXTENSION_BUILD
|
||||||
#include <godot_cpp/core/class_db.hpp>
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
#elif defined(GODOT_MODULE_BUILD)
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef REDOT_MODULE_BUILD
|
||||||
#include "core/object/class_db.h"
|
#include "core/object/class_db.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user