Now modules make use of the new registration levels.

This commit is contained in:
Relintai 2023-01-15 17:04:00 +01:00
parent 50e98d6a10
commit 227e32b67c
55 changed files with 1154 additions and 906 deletions

View File

@ -35,9 +35,11 @@
#include "image_compress_cvtt.h"
void register_cvtt_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
Image::set_compress_bptc_func(image_compress_cvtt);
Image::_image_decompress_bptc = image_decompress_cvtt;
}
}
void unregister_cvtt_types(ModuleRegistrationLevel p_level) {}

View File

@ -36,13 +36,17 @@
static Ref<ResourceFormatPKM> resource_loader_pkm;
void register_etc_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
resource_loader_pkm.instance();
ResourceLoader::add_resource_format_loader(resource_loader_pkm);
_register_etc_compress_func();
}
}
void unregister_etc_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ResourceLoader::remove_resource_format_loader(resource_loader_pkm);
resource_loader_pkm.unref();
}
}

View File

@ -52,6 +52,7 @@ static void _editor_init() {
void register_gltf_types(ModuleRegistrationLevel p_level) {
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<EditorSceneImporterGLTF>();
@ -59,8 +60,10 @@ void register_gltf_types(ModuleRegistrationLevel p_level) {
EditorPlugins::add_by_type<SceneExporterGLTFPlugin>();
ClassDB::set_current_api(prev_api);
EditorNode::add_init_callback(_editor_init);
}
#endif
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<GLTFSpecGloss>();
ClassDB::register_class<GLTFNode>();
ClassDB::register_class<GLTFAnimation>();
@ -77,6 +80,7 @@ void register_gltf_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<GLTFDocumentExtension>();
ClassDB::register_class<PackedSceneGLTF>();
}
}
void unregister_gltf_types(ModuleRegistrationLevel p_level) {
}

View File

@ -28,7 +28,9 @@ SOFTWARE.
void register_plugin_refresher_types(ModuleRegistrationLevel p_level) {
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<PluginRefresherEditorPlugin>();
}
#endif
}

View File

@ -33,17 +33,25 @@ SOFTWARE.
Ref<TextEditorTextLoader> text_editor_text_resource_loader;
void register_text_editor_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<TextEditorFile>();
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
text_editor_text_resource_loader.instance();
ResourceLoader::add_resource_format_loader(text_editor_text_resource_loader);
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TextEditorFile>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<TextEditorEditorPlugin>();
}
#endif
}
void unregister_text_editor_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ResourceLoader::remove_resource_format_loader(text_editor_text_resource_loader);
text_editor_text_resource_loader.unref();
}
}

View File

@ -36,14 +36,18 @@
static ImageLoaderTinyEXR *image_loader_tinyexr = nullptr;
void register_tinyexr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_tinyexr = memnew(ImageLoaderTinyEXR);
ImageLoader::add_image_format_loader(image_loader_tinyexr);
Image::save_exr_func = save_exr;
}
}
void unregister_tinyexr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_tinyexr);
Image::save_exr_func = nullptr;
}
}

View File

@ -1520,7 +1520,17 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
MAIN_PRINT("Main: Load Modules, Physics, Drivers, Scripts");
register_platform_apis();
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_START);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SINGLETON);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_CORE);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_DRIVER);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR);
//register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_FINALIZE);
// Theme needs modules to be initialized so that sub-resources can be loaded.
initialize_theme();
@ -2440,7 +2450,18 @@ void Main::cleanup(bool p_force) {
ImageLoader::cleanup();
unregister_driver_types();
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_START);
//unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_DRIVER);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_CORE);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SINGLETON);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_FINALIZE);
unregister_platform_apis();
unregister_scene_types();
unregister_server_types();

View File

@ -35,10 +35,14 @@
static ImageLoaderBMP *image_loader_bmp = nullptr;
void register_bmp_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_bmp = memnew(ImageLoaderBMP);
ImageLoader::add_image_format_loader(image_loader_bmp);
}
}
void unregister_bmp_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_bmp);
}
}

View File

@ -27,8 +27,10 @@ SOFTWARE.
#include "biome_terrain_generator.h"
void register_broken_seals_module_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<BiomeTerrainGenerator>();
}
}
void unregister_broken_seals_module_types(ModuleRegistrationLevel p_level) {
}

View File

@ -137,8 +137,7 @@ static void _editor_init() {
#endif // TOOLS_ENABLED
void register_cscript_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<CScript>();
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
script_language_cscript = memnew(CScriptLanguage);
ScriptServer::register_language(script_language_cscript);
@ -147,14 +146,22 @@ void register_cscript_types(ModuleRegistrationLevel p_level) {
resource_saver_cscript.instance();
ResourceSaver::add_resource_format_saver(resource_saver_cscript);
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<CScript>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
ScriptEditor::register_create_syntax_highlighter_function(CScriptSyntaxHighlighter::create);
EditorNode::add_init_callback(_editor_init);
}
#endif // TOOLS_ENABLED
}
void unregister_cscript_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ScriptServer::unregister_language(script_language_cscript);
if (script_language_cscript) {
@ -167,3 +174,4 @@ void unregister_cscript_types(ModuleRegistrationLevel p_level) {
ResourceSaver::remove_resource_format_saver(resource_saver_cscript);
resource_saver_cscript.unref();
}
}

View File

@ -36,21 +36,27 @@ SOFTWARE.
DatabaseManager *_database_manager = nullptr;
void register_database_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
_database_manager = memnew(DatabaseManager);
ClassDB::register_class<DatabaseManager>();
Engine::get_singleton()->add_singleton(Engine::Singleton("DatabaseManager", DatabaseManager::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<Database>();
ClassDB::register_class<DatabaseConnection>();
ClassDB::register_class<DatabaseManager>();
ClassDB::register_class<DatabaseMultiThreaded>();
ClassDB::register_class<DatabaseSingleThreaded>();
ClassDB::register_class<QueryBuilder>();
ClassDB::register_class<QueryResult>();
ClassDB::register_class<TableBuilder>();
_database_manager = memnew(DatabaseManager);
Engine::get_singleton()->add_singleton(Engine::Singleton("DatabaseManager", DatabaseManager::get_singleton()));
}
}
void unregister_database_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (_database_manager) {
memdelete(_database_manager);
}
}
}

View File

@ -25,8 +25,10 @@ SOFTWARE.
#include "sqlite3_database.h"
void register_database_sqlite_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<SQLite3Database>();
}
}
void unregister_database_sqlite_types(ModuleRegistrationLevel p_level) {
}

View File

@ -35,11 +35,15 @@
static Ref<ResourceFormatDDS> resource_loader_dds;
void register_dds_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
resource_loader_dds.instance();
ResourceLoader::add_resource_format_loader(resource_loader_dds);
}
}
void unregister_dds_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ResourceLoader::remove_resource_format_loader(resource_loader_dds);
resource_loader_dds.unref();
}
}

View File

@ -35,17 +35,23 @@
static bool enet_ok = false;
void register_enet_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (enet_initialize() != 0) {
ERR_PRINT("ENet initialization failure");
} else {
enet_ok = true;
}
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<NetworkedMultiplayerENet>();
}
}
void unregister_enet_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (enet_ok) {
enet_deinitialize();
}
}
}

View File

@ -146,6 +146,17 @@ static ESS *entity_data_manager = NULL;
static ProfileManager *profile_manager = NULL;
void register_entity_spell_system_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
entity_data_manager = memnew(ESS);
ClassDB::register_class<ESS>();
Engine::get_singleton()->add_singleton(Engine::Singleton("ESS", ESS::get_singleton()));
profile_manager = memnew(ProfileManager);
ClassDB::register_class<ProfileManager>();
Engine::get_singleton()->add_singleton(Engine::Singleton("ProfileManager", ProfileManager::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
#ifdef MODULE_PROPS_ENABLED
ClassDB::register_class<PropDataEntity>();
#endif
@ -274,21 +285,17 @@ void register_entity_spell_system_types(ModuleRegistrationLevel p_level) {
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<ESSMaterialCachePCM>();
#endif
entity_data_manager = memnew(ESS);
ClassDB::register_class<ESS>();
Engine::get_singleton()->add_singleton(Engine::Singleton("ESS", ESS::get_singleton()));
profile_manager = memnew(ProfileManager);
ClassDB::register_class<ProfileManager>();
Engine::get_singleton()->add_singleton(Engine::Singleton("ProfileManager", ProfileManager::get_singleton()));
}
#ifdef TOOLS_ENABLED
//if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
//EditorPlugins::add_by_type<ESSEditorPlugin>();
//}
#endif
}
void unregister_entity_spell_system_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (entity_data_manager) {
memdelete(entity_data_manager);
}
@ -297,3 +304,4 @@ void unregister_entity_spell_system_types(ModuleRegistrationLevel p_level) {
memdelete(profile_manager);
}
}
}

