diff options
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r-- | core/os/os.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 1f967030e7..03e63f636e 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -393,16 +393,16 @@ Error OS::dialog_input_text(String p_title, String p_description, String p_parti return OK; }; -int OS::get_static_memory_usage() const { +uint64_t OS::get_static_memory_usage() const { return Memory::get_mem_usage(); } -int OS::get_dynamic_memory_usage() const { +uint64_t OS::get_dynamic_memory_usage() const { return MemoryPool::total_memory; } -int OS::get_static_memory_peak_usage() const { +uint64_t OS::get_static_memory_peak_usage() const { return Memory::get_mem_max_usage(); } @@ -418,7 +418,7 @@ bool OS::has_touchscreen_ui_hint() const { return Input::get_singleton() && Input::get_singleton()->is_emulating_touch_from_mouse(); } -int OS::get_free_static_memory() const { +uint64_t OS::get_free_static_memory() const { return Memory::get_mem_available(); } @@ -569,6 +569,11 @@ int OS::get_power_percent_left() { return -1; } +void OS::set_has_server_feature_callback(HasServerFeatureCallback p_callback) { + + has_server_feature_callback = p_callback; +} + bool OS::has_feature(const String &p_feature) { if (p_feature == get_name()) @@ -625,6 +630,10 @@ bool OS::has_feature(const String &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)) return true; @@ -729,6 +738,8 @@ OS::OS() { _logger = NULL; + has_server_feature_callback = NULL; + Vector<Logger *> loggers; loggers.push_back(memnew(StdLogger)); _set_logger(memnew(CompositeLogger(loggers))); |