diff options
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r-- | core/os/os.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 4414b582bd..da9dabd401 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -178,14 +178,16 @@ static FileAccess *_OSPRF = nullptr; static void _OS_printres(Object *p_obj) { Resource *res = Object::cast_to<Resource>(p_obj); - if (!res) + if (!res) { return; + } String str = itos(res->get_instance_id()) + String(res->get_class()) + ":" + String(res->get_name()) + " - " + res->get_path(); - if (_OSPRF) + if (_OSPRF) { _OSPRF->store_line(str); - else + } else { print_line(str); + } } void OS::print_all_resources(String p_to_file) { @@ -202,8 +204,9 @@ void OS::print_all_resources(String p_to_file) { ObjectDB::debug_objects(_OS_printres); if (p_to_file != "") { - if (_OSPRF) + if (_OSPRF) { memdelete(_OSPRF); + } _OSPRF = nullptr; } } @@ -366,18 +369,21 @@ void OS::set_has_server_feature_callback(HasServerFeatureCallback p_callback) { } bool OS::has_feature(const String &p_feature) { - if (p_feature == get_name()) + if (p_feature == get_name()) { return true; + } #ifdef DEBUG_ENABLED - if (p_feature == "debug") + if (p_feature == "debug") { return true; + } #else if (p_feature == "release") return true; #endif #ifdef TOOLS_ENABLED - if (p_feature == "editor") + if (p_feature == "editor") { return true; + } #else if (p_feature == "standalone") return true; @@ -417,15 +423,17 @@ bool OS::has_feature(const String &p_feature) { } #endif - if (_check_internal_feature_support(p_feature)) + if (_check_internal_feature_support(p_feature)) { return true; + } if (has_server_feature_callback && has_server_feature_callback(p_feature)) { return true; } - if (ProjectSettings::get_singleton()->has_custom_feature(p_feature)) + if (ProjectSettings::get_singleton()->has_custom_feature(p_feature)) { return true; + } return false; } @@ -444,21 +452,24 @@ List<String> OS::get_restart_on_exit_arguments() const { } PackedStringArray OS::get_connected_midi_inputs() { - if (MIDIDriver::get_singleton()) + if (MIDIDriver::get_singleton()) { return MIDIDriver::get_singleton()->get_connected_inputs(); + } PackedStringArray list; return list; } void OS::open_midi_inputs() { - if (MIDIDriver::get_singleton()) + if (MIDIDriver::get_singleton()) { MIDIDriver::get_singleton()->open(); + } } void OS::close_midi_inputs() { - if (MIDIDriver::get_singleton()) + if (MIDIDriver::get_singleton()) { MIDIDriver::get_singleton()->close(); + } } OS::OS() { |