View File

@ -6,9 +6,11 @@
#include "noise.h"
void register_fastnoise_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<FastNoise>();
ClassDB::register_class<FastnoiseNoiseParams>();
}
}
void unregister_fastnoise_types(ModuleRegistrationLevel p_level) {
}

View File

@ -137,9 +137,7 @@ static void _editor_init() {
#endif // TOOLS_ENABLED
void register_gdscript_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<GDScript>();
ClassDB::register_virtual_class<GDScriptFunctionState>();
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
script_language_gd = memnew(GDScriptLanguage);
ScriptServer::register_language(script_language_gd);
@ -148,14 +146,23 @@ void register_gdscript_types(ModuleRegistrationLevel p_level) {
resource_saver_gd.instance();
ResourceSaver::add_resource_format_saver(resource_saver_gd);
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<GDScript>();
ClassDB::register_virtual_class<GDScriptFunctionState>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
ScriptEditor::register_create_syntax_highlighter_function(GDScriptSyntaxHighlighter::create);
EditorNode::add_init_callback(_editor_init);
}
#endif // TOOLS_ENABLED
}
void unregister_gdscript_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
ScriptServer::unregister_language(script_language_gd);
if (script_language_gd) {
@ -168,3 +175,4 @@ void unregister_gdscript_types(ModuleRegistrationLevel p_level) {
ResourceSaver::remove_resource_format_saver(resource_saver_gd);
resource_saver_gd.unref();
}
}

View File

@ -35,18 +35,23 @@
#include "mesh_library.h"
#ifdef TOOLS_ENABLED
#include "mesh_library_editor_plugin.h"
#include "grid_map_editor_plugin.h"
#include "mesh_library_editor_plugin.h"
#endif
#endif
void register_gridmap_types(ModuleRegistrationLevel p_level) {
#ifndef _3D_DISABLED
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<GridMap>();
ClassDB::register_class<MeshLibrary>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<GridMapEditorPlugin>();
EditorPlugins::add_by_type<MeshLibraryEditorPlugin>();
}
#endif
#endif
}

View File

@ -35,10 +35,14 @@
static ImageLoaderHDR *image_loader_hdr = nullptr;
void register_hdr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_hdr = memnew(ImageLoaderHDR);
ImageLoader::add_image_format_loader(image_loader_hdr);
}
}
void unregister_hdr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_hdr);
}
}

View File

@ -24,10 +24,11 @@ SOFTWARE.
#include "web_server_simple.h"
void register_http_server_simple_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<WebServerSimple>();
}
}
void unregister_http_server_simple_types(ModuleRegistrationLevel p_level) {
}

View File

@ -35,10 +35,14 @@
static ImageLoaderJPG *image_loader_jpg = nullptr;
void register_jpg_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_jpg = memnew(ImageLoaderJPG);
ImageLoader::add_image_format_loader(image_loader_jpg);
}
}
void unregister_jpg_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_jpg);
}
}

View File

@ -4,8 +4,10 @@
#include "lz4_compressor.h"
void register_lz4_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<LZ4Compressor>();
}
}
void unregister_lz4_types(ModuleRegistrationLevel p_level) {
}

View File

