diff options
Diffstat (limited to 'core/config')
| -rw-r--r-- | core/config/engine.cpp | 8 | ||||
| -rw-r--r-- | core/config/engine.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 12ada98d43..aac048e93f 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -116,6 +116,10 @@ void Engine::set_time_scale(double p_scale) { } double Engine::get_time_scale() const { + return freeze_time_scale ? 0 : _time_scale; +} + +double Engine::get_unfrozen_time_scale() const { return _time_scale; } @@ -404,6 +408,10 @@ bool Engine::notify_frame_server_synced() { return server_syncs > SERVER_SYNC_FRAME_COUNT_WARNING; } +void Engine::set_freeze_time_scale(bool p_frozen) { + freeze_time_scale = p_frozen; +} + Engine::Engine() { singleton = this; } diff --git a/core/config/engine.h b/core/config/engine.h index fd7fbd717e..b38412308a 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -99,6 +99,8 @@ private: int server_syncs = 0; bool frame_server_synced = false; + bool freeze_time_scale = false; + public: static Engine *get_singleton(); @@ -130,6 +132,7 @@ public: void set_time_scale(double p_scale); double get_time_scale() const; + double get_unfrozen_time_scale() const; void set_print_to_stdout(bool p_enabled); bool is_printing_to_stdout() const; @@ -197,6 +200,8 @@ public: void increment_frames_drawn(); bool notify_frame_server_synced(); + void set_freeze_time_scale(bool p_frozen); + Engine(); virtual ~Engine(); }; |
