diff options
author | Andreas Haas <Hinsbart@users.noreply.github.com> | 2017-10-02 23:10:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 23:10:36 +0200 |
commit | 5303efb2fabd668bef18b7ac7606426692e5d6bb (patch) | |
tree | b699146047e60501afbfa09c36161d8ae408a223 /scene/gui | |
parent | 1e9465096d9c738057aad81d5046b85777155f87 (diff) | |
parent | 4537977d6dd2a76580d9ab611a18634efab55c74 (diff) |
Merge pull request #11659 from AndreaCatania/prephysics
Renamed fixed_process to physics_process
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/scroll_bar.cpp | 28 | ||||
-rw-r--r-- | scene/gui/scroll_container.cpp | 22 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 12 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 22 |
4 files changed, 42 insertions, 42 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 6044b86ef5..c5ffec2d5e 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -113,7 +113,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { if (smooth_scroll_enabled) { scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { set_value(target_scroll); } @@ -137,7 +137,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { if (smooth_scroll_enabled) { scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { set_value(target_scroll); } @@ -335,13 +335,13 @@ void ScrollBar::_notification(int p_what) { drag_slave = NULL; } - if (p_what == NOTIFICATION_FIXED_PROCESS) { + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { if (scrolling) { if (get_value() != target_scroll) { double target = target_scroll - get_value(); double dist = sqrt(target * target); - double vel = ((target / dist) * 500) * get_fixed_process_delta_time(); + double vel = ((target / dist) * 500) * get_physics_process_delta_time(); if (Math::abs(vel) >= dist) { set_value(target_scroll); @@ -350,14 +350,14 @@ void ScrollBar::_notification(int p_what) { } } else { scrolling = false; - set_fixed_process(false); + set_physics_process(false); } } else if (drag_slave_touching) { if (drag_slave_touching_deaccel) { Vector2 pos = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0); - pos += drag_slave_speed * get_fixed_process_delta_time(); + pos += drag_slave_speed * get_physics_process_delta_time(); bool turnoff = false; @@ -377,7 +377,7 @@ void ScrollBar::_notification(int p_what) { float sgn_x = drag_slave_speed.x < 0 ? -1 : 1; float val_x = Math::abs(drag_slave_speed.x); - val_x -= 1000 * get_fixed_process_delta_time(); + val_x -= 1000 * get_physics_process_delta_time(); if (val_x < 0) { turnoff = true; @@ -401,7 +401,7 @@ void ScrollBar::_notification(int p_what) { float sgn_y = drag_slave_speed.y < 0 ? -1 : 1; float val_y = Math::abs(drag_slave_speed.y); - val_y -= 1000 * get_fixed_process_delta_time(); + val_y -= 1000 * get_physics_process_delta_time(); if (val_y < 0) { turnoff = true; @@ -410,7 +410,7 @@ void ScrollBar::_notification(int p_what) { } if (turnoff) { - set_fixed_process(false); + set_physics_process(false); drag_slave_touching = false; drag_slave_touching_deaccel = false; } @@ -421,10 +421,10 @@ void ScrollBar::_notification(int p_what) { Vector2 diff = drag_slave_accum - last_drag_slave_accum; last_drag_slave_accum = drag_slave_accum; - drag_slave_speed = diff / get_fixed_process_delta_time(); + drag_slave_speed = diff / get_physics_process_delta_time(); } - time_since_motion += get_fixed_process_delta_time(); + time_since_motion += get_physics_process_delta_time(); } } } @@ -579,7 +579,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) { if (mb->is_pressed()) { if (drag_slave_touching) { - set_fixed_process(false); + set_physics_process(false); drag_slave_touching_deaccel = false; drag_slave_touching = false; drag_slave_speed = Vector2(); @@ -599,7 +599,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) { drag_slave_touching_deaccel = false; time_since_motion = 0; if (drag_slave_touching) { - set_fixed_process(true); + set_physics_process(true); time_since_motion = 0; } } @@ -611,7 +611,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) { if (drag_slave_speed == Vector2()) { drag_slave_touching_deaccel = false; drag_slave_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_slave_touching_deaccel = true; diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index c71093b947..1ad1e3f638 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -67,7 +67,7 @@ Size2 ScrollContainer::get_minimum_size() const { }; void ScrollContainer::_cancel_drag() { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = Vector2(); @@ -121,7 +121,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { if (mb->is_pressed()) { if (drag_touching) { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = Vector2(); @@ -139,7 +139,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { drag_touching_deaccel = false; time_since_motion = 0; if (drag_touching) { - set_fixed_process(true); + set_physics_process(true); time_since_motion = 0; } } @@ -150,7 +150,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { if (drag_speed == Vector2()) { drag_touching_deaccel = false; drag_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_touching_deaccel = true; @@ -257,14 +257,14 @@ void ScrollContainer::_notification(int p_what) { update_scrollbars(); } - if (p_what == NOTIFICATION_FIXED_PROCESS) { + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { if (drag_touching) { if (drag_touching_deaccel) { Vector2 pos = Vector2(h_scroll->get_value(), v_scroll->get_value()); - pos += drag_speed * get_fixed_process_delta_time(); + pos += drag_speed * get_physics_process_delta_time(); bool turnoff_h = false; bool turnoff_v = false; @@ -294,7 +294,7 @@ void ScrollContainer::_notification(int p_what) { float sgn_x = drag_speed.x < 0 ? -1 : 1; float val_x = Math::abs(drag_speed.x); - val_x -= 1000 * get_fixed_process_delta_time(); + val_x -= 1000 * get_physics_process_delta_time(); if (val_x < 0) { turnoff_h = true; @@ -302,7 +302,7 @@ void ScrollContainer::_notification(int p_what) { float sgn_y = drag_speed.y < 0 ? -1 : 1; float val_y = Math::abs(drag_speed.y); - val_y -= 1000 * get_fixed_process_delta_time(); + val_y -= 1000 * get_physics_process_delta_time(); if (val_y < 0) { turnoff_v = true; @@ -311,7 +311,7 @@ void ScrollContainer::_notification(int p_what) { drag_speed = Vector2(sgn_x * val_x, sgn_y * val_y); if (turnoff_h && turnoff_v) { - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -322,10 +322,10 @@ void ScrollContainer::_notification(int p_what) { Vector2 diff = drag_accum - last_drag_accum; last_drag_accum = drag_accum; - drag_speed = diff / get_fixed_process_delta_time(); + drag_speed = diff / get_physics_process_delta_time(); } - time_since_motion += get_fixed_process_delta_time(); + time_since_motion += get_physics_process_delta_time(); } } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 11bdbfc3e8..d14d3ef947 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -428,22 +428,22 @@ void TextEdit::_notification(int p_what) { draw_caret = false; update(); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_PHYSICS_PROCESS: { if (scrolling && v_scroll->get_value() != target_v_scroll) { double target_y = target_v_scroll - v_scroll->get_value(); double dist = sqrt(target_y * target_y); - double vel = ((target_y / dist) * v_scroll_speed) * get_fixed_process_delta_time(); + double vel = ((target_y / dist) * v_scroll_speed) * get_physics_process_delta_time(); if (Math::abs(vel) >= dist) { v_scroll->set_value(target_v_scroll); scrolling = false; - set_fixed_process(false); + set_physics_process(false); } else { v_scroll->set_value(v_scroll->get_value() + vel); } } else { scrolling = false; - set_fixed_process(false); + set_physics_process(false); } } break; case NOTIFICATION_DRAW: { @@ -1610,7 +1610,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { target_v_scroll = 0; } scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { v_scroll->set_value(target_v_scroll); } @@ -1632,7 +1632,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { target_v_scroll = max_v_scroll; } scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { v_scroll->set_value(target_v_scroll); } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 613e5520a9..178a1c272b 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2493,7 +2493,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (drag_speed == 0) { drag_touching_deaccel = false; drag_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_touching_deaccel = true; @@ -2559,7 +2559,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { break; if (drag_touching) { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = 0; @@ -2574,7 +2574,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { drag_touching = OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel = false; if (drag_touching) { - set_fixed_process(true); + set_physics_process(true); } } @@ -2765,7 +2765,7 @@ void Tree::_notification(int p_what) { drop_mode_flags = 0; scrolling = false; - set_fixed_process(false); + set_physics_process(false); update(); } if (p_what == NOTIFICATION_DRAG_BEGIN) { @@ -2773,23 +2773,23 @@ void Tree::_notification(int p_what) { single_select_defer = NULL; if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_position() - get_global_position())) { scrolling = true; - set_fixed_process(true); + set_physics_process(true); } } - if (p_what == NOTIFICATION_FIXED_PROCESS) { + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { if (drag_touching) { if (drag_touching_deaccel) { float pos = v_scroll->get_value(); - pos += drag_speed * get_fixed_process_delta_time(); + pos += drag_speed * get_physics_process_delta_time(); bool turnoff = false; if (pos < 0) { pos = 0; turnoff = true; - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -2801,7 +2801,7 @@ void Tree::_notification(int p_what) { v_scroll->set_value(pos); float sgn = drag_speed < 0 ? -1 : 1; float val = Math::abs(drag_speed); - val -= 1000 * get_fixed_process_delta_time(); + val -= 1000 * get_physics_process_delta_time(); if (val < 0) { turnoff = true; @@ -2809,7 +2809,7 @@ void Tree::_notification(int p_what) { drag_speed = sgn * val; if (turnoff) { - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -2834,7 +2834,7 @@ void Tree::_notification(int p_what) { } else { point.y = 0; } - point *= cache.scroll_speed * get_fixed_process_delta_time(); + point *= cache.scroll_speed * get_physics_process_delta_time(); point += get_scroll(); h_scroll->set_value(point.x); v_scroll->set_value(point.y); |