Core: Handle disabled class detection in ClassDB
This commit is contained in:
parent
21fbf033f7
commit
555e7ad073
13 changed files with 62 additions and 52 deletions
|
|
@ -45,7 +45,7 @@ void initialize_dds_module(ModuleInitializationLevel p_level) {
|
|||
Image::save_dds_func = save_dds;
|
||||
Image::save_dds_buffer_func = save_dds_buffer;
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(Texture)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(Texture)) {
|
||||
resource_loader_dds.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_dds);
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ void uninitialize_dds_module(ModuleInitializationLevel p_level) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(Texture)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(Texture)) {
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_dds);
|
||||
resource_loader_dds.unref();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ static Node *gltf_import(const String &p_file) {
|
|||
|
||||
// Once editor import convert pngs to ctex, we will need to load it as ctex resource.
|
||||
Ref<ResourceFormatLoaderCompressedTexture2D> resource_loader_stream_texture;
|
||||
if (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
|
||||
resource_loader_stream_texture.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_stream_texture);
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ static Node *gltf_import(const String &p_file) {
|
|||
|
||||
ResourceImporterScene::remove_scene_importer(import_gltf);
|
||||
ResourceFormatImporter::get_singleton()->remove_importer(import_texture);
|
||||
if (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_stream_texture);
|
||||
resource_loader_stream_texture.unref();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ static MovieWriterMJPEG *writer_mjpeg = nullptr;
|
|||
void initialize_jpg_module(ModuleInitializationLevel p_level) {
|
||||
switch (p_level) {
|
||||
case MODULE_INITIALIZATION_LEVEL_SERVERS: {
|
||||
if (GD_IS_CLASS_ENABLED(MovieWriterMJPEG)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MovieWriterMJPEG)) {
|
||||
writer_mjpeg = memnew(MovieWriterMJPEG);
|
||||
MovieWriter::add_writer(writer_mjpeg);
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ void uninitialize_jpg_module(ModuleInitializationLevel p_level) {
|
|||
} break;
|
||||
|
||||
case MODULE_INITIALIZATION_LEVEL_SERVERS: {
|
||||
if (GD_IS_CLASS_ENABLED(MovieWriterMJPEG)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MovieWriterMJPEG)) {
|
||||
memdelete(writer_mjpeg);
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ void initialize_ktx_module(ModuleInitializationLevel p_level) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(ImageTexture)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(ImageTexture)) {
|
||||
resource_loader_ktx.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_ktx);
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ void uninitialize_ktx_module(ModuleInitializationLevel p_level) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(ImageTexture)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(ImageTexture)) {
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_ktx);
|
||||
resource_loader_ktx.unref();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void initialize_mono_module(ModuleInitializationLevel p_level) {
|
|||
script_language_cs->set_language_index(ScriptServer::get_language_count());
|
||||
ScriptServer::register_language(script_language_cs);
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(CSharpScript)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(CSharpScript)) {
|
||||
resource_loader_cs.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_cs);
|
||||
resource_saver_cs.instantiate();
|
||||
|
|
@ -72,7 +72,7 @@ void uninitialize_mono_module(ModuleInitializationLevel p_level) {
|
|||
memdelete(script_language_cs);
|
||||
}
|
||||
|
||||
if (GD_IS_CLASS_ENABLED(CSharpScript)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(CSharpScript)) {
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_cs);
|
||||
resource_loader_cs.unref();
|
||||
ResourceSaver::remove_resource_format_saver(resource_saver_cs);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void initialize_multiplayer_module(ModuleInitializationLevel p_level) {
|
|||
GDREGISTER_CLASS(MultiplayerSynchronizer);
|
||||
GDREGISTER_CLASS(OfflineMultiplayerPeer);
|
||||
GDREGISTER_CLASS(SceneMultiplayer);
|
||||
if (GD_IS_CLASS_ENABLED(MultiplayerAPI)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MultiplayerAPI)) {
|
||||
MultiplayerAPI::set_default_interface("SceneMultiplayer");
|
||||
MultiplayerDebugger::initialize();
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ void initialize_multiplayer_module(ModuleInitializationLevel p_level) {
|
|||
}
|
||||
|
||||
void uninitialize_multiplayer_module(ModuleInitializationLevel p_level) {
|
||||
if (GD_IS_CLASS_ENABLED(MultiplayerAPI)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MultiplayerAPI)) {
|
||||
MultiplayerDebugger::deinitialize();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void initialize_theora_module(ModuleInitializationLevel p_level) {
|
|||
switch (p_level) {
|
||||
case MODULE_INITIALIZATION_LEVEL_SERVERS: {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (GD_IS_CLASS_ENABLED(MovieWriterOGV)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MovieWriterOGV)) {
|
||||
writer_ogv = memnew(MovieWriterOGV);
|
||||
MovieWriter::add_writer(writer_ogv);
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ void uninitialize_theora_module(ModuleInitializationLevel p_level) {
|
|||
|
||||
case MODULE_INITIALIZATION_LEVEL_SERVERS: {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (GD_IS_CLASS_ENABLED(MovieWriterOGV)) {
|
||||
if constexpr (GD_IS_CLASS_ENABLED(MovieWriterOGV)) {
|
||||
memdelete(writer_ogv);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue