summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2015-11-27 23:40:04 +0900
committervolzhs <volzhs@gmail.com>2016-01-16 20:57:34 +0900
commitfb2bf78591672362adbb62ea15e7be4ac34a7dee (patch)
tree98da1c62d4183bb0ca2f194f4650595cf386b3e1 /core/os
parent3c6dd5749d445f082fc925a34cc0a26f8d342304 (diff)
Add ability to set "keep screen on" for android
Diffstat (limited to 'core/os')
-rw-r--r--core/os/os.cpp9
-rw-r--r--core/os/os.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index be447d511e..e93038f854 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -112,6 +112,14 @@ float OS::get_target_fps() const {
return _target_fps;
}
+void OS::set_keep_screen_on(bool p_enabled) {
+ _keep_screen_on=p_enabled;
+}
+
+bool OS::is_keep_screen_on() const {
+ return _keep_screen_on;
+}
+
void OS::set_low_processor_usage_mode(bool p_enabled) {
low_processor_usage_mode=p_enabled;
@@ -520,6 +528,7 @@ OS::OS() {
frames_drawn=0;
singleton=this;
ips=60;
+ _keep_screen_on=true; // set default value to true, because this had been true before godot 2.0.
low_processor_usage_mode=false;
_verbose_stdout=false;
_frame_delay=0;
diff --git a/core/os/os.h b/core/os/os.h
index 83ea2c2101..bc3fad302a 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -46,6 +46,7 @@ class OS {
String _custom_level;
List<String> _cmdline;
int ips;
+ bool _keep_screen_on;
bool low_processor_usage_mode;
bool _verbose_stdout;
String _local_clipboard;
@@ -180,7 +181,8 @@ public:
virtual float get_frames_per_second() const { return _fps; };
-
+ virtual void set_keep_screen_on(bool p_enabled);
+ 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;