@ -156,8 +156,13 @@ SOFTWARE.
static _MMAlgos *_mm_algos_singleton = nullptr;
void register_material_maker_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
_mm_algos_singleton = memnew(_MMAlgos);
ClassDB::register_class<_MMAlgos>();
Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<MMNodeUniversalProperty>();
ClassDB::register_class<MMMaterial>();
ClassDB::register_class<MMNode>();
@ -370,17 +375,19 @@ void register_material_maker_types(ModuleRegistrationLevel p_level) {
MMAlgos::register_node_class("Filter", "MMBlend");
ClassDB::register_class<MMAdjustHsv>();
MMAlgos::register_node_class("Filter", "MMAdjustHsv");
_mm_algos_singleton = memnew(_MMAlgos);
Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));
}
#if TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<MaterialMakerEditorPlugin>();
}
#endif
}
void unregister_material_maker_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (_mm_algos_singleton) {
memdelete(_mm_algos_singleton);
}
}
}

View File

@ -36,15 +36,19 @@
#include "stream_peer_mbedtls.h"
void register_mbedtls_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
CryptoMbedTLS::initialize_crypto();
StreamPeerMbedTLS::initialize_ssl();
PacketPeerMbedDTLS::initialize_dtls();
DTLSServerMbedTLS::initialize();
}
}
void unregister_mbedtls_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
DTLSServerMbedTLS::finalize();
PacketPeerMbedDTLS::finalize_dtls();
StreamPeerMbedTLS::finalize_ssl();
CryptoMbedTLS::finalize_crypto();
}
}

View File

@ -53,6 +53,7 @@ SOFTWARE.
#endif
void register_mesh_data_resource_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<MeshDataResource>();
ClassDB::register_class<MeshDataResourceCollection>();
@ -70,9 +71,10 @@ void register_mesh_data_resource_types(ModuleRegistrationLevel p_level) {
Ref<Prop2DDataMeshData> prop_2d_processor = Ref<Prop2DDataMeshData>(memnew(Prop2DDataMeshData));
Prop2DUtils::add_processor(prop_2d_processor);
#endif
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
#ifdef MODULE_GLTF_ENABLED
EditorPlugins::add_by_type<EditorPluginGLTFMdr>();
#endif
@ -80,7 +82,7 @@ void register_mesh_data_resource_types(ModuleRegistrationLevel p_level) {
#ifdef MODULE_MESH_UTILS_ENABLED
EditorPlugins::add_by_type<MDIEdPlugin>();
#endif
}
#endif
}

View File

@ -33,16 +33,22 @@ SOFTWARE.
static MeshUtils *mesh_utils = NULL;
void register_mesh_utils_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<FastQuadraticMeshSimplifier>();
ClassDB::register_class<MeshMerger>();
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
mesh_utils = memnew(MeshUtils);
ClassDB::register_class<MeshUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("MeshUtils", MeshUtils::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<FastQuadraticMeshSimplifier>();
ClassDB::register_class<MeshMerger>();
}
}
void unregister_mesh_utils_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (mesh_utils) {
memdelete(mesh_utils);
}
}
}

View File

@ -38,14 +38,19 @@
#endif
void register_minimp3_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<AudioStreamMP3>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
if (Engine::get_singleton()->is_editor_hint()) {
Ref<ResourceImporterMP3> mp3_import;
mp3_import.instance();
ResourceFormatImporter::get_singleton()->add_importer(mp3_import);
}
}
#endif
ClassDB::register_class<AudioStreamMP3>();
}
void unregister_minimp3_types(ModuleRegistrationLevel p_level) {

View File

@ -51,6 +51,7 @@ NavigationServer *new_server() {
}
void register_navigation_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
NavigationServerManager::set_default_server(new_server);
#ifndef _3D_DISABLED
@ -58,16 +59,21 @@ void register_navigation_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<NavigationMeshGenerator>();
Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationMeshGenerator", NavigationMeshGenerator::get_singleton()));
#endif
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<NavigationMeshEditorPlugin>();
}
#endif
}
void unregister_navigation_types(ModuleRegistrationLevel p_level) {
#ifndef _3D_DISABLED
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (_nav_mesh_generator) {
memdelete(_nav_mesh_generator);
}
}
#endif
}

View File

