diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-13 12:51:14 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-13 12:51:14 -0300 |
commit | e53c247cb16b25b828461f32533da64f4fab0e0b (patch) | |
tree | 985328cee0387b987889ecccb65293bf87883dec /core/os | |
parent | 0ad9939603a3d659f3f9cfba095a2e0c082483e8 (diff) |
Created new Engine singleton, and moved engine related OS functions to it.
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/os.cpp | 49 | ||||
-rw-r--r-- | core/os/os.h | 34 |
2 files changed, 4 insertions, 79 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 677bf63e69..db7b7cb943 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -98,23 +98,6 @@ void OS::printerr(const char* p_format, ...) { }; -void OS::set_iterations_per_second(int p_ips) { - - ips=p_ips; -} -int OS::get_iterations_per_second() const { - - return ips; -} - -void OS::set_target_fps(int p_fps) { - _target_fps=p_fps>0? p_fps : 0; -} - -float OS::get_target_fps() const { - return _target_fps; -} - void OS::set_keep_screen_on(bool p_enabled) { _keep_screen_on=p_enabled; } @@ -152,10 +135,6 @@ int OS::get_process_ID() const { return -1; }; -uint64_t OS::get_frames_drawn() { - - return frames_drawn; -} bool OS::is_stdout_verbose() const { @@ -261,15 +240,7 @@ void OS::clear_last_error() { memfree(last_error); last_error=NULL; } -void OS::set_frame_delay(uint32_t p_msec) { - _frame_delay=p_msec; -} - -uint32_t OS::get_frame_delay() const { - - return _frame_delay; -} void OS::set_no_window_mode(bool p_enable) { @@ -513,20 +484,13 @@ OS::MouseMode OS::get_mouse_mode() const{ return MOUSE_MODE_VISIBLE; } -void OS::set_time_scale(float p_scale) { - - _time_scale=p_scale; -} OS::LatinKeyboardVariant OS::get_latin_keyboard_variant() const { return LATIN_KEYBOARD_QWERTY; } -float OS::get_time_scale() const { - return _time_scale; -} bool OS::is_joy_known(int p_device) { return true; @@ -572,25 +536,18 @@ Dictionary OS::get_engine_version() const { OS::OS() { last_error=NULL; - 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; _no_window=false; _exit_code=0; _orientation=SCREEN_LANDSCAPE; - _fps=1; - _target_fps=0; + _render_thread_mode=RENDER_THREAD_SAFE; - _time_scale=1.0; - _pixel_snap=false; + + _allow_hidpi=true; - _fixed_frames=0; - _idle_frames=0; - _in_fixed=false; Math::seed(1234567); } diff --git a/core/os/os.h b/core/os/os.h index 5ea3216f24..4c34ff92f9 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -32,6 +32,7 @@ #include "ustring.h" #include "list.h" #include "vector.h" +#include "engine.h" #include "os/main_loop.h" #include <stdarg.h> @@ -43,28 +44,17 @@ class OS { static OS* singleton; String _execpath; - String _custom_level; List<String> _cmdline; - int ips; bool _keep_screen_on; bool low_processor_usage_mode; bool _verbose_stdout; String _local_clipboard; - uint64_t frames_drawn; - uint32_t _frame_delay; uint64_t _msec_splash; bool _no_window; int _exit_code; int _orientation; - float _fps; - int _target_fps; - float _time_scale; - bool _pixel_snap; bool _allow_hidpi; - uint64_t _fixed_frames; - uint64_t _idle_frames; - bool _in_fixed; char *last_error; @@ -185,15 +175,6 @@ public: virtual bool get_borderless_window() { return 0; } - - virtual void set_iterations_per_second(int p_ips); - virtual int get_iterations_per_second() const; - - virtual void set_target_fps(int p_fps); - virtual float get_target_fps() const; - - 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); @@ -217,7 +198,6 @@ public: virtual MainLoop *get_main_loop() const=0; - String get_custom_level() const { return _custom_level; } virtual void yield(); @@ -280,17 +260,9 @@ public: uint32_t get_ticks_msec() const; uint64_t get_splash_tick_msec() const; - void set_frame_delay(uint32_t p_msec); - uint32_t get_frame_delay() const; virtual bool can_draw() const = 0; - uint64_t get_frames_drawn(); - - uint64_t get_fixed_frames() const { return _fixed_frames; } - uint64_t get_idle_frames() const { return _idle_frames; } - bool is_in_fixed_frame() const { return _in_fixed; } - bool is_stdout_verbose() const; enum CursorShape { @@ -416,10 +388,6 @@ public: virtual LatinKeyboardVariant get_latin_keyboard_variant() const; - void set_time_scale(float p_scale); - float get_time_scale() const; - - _FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; } virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device)const; |