diff options
| author | Juan Linietsky | 2017-01-13 12:51:14 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-01-13 12:51:14 -0300 |
| commit | e53c247cb16b25b828461f32533da64f4fab0e0b (patch) | |
| tree | 985328cee0387b987889ecccb65293bf87883dec /main/input_default.cpp | |
| parent | 0ad9939603a3d659f3f9cfba095a2e0c082483e8 (diff) | |
| download | godot-e53c247cb16b25b828461f32533da64f4fab0e0b.tar.gz godot-e53c247cb16b25b828461f32533da64f4fab0e0b.tar.zst godot-e53c247cb16b25b828461f32533da64f4fab0e0b.zip | |
Created new Engine singleton, and moved engine related OS functions to it.
Diffstat (limited to 'main/input_default.cpp')
| -rw-r--r-- | main/input_default.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 6f27bcdc5..61a3a7da7 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -158,10 +158,10 @@ bool InputDefault::is_action_just_pressed(const StringName& p_action) const { if (!E) return false; - if (OS::get_singleton()->is_in_fixed_frame()) { - return E->get().pressed && E->get().fixed_frame==OS::get_singleton()->get_fixed_frames(); + if (Engine::get_singleton()->is_in_fixed_frame()) { + return E->get().pressed && E->get().fixed_frame==Engine::get_singleton()->get_fixed_frames(); } else { - return E->get().pressed && E->get().idle_frame==OS::get_singleton()->get_idle_frames(); + return E->get().pressed && E->get().idle_frame==Engine::get_singleton()->get_idle_frames(); } } @@ -171,10 +171,10 @@ bool InputDefault::is_action_just_released(const StringName& p_action) const{ if (!E) return false; - if (OS::get_singleton()->is_in_fixed_frame()) { - return !E->get().pressed && E->get().fixed_frame==OS::get_singleton()->get_fixed_frames(); + if (Engine::get_singleton()->is_in_fixed_frame()) { + return !E->get().pressed && E->get().fixed_frame==Engine::get_singleton()->get_fixed_frames(); } else { - return !E->get().pressed && E->get().idle_frame==OS::get_singleton()->get_idle_frames(); + return !E->get().pressed && E->get().idle_frame==Engine::get_singleton()->get_idle_frames(); } } @@ -379,8 +379,8 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { if(is_action_pressed(E->key()) != p_event.is_pressed()) { Action action; - action.fixed_frame=OS::get_singleton()->get_fixed_frames(); - action.idle_frame=OS::get_singleton()->get_idle_frames(); + action.fixed_frame=Engine::get_singleton()->get_fixed_frames(); + action.idle_frame=Engine::get_singleton()->get_idle_frames(); action.pressed=p_event.is_pressed(); action_state[E->key()]=action; } @@ -490,8 +490,8 @@ void InputDefault::action_press(const StringName& p_action) { Action action; - action.fixed_frame=OS::get_singleton()->get_fixed_frames(); - action.idle_frame=OS::get_singleton()->get_idle_frames(); + action.fixed_frame=Engine::get_singleton()->get_fixed_frames(); + action.idle_frame=Engine::get_singleton()->get_idle_frames(); action.pressed=true; action_state[p_action]=action; @@ -502,8 +502,8 @@ void InputDefault::action_release(const StringName& p_action){ Action action; - action.fixed_frame=OS::get_singleton()->get_fixed_frames(); - action.idle_frame=OS::get_singleton()->get_idle_frames(); + action.fixed_frame=Engine::get_singleton()->get_fixed_frames(); + action.idle_frame=Engine::get_singleton()->get_idle_frames(); action.pressed=false; action_state[p_action]=action; |