@ -34,15 +34,15 @@
#include "register_types.h"
#include "core/config/project_settings.h"
#include "data_buffer.h"
#include "interpolator.h"
#include "networked_controller.h"
#include "scene_diff.h"
#include "scene_synchronizer.h"
#include "core/config/project_settings.h"
void register_network_synchronizer_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<DataBuffer>();
ClassDB::register_class<SceneDiff>();
ClassDB::register_class<Interpolator>();
@ -52,6 +52,7 @@ void register_network_synchronizer_types(ModuleRegistrationLevel p_level) {
GLOBAL_DEF("NetworkSynchronizer/debug_server_speedup", false);
GLOBAL_DEF("NetworkSynchronizer/debug_doll_speedup", false);
}
}
void unregister_network_synchronizer_types(ModuleRegistrationLevel p_level) {
}

View File

@ -33,9 +33,11 @@
#include "open_simplex_noise.h"
void register_opensimplex_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<OpenSimplexNoise>();
ClassDB::register_class<NoiseTexture>();
}
}
void unregister_opensimplex_types(ModuleRegistrationLevel p_level) {
}

View File

@ -53,6 +53,7 @@ SOFTWARE.
#endif
void register_paint_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<PaintAction>();
ClassDB::register_class<BrightenAction>();
@ -78,9 +79,12 @@ void register_paint_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<PaintNode>();
ClassDB::register_class<PaintCanvas>();
ClassDB::register_class<PaintProject>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<PaintEditorPlugin>();
}
#endif
}

View File

@ -72,6 +72,17 @@ static PropUtils *prop_utils = NULL;
static PropCache *prop_texture_cache = NULL;
void register_props_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
prop_utils = memnew(PropUtils);
ClassDB::register_class<PropUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("PropUtils", PropUtils::get_singleton()));
prop_texture_cache = memnew(PropCache);
ClassDB::register_class<PropCache>();
Engine::get_singleton()->add_singleton(Engine::Singleton("PropCache", PropCache::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TiledWall>();
ClassDB::register_class<TiledWallData>();
@ -110,14 +121,6 @@ void register_props_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<PropMaterialCachePCM>();
#endif
prop_utils = memnew(PropUtils);
ClassDB::register_class<PropUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("PropUtils", PropUtils::get_singleton()));
prop_texture_cache = memnew(PropCache);
ClassDB::register_class<PropCache>();
Engine::get_singleton()->add_singleton(Engine::Singleton("PropCache", PropCache::get_singleton()));
Ref<PropDataLight> light_processor = Ref<PropDataLight>(memnew(PropDataLight));
PropUtils::add_processor(light_processor);
@ -132,13 +135,17 @@ void register_props_types(ModuleRegistrationLevel p_level) {
Ref<PropDataTiledWall> tiled_wall_processor = Ref<PropDataTiledWall>(memnew(PropDataTiledWall));
PropUtils::add_processor(tiled_wall_processor);
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<PropEditorPlugin>();
}
#endif
}
void unregister_props_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (prop_utils) {
memdelete(prop_utils);
}
@ -147,3 +154,4 @@ void unregister_props_types(ModuleRegistrationLevel p_level) {
memdelete(prop_texture_cache);
}
}
}

View File

@ -72,6 +72,17 @@ static Prop2DUtils *prop_utils = NULL;
static Prop2DCache *prop_texture_cache = NULL;
void register_props_2d_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
prop_utils = memnew(Prop2DUtils);
ClassDB::register_class<Prop2DUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("Prop2DUtils", Prop2DUtils::get_singleton()));
prop_texture_cache = memnew(Prop2DCache);
ClassDB::register_class<Prop2DCache>();
Engine::get_singleton()->add_singleton(Engine::Singleton("Prop2DCache", Prop2DCache::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TiledWall2D>();
ClassDB::register_class<TiledWall2DData>();
@ -110,14 +121,6 @@ void register_props_2d_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<Prop2DMaterialCachePCM>();
#endif
prop_utils = memnew(Prop2DUtils);
ClassDB::register_class<Prop2DUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("Prop2DUtils", Prop2DUtils::get_singleton()));
prop_texture_cache = memnew(Prop2DCache);
ClassDB::register_class<Prop2DCache>();
Engine::get_singleton()->add_singleton(Engine::Singleton("Prop2DCache", Prop2DCache::get_singleton()));
Ref<Prop2DDataLight> light_processor = Ref<Prop2DDataLight>(memnew(Prop2DDataLight));
Prop2DUtils::add_processor(light_processor);
@ -135,13 +138,17 @@ void register_props_2d_types(ModuleRegistrationLevel p_level) {
Ref<Prop2DDataSprite> sprite_processor = Ref<Prop2DDataSprite>(memnew(Prop2DDataSprite));
Prop2DUtils::add_processor(sprite_processor);
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<Prop2DEditorPlugin>();
}
#endif
}
void unregister_props_2d_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (prop_utils) {
memdelete(prop_utils);
}
@ -150,3 +157,4 @@ void unregister_props_2d_types(ModuleRegistrationLevel p_level) {
memdelete(prop_texture_cache);
}
}
}

