diff options
Diffstat (limited to 'core/engine.h')
-rw-r--r-- | core/engine.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/core/engine.h b/core/engine.h index cfe3a918fc..fef330c0c1 100644 --- a/core/engine.h +++ b/core/engine.h @@ -37,12 +37,11 @@ #include "core/vector.h" class Engine { - public: struct Singleton { StringName name; Object *ptr; - Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) : + Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr) : name(p_name), ptr(p_ptr) { } @@ -51,28 +50,28 @@ public: private: friend class Main; - uint64_t frames_drawn; - uint32_t _frame_delay; - uint64_t _frame_ticks; - float _frame_step; + uint64_t frames_drawn = 0; + uint32_t _frame_delay = 0; + uint64_t _frame_ticks = 0; + float _frame_step = 0; - int ips; - float physics_jitter_fix; - float _fps; - int _target_fps; - float _time_scale; - bool _pixel_snap; - uint64_t _physics_frames; - float _physics_interpolation_fraction; - bool abort_on_gpu_errors; + int ips = 60; + float physics_jitter_fix = 0.5; + float _fps = 1; + int _target_fps = 0; + float _time_scale = 1.0; + bool _pixel_snap = false; + uint64_t _physics_frames = 0; + float _physics_interpolation_fraction = 0.0f; + bool abort_on_gpu_errors = false; - uint64_t _idle_frames; - bool _in_physics; + uint64_t _idle_frames = 0; + bool _in_physics = false; List<Singleton> singletons; Map<StringName, Object *> singleton_ptrs; - bool editor_hint; + bool editor_hint = false; static Engine *singleton; @@ -86,7 +85,7 @@ public: float get_physics_jitter_fix() const; virtual void set_target_fps(int p_fps); - virtual float get_target_fps() const; + virtual int get_target_fps() const; virtual float get_frames_per_second() const { return _fps; } |