From de0ca3b999819a99a5dcab99f0083a760277b95e Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 3 May 2022 11:56:08 +0200 Subject: Refactor module initialization * Changed to use the same stages as extensions. * Makes the initialization more coherent, helping solve problems due to lack of stages. * Makes it easier to port between module and extension. * removed the DRIVER initialization level (no longer needed). --- core/extension/gdnative_interface.h | 1 - core/extension/native_extension.cpp | 1 - core/extension/native_extension.h | 9 ++++----- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'core/extension') diff --git a/core/extension/gdnative_interface.h b/core/extension/gdnative_interface.h index ad4c8917df..4d2682b253 100644 --- a/core/extension/gdnative_interface.h +++ b/core/extension/gdnative_interface.h @@ -556,7 +556,6 @@ typedef enum { GDNATIVE_INITIALIZATION_CORE, GDNATIVE_INITIALIZATION_SERVERS, GDNATIVE_INITIALIZATION_SCENE, - GDNATIVE_INITIALIZATION_DRIVER, GDNATIVE_INITIALIZATION_EDITOR, GDNATIVE_MAX_INITIALIZATION_LEVEL, } GDNativeInitializationLevel; diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp index 4fc7d71387..e6a0c2ce89 100644 --- a/core/extension/native_extension.cpp +++ b/core/extension/native_extension.cpp @@ -334,7 +334,6 @@ void NativeExtension::_bind_methods() { BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_CORE); BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_SERVERS); BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_SCENE); - BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_DRIVER); BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_EDITOR); } diff --git a/core/extension/native_extension.h b/core/extension/native_extension.h index d29ccd81b8..c1700f3538 100644 --- a/core/extension/native_extension.h +++ b/core/extension/native_extension.h @@ -70,11 +70,10 @@ public: void close_library(); enum InitializationLevel { - INITIALIZATION_LEVEL_CORE, - INITIALIZATION_LEVEL_SERVERS, - INITIALIZATION_LEVEL_SCENE, - INITIALIZATION_LEVEL_DRIVER, - INITIALIZATION_LEVEL_EDITOR, + INITIALIZATION_LEVEL_CORE = GDNATIVE_INITIALIZATION_CORE, + INITIALIZATION_LEVEL_SERVERS = GDNATIVE_INITIALIZATION_SERVERS, + INITIALIZATION_LEVEL_SCENE = GDNATIVE_INITIALIZATION_SCENE, + INITIALIZATION_LEVEL_EDITOR = GDNATIVE_INITIALIZATION_EDITOR }; bool is_library_open() const; -- cgit v1.2.3