View File

@ -36,13 +36,17 @@
static Ref<ResourceFormatPVR> resource_loader_pvr;
void register_pvr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
resource_loader_pvr.instance();
ResourceLoader::add_resource_format_loader(resource_loader_pvr);
_register_pvrtc_compress_func();
}
}
void unregister_pvr_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ResourceLoader::remove_resource_format_loader(resource_loader_pvr);
resource_loader_pvr.unref();
}
}

View File

@ -33,9 +33,11 @@
#include "regex.h"
void register_regex_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<RegExMatch>();
ClassDB::register_class<RegEx>();
}
}
void unregister_regex_types(ModuleRegistrationLevel p_level) {
}

View File

@ -19,6 +19,7 @@
#endif
void register_skeleton_2d_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<Skeleton2D>();
ClassDB::register_class<Bone2D>();
ClassDB::register_class<PhysicalBone2D>();
@ -34,9 +35,12 @@ void register_skeleton_2d_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<PhysicalBone2D>();
ClassDB::register_class<SkeletonModification2DPhysicalBones>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<Skeleton2DEditorPlugin>();
}
#endif
}

View File

@ -19,12 +19,13 @@
#include "resources/skeleton_modification_stack_3d.h"
#ifdef TOOLS_ENABLED
#include "editor/physical_bone_plugin.h"
#include "editor/skeleton_editor_plugin.h"
#include "editor/skeleton_ik_editor_plugin.h"
#include "editor/physical_bone_plugin.h"
#endif
void register_skeleton_3d_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<Skeleton>();
ClassDB::register_class<Skin>();
ClassDB::register_class<SkinReference>();
@ -43,11 +44,14 @@ void register_skeleton_3d_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<SkeletonModification3DJiggle>();
ClassDB::register_class<SkeletonModification3DTwoBoneIK>();
ClassDB::register_class<SkeletonModification3DStackHolder>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<SkeletonEditorPlugin>();
EditorPlugins::add_by_type<SkeletonIKEditorPlugin>();
EditorPlugins::add_by_type<PhysicalBonePlugin>();
}
#endif
}

View File

@ -32,8 +32,10 @@
#include "image_compress_squish.h"
void register_squish_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
Image::set_compress_bc_func(image_compress_squish);
Image::_image_decompress_bc = image_decompress_squish;
}
}
void unregister_squish_types(ModuleRegistrationLevel p_level) {}

View File

@ -38,14 +38,19 @@
#endif
void register_stb_vorbis_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<AudioStreamOGGVorbis>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
if (Engine::get_singleton()->is_editor_hint()) {
Ref<ResourceImporterOGGVorbis> ogg_import;
ogg_import.instance();
ResourceFormatImporter::get_singleton()->add_importer(ogg_import);
}
}
#endif
ClassDB::register_class<AudioStreamOGGVorbis>();
}
void unregister_stb_vorbis_types(ModuleRegistrationLevel p_level) {

View File

@ -62,10 +62,13 @@ SOFTWARE.
static GSAIUtils *gs_ai_utils = NULL;
void register_steering_ai_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
gs_ai_utils = memnew(GSAIUtils);
ClassDB::register_class<GSAIUtils>();
Engine::get_singleton()->add_singleton(Engine::Singleton("GSAIUtils", GSAIUtils::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<GSAITargetAcceleration>();
ClassDB::register_class<GSAISteeringBehavior>();
ClassDB::register_class<GSAISteeringAgent>();
@ -98,9 +101,12 @@ void register_steering_ai_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<GSAIRigidBody3DAgent>();
ClassDB::register_class<GSAISpecializedAgent>();
}
}
void unregister_steering_ai_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (gs_ai_utils) {
memdelete(gs_ai_utils);
}
}
}

