summaryrefslogtreecommitdiff
path: root/scene/2d/camera_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/camera_2d.cpp')
-rw-r--r--scene/2d/camera_2d.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 853e92780b..b4de12b113 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -63,11 +63,11 @@ void Camera2D::_update_scroll() {
};
}
-void Camera2D::_update_process_mode() {
+void Camera2D::_update_process_callback() {
if (Engine::get_singleton()->is_editor_hint()) {
set_process_internal(false);
set_physics_process_internal(false);
- } else if (process_mode == CAMERA2D_PROCESS_IDLE) {
+ } else if (process_callback == CAMERA2D_PROCESS_IDLE) {
set_process_internal(true);
set_physics_process_internal(false);
} else {
@@ -157,7 +157,7 @@ Transform2D Camera2D::get_camera_transform() {
}
if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) {
- float c = smoothing * (process_mode == CAMERA2D_PROCESS_PHYSICS ? get_physics_process_delta_time() : get_process_delta_time());
+ float c = smoothing * (process_callback == CAMERA2D_PROCESS_PHYSICS ? get_physics_process_delta_time() : get_process_delta_time());
smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos;
ret_camera_pos = smoothed_camera_pos;
//camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing;
@@ -247,7 +247,7 @@ void Camera2D::_notification(int p_what) {
add_to_group(group_name);
add_to_group(canvas_group_name);
- _update_process_mode();
+ _update_process_callback();
_update_scroll();
first = true;
@@ -375,17 +375,17 @@ bool Camera2D::is_rotating() const {
return rotating;
}
-void Camera2D::set_process_mode(Camera2DProcessMode p_mode) {
- if (process_mode == p_mode) {
+void Camera2D::set_process_callback(Camera2DProcessCallback p_mode) {
+ if (process_callback == p_mode) {
return;
}
- process_mode = p_mode;
- _update_process_mode();
+ process_callback = p_mode;
+ _update_process_callback();
}
-Camera2D::Camera2DProcessMode Camera2D::get_process_mode() const {
- return process_mode;
+Camera2D::Camera2DProcessCallback Camera2D::get_process_callback() const {
+ return process_callback;
}
void Camera2D::_make_current(Object *p_which) {
@@ -651,8 +651,8 @@ void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_scroll"), &Camera2D::_update_scroll);
- ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &Camera2D::set_process_mode);
- ClassDB::bind_method(D_METHOD("get_process_mode"), &Camera2D::get_process_mode);
+ ClassDB::bind_method(D_METHOD("set_process_callback", "mode"), &Camera2D::set_process_callback);
+ ClassDB::bind_method(D_METHOD("get_process_callback"), &Camera2D::get_process_callback);
ClassDB::bind_method(D_METHOD("_set_current", "current"), &Camera2D::_set_current);
ClassDB::bind_method(D_METHOD("is_current"), &Camera2D::is_current);
@@ -714,7 +714,7 @@ void Camera2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "_set_current", "is_current");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom"), "set_zoom", "get_zoom");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_callback", "get_process_callback");
ADD_GROUP("Limit", "limit_");
ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_left"), "set_limit", "get_limit", SIDE_LEFT);