From e9a19c1a660ef1226104c884690a488149522d63 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 15 Jan 2023 11:46:13 +0100 Subject: [PATCH] Added module initialization levels (similar idea to what's in godot4, although I added more). --- editor_modules/etc/register_types.cpp | 4 ++-- editor_modules/etc/register_types.h | 6 ++++-- editor_modules/gltf/register_types.cpp | 4 ++-- editor_modules/gltf/register_types.h | 6 ++++-- editor_modules/plugin_refresher/register_types.cpp | 4 ++-- editor_modules/plugin_refresher/register_types.h | 6 ++++-- editor_modules/text_editor/register_types.cpp | 4 ++-- editor_modules/text_editor/register_types.h | 6 ++++-- editor_modules/tinyexr/register_types.cpp | 4 ++-- editor_modules/tinyexr/register_types.h | 6 ++++-- main/main.cpp | 4 ++-- methods.py | 8 ++++---- modules/bmp/register_types.cpp | 4 ++-- modules/bmp/register_types.h | 6 ++++-- modules/broken_seals_module/register_types.cpp | 4 ++-- modules/broken_seals_module/register_types.h | 6 ++++-- modules/cscript/register_types.cpp | 4 ++-- modules/cscript/register_types.h | 6 ++++-- modules/cvtt/register_types.cpp | 4 ++-- modules/cvtt/register_types.h | 6 ++++-- modules/database/register_types.cpp | 4 ++-- modules/database/register_types.h | 6 ++++-- modules/database_sqlite/register_types.cpp | 4 ++-- modules/database_sqlite/register_types.h | 6 ++++-- modules/dds/register_types.cpp | 4 ++-- modules/dds/register_types.h | 6 ++++-- modules/enet/register_types.cpp | 4 ++-- modules/enet/register_types.h | 6 ++++-- modules/entity_spell_system/register_types.cpp | 4 ++-- modules/entity_spell_system/register_types.h | 6 ++++-- modules/fastnoise/register_types.cpp | 4 ++-- modules/fastnoise/register_types.h | 9 +++++++-- modules/freetype/register_types.cpp | 4 ++-- modules/freetype/register_types.h | 6 ++++-- modules/gdscript/register_types.cpp | 4 ++-- modules/gdscript/register_types.h | 6 ++++-- modules/gridmap/register_types.cpp | 4 ++-- modules/gridmap/register_types.h | 6 ++++-- modules/hdr/register_types.cpp | 4 ++-- modules/hdr/register_types.h | 6 ++++-- modules/http_server_simple/register_types.cpp | 4 ++-- modules/http_server_simple/register_types.h | 6 ++++-- modules/jpg/register_types.cpp | 4 ++-- modules/jpg/register_types.h | 6 ++++-- modules/lz4/register_types.cpp | 4 ++-- modules/lz4/register_types.h | 6 ++++-- modules/material_maker/register_types.cpp | 4 ++-- modules/material_maker/register_types.h | 6 ++++-- modules/mbedtls/register_types.cpp | 4 ++-- modules/mbedtls/register_types.h | 6 ++++-- modules/mesh_data_resource/register_types.cpp | 4 ++-- modules/mesh_data_resource/register_types.h | 6 ++++-- modules/mesh_utils/register_types.cpp | 4 ++-- modules/mesh_utils/register_types.h | 6 ++++-- modules/minimp3/register_types.cpp | 4 ++-- modules/minimp3/register_types.h | 6 ++++-- modules/navigation/register_types.cpp | 4 ++-- modules/navigation/register_types.h | 6 ++++-- modules/network_synchronizer/register_types.cpp | 4 ++-- modules/network_synchronizer/register_types.h | 6 ++++-- modules/ogg/register_types.cpp | 4 ++-- modules/ogg/register_types.h | 6 ++++-- modules/opensimplex/register_types.cpp | 4 ++-- modules/opensimplex/register_types.h | 6 ++++-- modules/opus/register_types.cpp | 4 ++-- modules/opus/register_types.h | 6 ++++-- modules/paint/register_types.cpp | 4 ++-- modules/paint/register_types.h | 6 ++++-- modules/props/register_types.cpp | 4 ++-- modules/props/register_types.h | 6 ++++-- modules/props_2d/register_types.cpp | 4 ++-- modules/props_2d/register_types.h | 6 ++++-- modules/pvr/register_types.cpp | 4 ++-- modules/pvr/register_types.h | 6 ++++-- modules/regex/register_types.cpp | 4 ++-- modules/regex/register_types.h | 6 ++++-- modules/register_module_types.h | 14 ++++++++++++-- modules/skeleton_2d/register_types.cpp | 4 ++-- modules/skeleton_2d/register_types.h | 8 ++++++-- modules/skeleton_3d/register_types.cpp | 4 ++-- modules/skeleton_3d/register_types.h | 8 ++++++-- modules/squish/register_types.cpp | 4 ++-- modules/squish/register_types.h | 6 ++++-- modules/stb_vorbis/register_types.cpp | 4 ++-- modules/stb_vorbis/register_types.h | 6 ++++-- modules/steering_ai/register_types.cpp | 4 ++-- modules/steering_ai/register_types.h | 6 ++++-- modules/svg/register_types.cpp | 4 ++-- modules/svg/register_types.h | 6 ++++-- modules/terraman/register_types.cpp | 4 ++-- modules/terraman/register_types.h | 6 ++++-- modules/terraman_2d/register_types.cpp | 4 ++-- modules/terraman_2d/register_types.h | 6 ++++-- modules/texture_packer/register_types.cpp | 4 ++-- modules/texture_packer/register_types.h | 6 ++++-- modules/tga/register_types.cpp | 4 ++-- modules/tga/register_types.h | 6 ++++-- modules/theora/register_types.cpp | 4 ++-- modules/theora/register_types.h | 6 ++++-- modules/tile_map/register_types.cpp | 4 ++-- modules/tile_map/register_types.h | 6 ++++-- modules/ui_extensions/register_types.cpp | 4 ++-- modules/ui_extensions/register_types.h | 6 ++++-- modules/upnp/register_types.cpp | 4 ++-- modules/upnp/register_types.h | 6 ++++-- modules/users/register_types.cpp | 4 ++-- modules/users/register_types.h | 6 ++++-- modules/vhacd/register_types.cpp | 4 ++-- modules/vhacd/register_types.h | 6 ++++-- modules/vorbis/register_types.cpp | 4 ++-- modules/vorbis/register_types.h | 6 ++++-- modules/voxelman/register_types.cpp | 4 ++-- modules/voxelman/register_types.h | 6 ++++-- modules/web/register_types.cpp | 4 ++-- modules/web/register_types.h | 6 ++++-- modules/websocket/register_types.cpp | 4 ++-- modules/websocket/register_types.h | 6 ++++-- modules/wfc/register_types.cpp | 4 ++-- modules/wfc/register_types.h | 6 ++++-- 119 files changed, 373 insertions(+), 240 deletions(-) diff --git a/editor_modules/etc/register_types.cpp b/editor_modules/etc/register_types.cpp index 0dc473dc0..2a80c32e2 100644 --- a/editor_modules/etc/register_types.cpp +++ b/editor_modules/etc/register_types.cpp @@ -35,14 +35,14 @@ static Ref resource_loader_pkm; -void register_etc_types() { +void register_etc_types(ModuleRegistrationLevel p_level) { resource_loader_pkm.instance(); ResourceLoader::add_resource_format_loader(resource_loader_pkm); _register_etc_compress_func(); } -void unregister_etc_types() { +void unregister_etc_types(ModuleRegistrationLevel p_level) { ResourceLoader::remove_resource_format_loader(resource_loader_pkm); resource_loader_pkm.unref(); } diff --git a/editor_modules/etc/register_types.h b/editor_modules/etc/register_types.h index 88fdd9a8b..8ac124285 100644 --- a/editor_modules/etc/register_types.h +++ b/editor_modules/etc/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_etc_types(); -void unregister_etc_types(); +#include "modules/register_module_types.h" + +void register_etc_types(ModuleRegistrationLevel p_level); +void unregister_etc_types(ModuleRegistrationLevel p_level); #endif // ETC_REGISTER_TYPES_H diff --git a/editor_modules/gltf/register_types.cpp b/editor_modules/gltf/register_types.cpp index f0ec66019..863f24a0e 100644 --- a/editor_modules/gltf/register_types.cpp +++ b/editor_modules/gltf/register_types.cpp @@ -50,7 +50,7 @@ static void _editor_init() { } #endif -void register_gltf_types() { +void register_gltf_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED ClassDB::APIType prev_api = ClassDB::get_current_api(); ClassDB::set_current_api(ClassDB::API_EDITOR); @@ -78,7 +78,7 @@ void register_gltf_types() { ClassDB::register_class(); } -void unregister_gltf_types() { +void unregister_gltf_types(ModuleRegistrationLevel p_level) { } #endif // _3D_DISABLED diff --git a/editor_modules/gltf/register_types.h b/editor_modules/gltf/register_types.h index b3cdad7c9..f6092c7ca 100644 --- a/editor_modules/gltf/register_types.h +++ b/editor_modules/gltf/register_types.h @@ -32,8 +32,10 @@ #ifndef _3D_DISABLED -void register_gltf_types(); -void unregister_gltf_types(); +#include "modules/register_module_types.h" + +void register_gltf_types(ModuleRegistrationLevel p_level); +void unregister_gltf_types(ModuleRegistrationLevel p_level); #endif // _3D_DISABLED diff --git a/editor_modules/plugin_refresher/register_types.cpp b/editor_modules/plugin_refresher/register_types.cpp index 35d733c4f..1705daf7f 100644 --- a/editor_modules/plugin_refresher/register_types.cpp +++ b/editor_modules/plugin_refresher/register_types.cpp @@ -26,11 +26,11 @@ SOFTWARE. #include "plugin_refresher_editor_plugin.h" #endif -void register_plugin_refresher_types() { +void register_plugin_refresher_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED EditorPlugins::add_by_type(); #endif } -void unregister_plugin_refresher_types() { +void unregister_plugin_refresher_types(ModuleRegistrationLevel p_level) { } diff --git a/editor_modules/plugin_refresher/register_types.h b/editor_modules/plugin_refresher/register_types.h index f47c00c4f..eaf15f35a 100644 --- a/editor_modules/plugin_refresher/register_types.h +++ b/editor_modules/plugin_refresher/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_plugin_refresher_types(); -void unregister_plugin_refresher_types(); +#include "modules/register_module_types.h" + +void register_plugin_refresher_types(ModuleRegistrationLevel p_level); +void unregister_plugin_refresher_types(ModuleRegistrationLevel p_level); diff --git a/editor_modules/text_editor/register_types.cpp b/editor_modules/text_editor/register_types.cpp index 510d672c4..0839a80cc 100644 --- a/editor_modules/text_editor/register_types.cpp +++ b/editor_modules/text_editor/register_types.cpp @@ -32,7 +32,7 @@ SOFTWARE. Ref text_editor_text_resource_loader; -void register_text_editor_types() { +void register_text_editor_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); text_editor_text_resource_loader.instance(); @@ -43,7 +43,7 @@ void register_text_editor_types() { #endif } -void unregister_text_editor_types() { +void unregister_text_editor_types(ModuleRegistrationLevel p_level) { ResourceLoader::remove_resource_format_loader(text_editor_text_resource_loader); text_editor_text_resource_loader.unref(); } diff --git a/editor_modules/text_editor/register_types.h b/editor_modules/text_editor/register_types.h index 745b2d46c..341b4c26d 100644 --- a/editor_modules/text_editor/register_types.h +++ b/editor_modules/text_editor/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_text_editor_types(); -void unregister_text_editor_types(); +#include "modules/register_module_types.h" + +void register_text_editor_types(ModuleRegistrationLevel p_level); +void unregister_text_editor_types(ModuleRegistrationLevel p_level); diff --git a/editor_modules/tinyexr/register_types.cpp b/editor_modules/tinyexr/register_types.cpp index 0879a55b6..3e3a13c5b 100644 --- a/editor_modules/tinyexr/register_types.cpp +++ b/editor_modules/tinyexr/register_types.cpp @@ -35,14 +35,14 @@ static ImageLoaderTinyEXR *image_loader_tinyexr = nullptr; -void register_tinyexr_types() { +void register_tinyexr_types(ModuleRegistrationLevel p_level) { image_loader_tinyexr = memnew(ImageLoaderTinyEXR); ImageLoader::add_image_format_loader(image_loader_tinyexr); Image::save_exr_func = save_exr; } -void unregister_tinyexr_types() { +void unregister_tinyexr_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_tinyexr); Image::save_exr_func = nullptr; diff --git a/editor_modules/tinyexr/register_types.h b/editor_modules/tinyexr/register_types.h index ecbb00f81..e1f4f41e9 100644 --- a/editor_modules/tinyexr/register_types.h +++ b/editor_modules/tinyexr/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_tinyexr_types(); -void unregister_tinyexr_types(); +#include "modules/register_module_types.h" + +void register_tinyexr_types(ModuleRegistrationLevel p_level); +void unregister_tinyexr_types(ModuleRegistrationLevel p_level); #endif // TINYEXR_REGISTER_TYPES_H diff --git a/main/main.cpp b/main/main.cpp index bba8e9a5c..b220526bb 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1520,7 +1520,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { MAIN_PRINT("Main: Load Modules, Physics, Drivers, Scripts"); register_platform_apis(); - register_module_types(); + register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_CORE); // Theme needs modules to be initialized so that sub-resources can be loaded. initialize_theme(); @@ -2440,7 +2440,7 @@ void Main::cleanup(bool p_force) { ImageLoader::cleanup(); unregister_driver_types(); - unregister_module_types(); + unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_CORE); unregister_platform_apis(); unregister_scene_types(); unregister_server_types(); diff --git a/methods.py b/methods.py index e809aa923..0ba86697a 100644 --- a/methods.py +++ b/methods.py @@ -309,10 +309,10 @@ def write_modules(modules): with open(os.path.join(path, "register_types.h")): includes_cpp += '#include "' + path + '/register_types.h"\n' register_cpp += "#ifdef MODULE_" + name.upper() + "_ENABLED\n" - register_cpp += "\tregister_" + name + "_types();\n" + register_cpp += "\tregister_" + name + "_types(p_level);\n" register_cpp += "#endif\n" unregister_cpp += "#ifdef MODULE_" + name.upper() + "_ENABLED\n" - unregister_cpp += "\tunregister_" + name + "_types();\n" + unregister_cpp += "\tunregister_" + name + "_types(p_level);\n" unregister_cpp += "#endif\n" except IOError: pass @@ -325,11 +325,11 @@ def write_modules(modules): %s -void register_module_types() { +void register_module_types(ModuleRegistrationLevel p_level) { %s } -void unregister_module_types() { +void unregister_module_types(ModuleRegistrationLevel p_level) { %s } """ % ( diff --git a/modules/bmp/register_types.cpp b/modules/bmp/register_types.cpp index 13e44099e..17f0969fd 100644 --- a/modules/bmp/register_types.cpp +++ b/modules/bmp/register_types.cpp @@ -34,11 +34,11 @@ static ImageLoaderBMP *image_loader_bmp = nullptr; -void register_bmp_types() { +void register_bmp_types(ModuleRegistrationLevel p_level) { image_loader_bmp = memnew(ImageLoaderBMP); ImageLoader::add_image_format_loader(image_loader_bmp); } -void unregister_bmp_types() { +void unregister_bmp_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_bmp); } diff --git a/modules/bmp/register_types.h b/modules/bmp/register_types.h index 9f069617e..557645680 100644 --- a/modules/bmp/register_types.h +++ b/modules/bmp/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_bmp_types(); -void unregister_bmp_types(); +#include "modules/register_module_types.h" + +void register_bmp_types(ModuleRegistrationLevel p_level); +void unregister_bmp_types(ModuleRegistrationLevel p_level); #endif // BMP_REGISTER_TYPES_H diff --git a/modules/broken_seals_module/register_types.cpp b/modules/broken_seals_module/register_types.cpp index f698ae98a..13967a13a 100644 --- a/modules/broken_seals_module/register_types.cpp +++ b/modules/broken_seals_module/register_types.cpp @@ -26,9 +26,9 @@ SOFTWARE. #include "biome_terrain_generator.h" -void register_broken_seals_module_types() { +void register_broken_seals_module_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); } -void unregister_broken_seals_module_types() { +void unregister_broken_seals_module_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/broken_seals_module/register_types.h b/modules/broken_seals_module/register_types.h index 4ee2e8cc6..b95d3f73c 100644 --- a/modules/broken_seals_module/register_types.h +++ b/modules/broken_seals_module/register_types.h @@ -26,7 +26,9 @@ SOFTWARE. */ -void register_broken_seals_module_types(); -void unregister_broken_seals_module_types(); +#include "modules/register_module_types.h" + +void register_broken_seals_module_types(ModuleRegistrationLevel p_level); +void unregister_broken_seals_module_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/cscript/register_types.cpp b/modules/cscript/register_types.cpp index 85af1a507..ce2c85efe 100644 --- a/modules/cscript/register_types.cpp +++ b/modules/cscript/register_types.cpp @@ -136,7 +136,7 @@ static void _editor_init() { #endif // TOOLS_ENABLED -void register_cscript_types() { +void register_cscript_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); script_language_cscript = memnew(CScriptLanguage); @@ -154,7 +154,7 @@ void register_cscript_types() { #endif // TOOLS_ENABLED } -void unregister_cscript_types() { +void unregister_cscript_types(ModuleRegistrationLevel p_level) { ScriptServer::unregister_language(script_language_cscript); if (script_language_cscript) { diff --git a/modules/cscript/register_types.h b/modules/cscript/register_types.h index bf6033074..2e76bae5c 100644 --- a/modules/cscript/register_types.h +++ b/modules/cscript/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_cscript_types(); -void unregister_cscript_types(); +#include "modules/register_module_types.h" + +void register_cscript_types(ModuleRegistrationLevel p_level); +void unregister_cscript_types(ModuleRegistrationLevel p_level); #endif // CSCRIPT_REGISTER_TYPES_H diff --git a/modules/cvtt/register_types.cpp b/modules/cvtt/register_types.cpp index 13903f700..a8a9d4095 100644 --- a/modules/cvtt/register_types.cpp +++ b/modules/cvtt/register_types.cpp @@ -34,11 +34,11 @@ #include "image_compress_cvtt.h" -void register_cvtt_types() { +void register_cvtt_types(ModuleRegistrationLevel p_level) { Image::set_compress_bptc_func(image_compress_cvtt); Image::_image_decompress_bptc = image_decompress_cvtt; } -void unregister_cvtt_types() {} +void unregister_cvtt_types(ModuleRegistrationLevel p_level) {} #endif diff --git a/modules/cvtt/register_types.h b/modules/cvtt/register_types.h index 8cf5f6f69..844928c50 100644 --- a/modules/cvtt/register_types.h +++ b/modules/cvtt/register_types.h @@ -32,8 +32,10 @@ #ifdef TOOLS_ENABLED -void register_cvtt_types(); -void unregister_cvtt_types(); +#include "modules/register_module_types.h" + +void register_cvtt_types(ModuleRegistrationLevel p_level); +void unregister_cvtt_types(ModuleRegistrationLevel p_level); #endif // TOOLS_ENABLED diff --git a/modules/database/register_types.cpp b/modules/database/register_types.cpp index 580cc036f..62c4c49a3 100644 --- a/modules/database/register_types.cpp +++ b/modules/database/register_types.cpp @@ -35,7 +35,7 @@ SOFTWARE. DatabaseManager *_database_manager = nullptr; -void register_database_types() { +void register_database_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); @@ -49,7 +49,7 @@ void register_database_types() { Engine::get_singleton()->add_singleton(Engine::Singleton("DatabaseManager", DatabaseManager::get_singleton())); } -void unregister_database_types() { +void unregister_database_types(ModuleRegistrationLevel p_level) { if (_database_manager) { memdelete(_database_manager); } diff --git a/modules/database/register_types.h b/modules/database/register_types.h index 77c257423..83c91c885 100644 --- a/modules/database/register_types.h +++ b/modules/database/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_database_types(); -void unregister_database_types(); +#include "modules/register_module_types.h" + +void register_database_types(ModuleRegistrationLevel p_level); +void unregister_database_types(ModuleRegistrationLevel p_level); diff --git a/modules/database_sqlite/register_types.cpp b/modules/database_sqlite/register_types.cpp index a81dd77a5..7bd081765 100644 --- a/modules/database_sqlite/register_types.cpp +++ b/modules/database_sqlite/register_types.cpp @@ -24,9 +24,9 @@ SOFTWARE. #include "sqlite3_database.h" -void register_database_sqlite_types() { +void register_database_sqlite_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); } -void unregister_database_sqlite_types() { +void unregister_database_sqlite_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/database_sqlite/register_types.h b/modules/database_sqlite/register_types.h index 41434d1c9..e5de81592 100644 --- a/modules/database_sqlite/register_types.h +++ b/modules/database_sqlite/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_database_sqlite_types(); -void unregister_database_sqlite_types(); +#include "modules/register_module_types.h" + +void register_database_sqlite_types(ModuleRegistrationLevel p_level); +void unregister_database_sqlite_types(ModuleRegistrationLevel p_level); diff --git a/modules/dds/register_types.cpp b/modules/dds/register_types.cpp index 36ff3b831..93859d3c1 100644 --- a/modules/dds/register_types.cpp +++ b/modules/dds/register_types.cpp @@ -34,12 +34,12 @@ static Ref resource_loader_dds; -void register_dds_types() { +void register_dds_types(ModuleRegistrationLevel p_level) { resource_loader_dds.instance(); ResourceLoader::add_resource_format_loader(resource_loader_dds); } -void unregister_dds_types() { +void unregister_dds_types(ModuleRegistrationLevel p_level) { ResourceLoader::remove_resource_format_loader(resource_loader_dds); resource_loader_dds.unref(); } diff --git a/modules/dds/register_types.h b/modules/dds/register_types.h index a6da7e57e..6b59be3cb 100644 --- a/modules/dds/register_types.h +++ b/modules/dds/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_dds_types(); -void unregister_dds_types(); +#include "modules/register_module_types.h" + +void register_dds_types(ModuleRegistrationLevel p_level); +void unregister_dds_types(ModuleRegistrationLevel p_level); #endif // DDS_REGISTER_TYPES_H diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp index 840e79e27..da5b48b6b 100644 --- a/modules/enet/register_types.cpp +++ b/modules/enet/register_types.cpp @@ -34,7 +34,7 @@ static bool enet_ok = false; -void register_enet_types() { +void register_enet_types(ModuleRegistrationLevel p_level) { if (enet_initialize() != 0) { ERR_PRINT("ENet initialization failure"); } else { @@ -44,7 +44,7 @@ void register_enet_types() { ClassDB::register_class(); } -void unregister_enet_types() { +void unregister_enet_types(ModuleRegistrationLevel p_level) { if (enet_ok) { enet_deinitialize(); } diff --git a/modules/enet/register_types.h b/modules/enet/register_types.h index e49d853bb..26fe3a561 100644 --- a/modules/enet/register_types.h +++ b/modules/enet/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_enet_types(); -void unregister_enet_types(); +#include "modules/register_module_types.h" + +void register_enet_types(ModuleRegistrationLevel p_level); +void unregister_enet_types(ModuleRegistrationLevel p_level); #endif // ENET_REGISTER_TYPES_H diff --git a/modules/entity_spell_system/register_types.cpp b/modules/entity_spell_system/register_types.cpp index 5a3939192..8f7571580 100644 --- a/modules/entity_spell_system/register_types.cpp +++ b/modules/entity_spell_system/register_types.cpp @@ -145,7 +145,7 @@ SOFTWARE. static ESS *entity_data_manager = NULL; static ProfileManager *profile_manager = NULL; -void register_entity_spell_system_types() { +void register_entity_spell_system_types(ModuleRegistrationLevel p_level) { #ifdef MODULE_PROPS_ENABLED ClassDB::register_class(); #endif @@ -288,7 +288,7 @@ void register_entity_spell_system_types() { #endif } -void unregister_entity_spell_system_types() { +void unregister_entity_spell_system_types(ModuleRegistrationLevel p_level) { if (entity_data_manager) { memdelete(entity_data_manager); } diff --git a/modules/entity_spell_system/register_types.h b/modules/entity_spell_system/register_types.h index 9bef4e9ae..3cf10de04 100644 --- a/modules/entity_spell_system/register_types.h +++ b/modules/entity_spell_system/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_entity_spell_system_types(); -void unregister_entity_spell_system_types(); +#include "modules/register_module_types.h" + +void register_entity_spell_system_types(ModuleRegistrationLevel p_level); +void unregister_entity_spell_system_types(ModuleRegistrationLevel p_level); diff --git a/modules/fastnoise/register_types.cpp b/modules/fastnoise/register_types.cpp index 750ea6f48..531dc28fc 100644 --- a/modules/fastnoise/register_types.cpp +++ b/modules/fastnoise/register_types.cpp @@ -5,10 +5,10 @@ #include "fastnoise_noise_params.h" #include "noise.h" -void register_fastnoise_types() { +void register_fastnoise_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); } -void unregister_fastnoise_types() { +void unregister_fastnoise_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/fastnoise/register_types.h b/modules/fastnoise/register_types.h index 5bc777920..da1e63d12 100644 --- a/modules/fastnoise/register_types.h +++ b/modules/fastnoise/register_types.h @@ -1,2 +1,7 @@ -void register_fastnoise_types(); -void unregister_fastnoise_types(); + + +#include "modules/register_module_types.h" + + +void register_fastnoise_types(ModuleRegistrationLevel p_level); +void unregister_fastnoise_types(ModuleRegistrationLevel p_level); diff --git a/modules/freetype/register_types.cpp b/modules/freetype/register_types.cpp index 28fd1a57c..a86d79fb8 100644 --- a/modules/freetype/register_types.cpp +++ b/modules/freetype/register_types.cpp @@ -30,6 +30,6 @@ #include "register_types.h" -void register_freetype_types() {} +void register_freetype_types(ModuleRegistrationLevel p_level) {} -void unregister_freetype_types() {} +void unregister_freetype_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/freetype/register_types.h b/modules/freetype/register_types.h index 7566b0ae6..ad5cb0dc2 100644 --- a/modules/freetype/register_types.h +++ b/modules/freetype/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_freetype_types(); -void unregister_freetype_types(); +#include "modules/register_module_types.h" + +void register_freetype_types(ModuleRegistrationLevel p_level); +void unregister_freetype_types(ModuleRegistrationLevel p_level); #endif // FREETYPE_REGISTER_TYPES_H diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index db9812f35..99a189840 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -136,7 +136,7 @@ static void _editor_init() { #endif // TOOLS_ENABLED -void register_gdscript_types() { +void register_gdscript_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_virtual_class(); @@ -155,7 +155,7 @@ void register_gdscript_types() { #endif // TOOLS_ENABLED } -void unregister_gdscript_types() { +void unregister_gdscript_types(ModuleRegistrationLevel p_level) { ScriptServer::unregister_language(script_language_gd); if (script_language_gd) { diff --git a/modules/gdscript/register_types.h b/modules/gdscript/register_types.h index 51b0368f6..c491e61dd 100644 --- a/modules/gdscript/register_types.h +++ b/modules/gdscript/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_gdscript_types(); -void unregister_gdscript_types(); +#include "modules/register_module_types.h" + +void register_gdscript_types(ModuleRegistrationLevel p_level); +void unregister_gdscript_types(ModuleRegistrationLevel p_level); #endif // GDSCRIPT_REGISTER_TYPES_H diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp index 63590f4e7..f7750c1e2 100644 --- a/modules/gridmap/register_types.cpp +++ b/modules/gridmap/register_types.cpp @@ -40,7 +40,7 @@ #endif #endif -void register_gridmap_types() { +void register_gridmap_types(ModuleRegistrationLevel p_level) { #ifndef _3D_DISABLED ClassDB::register_class(); ClassDB::register_class(); @@ -51,5 +51,5 @@ void register_gridmap_types() { #endif } -void unregister_gridmap_types() { +void unregister_gridmap_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/gridmap/register_types.h b/modules/gridmap/register_types.h index 2fa622bd1..6e4ef2e3d 100644 --- a/modules/gridmap/register_types.h +++ b/modules/gridmap/register_types.h @@ -31,7 +31,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_gridmap_types(); -void unregister_gridmap_types(); +#include "modules/register_module_types.h" + +void register_gridmap_types(ModuleRegistrationLevel p_level); +void unregister_gridmap_types(ModuleRegistrationLevel p_level); #endif // GRIDMAP_REGISTER_TYPES_H diff --git a/modules/hdr/register_types.cpp b/modules/hdr/register_types.cpp index 6bfeecc92..4f338936d 100644 --- a/modules/hdr/register_types.cpp +++ b/modules/hdr/register_types.cpp @@ -34,11 +34,11 @@ static ImageLoaderHDR *image_loader_hdr = nullptr; -void register_hdr_types() { +void register_hdr_types(ModuleRegistrationLevel p_level) { image_loader_hdr = memnew(ImageLoaderHDR); ImageLoader::add_image_format_loader(image_loader_hdr); } -void unregister_hdr_types() { +void unregister_hdr_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_hdr); } diff --git a/modules/hdr/register_types.h b/modules/hdr/register_types.h index 8c89df02c..5fa93a948 100644 --- a/modules/hdr/register_types.h +++ b/modules/hdr/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_hdr_types(); -void unregister_hdr_types(); +#include "modules/register_module_types.h" + +void register_hdr_types(ModuleRegistrationLevel p_level); +void unregister_hdr_types(ModuleRegistrationLevel p_level); #endif // HDR_REGISTER_TYPES_H diff --git a/modules/http_server_simple/register_types.cpp b/modules/http_server_simple/register_types.cpp index 1d58c8bf5..8aad0aacd 100644 --- a/modules/http_server_simple/register_types.cpp +++ b/modules/http_server_simple/register_types.cpp @@ -25,9 +25,9 @@ SOFTWARE. #include "web_server_simple.h" -void register_http_server_simple_types() { +void register_http_server_simple_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); } -void unregister_http_server_simple_types() { +void unregister_http_server_simple_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/http_server_simple/register_types.h b/modules/http_server_simple/register_types.h index c7167a70d..f2e6de7b2 100644 --- a/modules/http_server_simple/register_types.h +++ b/modules/http_server_simple/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_http_server_simple_types(); -void unregister_http_server_simple_types(); +#include "modules/register_module_types.h" + +void register_http_server_simple_types(ModuleRegistrationLevel p_level); +void unregister_http_server_simple_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/jpg/register_types.cpp b/modules/jpg/register_types.cpp index 63203274f..a4e247818 100644 --- a/modules/jpg/register_types.cpp +++ b/modules/jpg/register_types.cpp @@ -34,11 +34,11 @@ static ImageLoaderJPG *image_loader_jpg = nullptr; -void register_jpg_types() { +void register_jpg_types(ModuleRegistrationLevel p_level) { image_loader_jpg = memnew(ImageLoaderJPG); ImageLoader::add_image_format_loader(image_loader_jpg); } -void unregister_jpg_types() { +void unregister_jpg_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_jpg); } diff --git a/modules/jpg/register_types.h b/modules/jpg/register_types.h index da96f08de..9cebe0716 100644 --- a/modules/jpg/register_types.h +++ b/modules/jpg/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_jpg_types(); -void unregister_jpg_types(); +#include "modules/register_module_types.h" + +void register_jpg_types(ModuleRegistrationLevel p_level); +void unregister_jpg_types(ModuleRegistrationLevel p_level); #endif // JPG_REGISTER_TYPES_H diff --git a/modules/lz4/register_types.cpp b/modules/lz4/register_types.cpp index 3a4c20ecc..dc6527d01 100644 --- a/modules/lz4/register_types.cpp +++ b/modules/lz4/register_types.cpp @@ -3,9 +3,9 @@ #include "lz4_compressor.h" -void register_lz4_types() { +void register_lz4_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); } -void unregister_lz4_types() { +void unregister_lz4_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/lz4/register_types.h b/modules/lz4/register_types.h index adf000b93..ef514a647 100644 --- a/modules/lz4/register_types.h +++ b/modules/lz4/register_types.h @@ -1,7 +1,9 @@ #ifndef LZ4_REGISTER_TYPES_H #define LZ4_REGISTER_TYPES_H -void register_lz4_types(); -void unregister_lz4_types(); +#include "modules/register_module_types.h" + +void register_lz4_types(ModuleRegistrationLevel p_level); +void unregister_lz4_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/material_maker/register_types.cpp b/modules/material_maker/register_types.cpp index a208df5bf..83fa8e6c6 100644 --- a/modules/material_maker/register_types.cpp +++ b/modules/material_maker/register_types.cpp @@ -155,7 +155,7 @@ SOFTWARE. static _MMAlgos *_mm_algos_singleton = nullptr; -void register_material_maker_types() { +void register_material_maker_types(ModuleRegistrationLevel p_level) { ClassDB::register_class<_MMAlgos>(); ClassDB::register_class(); @@ -379,7 +379,7 @@ void register_material_maker_types() { #endif } -void unregister_material_maker_types() { +void unregister_material_maker_types(ModuleRegistrationLevel p_level) { if (_mm_algos_singleton) { memdelete(_mm_algos_singleton); } diff --git a/modules/material_maker/register_types.h b/modules/material_maker/register_types.h index 41e44cb4f..a03d428b7 100644 --- a/modules/material_maker/register_types.h +++ b/modules/material_maker/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_material_maker_types(); -void unregister_material_maker_types(); +#include "modules/register_module_types.h" + +void register_material_maker_types(ModuleRegistrationLevel p_level); +void unregister_material_maker_types(ModuleRegistrationLevel p_level); diff --git a/modules/mbedtls/register_types.cpp b/modules/mbedtls/register_types.cpp index d8de75335..92f30a064 100644 --- a/modules/mbedtls/register_types.cpp +++ b/modules/mbedtls/register_types.cpp @@ -35,14 +35,14 @@ #include "packet_peer_mbed_dtls.h" #include "stream_peer_mbedtls.h" -void register_mbedtls_types() { +void register_mbedtls_types(ModuleRegistrationLevel p_level) { CryptoMbedTLS::initialize_crypto(); StreamPeerMbedTLS::initialize_ssl(); PacketPeerMbedDTLS::initialize_dtls(); DTLSServerMbedTLS::initialize(); } -void unregister_mbedtls_types() { +void unregister_mbedtls_types(ModuleRegistrationLevel p_level) { DTLSServerMbedTLS::finalize(); PacketPeerMbedDTLS::finalize_dtls(); StreamPeerMbedTLS::finalize_ssl(); diff --git a/modules/mbedtls/register_types.h b/modules/mbedtls/register_types.h index 3eae4d667..e5a197f2e 100644 --- a/modules/mbedtls/register_types.h +++ b/modules/mbedtls/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_mbedtls_types(); -void unregister_mbedtls_types(); +#include "modules/register_module_types.h" + +void register_mbedtls_types(ModuleRegistrationLevel p_level); +void unregister_mbedtls_types(ModuleRegistrationLevel p_level); #endif // MBEDTLS_REGISTER_TYPES_H diff --git a/modules/mesh_data_resource/register_types.cpp b/modules/mesh_data_resource/register_types.cpp index 69de6b182..2dd49e9da 100644 --- a/modules/mesh_data_resource/register_types.cpp +++ b/modules/mesh_data_resource/register_types.cpp @@ -52,7 +52,7 @@ SOFTWARE. #include "props_2d/prop_2d_data_mesh_data.h" #endif -void register_mesh_data_resource_types() { +void register_mesh_data_resource_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -84,5 +84,5 @@ void register_mesh_data_resource_types() { #endif } -void unregister_mesh_data_resource_types() { +void unregister_mesh_data_resource_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/mesh_data_resource/register_types.h b/modules/mesh_data_resource/register_types.h index 0aba9d7c9..ad6cd1160 100644 --- a/modules/mesh_data_resource/register_types.h +++ b/modules/mesh_data_resource/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_mesh_data_resource_types(); -void unregister_mesh_data_resource_types(); +#include "modules/register_module_types.h" + +void register_mesh_data_resource_types(ModuleRegistrationLevel p_level); +void unregister_mesh_data_resource_types(ModuleRegistrationLevel p_level); diff --git a/modules/mesh_utils/register_types.cpp b/modules/mesh_utils/register_types.cpp index de33b3ff0..051620949 100644 --- a/modules/mesh_utils/register_types.cpp +++ b/modules/mesh_utils/register_types.cpp @@ -32,7 +32,7 @@ SOFTWARE. static MeshUtils *mesh_utils = NULL; -void register_mesh_utils_types() { +void register_mesh_utils_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -41,7 +41,7 @@ void register_mesh_utils_types() { Engine::get_singleton()->add_singleton(Engine::Singleton("MeshUtils", MeshUtils::get_singleton())); } -void unregister_mesh_utils_types() { +void unregister_mesh_utils_types(ModuleRegistrationLevel p_level) { if (mesh_utils) { memdelete(mesh_utils); } diff --git a/modules/mesh_utils/register_types.h b/modules/mesh_utils/register_types.h index 099863a14..e92236c1e 100644 --- a/modules/mesh_utils/register_types.h +++ b/modules/mesh_utils/register_types.h @@ -25,7 +25,9 @@ SOFTWARE. */ -void register_mesh_utils_types(); -void unregister_mesh_utils_types(); +#include "modules/register_module_types.h" + +void register_mesh_utils_types(ModuleRegistrationLevel p_level); +void unregister_mesh_utils_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/minimp3/register_types.cpp b/modules/minimp3/register_types.cpp index e33068796..43dba8b2b 100644 --- a/modules/minimp3/register_types.cpp +++ b/modules/minimp3/register_types.cpp @@ -37,7 +37,7 @@ #include "resource_importer_mp3.h" #endif -void register_minimp3_types() { +void register_minimp3_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { Ref mp3_import; @@ -48,5 +48,5 @@ void register_minimp3_types() { ClassDB::register_class(); } -void unregister_minimp3_types() { +void unregister_minimp3_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/minimp3/register_types.h b/modules/minimp3/register_types.h index 6b8f9b616..34fcc76f3 100644 --- a/modules/minimp3/register_types.h +++ b/modules/minimp3/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_minimp3_types(); -void unregister_minimp3_types(); +#include "modules/register_module_types.h" + +void register_minimp3_types(ModuleRegistrationLevel p_level); +void unregister_minimp3_types(ModuleRegistrationLevel p_level); #endif // MINIMP3_REGISTER_TYPES_H diff --git a/modules/navigation/register_types.cpp b/modules/navigation/register_types.cpp index aa1fd4b5a..1686abdb8 100644 --- a/modules/navigation/register_types.cpp +++ b/modules/navigation/register_types.cpp @@ -50,7 +50,7 @@ NavigationServer *new_server() { return memnew(PandemoniumNavigationServer); } -void register_navigation_types() { +void register_navigation_types(ModuleRegistrationLevel p_level) { NavigationServerManager::set_default_server(new_server); #ifndef _3D_DISABLED @@ -64,7 +64,7 @@ void register_navigation_types() { #endif } -void unregister_navigation_types() { +void unregister_navigation_types(ModuleRegistrationLevel p_level) { #ifndef _3D_DISABLED if (_nav_mesh_generator) { memdelete(_nav_mesh_generator); diff --git a/modules/navigation/register_types.h b/modules/navigation/register_types.h index 37d9de90e..3cbbe4884 100644 --- a/modules/navigation/register_types.h +++ b/modules/navigation/register_types.h @@ -28,5 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_navigation_types(); -void unregister_navigation_types(); +#include "modules/register_module_types.h" + +void register_navigation_types(ModuleRegistrationLevel p_level); +void unregister_navigation_types(ModuleRegistrationLevel p_level); diff --git a/modules/network_synchronizer/register_types.cpp b/modules/network_synchronizer/register_types.cpp index 60d1c55a3..55c68c0e6 100644 --- a/modules/network_synchronizer/register_types.cpp +++ b/modules/network_synchronizer/register_types.cpp @@ -42,7 +42,7 @@ #include "core/config/project_settings.h" -void register_network_synchronizer_types() { +void register_network_synchronizer_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); @@ -53,5 +53,5 @@ void register_network_synchronizer_types() { GLOBAL_DEF("NetworkSynchronizer/debug_doll_speedup", false); } -void unregister_network_synchronizer_types() { +void unregister_network_synchronizer_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/network_synchronizer/register_types.h b/modules/network_synchronizer/register_types.h index 5fdca264f..d14b59c04 100644 --- a/modules/network_synchronizer/register_types.h +++ b/modules/network_synchronizer/register_types.h @@ -32,5 +32,7 @@ @author AndreaCatania */ -void register_network_synchronizer_types(); -void unregister_network_synchronizer_types(); +#include "modules/register_module_types.h" + +void register_network_synchronizer_types(ModuleRegistrationLevel p_level); +void unregister_network_synchronizer_types(ModuleRegistrationLevel p_level); diff --git a/modules/ogg/register_types.cpp b/modules/ogg/register_types.cpp index 40b560d05..c66482930 100644 --- a/modules/ogg/register_types.cpp +++ b/modules/ogg/register_types.cpp @@ -32,6 +32,6 @@ // Dummy module as libogg is needed by other modules (vorbis, theora, opus, ...) -void register_ogg_types() {} +void register_ogg_types(ModuleRegistrationLevel p_level) {} -void unregister_ogg_types() {} +void unregister_ogg_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/ogg/register_types.h b/modules/ogg/register_types.h index 0007a2416..4dc3f46b2 100644 --- a/modules/ogg/register_types.h +++ b/modules/ogg/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_ogg_types(); -void unregister_ogg_types(); +#include "modules/register_module_types.h" + +void register_ogg_types(ModuleRegistrationLevel p_level); +void unregister_ogg_types(ModuleRegistrationLevel p_level); #endif // OGG_REGISTER_TYPES_H diff --git a/modules/opensimplex/register_types.cpp b/modules/opensimplex/register_types.cpp index 0d280559f..a5e7eda74 100644 --- a/modules/opensimplex/register_types.cpp +++ b/modules/opensimplex/register_types.cpp @@ -32,10 +32,10 @@ #include "noise_texture.h" #include "open_simplex_noise.h" -void register_opensimplex_types() { +void register_opensimplex_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); } -void unregister_opensimplex_types() { +void unregister_opensimplex_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/opensimplex/register_types.h b/modules/opensimplex/register_types.h index 5f2ce8847..beb9cc895 100644 --- a/modules/opensimplex/register_types.h +++ b/modules/opensimplex/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_opensimplex_types(); -void unregister_opensimplex_types(); +#include "modules/register_module_types.h" + +void register_opensimplex_types(ModuleRegistrationLevel p_level); +void unregister_opensimplex_types(ModuleRegistrationLevel p_level); #endif // OPENSIMPLEX_REGISTER_TYPES_H diff --git a/modules/opus/register_types.cpp b/modules/opus/register_types.cpp index d2e0a81e2..b74e7c59a 100644 --- a/modules/opus/register_types.cpp +++ b/modules/opus/register_types.cpp @@ -32,6 +32,6 @@ // Dummy module as libvorbis is needed by other modules (theora ...) -void register_opus_types() {} +void register_opus_types(ModuleRegistrationLevel p_level) {} -void unregister_opus_types() {} +void unregister_opus_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/opus/register_types.h b/modules/opus/register_types.h index f9032d2a2..7f429d562 100644 --- a/modules/opus/register_types.h +++ b/modules/opus/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_opus_types(); -void unregister_opus_types(); +#include "modules/register_module_types.h" + +void register_opus_types(ModuleRegistrationLevel p_level); +void unregister_opus_types(ModuleRegistrationLevel p_level); #endif // OPUS_REGISTER_TYPES_H diff --git a/modules/paint/register_types.cpp b/modules/paint/register_types.cpp index 1c7cface8..16dde86fe 100644 --- a/modules/paint/register_types.cpp +++ b/modules/paint/register_types.cpp @@ -52,7 +52,7 @@ SOFTWARE. #include "editor/paint_editor_plugin.h" #endif -void register_paint_types() { +void register_paint_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -84,5 +84,5 @@ void register_paint_types() { #endif } -void unregister_paint_types() { +void unregister_paint_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/paint/register_types.h b/modules/paint/register_types.h index 3078fa581..01f227829 100644 --- a/modules/paint/register_types.h +++ b/modules/paint/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_paint_types(); -void unregister_paint_types(); +#include "modules/register_module_types.h" + +void register_paint_types(ModuleRegistrationLevel p_level); +void unregister_paint_types(ModuleRegistrationLevel p_level); diff --git a/modules/props/register_types.cpp b/modules/props/register_types.cpp index 6089ca505..d1baf7ac9 100644 --- a/modules/props/register_types.cpp +++ b/modules/props/register_types.cpp @@ -71,7 +71,7 @@ SOFTWARE. static PropUtils *prop_utils = NULL; static PropCache *prop_texture_cache = NULL; -void register_props_types() { +void register_props_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -138,7 +138,7 @@ void register_props_types() { #endif } -void unregister_props_types() { +void unregister_props_types(ModuleRegistrationLevel p_level) { if (prop_utils) { memdelete(prop_utils); } diff --git a/modules/props/register_types.h b/modules/props/register_types.h index 8f08c971e..7df120019 100644 --- a/modules/props/register_types.h +++ b/modules/props/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_props_types(); -void unregister_props_types(); +#include "modules/register_module_types.h" + +void register_props_types(ModuleRegistrationLevel p_level); +void unregister_props_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/props_2d/register_types.cpp b/modules/props_2d/register_types.cpp index e85c5ec3c..766d21d0b 100644 --- a/modules/props_2d/register_types.cpp +++ b/modules/props_2d/register_types.cpp @@ -71,7 +71,7 @@ SOFTWARE. static Prop2DUtils *prop_utils = NULL; static Prop2DCache *prop_texture_cache = NULL; -void register_props_2d_types() { +void register_props_2d_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -141,7 +141,7 @@ void register_props_2d_types() { #endif } -void unregister_props_2d_types() { +void unregister_props_2d_types(ModuleRegistrationLevel p_level) { if (prop_utils) { memdelete(prop_utils); } diff --git a/modules/props_2d/register_types.h b/modules/props_2d/register_types.h index 9bba34deb..0874b8af1 100644 --- a/modules/props_2d/register_types.h +++ b/modules/props_2d/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_props_2d_types(); -void unregister_props_2d_types(); +#include "modules/register_module_types.h" + +void register_props_2d_types(ModuleRegistrationLevel p_level); +void unregister_props_2d_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp index c3e208636..ab4f76ff5 100644 --- a/modules/pvr/register_types.cpp +++ b/modules/pvr/register_types.cpp @@ -35,14 +35,14 @@ static Ref resource_loader_pvr; -void register_pvr_types() { +void register_pvr_types(ModuleRegistrationLevel p_level) { resource_loader_pvr.instance(); ResourceLoader::add_resource_format_loader(resource_loader_pvr); _register_pvrtc_compress_func(); } -void unregister_pvr_types() { +void unregister_pvr_types(ModuleRegistrationLevel p_level) { ResourceLoader::remove_resource_format_loader(resource_loader_pvr); resource_loader_pvr.unref(); } diff --git a/modules/pvr/register_types.h b/modules/pvr/register_types.h index c8c43c647..7768a2f4c 100644 --- a/modules/pvr/register_types.h +++ b/modules/pvr/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_pvr_types(); -void unregister_pvr_types(); +#include "modules/register_module_types.h" + +void register_pvr_types(ModuleRegistrationLevel p_level); +void unregister_pvr_types(ModuleRegistrationLevel p_level); #endif // PVR_REGISTER_TYPES_H diff --git a/modules/regex/register_types.cpp b/modules/regex/register_types.cpp index 9a0183432..1843ef311 100644 --- a/modules/regex/register_types.cpp +++ b/modules/regex/register_types.cpp @@ -32,10 +32,10 @@ #include "core/object/class_db.h" #include "regex.h" -void register_regex_types() { +void register_regex_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); } -void unregister_regex_types() { +void unregister_regex_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/regex/register_types.h b/modules/regex/register_types.h index f2be2ccc0..6555203ca 100644 --- a/modules/regex/register_types.h +++ b/modules/regex/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_regex_types(); -void unregister_regex_types(); +#include "modules/register_module_types.h" + +void register_regex_types(ModuleRegistrationLevel p_level); +void unregister_regex_types(ModuleRegistrationLevel p_level); #endif // REGEX_REGISTER_TYPES_H diff --git a/modules/register_module_types.h b/modules/register_module_types.h index 8e1f3f27a..3cf01da62 100644 --- a/modules/register_module_types.h +++ b/modules/register_module_types.h @@ -30,7 +30,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_module_types(); -void unregister_module_types(); +enum ModuleRegistrationLevel { + MODULE_REGISTRATION_LEVEL_CORE = 0, + MODULE_REGISTRATION_LEVEL_DRIVER, + MODULE_REGISTRATION_LEVEL_PLATFORM, + MODULE_REGISTRATION_LEVEL_SERVER, + MODULE_REGISTRATION_LEVEL_SCENE, + MODULE_REGISTRATION_LEVEL_EDITOR, + MODULE_REGISTRATION_LEVEL_TEST, +}; + +void register_module_types(ModuleRegistrationLevel p_level); +void unregister_module_types(ModuleRegistrationLevel p_level); #endif // REGISTER_MODULE_TYPES_H diff --git a/modules/skeleton_2d/register_types.cpp b/modules/skeleton_2d/register_types.cpp index 4fb5e65d9..7777d67e3 100644 --- a/modules/skeleton_2d/register_types.cpp +++ b/modules/skeleton_2d/register_types.cpp @@ -18,7 +18,7 @@ #include "editor/skeleton_2d_editor_plugin.h" #endif -void register_skeleton_2d_types() { +void register_skeleton_2d_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); @@ -40,5 +40,5 @@ void register_skeleton_2d_types() { #endif } -void unregister_skeleton_2d_types() { +void unregister_skeleton_2d_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/skeleton_2d/register_types.h b/modules/skeleton_2d/register_types.h index 048dfcd85..b14e85b48 100644 --- a/modules/skeleton_2d/register_types.h +++ b/modules/skeleton_2d/register_types.h @@ -1,3 +1,7 @@ -void register_skeleton_2d_types(); -void unregister_skeleton_2d_types(); + +#include "modules/register_module_types.h" + + +void register_skeleton_2d_types(ModuleRegistrationLevel p_level); +void unregister_skeleton_2d_types(ModuleRegistrationLevel p_level); diff --git a/modules/skeleton_3d/register_types.cpp b/modules/skeleton_3d/register_types.cpp index 3b58ec6df..d37d869a7 100644 --- a/modules/skeleton_3d/register_types.cpp +++ b/modules/skeleton_3d/register_types.cpp @@ -24,7 +24,7 @@ #include "editor/physical_bone_plugin.h" #endif -void register_skeleton_3d_types() { +void register_skeleton_3d_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); @@ -51,5 +51,5 @@ void register_skeleton_3d_types() { #endif } -void unregister_skeleton_3d_types() { +void unregister_skeleton_3d_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/skeleton_3d/register_types.h b/modules/skeleton_3d/register_types.h index 978d2ad71..5de1d1225 100644 --- a/modules/skeleton_3d/register_types.h +++ b/modules/skeleton_3d/register_types.h @@ -1,3 +1,7 @@ -void register_skeleton_3d_types(); -void unregister_skeleton_3d_types(); + +#include "modules/register_module_types.h" + + +void register_skeleton_3d_types(ModuleRegistrationLevel p_level); +void unregister_skeleton_3d_types(ModuleRegistrationLevel p_level); diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp index 0eb635607..54a5ab3e1 100644 --- a/modules/squish/register_types.cpp +++ b/modules/squish/register_types.cpp @@ -31,9 +31,9 @@ #include "register_types.h" #include "image_compress_squish.h" -void register_squish_types() { +void register_squish_types(ModuleRegistrationLevel p_level) { Image::set_compress_bc_func(image_compress_squish); Image::_image_decompress_bc = image_decompress_squish; } -void unregister_squish_types() {} +void unregister_squish_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/squish/register_types.h b/modules/squish/register_types.h index 3b3d2a82f..9cc1ce4ac 100644 --- a/modules/squish/register_types.h +++ b/modules/squish/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_squish_types(); -void unregister_squish_types(); +#include "modules/register_module_types.h" + +void register_squish_types(ModuleRegistrationLevel p_level); +void unregister_squish_types(ModuleRegistrationLevel p_level); #endif // SQUISH_REGISTER_TYPES_H diff --git a/modules/stb_vorbis/register_types.cpp b/modules/stb_vorbis/register_types.cpp index 86560be66..503350cd8 100644 --- a/modules/stb_vorbis/register_types.cpp +++ b/modules/stb_vorbis/register_types.cpp @@ -37,7 +37,7 @@ #include "resource_importer_ogg_vorbis.h" #endif -void register_stb_vorbis_types() { +void register_stb_vorbis_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { Ref ogg_import; @@ -48,5 +48,5 @@ void register_stb_vorbis_types() { ClassDB::register_class(); } -void unregister_stb_vorbis_types() { +void unregister_stb_vorbis_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/stb_vorbis/register_types.h b/modules/stb_vorbis/register_types.h index fd3b069a8..ac5487871 100644 --- a/modules/stb_vorbis/register_types.h +++ b/modules/stb_vorbis/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_stb_vorbis_types(); -void unregister_stb_vorbis_types(); +#include "modules/register_module_types.h" + +void register_stb_vorbis_types(ModuleRegistrationLevel p_level); +void unregister_stb_vorbis_types(ModuleRegistrationLevel p_level); #endif // STB_VORBIS_REGISTER_TYPES_H diff --git a/modules/steering_ai/register_types.cpp b/modules/steering_ai/register_types.cpp index f0b374feb..676ba6ecf 100644 --- a/modules/steering_ai/register_types.cpp +++ b/modules/steering_ai/register_types.cpp @@ -61,7 +61,7 @@ SOFTWARE. static GSAIUtils *gs_ai_utils = NULL; -void register_steering_ai_types() { +void register_steering_ai_types(ModuleRegistrationLevel p_level) { gs_ai_utils = memnew(GSAIUtils); ClassDB::register_class(); Engine::get_singleton()->add_singleton(Engine::Singleton("GSAIUtils", GSAIUtils::get_singleton())); @@ -99,7 +99,7 @@ void register_steering_ai_types() { ClassDB::register_class(); } -void unregister_steering_ai_types() { +void unregister_steering_ai_types(ModuleRegistrationLevel p_level) { if (gs_ai_utils) { memdelete(gs_ai_utils); } diff --git a/modules/steering_ai/register_types.h b/modules/steering_ai/register_types.h index 32eece552..80f25f7d6 100644 --- a/modules/steering_ai/register_types.h +++ b/modules/steering_ai/register_types.h @@ -25,7 +25,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_steering_ai_types(); -void unregister_steering_ai_types(); +#include "modules/register_module_types.h" + +void register_steering_ai_types(ModuleRegistrationLevel p_level); +void unregister_steering_ai_types(ModuleRegistrationLevel p_level); #endif \ No newline at end of file diff --git a/modules/svg/register_types.cpp b/modules/svg/register_types.cpp index 1560af95c..8ac4ec256 100644 --- a/modules/svg/register_types.cpp +++ b/modules/svg/register_types.cpp @@ -34,11 +34,11 @@ static ImageLoaderSVG *image_loader_svg = nullptr; -void register_svg_types() { +void register_svg_types(ModuleRegistrationLevel p_level) { image_loader_svg = memnew(ImageLoaderSVG); ImageLoader::add_image_format_loader(image_loader_svg); } -void unregister_svg_types() { +void unregister_svg_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_svg); } diff --git a/modules/svg/register_types.h b/modules/svg/register_types.h index fcefb8b82..727777091 100644 --- a/modules/svg/register_types.h +++ b/modules/svg/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_svg_types(); -void unregister_svg_types(); +#include "modules/register_module_types.h" + +void register_svg_types(ModuleRegistrationLevel p_level); +void unregister_svg_types(ModuleRegistrationLevel p_level); #endif // SVG_REGISTER_TYPES_H diff --git a/modules/terraman/register_types.cpp b/modules/terraman/register_types.cpp index f8677bc25..8596f99c2 100644 --- a/modules/terraman/register_types.cpp +++ b/modules/terraman/register_types.cpp @@ -70,7 +70,7 @@ SOFTWARE. #include "world/jobs/terrain_prop_job.h" #include "world/jobs/terrain_terrain_job.h" -void register_terraman_types() { +void register_terraman_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -121,5 +121,5 @@ void register_terraman_types() { #endif } -void unregister_terraman_types() { +void unregister_terraman_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/terraman/register_types.h b/modules/terraman/register_types.h index a50637b40..e2e5424a6 100644 --- a/modules/terraman/register_types.h +++ b/modules/terraman/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_terraman_types(); -void unregister_terraman_types(); +#include "modules/register_module_types.h" + +void register_terraman_types(ModuleRegistrationLevel p_level); +void unregister_terraman_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/terraman_2d/register_types.cpp b/modules/terraman_2d/register_types.cpp index 586cd4e52..04db9681e 100644 --- a/modules/terraman_2d/register_types.cpp +++ b/modules/terraman_2d/register_types.cpp @@ -72,7 +72,7 @@ SOFTWARE. #include "world/jobs/terrain_2d_prop_job.h" #include "world/jobs/terrain_2d_terrain_job.h" -void register_terraman_2d_types() { +void register_terraman_2d_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -126,5 +126,5 @@ void register_terraman_2d_types() { #endif } -void unregister_terraman_2d_types() { +void unregister_terraman_2d_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/terraman_2d/register_types.h b/modules/terraman_2d/register_types.h index dc0c81c4d..833b6452d 100644 --- a/modules/terraman_2d/register_types.h +++ b/modules/terraman_2d/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_terraman_2d_types(); -void unregister_terraman_2d_types(); +#include "modules/register_module_types.h" + +void register_terraman_2d_types(ModuleRegistrationLevel p_level); +void unregister_terraman_2d_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/texture_packer/register_types.cpp b/modules/texture_packer/register_types.cpp index 248c55d21..cf60265eb 100644 --- a/modules/texture_packer/register_types.cpp +++ b/modules/texture_packer/register_types.cpp @@ -35,7 +35,7 @@ SOFTWARE. #include "texture_resource/editor_plugin_packer_image_resource.h" #endif -void register_texture_packer_types() { +void register_texture_packer_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -48,5 +48,5 @@ void register_texture_packer_types() { #endif } -void unregister_texture_packer_types() { +void unregister_texture_packer_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/texture_packer/register_types.h b/modules/texture_packer/register_types.h index 399992605..12b717589 100644 --- a/modules/texture_packer/register_types.h +++ b/modules/texture_packer/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_texture_packer_types(); -void unregister_texture_packer_types(); +#include "modules/register_module_types.h" + +void register_texture_packer_types(ModuleRegistrationLevel p_level); +void unregister_texture_packer_types(ModuleRegistrationLevel p_level); diff --git a/modules/tga/register_types.cpp b/modules/tga/register_types.cpp index 35f9d1095..a9635edfb 100644 --- a/modules/tga/register_types.cpp +++ b/modules/tga/register_types.cpp @@ -34,11 +34,11 @@ static ImageLoaderTGA *image_loader_tga = nullptr; -void register_tga_types() { +void register_tga_types(ModuleRegistrationLevel p_level) { image_loader_tga = memnew(ImageLoaderTGA); ImageLoader::add_image_format_loader(image_loader_tga); } -void unregister_tga_types() { +void unregister_tga_types(ModuleRegistrationLevel p_level) { memdelete(image_loader_tga); } diff --git a/modules/tga/register_types.h b/modules/tga/register_types.h index 2e9aeecc8..4fe941b13 100644 --- a/modules/tga/register_types.h +++ b/modules/tga/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_tga_types(); -void unregister_tga_types(); +#include "modules/register_module_types.h" + +void register_tga_types(ModuleRegistrationLevel p_level); +void unregister_tga_types(ModuleRegistrationLevel p_level); #endif // TGA_REGISTER_TYPES_H diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp index f85055235..284b93901 100644 --- a/modules/theora/register_types.cpp +++ b/modules/theora/register_types.cpp @@ -34,14 +34,14 @@ static Ref resource_loader_theora; -void register_theora_types() { +void register_theora_types(ModuleRegistrationLevel p_level) { resource_loader_theora.instance(); ResourceLoader::add_resource_format_loader(resource_loader_theora, true); ClassDB::register_class(); } -void unregister_theora_types() { +void unregister_theora_types(ModuleRegistrationLevel p_level) { ResourceLoader::remove_resource_format_loader(resource_loader_theora); resource_loader_theora.unref(); } diff --git a/modules/theora/register_types.h b/modules/theora/register_types.h index dea1ebecf..498bf9157 100644 --- a/modules/theora/register_types.h +++ b/modules/theora/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_theora_types(); -void unregister_theora_types(); +#include "modules/register_module_types.h" + +void register_theora_types(ModuleRegistrationLevel p_level); +void unregister_theora_types(ModuleRegistrationLevel p_level); #endif // THEORA_REGISTER_TYPES_H diff --git a/modules/tile_map/register_types.cpp b/modules/tile_map/register_types.cpp index b1bf71f24..137368919 100644 --- a/modules/tile_map/register_types.cpp +++ b/modules/tile_map/register_types.cpp @@ -30,7 +30,7 @@ SOFTWARE. #include "tile_set_editor_plugin.h" #endif -void register_tile_map_types() { +void register_tile_map_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED EditorPlugins::add_by_type(); EditorPlugins::add_by_type(); @@ -45,5 +45,5 @@ void register_tile_map_types() { #endif } -void unregister_tile_map_types() { +void unregister_tile_map_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/tile_map/register_types.h b/modules/tile_map/register_types.h index 1e8ebd30c..8df80ef1a 100644 --- a/modules/tile_map/register_types.h +++ b/modules/tile_map/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_tile_map_types(); -void unregister_tile_map_types(); +#include "modules/register_module_types.h" + +void register_tile_map_types(ModuleRegistrationLevel p_level); +void unregister_tile_map_types(ModuleRegistrationLevel p_level); diff --git a/modules/ui_extensions/register_types.cpp b/modules/ui_extensions/register_types.cpp index cbb192600..8f1271d4c 100644 --- a/modules/ui_extensions/register_types.cpp +++ b/modules/ui_extensions/register_types.cpp @@ -27,11 +27,11 @@ SOFTWARE. #include "core/input/shortcut.h" #include "touch_button.h" -void register_ui_extensions_types() { +void register_ui_extensions_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); } -void unregister_ui_extensions_types() { +void unregister_ui_extensions_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/ui_extensions/register_types.h b/modules/ui_extensions/register_types.h index 3face26c2..8b560c061 100644 --- a/modules/ui_extensions/register_types.h +++ b/modules/ui_extensions/register_types.h @@ -20,5 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_ui_extensions_types(); -void unregister_ui_extensions_types(); +#include "modules/register_module_types.h" + +void register_ui_extensions_types(ModuleRegistrationLevel p_level); +void unregister_ui_extensions_types(ModuleRegistrationLevel p_level); diff --git a/modules/upnp/register_types.cpp b/modules/upnp/register_types.cpp index f47a9f3d6..2561ace65 100644 --- a/modules/upnp/register_types.cpp +++ b/modules/upnp/register_types.cpp @@ -35,10 +35,10 @@ #include "upnp.h" #include "upnp_device.h" -void register_upnp_types() { +void register_upnp_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); } -void unregister_upnp_types() { +void unregister_upnp_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/upnp/register_types.h b/modules/upnp/register_types.h index 200cc0d96..4ea8f944c 100644 --- a/modules/upnp/register_types.h +++ b/modules/upnp/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_upnp_types(); -void unregister_upnp_types(); +#include "modules/register_module_types.h" + +void register_upnp_types(ModuleRegistrationLevel p_level); +void unregister_upnp_types(ModuleRegistrationLevel p_level); #endif // UPNP_REGISTER_TYPES_H diff --git a/modules/users/register_types.cpp b/modules/users/register_types.cpp index aa5671d95..f89f2a236 100644 --- a/modules/users/register_types.cpp +++ b/modules/users/register_types.cpp @@ -54,7 +54,7 @@ SOFTWARE. UserDB *_user_db = nullptr; -void register_users_types() { +void register_users_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -85,7 +85,7 @@ void register_users_types() { #endif } -void unregister_users_types() { +void unregister_users_types(ModuleRegistrationLevel p_level) { if (_user_db) { memdelete(_user_db); } diff --git a/modules/users/register_types.h b/modules/users/register_types.h index c5a16dcdf..5d91d286c 100644 --- a/modules/users/register_types.h +++ b/modules/users/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_users_types(); -void unregister_users_types(); +#include "modules/register_module_types.h" + +void register_users_types(ModuleRegistrationLevel p_level); +void unregister_users_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/vhacd/register_types.cpp b/modules/vhacd/register_types.cpp index 16172e6e5..b213cf1f5 100644 --- a/modules/vhacd/register_types.cpp +++ b/modules/vhacd/register_types.cpp @@ -78,10 +78,10 @@ static Vector> convex_decompose(const real_t *p_vertices, in return ret; } -void register_vhacd_types() { +void register_vhacd_types(ModuleRegistrationLevel p_level) { Mesh::convex_decomposition_function = convex_decompose; } -void unregister_vhacd_types() { +void unregister_vhacd_types(ModuleRegistrationLevel p_level) { Mesh::convex_decomposition_function = nullptr; } diff --git a/modules/vhacd/register_types.h b/modules/vhacd/register_types.h index f2a40f7af..30d3de2f9 100644 --- a/modules/vhacd/register_types.h +++ b/modules/vhacd/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_vhacd_types(); -void unregister_vhacd_types(); +#include "modules/register_module_types.h" + +void register_vhacd_types(ModuleRegistrationLevel p_level); +void unregister_vhacd_types(ModuleRegistrationLevel p_level); #endif // VHACD_REGISTER_TYPES_H diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp index daa3031fd..a475790ba 100644 --- a/modules/vorbis/register_types.cpp +++ b/modules/vorbis/register_types.cpp @@ -32,6 +32,6 @@ // Dummy module as libvorbis is needed by other modules (theora ...) -void register_vorbis_types() {} +void register_vorbis_types(ModuleRegistrationLevel p_level) {} -void unregister_vorbis_types() {} +void unregister_vorbis_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/vorbis/register_types.h b/modules/vorbis/register_types.h index d3692992e..e5ed3ac60 100644 --- a/modules/vorbis/register_types.h +++ b/modules/vorbis/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_vorbis_types(); -void unregister_vorbis_types(); +#include "modules/register_module_types.h" + +void register_vorbis_types(ModuleRegistrationLevel p_level); +void unregister_vorbis_types(ModuleRegistrationLevel p_level); #endif // VORBIS_REGISTER_TYPES_H diff --git a/modules/voxelman/register_types.cpp b/modules/voxelman/register_types.cpp index 0d9464697..a76b05f9d 100644 --- a/modules/voxelman/register_types.cpp +++ b/modules/voxelman/register_types.cpp @@ -83,7 +83,7 @@ SOFTWARE. #include "world/jobs/voxel_prop_job.h" #include "world/jobs/voxel_terrain_job.h" -void register_voxelman_types() { +void register_voxelman_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); @@ -147,5 +147,5 @@ void register_voxelman_types() { #endif } -void unregister_voxelman_types() { +void unregister_voxelman_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/voxelman/register_types.h b/modules/voxelman/register_types.h index 8406818e6..f4a6e50a5 100644 --- a/modules/voxelman/register_types.h +++ b/modules/voxelman/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_voxelman_types(); -void unregister_voxelman_types(); +#include "modules/register_module_types.h" + +void register_voxelman_types(ModuleRegistrationLevel p_level); +void unregister_voxelman_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/web/register_types.cpp b/modules/web/register_types.cpp index 9b3ba903b..91c807b4c 100644 --- a/modules/web/register_types.cpp +++ b/modules/web/register_types.cpp @@ -72,7 +72,7 @@ SOFTWARE. #include "database/http_session_manager_db.h" #endif -void register_web_types() { +void register_web_types(ModuleRegistrationLevel p_level) { ClassDB::register_class<_HTMLBuilder>(); ClassDB::register_class<_HTMLTag>(); @@ -146,5 +146,5 @@ void register_web_types() { #endif } -void unregister_web_types() { +void unregister_web_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/web/register_types.h b/modules/web/register_types.h index cf3c19cdd..8bf111a8e 100644 --- a/modules/web/register_types.h +++ b/modules/web/register_types.h @@ -22,7 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_web_types(); -void unregister_web_types(); +#include "modules/register_module_types.h" + +void register_web_types(ModuleRegistrationLevel p_level); +void unregister_web_types(ModuleRegistrationLevel p_level); #endif diff --git a/modules/websocket/register_types.cpp b/modules/websocket/register_types.cpp index 28edd2031..8aabf80ca 100644 --- a/modules/websocket/register_types.cpp +++ b/modules/websocket/register_types.cpp @@ -41,7 +41,7 @@ #include "wsl_server.h" #endif -void register_websocket_types() { +void register_websocket_types(ModuleRegistrationLevel p_level) { #define _SET_HINT(NAME, _VAL_, _MAX_) \ GLOBAL_DEF(NAME, _VAL_); \ ProjectSettings::get_singleton()->set_custom_property_info(NAME, PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater")); @@ -74,4 +74,4 @@ void register_websocket_types() { ClassDB::register_custom_instance_class(); } -void unregister_websocket_types() {} +void unregister_websocket_types(ModuleRegistrationLevel p_level) {} diff --git a/modules/websocket/register_types.h b/modules/websocket/register_types.h index e3e107e7f..1472dcc8d 100644 --- a/modules/websocket/register_types.h +++ b/modules/websocket/register_types.h @@ -30,7 +30,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_websocket_types(); -void unregister_websocket_types(); +#include "modules/register_module_types.h" + +void register_websocket_types(ModuleRegistrationLevel p_level); +void unregister_websocket_types(ModuleRegistrationLevel p_level); #endif // WEBSOCKET_REGISTER_TYPES_H diff --git a/modules/wfc/register_types.cpp b/modules/wfc/register_types.cpp index 9867e239f..8ed4e6848 100644 --- a/modules/wfc/register_types.cpp +++ b/modules/wfc/register_types.cpp @@ -6,12 +6,12 @@ #include "wave_form_collapse.h" #include "image_indexer.h" -void register_wfc_types() { +void register_wfc_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); } -void unregister_wfc_types() { +void unregister_wfc_types(ModuleRegistrationLevel p_level) { } diff --git a/modules/wfc/register_types.h b/modules/wfc/register_types.h index 4ef314102..ad59c1a2d 100644 --- a/modules/wfc/register_types.h +++ b/modules/wfc/register_types.h @@ -1,3 +1,5 @@ -void register_wfc_types(); -void unregister_wfc_types(); +#include "modules/register_module_types.h" + +void register_wfc_types(ModuleRegistrationLevel p_level); +void unregister_wfc_types(ModuleRegistrationLevel p_level);