View File

@ -35,10 +35,14 @@
static ImageLoaderSVG *image_loader_svg = nullptr;
void register_svg_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_svg = memnew(ImageLoaderSVG);
ImageLoader::add_image_format_loader(image_loader_svg);
}
}
void unregister_svg_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_svg);
}
}

View File

@ -71,6 +71,7 @@ SOFTWARE.
#include "world/jobs/terrain_terrain_job.h"
void register_terraman_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TerrainMesher>();
ClassDB::register_class<TerrainMesherDefault>();
@ -115,9 +116,12 @@ void register_terraman_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<TerrainMesherJobStep>();
ClassDB::register_class<TerrainLightJob>();
ClassDB::register_class<TerrainPropJob>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<TerrainWorldEditorPlugin>();
}
#endif
}

View File

@ -73,6 +73,7 @@ SOFTWARE.
#include "world/jobs/terrain_2d_terrain_job.h"
void register_terraman_2d_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<Terrain2DMesher>();
ClassDB::register_class<Terrain2DMesherDefault>();
@ -120,9 +121,12 @@ void register_terraman_2d_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<Terrain2DTerrain2DJob>();
ClassDB::register_class<Terrain2DLightJob>();
ClassDB::register_class<Terrain2DProp2DJob>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<Terrain2DWorldEditorPlugin>();
}
#endif
}

View File

@ -36,15 +36,19 @@ SOFTWARE.
#endif
void register_texture_packer_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TexturePacker>();
ClassDB::register_class<TextureMerger>();
ClassDB::register_class<PackerImageResource>();
ClassDB::register_class<TextureLayerMerger>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<EditorPluginPackerImageResource>();
}
#endif
}

View File

@ -35,10 +35,14 @@
static ImageLoaderTGA *image_loader_tga = nullptr;
void register_tga_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
image_loader_tga = memnew(ImageLoaderTGA);
ImageLoader::add_image_format_loader(image_loader_tga);
}
}
void unregister_tga_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
memdelete(image_loader_tga);
}
}

View File

@ -35,13 +35,19 @@
static Ref<ResourceFormatLoaderTheora> resource_loader_theora;
void register_theora_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
resource_loader_theora.instance();
ResourceLoader::add_resource_format_loader(resource_loader_theora, true);
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<VideoStreamTheora>();
}
}
void unregister_theora_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_CORE) {
ResourceLoader::remove_resource_format_loader(resource_loader_theora);
resource_loader_theora.unref();
}
}

View File

@ -31,14 +31,18 @@ SOFTWARE.
#endif
void register_tile_map_types(ModuleRegistrationLevel p_level) {
#ifdef TOOLS_ENABLED
EditorPlugins::add_by_type<TileMapEditorPlugin>();
EditorPlugins::add_by_type<TileSetEditorPlugin>();
#endif
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TileMap>();
ClassDB::register_class<TileSet>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<TileMapEditorPlugin>();
EditorPlugins::add_by_type<TileSetEditorPlugin>();
}
#endif
}
void unregister_tile_map_types(ModuleRegistrationLevel p_level) {
}

View File

@ -23,15 +23,17 @@ SOFTWARE.
#include "register_types.h"
#include "bs_input_event_key.h"
#include "input_map_editor.h"
#include "core/input/shortcut.h"
#include "input_map_editor.h"
#include "touch_button.h"
void register_ui_extensions_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<TouchButton>();
ClassDB::register_class<BSInputEventKey>();
ClassDB::register_class<InputMapEditor>();
}
}
void unregister_ui_extensions_types(ModuleRegistrationLevel p_level) {
}

View File

@ -36,9 +36,11 @@
#include "upnp_device.h"
void register_upnp_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<UPNP>();
ClassDB::register_class<UPNPDevice>();
}
}
void unregister_upnp_types(ModuleRegistrationLevel p_level) {
}

