diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-22 14:40:43 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-11-22 14:41:45 -0300 |
commit | 62d86b15887371c59f99bfa37dbe2fcaf80478f7 (patch) | |
tree | f79db46d86b749cbe64f00a5ae949a583dd07e2f /core | |
parent | 81213917d11f9e177db0f0363ee42ff5a47a21dc (diff) |
Modified low processor sleep to 8000 and made it customizable (should be customizable for editor too)
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 11 | ||||
-rw-r--r-- | core/os/os.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 84937c0e59..a39dfcc003 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -122,6 +122,16 @@ bool OS::is_in_low_processor_usage_mode() const { return low_processor_usage_mode; } +void OS::set_low_processor_usage_mode_sleep_usec(int p_usec) { + + low_processor_usage_mode_sleep_usec = p_usec; +} + +int OS::get_low_processor_usage_mode_sleep_usec() const { + + return low_processor_usage_mode_sleep_usec; +} + void OS::set_clipboard(const String &p_text) { _local_clipboard = p_text; @@ -599,6 +609,7 @@ OS::OS() { singleton = this; _keep_screen_on = true; // set default value to true, because this had been true before godot 2.0. low_processor_usage_mode = false; + low_processor_usage_mode_sleep_usec = 10000; _verbose_stdout = false; _no_window = false; _exit_code = 0; diff --git a/core/os/os.h b/core/os/os.h index fe4ffb2922..d7a1512e39 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -50,6 +50,7 @@ class OS { List<String> _cmdline; bool _keep_screen_on; bool low_processor_usage_mode; + int low_processor_usage_mode_sleep_usec; bool _verbose_stdout; String _local_clipboard; uint64_t _msec_splash; @@ -202,6 +203,8 @@ public: virtual bool is_keep_screen_on() const; virtual void set_low_processor_usage_mode(bool p_enabled); virtual bool is_in_low_processor_usage_mode() const; + virtual void set_low_processor_usage_mode_sleep_usec(int p_usec); + virtual int get_low_processor_usage_mode_sleep_usec() const; virtual String get_executable_path() const; virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false) = 0; |