View File

@ -55,6 +55,13 @@ SOFTWARE.
UserDB *_user_db = nullptr;
void register_users_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
_user_db = memnew(UserDB);
ClassDB::register_class<UserDB>();
Engine::get_singleton()->add_singleton(Engine::Singleton("UserDB", UserDB::get_singleton()));
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<User>();
ClassDB::register_class<UserModule>();
@ -62,11 +69,6 @@ void register_users_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<UserManagerStatic>();
ClassDB::register_class<UserManagerFile>();
ClassDB::register_class<UserDB>();
_user_db = memnew(UserDB);
Engine::get_singleton()->add_singleton(Engine::Singleton("UserDB", UserDB::get_singleton()));
#ifdef MODULE_WEB_ENABLED
ClassDB::register_class<UserSessionSetupWebServerMiddleware>();
@ -84,9 +86,12 @@ void register_users_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<UserManagerDB>();
#endif
}
}
void unregister_users_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SINGLETON) {
if (_user_db) {
memdelete(_user_db);
}
}
}

View File

@ -79,9 +79,13 @@ static Vector<PoolVector<Vector3>> convex_decompose(const real_t *p_vertices, in
}
void register_vhacd_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_DRIVER) {
Mesh::convex_decomposition_function = convex_decompose;
}
}
void unregister_vhacd_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_DRIVER) {
Mesh::convex_decomposition_function = nullptr;
}
}

View File

@ -84,6 +84,7 @@ SOFTWARE.
#include "world/jobs/voxel_terrain_job.h"
void register_voxelman_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<VoxelMesher>();
ClassDB::register_class<VoxelMesherDefault>();
@ -141,9 +142,12 @@ void register_voxelman_types(ModuleRegistrationLevel p_level) {
ClassDB::register_class<VoxelMesherJobStep>();
ClassDB::register_class<VoxelLightJob>();
ClassDB::register_class<VoxelPropJob>();
}
#ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<VoxelWorldEditorPlugin>();
}
#endif
}

View File

@ -73,6 +73,7 @@ SOFTWARE.
#endif
void register_web_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<_HTMLBuilder>();
ClassDB::register_class<_HTMLTag>();
@ -140,9 +141,12 @@ void register_web_types(ModuleRegistrationLevel p_level) {
#ifdef MODULE_DATABASE_ENABLED
ClassDB::register_class<HTTPSessionManagerDB>();
#endif
}
#if TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<WebNodeEditorPlugin>();
}
#endif
}

View File

@ -29,8 +29,8 @@
/*************************************************************************/
#include "register_types.h"
#include "core/error/error_macros.h"
#include "core/config/project_settings.h"
#include "core/error/error_macros.h"
#ifdef JAVASCRIPT_ENABLED
#include "emscripten.h"
#include "emws_client.h"
@ -42,6 +42,7 @@
#endif
void register_websocket_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_DRIVER) {
#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"));
@ -67,11 +68,14 @@ void register_websocket_types(ModuleRegistrationLevel p_level) {
WSLClient::make_default();
WSLServer::make_default();
#endif
}
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_virtual_class<WebSocketMultiplayerPeer>();
ClassDB::register_custom_instance_class<WebSocketServer>();
ClassDB::register_custom_instance_class<WebSocketClient>();
ClassDB::register_custom_instance_class<WebSocketPeer>();
}
}
void unregister_websocket_types(ModuleRegistrationLevel p_level) {}

View File

@ -1,17 +1,19 @@
#include "register_types.h"
#include "image_indexer.h"
#include "overlapping_wave_form_collapse.h"
#include "tiling_wave_form_collapse.h"
#include "wave_form_collapse.h"
#include "image_indexer.h"
void register_wfc_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
ClassDB::register_class<WaveFormCollapse>();
ClassDB::register_class<OverlappingWaveFormCollapse>();
ClassDB::register_class<TilingWaveFormCollapse>();
ClassDB::register_class<ImageIndexer>();
}
}
void unregister_wfc_types(ModuleRegistrationLevel p_level) {
}