summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/area_2d.cpp42
-rw-r--r--scene/2d/area_2d.h6
-rw-r--r--scene/2d/camera_2d.cpp16
-rw-r--r--scene/2d/canvas_item.cpp46
-rw-r--r--scene/2d/canvas_item.h4
-rw-r--r--scene/2d/collision_object_2d.cpp4
-rw-r--r--scene/2d/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/collision_shape_2d.cpp4
-rw-r--r--scene/2d/joints_2d.cpp10
-rw-r--r--scene/2d/node_2d.cpp4
-rw-r--r--scene/2d/parallax_background.cpp6
-rw-r--r--scene/2d/parallax_layer.cpp6
-rw-r--r--scene/2d/particles_2d.cpp14
-rw-r--r--scene/2d/path_2d.cpp8
-rw-r--r--scene/2d/physics_body_2d.cpp24
-rw-r--r--scene/2d/physics_body_2d.h4
-rw-r--r--scene/2d/position_2d.cpp6
-rw-r--r--scene/2d/ray_cast_2d.cpp12
-rw-r--r--scene/2d/remote_transform_2d.cpp8
-rw-r--r--scene/2d/remote_transform_2d.h2
-rw-r--r--scene/2d/sample_player_2d.cpp2
-rw-r--r--scene/2d/screen_button.cpp22
-rw-r--r--scene/2d/sound_player_2d.cpp4
-rw-r--r--scene/2d/sprite.cpp6
-rw-r--r--scene/2d/tile_map.cpp12
-rw-r--r--scene/2d/visibility_notifier_2d.cpp20
-rw-r--r--scene/3d/area.cpp42
-rw-r--r--scene/3d/area.h6
-rw-r--r--scene/3d/body_shape.cpp4
-rw-r--r--scene/3d/bone_attachment.cpp8
-rw-r--r--scene/3d/camera.cpp30
-rw-r--r--scene/3d/collision_object.cpp4
-rw-r--r--scene/3d/collision_polygon.cpp2
-rw-r--r--scene/3d/interpolated_camera.cpp6
-rw-r--r--scene/3d/light.cpp8
-rw-r--r--scene/3d/mesh_instance.cpp4
-rw-r--r--scene/3d/navigation_mesh.cpp6
-rw-r--r--scene/3d/path.cpp720
-rw-r--r--scene/3d/physics_body.cpp42
-rw-r--r--scene/3d/physics_body.h6
-rw-r--r--scene/3d/physics_joint.cpp4
-rw-r--r--scene/3d/proximity_group.cpp4
-rw-r--r--scene/3d/quad.cpp6
-rw-r--r--scene/3d/ray_cast.cpp10
-rw-r--r--scene/3d/room_instance.cpp2
-rw-r--r--scene/3d/skeleton.cpp8
-rw-r--r--scene/3d/spatial.cpp24
-rw-r--r--scene/3d/spatial.h2
-rw-r--r--scene/3d/spatial_stream_player.cpp4
-rw-r--r--scene/3d/sprite_3d.cpp4
-rw-r--r--scene/3d/vehicle_body.cpp4
-rw-r--r--scene/3d/visibility_notifier.cpp14
-rw-r--r--scene/3d/visual_instance.cpp2
-rw-r--r--scene/animation/animation_cache.cpp10
-rw-r--r--scene/animation/animation_cache.h2
-rw-r--r--scene/animation/animation_player.cpp14
-rw-r--r--scene/animation/animation_tree_player.cpp2
-rw-r--r--scene/animation/tween.cpp4
-rw-r--r--scene/audio/event_player.cpp12
-rw-r--r--scene/audio/sound_room_params.cpp4
-rw-r--r--scene/audio/stream_player.cpp12
-rw-r--r--scene/gui/base_button.cpp4
-rw-r--r--scene/gui/button_group.cpp2
-rw-r--r--scene/gui/container.cpp6
-rw-r--r--scene/gui/control.cpp76
-rw-r--r--scene/gui/dialogs.cpp2
-rw-r--r--scene/gui/label.cpp2
-rw-r--r--scene/gui/line_edit.cpp2
-rw-r--r--scene/gui/option_button.cpp2
-rw-r--r--scene/gui/range.cpp4
-rw-r--r--scene/gui/reference_frame.cpp4
-rw-r--r--scene/gui/scroll_bar.cpp16
-rw-r--r--scene/gui/scroll_container.cpp2
-rw-r--r--scene/gui/spin_box.cpp2
-rw-r--r--scene/gui/text_edit.cpp10
-rw-r--r--scene/gui/tree.cpp10
-rw-r--r--scene/gui/video_player.cpp10
-rw-r--r--scene/main/canvas_layer.cpp6
-rw-r--r--scene/main/node.cpp152
-rw-r--r--scene/main/node.h20
-rw-r--r--scene/main/scene_main_loop.cpp137
-rw-r--r--scene/main/scene_main_loop.h14
-rw-r--r--scene/main/timer.cpp2
-rw-r--r--scene/main/viewport.cpp60
-rw-r--r--scene/main/viewport.h4
-rw-r--r--scene/register_scene_types.cpp2
-rw-r--r--scene/scene_string_names.cpp12
-rw-r--r--scene/scene_string_names.h12
88 files changed, 953 insertions, 952 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index ad228662e4..48fa74cc6d 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -94,7 +94,7 @@ real_t Area2D::get_priority() const{
}
-void Area2D::_body_enter_scene(ObjectID p_id) {
+void Area2D::_body_enter_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
@@ -102,9 +102,9 @@ void Area2D::_body_enter_scene(ObjectID p_id) {
Map<ObjectID,BodyState>::Element *E=body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(E->get().in_scene);
+ ERR_FAIL_COND(E->get().in_tree);
- E->get().in_scene=true;
+ E->get().in_tree=true;
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -113,15 +113,15 @@ void Area2D::_body_enter_scene(ObjectID p_id) {
}
-void Area2D::_body_exit_scene(ObjectID p_id) {
+void Area2D::_body_exit_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_FAIL_COND(!node);
Map<ObjectID,BodyState>::Element *E=body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(!E->get().in_scene);
- E->get().in_scene=false;
+ ERR_FAIL_COND(!E->get().in_tree);
+ E->get().in_tree=false;
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -147,11 +147,11 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
E = body_map.insert(objid,BodyState());
E->get().rc=0;
- E->get().in_scene=node && node->is_inside_scene();
+ E->get().in_tree=node && node->is_inside_tree();
if (node) {
- node->connect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene,make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene,make_binds(objid));
- if (E->get().in_scene) {
+ node->connect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree,make_binds(objid));
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
}
}
@@ -162,7 +162,7 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
E->get().shapes.insert(ShapePair(p_body_shape,p_area_shape));
- if (E->get().in_scene) {
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,objid,node,p_body_shape,p_area_shape);
}
@@ -178,9 +178,9 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
if (E->get().rc==0) {
if (node) {
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
- if (E->get().in_scene)
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
+ if (E->get().in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
}
@@ -188,7 +188,7 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
eraseit=true;
}
- if (node && E->get().in_scene) {
+ if (node && E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,objid,obj,p_body_shape,p_area_shape);
}
@@ -212,7 +212,7 @@ void Area2D::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_CONTINUE(!node);
- if (!E->get().in_scene)
+ if (!E->get().in_tree)
continue;
for(int i=0;i<E->get().shapes.size();i++) {
@@ -222,8 +222,8 @@ void Area2D::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
}
}
@@ -232,7 +232,7 @@ void Area2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
_clear_monitoring();
} break;
@@ -266,8 +266,8 @@ bool Area2D::is_monitoring_enabled() const {
void Area2D::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_body_enter_scene","id"),&Area2D::_body_enter_scene);
- ObjectTypeDB::bind_method(_MD("_body_exit_scene","id"),&Area2D::_body_exit_scene);
+ ObjectTypeDB::bind_method(_MD("_body_enter_tree","id"),&Area2D::_body_enter_tree);
+ ObjectTypeDB::bind_method(_MD("_body_exit_tree","id"),&Area2D::_body_exit_tree);
ObjectTypeDB::bind_method(_MD("set_space_override_mode","enable"),&Area2D::set_space_override_mode);
ObjectTypeDB::bind_method(_MD("get_space_override_mode"),&Area2D::get_space_override_mode);
diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h
index b4c8edf138..85f2b91582 100644
--- a/scene/2d/area_2d.h
+++ b/scene/2d/area_2d.h
@@ -55,8 +55,8 @@ private:
void _body_inout(int p_status,const RID& p_body, int p_instance, int p_body_shape,int p_area_shape);
- void _body_enter_scene(ObjectID p_id);
- void _body_exit_scene(ObjectID p_id);
+ void _body_enter_tree(ObjectID p_id);
+ void _body_exit_tree(ObjectID p_id);
struct ShapePair {
@@ -76,7 +76,7 @@ private:
struct BodyState {
int rc;
- bool in_scene;
+ bool in_tree;
VSet<ShapePair> shapes;
};
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index fe6c9637e0..b3897010bf 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -33,10 +33,10 @@
void Camera2D::_update_scroll() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
- if (get_scene()->is_editor_hint()) {
+ if (get_tree()->is_editor_hint()) {
update(); //will just be drawn
return;
}
@@ -48,7 +48,7 @@ void Camera2D::_update_scroll() {
if (viewport) {
viewport->set_canvas_transform( xform );
}
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform);
};
}
@@ -67,7 +67,7 @@ Vector2 Camera2D::get_zoom() const {
Matrix32 Camera2D::get_camera_transform() {
- if (!get_scene())
+ if (!get_tree())
return Matrix32();
Size2 screen_size = get_viewport_rect().size;
@@ -213,7 +213,7 @@ void Camera2D::_notification(int p_what) {
_update_scroll();
} break;
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
viewport = NULL;
Node *n=this;
@@ -239,7 +239,7 @@ void Camera2D::_notification(int p_what) {
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (is_current()) {
if (viewport) {
@@ -316,10 +316,10 @@ bool Camera2D::is_current() const {
void Camera2D::make_current() {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
current=true;
} else {
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,group_name,"_make_current",this);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",this);
}
}
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index d66f100b3f..f90da51eea 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -38,7 +38,7 @@
bool CanvasItem::is_visible() const {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return false;
const CanvasItem *p=this;
@@ -92,7 +92,7 @@ void CanvasItem::show() {
hidden=false;
VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,true);
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (is_visible()) {
@@ -106,11 +106,11 @@ void CanvasItem::hide() {
if (hidden)
return;
- bool propagate=is_inside_scene() && is_visible();
+ bool propagate=is_inside_tree() && is_visible();
hidden=true;
VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false);
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (propagate)
_propagate_visibility_changed(false);
@@ -147,7 +147,7 @@ void CanvasItem::_update_callback() {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
pending_update=false;
return;
}
@@ -225,7 +225,7 @@ void CanvasItem::_sort_children() {
pending_children_sort=false;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
for(int i=0;i<get_child_count();i++) {
@@ -243,7 +243,7 @@ void CanvasItem::_sort_children() {
void CanvasItem::_raise_self() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
VisualServer::get_singleton()->canvas_item_raise(canvas_item);
@@ -283,7 +283,7 @@ void CanvasItem::_enter_canvas() {
group = "root_canvas"+itos(canvas.get_id());
add_to_group(group);
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_UNIQUE,group,"_raise_self");
+ get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_raise_self");
} else {
@@ -313,7 +313,7 @@ void CanvasItem::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
first_draw=true;
pending_children_sort=false;
@@ -324,14 +324,14 @@ void CanvasItem::_notification(int p_what) {
}
_enter_canvas();
if (!block_transform_notify && !xform_change.in_list()) {
- get_scene()->xform_change_list.add(&xform_change);
+ get_tree()->xform_change_list.add(&xform_change);
}
} break;
case NOTIFICATION_MOVED_IN_PARENT: {
if (group!="") {
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_UNIQUE,group,"_raise_self");
+ get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_raise_self");
} else {
CanvasItem *p = get_parent_item();
ERR_FAIL_COND(!p);
@@ -340,9 +340,9 @@ void CanvasItem::_notification(int p_what) {
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (xform_change.in_list())
- get_scene()->xform_change_list.remove(&xform_change);
+ get_tree()->xform_change_list.remove(&xform_change);
_exit_canvas();
if (C) {
get_parent()->cast_to<CanvasItem>()->children_items.erase(C);
@@ -379,7 +379,7 @@ bool CanvasItem::_is_visible_() const {
void CanvasItem::update() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (pending_update)
return;
@@ -406,7 +406,7 @@ void CanvasItem::set_as_toplevel(bool p_toplevel) {
if (toplevel==p_toplevel)
return;
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
toplevel=p_toplevel;
return;
}
@@ -630,8 +630,8 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) {
if (!p_node->xform_change.in_list()) {
if (!p_node->block_transform_notify) {
- if (p_node->is_inside_scene())
- get_scene()->xform_change_list.add(&p_node->xform_change);
+ if (p_node->is_inside_tree())
+ get_tree()->xform_change_list.add(&p_node->xform_change);
}
}
@@ -648,13 +648,13 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) {
Rect2 CanvasItem::get_viewport_rect() const {
- ERR_FAIL_COND_V(!is_inside_scene(),Rect2());
+ ERR_FAIL_COND_V(!is_inside_tree(),Rect2());
return get_viewport()->get_visible_rect();
}
RID CanvasItem::get_canvas() const {
- ERR_FAIL_COND_V(!is_inside_scene(),RID());
+ ERR_FAIL_COND_V(!is_inside_tree(),RID());
if (canvas_layer)
return canvas_layer->get_world_2d()->get_canvas();
@@ -677,7 +677,7 @@ CanvasItem *CanvasItem::get_toplevel() const {
Ref<World2D> CanvasItem::get_world_2d() const {
- ERR_FAIL_COND_V(!is_inside_scene(),Ref<World2D>());
+ ERR_FAIL_COND_V(!is_inside_tree(),Ref<World2D>());
CanvasItem *tl=get_toplevel();
@@ -693,7 +693,7 @@ Ref<World2D> CanvasItem::get_world_2d() const {
RID CanvasItem::get_viewport_rid() const {
- ERR_FAIL_COND_V(!is_inside_scene(),RID());
+ ERR_FAIL_COND_V(!is_inside_tree(),RID());
return get_viewport()->get_viewport();
}
@@ -824,7 +824,7 @@ void CanvasItem::_bind_methods() {
Matrix32 CanvasItem::get_canvas_transform() const {
- ERR_FAIL_COND_V(!is_inside_scene(),Matrix32());
+ ERR_FAIL_COND_V(!is_inside_tree(),Matrix32());
if (canvas_layer)
return canvas_layer->get_transform();
@@ -835,7 +835,7 @@ Matrix32 CanvasItem::get_canvas_transform() const {
Matrix32 CanvasItem::get_viewport_transform() const {
- ERR_FAIL_COND_V(!is_inside_scene(),Matrix32());
+ ERR_FAIL_COND_V(!is_inside_tree(),Matrix32());
if (canvas_layer) {
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 604eef0527..dbf8fd79e9 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -110,7 +110,7 @@ protected:
- _FORCE_INLINE_ void _notify_transform() { if (!is_inside_scene()) return; _notify_transform(this); if (!block_transform_notify) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
+ _FORCE_INLINE_ void _notify_transform() { if (!is_inside_tree()) return; _notify_transform(this); if (!block_transform_notify) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
void item_rect_changed();
@@ -120,7 +120,7 @@ public:
enum {
- NOTIFICATION_TRANSFORM_CHANGED=SceneMainLoop::NOTIFICATION_TRANSFORM_CHANGED, //unique
+ NOTIFICATION_TRANSFORM_CHANGED=SceneTree::NOTIFICATION_TRANSFORM_CHANGED, //unique
NOTIFICATION_DRAW=30,
NOTIFICATION_VISIBILITY_CHANGED=31,
NOTIFICATION_ENTER_CANVAS=32,
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index 56359e6015..3b859d9366 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -45,7 +45,7 @@ void CollisionObject2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (area)
Physics2DServer::get_singleton()->area_set_transform(rid,get_global_transform());
@@ -69,7 +69,7 @@ void CollisionObject2D::_notification(int p_what) {
Physics2DServer::get_singleton()->body_set_state(rid,Physics2DServer::BODY_STATE_TRANSFORM,get_global_transform());
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (area) {
Physics2DServer::get_singleton()->area_set_space(rid,RID());
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index ef63286697..57495b5cb0 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -95,7 +95,7 @@ void CollisionPolygon2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
break;
_update_parent();
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index 3f068f4ccc..9f35ade322 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -72,12 +72,12 @@ void CollisionShape2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
unparenting=false;
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
break;
_update_parent();
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp
index 0e673ff791..e706ad658a 100644
--- a/scene/2d/joints_2d.cpp
+++ b/scene/2d/joints_2d.cpp
@@ -32,7 +32,7 @@
void Joint2D::_update_joint() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (joint.is_valid()) {
@@ -86,7 +86,7 @@ void Joint2D::_notification(int p_what) {
case NOTIFICATION_READY: {
_update_joint();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (joint.is_valid()) {
Physics2DServer::get_singleton()->free(joint);
@@ -145,7 +145,7 @@ void PinJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
- if (is_inside_scene() && get_scene()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_editor_hint()) {
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3);
@@ -197,7 +197,7 @@ void GrooveJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
- if (is_inside_scene() && get_scene()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_editor_hint()) {
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
@@ -291,7 +291,7 @@ void DampedSpringJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
- if (is_inside_scene() && get_scene()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_editor_hint()) {
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 4c00db2429..6dcee3458f 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -130,7 +130,7 @@ void Node2D::_update_transform() {
VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),_mat);
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
@@ -272,7 +272,7 @@ void Node2D::set_transform(const Matrix32& p_transform) {
VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),_mat);
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
_notify_transform();
diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp
index 55607bd4eb..df37285f9d 100644
--- a/scene/2d/parallax_background.cpp
+++ b/scene/2d/parallax_background.cpp
@@ -36,13 +36,13 @@ void ParallaxBackground::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
group_name = "__cameras_"+itos(get_viewport().get_id());
add_to_group(group_name);
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
remove_from_group(group_name);
} break;
@@ -78,7 +78,7 @@ void ParallaxBackground::set_scroll_offset(const Point2& p_ofs) {
void ParallaxBackground::_update_scroll() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Vector2 ofs = base_offset+offset*base_scale;
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 2cda51dccb..a0913ab50c 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -74,7 +74,7 @@ void ParallaxLayer::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
orig_offset=get_pos();
orig_scale=get_scale();
@@ -85,9 +85,9 @@ void ParallaxLayer::_notification(int p_what) {
void ParallaxLayer::set_base_offset_and_scale(const Point2& p_offset,float p_scale) {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
return;
Point2 new_ofs = ((orig_offset+p_offset)*motion_scale)*p_scale;
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index 819b06e095..7f492e743c 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -34,14 +34,14 @@ void ParticleAttractor2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
_update_owner();
} break;
case NOTIFICATION_DRAW: {
- if (!get_scene()->is_editor_hint())
+ if (!get_tree()->is_editor_hint())
return;
Vector2 pv;
@@ -58,7 +58,7 @@ void ParticleAttractor2D::_notification(int p_what) {
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (owner) {
_set_owner(NULL);
}
@@ -76,7 +76,7 @@ void ParticleAttractor2D::_owner_exited() {
void ParticleAttractor2D::_update_owner() {
- if (!is_inside_scene() || !has_node(path)) {
+ if (!is_inside_tree() || !has_node(path)) {
_set_owner(NULL);
return;
}
@@ -98,7 +98,7 @@ void ParticleAttractor2D::_set_owner(Particles2D* p_owner) {
return;
if (owner) {
- owner->disconnect("exit_scene",this,"_owner_exited");
+ owner->disconnect("exit_tree",this,"_owner_exited");
owner->attractors.erase(this);
owner=NULL;
}
@@ -106,7 +106,7 @@ void ParticleAttractor2D::_set_owner(Particles2D* p_owner) {
if (owner) {
- owner->connect("exit_scene",this,"_owner_exited",varray(),CONNECT_ONESHOT);
+ owner->connect("exit_tree",this,"_owner_exited",varray(),CONNECT_ONESHOT);
owner->attractors.insert(this);
}
}
@@ -457,7 +457,7 @@ void Particles2D::_notification(int p_what) {
_process_particles( get_process_delta_time() );
} break;
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
float ppt=preprocess;
while(ppt>0) {
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index febec54124..5560274c98 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -31,7 +31,7 @@
void Path2D::_notification(int p_what) {
- if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_scene() && get_scene()->is_editor_hint()) {
+ if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_tree() && get_tree()->is_editor_hint()) {
//draw the curve!!
for(int i=0;i<curve->get_point_count();i++) {
@@ -52,7 +52,7 @@ void Path2D::_notification(int p_what) {
void Path2D::_curve_changed() {
- if (is_inside_scene() && get_scene()->is_editor_hint())
+ if (is_inside_tree() && get_tree()->is_editor_hint())
update();
}
@@ -135,7 +135,7 @@ void PathFollow2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
Node *parent=get_parent();
if (parent) {
@@ -147,7 +147,7 @@ void PathFollow2D::_notification(int p_what) {
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
path=NULL;
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 308aa8402f..f2f7a15e91 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -198,7 +198,7 @@ StaticBody2D::~StaticBody2D() {
-void RigidBody2D::_body_enter_scene(ObjectID p_id) {
+void RigidBody2D::_body_enter_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
@@ -218,7 +218,7 @@ void RigidBody2D::_body_enter_scene(ObjectID p_id) {
}
-void RigidBody2D::_body_exit_scene(ObjectID p_id) {
+void RigidBody2D::_body_exit_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
@@ -251,10 +251,10 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap
E = contact_monitor->body_map.insert(objid,BodyState());
// E->get().rc=0;
- E->get().in_scene=node && node->is_inside_scene();
+ E->get().in_scene=node && node->is_inside_tree();
if (node) {
- node->connect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene,make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene,make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree,make_binds(objid));
if (E->get().in_scene) {
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
}
@@ -283,8 +283,8 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap
if (E->get().shapes.empty()) {
if (node) {
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
if (in_scene)
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
@@ -694,8 +694,8 @@ void RigidBody2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_able_to_sleep"),&RigidBody2D::is_able_to_sleep);
ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&RigidBody2D::_direct_state_changed);
- ObjectTypeDB::bind_method(_MD("_body_enter_scene"),&RigidBody2D::_body_enter_scene);
- ObjectTypeDB::bind_method(_MD("_body_exit_scene"),&RigidBody2D::_body_exit_scene);
+ ObjectTypeDB::bind_method(_MD("_body_enter_tree"),&RigidBody2D::_body_enter_tree);
+ ObjectTypeDB::bind_method(_MD("_body_exit_tree"),&RigidBody2D::_body_exit_tree);
BIND_VMETHOD(MethodInfo("_integrate_forces",PropertyInfo(Variant::OBJECT,"state:Physics2DDirectBodyState")));
@@ -803,7 +803,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) {
colliding=false;
- ERR_FAIL_COND_V(!is_inside_scene(),Vector2());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(get_world_2d()->get_space());
ERR_FAIL_COND_V(!dss,Vector2());
const int max_shapes=32;
@@ -947,7 +947,7 @@ Vector2 KinematicBody2D::move_to(const Vector2& p_position) {
bool KinematicBody2D::can_move_to(const Vector2& p_position, bool p_discrete) {
- ERR_FAIL_COND_V(!is_inside_scene(),false);
+ ERR_FAIL_COND_V(!is_inside_tree(),false);
Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(get_world_2d()->get_space());
ERR_FAIL_COND_V(!dss,false);
@@ -987,7 +987,7 @@ bool KinematicBody2D::can_move_to(const Vector2& p_position, bool p_discrete) {
bool KinematicBody2D::is_colliding() const {
- ERR_FAIL_COND_V(!is_inside_scene(),false);
+ ERR_FAIL_COND_V(!is_inside_tree(),false);
return colliding;
}
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index e429ca1432..77e909f105 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -170,8 +170,8 @@ private:
ContactMonitor *contact_monitor;
- void _body_enter_scene(ObjectID p_id);
- void _body_exit_scene(ObjectID p_id);
+ void _body_enter_tree(ObjectID p_id);
+ void _body_exit_tree(ObjectID p_id);
void _body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape);
diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp
index ca3be9aa8f..2db2be123b 100644
--- a/scene/2d/position_2d.cpp
+++ b/scene/2d/position_2d.cpp
@@ -45,14 +45,14 @@ void Position2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
update();
} break;
case NOTIFICATION_DRAW: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
break;
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
_draw_cross();
} break;
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index 8479338521..e352ac64f5 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -33,7 +33,7 @@
void RayCast2D::set_cast_to(const Vector2& p_point) {
cast_to=p_point;
- if (is_inside_scene() && get_scene()->is_editor_hint())
+ if (is_inside_tree() && get_tree()->is_editor_hint())
update();
}
@@ -82,7 +82,7 @@ Vector2 RayCast2D::get_collision_normal() const{
void RayCast2D::set_enabled(bool p_enabled) {
enabled=p_enabled;
- if (is_inside_scene() && !get_scene()->is_editor_hint())
+ if (is_inside_tree() && !get_tree()->is_editor_hint())
set_fixed_process(p_enabled);
if (!p_enabled)
collided=false;
@@ -101,15 +101,15 @@ void RayCast2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
- if (enabled && !get_scene()->is_editor_hint())
+ if (enabled && !get_tree()->is_editor_hint())
set_fixed_process(true);
else
set_fixed_process(false);
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (enabled)
set_fixed_process(false);
@@ -118,7 +118,7 @@ void RayCast2D::_notification(int p_what) {
#ifdef TOOLS_ENABLED
case NOTIFICATION_DRAW: {
- if (!get_scene()->is_editor_hint())
+ if (!get_tree()->is_editor_hint())
break;
Matrix32 xf;
xf.rotate(cast_to.atan2());
diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp
index 80d038f6f8..b170986017 100644
--- a/scene/2d/remote_transform_2d.cpp
+++ b/scene/2d/remote_transform_2d.cpp
@@ -45,7 +45,7 @@ void RemoteTransform2D::_update_cache() {
void RemoteTransform2D::_update_remote() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (!cache)
@@ -59,7 +59,7 @@ void RemoteTransform2D::_update_remote() {
if (!n)
return;
- if (!n->is_inside_scene())
+ if (!n->is_inside_tree())
return;
//todo make faster
@@ -77,7 +77,7 @@ void RemoteTransform2D::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
break;
if (cache) {
@@ -95,7 +95,7 @@ void RemoteTransform2D::_notification(int p_what) {
void RemoteTransform2D::set_remote_node(const NodePath& p_remote_node) {
remote_node=p_remote_node;
- if (is_inside_scene())
+ if (is_inside_tree())
_update_cache();
}
diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h
index 9561e72255..05a9b20f6e 100644
--- a/scene/2d/remote_transform_2d.h
+++ b/scene/2d/remote_transform_2d.h
@@ -38,7 +38,7 @@ class RemoteTransform2D : public Node2D {
void _update_remote();
void _update_cache();
- void _node_exited_scene();
+ //void _node_exited_scene();
protected:
static void _bind_methods();
diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp
index bc1734ec06..99dfa67c27 100644
--- a/scene/2d/sample_player_2d.cpp
+++ b/scene/2d/sample_player_2d.cpp
@@ -89,7 +89,7 @@ void SamplePlayer2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
SpatialSound2DServer::get_singleton()->source_set_polyphony(get_source_rid(),polyphony);
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index b606634819..2ac3c06031 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -69,9 +69,9 @@ void TouchScreenButton::_notification(int p_what) {
case NOTIFICATION_DRAW: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
- if (!get_scene()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY)
+ if (!get_tree()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY)
return;
if (finger_pressed!=-1) {
@@ -87,13 +87,13 @@ void TouchScreenButton::_notification(int p_what) {
}
} break;
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
- if (!get_scene()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY)
+ if (!get_tree()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY)
return;
update();
- if (!get_scene()->is_editor_hint())
+ if (!get_tree()->is_editor_hint())
set_process_input(true);
if (action.operator String()!="" && InputMap::get_singleton()->has_action(action)) {
@@ -129,7 +129,7 @@ String TouchScreenButton::get_action() const {
void TouchScreenButton::_input(const InputEvent& p_event) {
- if (!get_scene())
+ if (!get_tree())
return;
if (p_event.device != 0)
@@ -149,7 +149,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
ie.ID=0;
ie.action.action=action_id;
ie.action.pressed=false;
- get_scene()->input_event(ie);
+ get_tree()->input_event(ie);
}
finger_pressed=-1;
@@ -193,7 +193,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
ie.ID=0;
ie.action.action=action_id;
ie.action.pressed=true;
- get_scene()->input_event(ie);
+ get_tree()->input_event(ie);
}
update();
@@ -213,7 +213,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
ie.ID=0;
ie.action.action=action_id;
ie.action.pressed=false;
- get_scene()->input_event(ie);
+ get_tree()->input_event(ie);
}
finger_pressed=-1;
@@ -268,7 +268,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
ie.ID=0;
ie.action.action=action_id;
ie.action.pressed=true;
- get_scene()->input_event(ie);
+ get_tree()->input_event(ie);
}
update();
@@ -289,7 +289,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
ie.ID=0;
ie.action.action=action_id;
ie.action.pressed=false;
- get_scene()->input_event(ie);
+ get_tree()->input_event(ie);
}
finger_pressed=-1;
update();
diff --git a/scene/2d/sound_player_2d.cpp b/scene/2d/sound_player_2d.cpp
index 2fffef4e51..ef51295476 100644
--- a/scene/2d/sound_player_2d.cpp
+++ b/scene/2d/sound_player_2d.cpp
@@ -39,7 +39,7 @@ void SoundPlayer2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
//find the sound space
source_rid = SpatialSound2DServer::get_singleton()->source_create(get_world_2d()->get_sound_space());
@@ -56,7 +56,7 @@ void SoundPlayer2D::_notification(int p_what) {
SpatialSound2DServer::get_singleton()->source_set_transform(source_rid,get_global_transform());
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (source_rid.is_valid())
SpatialSound2DServer::get_singleton()->free(source_rid);
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index 8c3bbfdfc9..9f789a7a1f 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -365,7 +365,7 @@ void ViewportSprite::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (!viewport_path.is_empty()) {
@@ -380,7 +380,7 @@ void ViewportSprite::_notification(int p_what) {
item_rect_changed();
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (texture.is_valid()) {
@@ -422,7 +422,7 @@ void ViewportSprite::set_viewport_path(const NodePath& p_viewport) {
viewport_path=p_viewport;
update();
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (texture.is_valid()) {
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index eb04ca924f..9fcf34cee6 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -33,7 +33,7 @@ void TileMap::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
pending_update=true;
_update_dirty_quadrants();
@@ -43,7 +43,7 @@ void TileMap::_notification(int p_what) {
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
_update_quadrant_space(RID());
@@ -68,7 +68,7 @@ void TileMap::_update_quadrant_space(const RID& p_space) {
void TileMap::_update_quadrant_transform() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Matrix32 global_transform = get_global_transform();
@@ -164,7 +164,7 @@ void TileMap::_update_dirty_quadrants() {
if (!pending_update)
return;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (!tile_set.is_valid())
return;
@@ -345,7 +345,7 @@ Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const
Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_FRICTION,friction);
Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_BOUNCE,bounce);
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
xform = get_global_transform() * xform;
RID space = get_world_2d()->get_space();
Physics2DServer::get_singleton()->body_set_space(q.static_body,space);
@@ -379,7 +379,7 @@ void TileMap::_make_quadrant_dirty(Map<PosKey,Quadrant>::Element *Q) {
if (pending_update)
return;
pending_update=true;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
call_deferred("_update_dirty_quadrants");
}
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index e5eb193f6f..22534eeb0e 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -64,7 +64,7 @@ void VisibilityNotifier2D::_exit_viewport(Viewport* p_viewport){
void VisibilityNotifier2D::set_rect(const Rect2& p_rect){
rect=p_rect;
- if (is_inside_scene())
+ if (is_inside_tree())
get_world_2d()->_update_notifier(this,get_global_transform().xform(rect));
_change_notify("rect");
@@ -85,7 +85,7 @@ void VisibilityNotifier2D::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
//get_world_2d()->
get_world_2d()->_register_notifier(this,get_global_transform().xform(rect));
@@ -97,12 +97,12 @@ void VisibilityNotifier2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- if (get_scene()->is_editor_hint()) {
+ if (get_tree()->is_editor_hint()) {
draw_rect(rect,Color(1,0.5,1,0.2));
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
get_world_2d()->_remove_notifier(this);
} break;
@@ -190,7 +190,7 @@ void VisibilityEnabler2D::_find_nodes(Node* p_node) {
if (add) {
- p_node->connect(SceneStringNames::get_singleton()->exit_scene,this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
+ p_node->connect(SceneStringNames::get_singleton()->exit_tree,this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
nodes[p_node]=meta;
_change_node_state(p_node,false);
}
@@ -207,9 +207,9 @@ void VisibilityEnabler2D::_find_nodes(Node* p_node) {
void VisibilityEnabler2D::_notification(int p_what){
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
return;
@@ -222,9 +222,9 @@ void VisibilityEnabler2D::_notification(int p_what){
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
return;
@@ -235,7 +235,7 @@ void VisibilityEnabler2D::_notification(int p_what){
if (!visible)
_change_node_state(E->key(),true);
- E->key()->disconnect(SceneStringNames::get_singleton()->exit_scene,this,"_node_removed");
+ E->key()->disconnect(SceneStringNames::get_singleton()->exit_tree,this,"_node_removed");
}
nodes.clear();
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index 7370c36eb7..407747fc0d 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -94,7 +94,7 @@ real_t Area::get_priority() const{
}
-void Area::_body_enter_scene(ObjectID p_id) {
+void Area::_body_enter_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
@@ -102,9 +102,9 @@ void Area::_body_enter_scene(ObjectID p_id) {
Map<ObjectID,BodyState>::Element *E=body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(E->get().in_scene);
+ ERR_FAIL_COND(E->get().in_tree);
- E->get().in_scene=true;
+ E->get().in_tree=true;
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -113,15 +113,15 @@ void Area::_body_enter_scene(ObjectID p_id) {
}
-void Area::_body_exit_scene(ObjectID p_id) {
+void Area::_body_exit_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_FAIL_COND(!node);
Map<ObjectID,BodyState>::Element *E=body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(!E->get().in_scene);
- E->get().in_scene=false;
+ ERR_FAIL_COND(!E->get().in_tree);
+ E->get().in_tree=false;
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -147,11 +147,11 @@ void Area::_body_inout(int p_status,const RID& p_body, int p_instance, int p_bod
E = body_map.insert(objid,BodyState());
E->get().rc=0;
- E->get().in_scene=node && node->is_inside_scene();
+ E->get().in_tree=node && node->is_inside_tree();
if (node) {
- node->connect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene,make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene,make_binds(objid));
- if (E->get().in_scene) {
+ node->connect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree,make_binds(objid));
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
}
}
@@ -162,7 +162,7 @@ void Area::_body_inout(int p_status,const RID& p_body, int p_instance, int p_bod
E->get().shapes.insert(ShapePair(p_body_shape,p_area_shape));
- if (E->get().in_scene) {
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,objid,node,p_body_shape,p_area_shape);
}
@@ -178,9 +178,9 @@ void Area::_body_inout(int p_status,const RID& p_body, int p_instance, int p_bod
if (E->get().rc==0) {
if (node) {
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
- if (E->get().in_scene)
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
+ if (E->get().in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
}
@@ -188,7 +188,7 @@ void Area::_body_inout(int p_status,const RID& p_body, int p_instance, int p_bod
eraseit=true;
}
- if (node && E->get().in_scene) {
+ if (node && E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,objid,obj,p_body_shape,p_area_shape);
}
@@ -211,7 +211,7 @@ void Area::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_CONTINUE(!node);
- if (!E->get().in_scene)
+ if (!E->get().in_tree)
continue;
for(int i=0;i<E->get().shapes.size();i++) {
@@ -221,14 +221,14 @@ void Area::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
}
}
void Area::_notification(int p_what) {
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
_clear_monitoring();
}
}
@@ -258,8 +258,8 @@ bool Area::is_monitoring_enabled() const {
void Area::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_body_enter_scene","id"),&Area::_body_enter_scene);
- ObjectTypeDB::bind_method(_MD("_body_exit_scene","id"),&Area::_body_exit_scene);
+ ObjectTypeDB::bind_method(_MD("_body_enter_tree","id"),&Area::_body_enter_tree);
+ ObjectTypeDB::bind_method(_MD("_body_exit_tree","id"),&Area::_body_exit_tree);
ObjectTypeDB::bind_method(_MD("set_space_override_mode","enable"),&Area::set_space_override_mode);
ObjectTypeDB::bind_method(_MD("get_space_override_mode"),&Area::get_space_override_mode);
diff --git a/scene/3d/area.h b/scene/3d/area.h
index 5558e2c719..96b8585338 100644
--- a/scene/3d/area.h
+++ b/scene/3d/area.h
@@ -56,8 +56,8 @@ private:
void _body_inout(int p_status,const RID& p_body, int p_instance, int p_body_shape,int p_area_shape);
- void _body_enter_scene(ObjectID p_id);
- void _body_exit_scene(ObjectID p_id);
+ void _body_enter_tree(ObjectID p_id);
+ void _body_exit_tree(ObjectID p_id);
struct ShapePair {
@@ -77,7 +77,7 @@ private:
struct BodyState {
int rc;
- bool in_scene;
+ bool in_tree;
VSet<ShapePair> shapes;
};
diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp
index 947acc6549..287515dce7 100644
--- a/scene/3d/body_shape.cpp
+++ b/scene/3d/body_shape.cpp
@@ -320,7 +320,7 @@ void CollisionShape::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
unparenting=false;
//indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario());
@@ -331,7 +331,7 @@ void CollisionShape::_notification(int p_what) {
_update_body();
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
/* if (indicator_instance.is_valid()) {
VisualServer::get_singleton()->free(indicator_instance);
indicator_instance=RID();
diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp
index cbc4abb7a9..6bbb957d25 100644
--- a/scene/3d/bone_attachment.cpp
+++ b/scene/3d/bone_attachment.cpp
@@ -102,12 +102,12 @@ void BoneAttachment::_check_unbind() {
void BoneAttachment::set_bone_name(const String& p_name) {
- if (is_inside_scene())
+ if (is_inside_tree())
_check_unbind();
bone_name=p_name;
- if (is_inside_scene())
+ if (is_inside_tree())
_check_bind();
}
@@ -120,11 +120,11 @@ void BoneAttachment::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
_check_bind();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
_check_unbind();
} break;
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index ab28c0c8d4..933f270475 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -121,7 +121,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const {
r_ret= int(keep_aspect);
else if (p_name=="current") {
- if (is_inside_scene() && get_scene()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_editor_hint()) {
r_ret=current;
} else {
r_ret=is_current();
@@ -182,7 +182,7 @@ void Camera::_update_camera() {
// if (viewport_ptr && is_inside_scene() && is_current())
// viewport_ptr->_camera_transform_changed_notify();
- if (is_inside_scene() && is_current()) {
+ if (is_inside_tree() && is_current()) {
if (viewport_ptr) {
viewport_ptr->_camera_transform_changed_notify();
}
@@ -309,7 +309,7 @@ void Camera::make_current() {
current=true;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (viewport_ptr) {
@@ -324,7 +324,7 @@ void Camera::_camera_make_next_current(Node *p_exclude) {
if (this==p_exclude)
return;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (get_viewport()->get_camera()!=NULL)
return;
@@ -336,14 +336,14 @@ void Camera::_camera_make_next_current(Node *p_exclude) {
void Camera::clear_current() {
current=false;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (viewport_ptr) {
if (viewport_ptr->get_camera()==this) {
viewport_ptr->_set_camera(NULL);
//a group is used beause this needs to be in order to be deterministic
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
}
}
@@ -352,7 +352,7 @@ void Camera::clear_current() {
bool Camera::is_current() const {
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if (viewport_ptr)
return viewport_ptr->get_camera()==this;
} else
@@ -462,9 +462,9 @@ Vector3 Camera::project_ray_normal(const Point2& p_pos) const {
Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
ERR_EXPLAIN("Camera is not inside scene.");
- ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
}
@@ -496,9 +496,9 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
ERR_EXPLAIN("Camera is not inside scene.");
- ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
}
#if 0
@@ -540,9 +540,9 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
Point2 Camera::unproject_position(const Vector3& p_pos) const {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
ERR_EXPLAIN("Camera is not inside scene.");
- ERR_FAIL_COND_V(!is_inside_scene(),Vector2());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
}
Size2 viewport_size = viewport_ptr->get_visible_rect().size;
@@ -571,9 +571,9 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const {
Vector3 Camera::project_position(const Point2& p_point) const {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
ERR_EXPLAIN("Camera is not inside scene.");
- ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
}
Size2 viewport_size = viewport_ptr->get_visible_rect().size;
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index 47d29cec1c..82158405ea 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -199,9 +199,9 @@ void CollisionObject::_mouse_exit() {
}
void CollisionObject::_update_pickable() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
- bool pickable = ray_pickable && is_inside_scene() && is_visible();
+ bool pickable = ray_pickable && is_inside_tree() && is_visible();
if (area)
PhysicsServer::get_singleton()->area_set_ray_pickable(rid,pickable);
else
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index 5a613f360a..4ab1a1a1ab 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -86,7 +86,7 @@ void CollisionPolygon::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_TRANSFORM_CHANGED: {
- if (!is_inside_scene())
+ if (!is_inside_tree())
break;
_update_parent();
diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp
index f795f935ae..2f35164f49 100644
--- a/scene/3d/interpolated_camera.cpp
+++ b/scene/3d/interpolated_camera.cpp
@@ -32,9 +32,9 @@
void InterpolatedCamera::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
- if (get_scene()->is_editor_hint() && enabled)
+ if (get_tree()->is_editor_hint() && enabled)
set_fixed_process(false);
} break;
@@ -109,7 +109,7 @@ void InterpolatedCamera::set_interpolation_enabled(bool p_enable) {
return;
enabled=p_enable;
if (p_enable) {
- if (is_inside_scene() && get_scene()->is_editor_hint())
+ if (is_inside_tree() && get_tree()->is_editor_hint())
return;
set_process(true);
} else
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index e51a9764f6..9d959cb0d6 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -432,7 +432,7 @@ void Light::approximate_opengl_attenuation(float p_constant, float p_linear, flo
void Light::_update_visibility() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
@@ -440,10 +440,10 @@ bool editor_ok=true;
#ifdef TOOLS_ENABLED
if (editor_only) {
- if (!get_scene()->is_editor_hint()) {
+ if (!get_tree()->is_editor_hint()) {
editor_ok=false;
} else {
- editor_ok = (get_scene()->get_edited_scene_root() && (this==get_scene()->get_edited_scene_root() || get_owner()==get_scene()->get_edited_scene_root()));
+ editor_ok = (get_tree()->get_edited_scene_root() && (this==get_tree()->get_edited_scene_root() || get_owner()==get_tree()->get_edited_scene_root()));
}
}
#endif
@@ -456,7 +456,7 @@ bool editor_ok=true;
void Light::_notification(int p_what) {
- if (p_what==NOTIFICATION_ENTER_SCENE || p_what==NOTIFICATION_VISIBILITY_CHANGED) {
+ if (p_what==NOTIFICATION_ENTER_TREE || p_what==NOTIFICATION_VISIBILITY_CHANGED) {
_update_visibility();
}
}
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 72d63fa006..d7266e5df7 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -126,7 +126,7 @@ void MeshInstance::_resolve_skeleton_path(){
void MeshInstance::set_skeleton_path(const NodePath &p_skeleton) {
skeleton_path = p_skeleton;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
_resolve_skeleton_path();
}
@@ -226,7 +226,7 @@ void MeshInstance::create_convex_collision() {
void MeshInstance::_notification(int p_what) {
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
_resolve_skeleton_path();
}
}
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index db416f24dd..8c52d4c35c 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -114,7 +114,7 @@ void NavigationMeshInstance::set_enabled(bool p_enabled) {
return;
enabled=p_enabled;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (!enabled) {
@@ -152,7 +152,7 @@ void NavigationMeshInstance::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
Spatial *c=this;
while(c) {
@@ -178,7 +178,7 @@ void NavigationMeshInstance::_notification(int p_what) {
}
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (navigation) {
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index bc5cb1c4a2..8be918fc22 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -26,363 +26,363 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "path.h"
-#include "scene/scene_string_names.h"
-
-void Path::_notification(int p_what) {
-#if 0
- if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_scene() && get_scene()->is_editor_hint()) {
- //draw the curve!!
-
- for(int i=0;i<curve->get_point_count();i++) {
-
- Vector2 prev_p=curve->get_point_pos(i);
-
- for(int j=1;j<=8;j++) {
-
- real_t frac = j/8.0;
- Vector2 p = curve->interpolate(i,frac);
- draw_line(prev_p,p,Color(0.5,0.6,1.0,0.7),2);
- prev_p=p;
- }
- }
- }
-#endif
-}
-
-void Path::_curve_changed() {
-
-
- if (is_inside_scene() && get_scene()->is_editor_hint())
- update_gizmo();
-}
-
-
-void Path::set_curve(const Ref<Curve3D>& p_curve) {
-
- if (curve.is_valid()) {
- curve->disconnect("changed",this,"_curve_changed");
- }
-
- curve=p_curve;
-
- if (curve.is_valid()) {
- curve->connect("changed",this,"_curve_changed");
- }
- _curve_changed();
-
-}
-
-Ref<Curve3D> Path::get_curve() const{
-
- return curve;
-}
-
-void Path::_bind_methods() {
-
- ObjectTypeDB::bind_method(_MD("set_curve","curve:Curve3D"),&Path::set_curve);
- ObjectTypeDB::bind_method(_MD("get_curve:Curve3D","curve"),&Path::get_curve);
- ObjectTypeDB::bind_method(_MD("_curve_changed"),&Path::_curve_changed);
-
- ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), _SCS("set_curve"),_SCS("get_curve"));
-}
-
-Path::Path() {
-
- set_curve(Ref<Curve3D>( memnew( Curve3D ))); //create one by default
-}
-
-
-//////////////
-
-
-void PathFollow::_update_transform() {
-
-
- if (!path)
- return;
-
- Ref<Curve3D> c =path->get_curve();
- if (!c.is_valid())
- return;
-
-
- float o = offset;
- if (loop)
- o=Math::fposmod(o,c->get_baked_length());
-
- Vector3 pos = c->interpolate_baked(o,cubic);
- Transform t=get_transform();
-
-
- if (rotation_mode!=ROTATION_NONE) {
-
- Vector3 n = (c->interpolate_baked(o+lookahead,cubic)-pos).normalized();
-
- if (rotation_mode==ROTATION_Y) {
-
- n.y=0;
- n.normalize();
- }
-
- if (n.length()<CMP_EPSILON) {//nothing, use previous
- n=-t.get_basis().get_axis(2).normalized();
- }
-
-
- Vector3 up = Vector3(0,1,0);
-
- if (rotation_mode==ROTATION_XYZ) {
-
- float tilt = c->interpolate_baked_tilt(o);
- if (tilt!=0) {
-
- Matrix3 rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan.
- up=rot.xform(up);
- }
- }
-
- t.set_look_at(pos,pos+n,up);
-
- } else {
-
- t.origin=pos;
- }
-
- t.origin+=t.basis.get_axis(0)*h_offset + t.basis.get_axis(1)*v_offset;
- set_transform(t);
-
-}
-
-void PathFollow::_notification(int p_what) {
-
-
- switch(p_what) {
-
- case NOTIFICATION_ENTER_SCENE: {
-
- Node *parent=get_parent();
- if (parent) {
-
- path=parent->cast_to<Path>();
- if (path) {
- _update_transform();
- }
- }
-
- } break;
- case NOTIFICATION_EXIT_SCENE: {
-
-
- path=NULL;
- } break;
- }
-
-}
-
-void PathFollow::set_cubic_interpolation(bool p_enable) {
-
- cubic=p_enable;
-}
-
-bool PathFollow::get_cubic_interpolation() const {
-
- return cubic;
-}
-
-
-bool PathFollow::_set(const StringName& p_name, const Variant& p_value) {
-
- if (p_name==SceneStringNames::get_singleton()->offset) {
- set_offset(p_value);
- } else if (p_name==SceneStringNames::get_singleton()->unit_offset) {
- set_unit_offset(p_value);
- } else if (p_name==SceneStringNames::get_singleton()->rotation_mode) {
- set_rotation_mode(RotationMode(p_value.operator int()));
- } else if (p_name==SceneStringNames::get_singleton()->v_offset) {
- set_v_offset(p_value);
- } else if (p_name==SceneStringNames::get_singleton()->h_offset) {
- set_h_offset(p_value);
- } else if (String(p_name)=="cubic_interp") {
- set_cubic_interpolation(p_value);
- } else if (String(p_name)=="loop") {
- set_loop(p_value);
- } else if (String(p_name)=="lookahead") {
- set_lookahead(p_value);
- } else
- return false;
-
- return true;
-}
-
-bool PathFollow::_get(const StringName& p_name,Variant &r_ret) const{
-
- if (p_name==SceneStringNames::get_singleton()->offset) {
- r_ret=get_offset();
- } else if (p_name==SceneStringNames::get_singleton()->unit_offset) {
- r_ret=get_unit_offset();
- } else if (p_name==SceneStringNames::get_singleton()->rotation_mode) {
- r_ret=get_rotation_mode();
- } else if (p_name==SceneStringNames::get_singleton()->v_offset) {
- r_ret=get_v_offset();
- } else if (p_name==SceneStringNames::get_singleton()->h_offset) {
- r_ret=get_h_offset();
- } else if (String(p_name)=="cubic_interp") {
- r_ret=cubic;
- } else if (String(p_name)=="loop") {
- r_ret=loop;
- } else if (String(p_name)=="lookahead") {
- r_ret=lookahead;
- } else
- return false;
-
- return true;
-
-}
-void PathFollow::_get_property_list( List<PropertyInfo> *p_list) const{
-
- float max=10000;
- if (path && path->get_curve().is_valid())
- max=path->get_curve()->get_baked_length();
- p_list->push_back( PropertyInfo( Variant::REAL, "offset", PROPERTY_HINT_RANGE,"0,"+rtos(max)+",0.01"));
- p_list->push_back( PropertyInfo( Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE,"0,1,0.0001",PROPERTY_USAGE_EDITOR));
- p_list->push_back( PropertyInfo( Variant::REAL, "h_offset") );
- p_list->push_back( PropertyInfo( Variant::REAL, "v_offset") );
- p_list->push_back( PropertyInfo( Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM,"None,Y,XY,XYZ"));
- p_list->push_back( PropertyInfo( Variant::BOOL, "cubic_interp"));
- p_list->push_back( PropertyInfo( Variant::BOOL, "loop"));
- p_list->push_back( PropertyInfo( Variant::REAL, "lookahead",PROPERTY_HINT_RANGE,"0.001,1024.0,0.001"));
-}
-
-
-void PathFollow::_bind_methods() {
-
- ObjectTypeDB::bind_method(_MD("set_offset","offset"),&PathFollow::set_offset);
- ObjectTypeDB::bind_method(_MD("get_offset"),&PathFollow::get_offset);
-
- ObjectTypeDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow::set_h_offset);
- ObjectTypeDB::bind_method(_MD("get_h_offset"),&PathFollow::get_h_offset);
-
- ObjectTypeDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow::set_v_offset);
- ObjectTypeDB::bind_method(_MD("get_v_offset"),&PathFollow::get_v_offset);
-
- ObjectTypeDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset);
- ObjectTypeDB::bind_method(_MD("get_unit_offset"),&PathFollow::get_unit_offset);
-
- ObjectTypeDB::bind_method(_MD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode);
- ObjectTypeDB::bind_method(_MD("get_rotation_mode"),&PathFollow::get_rotation_mode);
-
- ObjectTypeDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation);
- ObjectTypeDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation);
-
- ObjectTypeDB::bind_method(_MD("set_loop","loop"),&PathFollow::set_loop);
- ObjectTypeDB::bind_method(_MD("has_loop"),&PathFollow::has_loop);
-
- BIND_CONSTANT( ROTATION_NONE );
- BIND_CONSTANT( ROTATION_Y );
- BIND_CONSTANT( ROTATION_XY );
- BIND_CONSTANT( ROTATION_XYZ );
-
-}
-
-void PathFollow::set_offset(float p_offset) {
-
- offset=p_offset;
- if (path)
- _update_transform();
- _change_notify("offset");
- _change_notify("unit_offset");
-
-}
-
-void PathFollow::set_h_offset(float p_h_offset) {
-
- h_offset=p_h_offset;
- if (path)
- _update_transform();
-
-}
-
-float PathFollow::get_h_offset() const {
-
- return h_offset;
-}
-
-void PathFollow::set_v_offset(float p_v_offset) {
-
- v_offset=p_v_offset;
- if (path)
- _update_transform();
-
-}
-
-float PathFollow::get_v_offset() const {
-
- return v_offset;
-}
-
-
-float PathFollow::get_offset() const{
-
- return offset;
-}
-
-void PathFollow::set_unit_offset(float p_unit_offset) {
-
- if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
- set_offset(p_unit_offset*path->get_curve()->get_baked_length());
-
-}
-
-float PathFollow::get_unit_offset() const{
-
- if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
- return get_offset()/path->get_curve()->get_baked_length();
- else
- return 0;
-}
-
-void PathFollow::set_lookahead(float p_lookahead) {
-
- lookahead=p_lookahead;
-
-}
-
-float PathFollow::get_lookahead() const{
-
- return lookahead;
-}
-
-void PathFollow::set_rotation_mode(RotationMode p_rotation_mode) {
-
- rotation_mode=p_rotation_mode;
- _update_transform();
-}
-
-PathFollow::RotationMode PathFollow::get_rotation_mode() const {
-
- return rotation_mode;
-}
-
-void PathFollow::set_loop(bool p_loop) {
-
- loop=p_loop;
-}
-
-bool PathFollow::has_loop() const{
-
- return loop;
-}
-
-
-PathFollow::PathFollow() {
-
- offset=0;
- h_offset=0;
- v_offset=0;
- path=NULL;
- rotation_mode=ROTATION_XYZ;
- cubic=true;
- loop=true;
- lookahead=0.1;
-}
+#include "path.h"
+#include "scene/scene_string_names.h"
+
+void Path::_notification(int p_what) {
+#if 0
+ if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_scene() && get_scene()->is_editor_hint()) {
+ //draw the curve!!
+
+ for(int i=0;i<curve->get_point_count();i++) {
+
+ Vector2 prev_p=curve->get_point_pos(i);
+
+ for(int j=1;j<=8;j++) {
+
+ real_t frac = j/8.0;
+ Vector2 p = curve->interpolate(i,frac);
+ draw_line(prev_p,p,Color(0.5,0.6,1.0,0.7),2);
+ prev_p=p;
+ }
+ }
+ }
+#endif
+}
+
+void Path::_curve_changed() {
+
+
+ if (is_inside_tree() && get_tree()->is_editor_hint())
+ update_gizmo();
+}
+
+
+void Path::set_curve(const Ref<Curve3D>& p_curve) {
+
+ if (curve.is_valid()) {
+ curve->disconnect("changed",this,"_curve_changed");
+ }
+
+ curve=p_curve;
+
+ if (curve.is_valid()) {
+ curve->connect("changed",this,"_curve_changed");
+ }
+ _curve_changed();
+
+}
+
+Ref<Curve3D> Path::get_curve() const{
+
+ return curve;
+}
+
+void Path::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("set_curve","curve:Curve3D"),&Path::set_curve);
+ ObjectTypeDB::bind_method(_MD("get_curve:Curve3D","curve"),&Path::get_curve);
+ ObjectTypeDB::bind_method(_MD("_curve_changed"),&Path::_curve_changed);
+
+ ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), _SCS("set_curve"),_SCS("get_curve"));
+}
+
+Path::Path() {
+
+ set_curve(Ref<Curve3D>( memnew( Curve3D ))); //create one by default
+}
+
+
+//////////////
+
+
+void PathFollow::_update_transform() {
+
+
+ if (!path)
+ return;
+
+ Ref<Curve3D> c =path->get_curve();
+ if (!c.is_valid())
+ return;
+
+
+ float o = offset;
+ if (loop)
+ o=Math::fposmod(o,c->get_baked_length());
+
+ Vector3 pos = c->interpolate_baked(o,cubic);
+ Transform t=get_transform();
+
+
+ if (rotation_mode!=ROTATION_NONE) {
+
+ Vector3 n = (c->interpolate_baked(o+lookahead,cubic)-pos).normalized();
+
+ if (rotation_mode==ROTATION_Y) {
+
+ n.y=0;
+ n.normalize();
+ }
+
+ if (n.length()<CMP_EPSILON) {//nothing, use previous
+ n=-t.get_basis().get_axis(2).normalized();
+ }
+
+
+ Vector3 up = Vector3(0,1,0);
+
+ if (rotation_mode==ROTATION_XYZ) {
+
+ float tilt = c->interpolate_baked_tilt(o);
+ if (tilt!=0) {
+
+ Matrix3 rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan.
+ up=rot.xform(up);
+ }
+ }
+
+ t.set_look_at(pos,pos+n,up);
+
+ } else {
+
+ t.origin=pos;
+ }
+
+ t.origin+=t.basis.get_axis(0)*h_offset + t.basis.get_axis(1)*v_offset;
+ set_transform(t);
+
+}
+
+void PathFollow::_notification(int p_what) {
+
+
+ switch(p_what) {
+
+ case NOTIFICATION_ENTER_TREE: {
+
+ Node *parent=get_parent();
+ if (parent) {
+
+ path=parent->cast_to<Path>();
+ if (path) {
+ _update_transform();
+ }
+ }
+
+ } break;
+ case NOTIFICATION_EXIT_TREE: {
+
+
+ path=NULL;
+ } break;
+ }
+
+}
+
+void PathFollow::set_cubic_interpolation(bool p_enable) {
+
+ cubic=p_enable;
+}
+
+bool PathFollow::get_cubic_interpolation() const {
+
+ return cubic;
+}
+
+
+bool PathFollow::_set(const StringName& p_name, const Variant& p_value) {
+
+ if (p_name==SceneStringNames::get_singleton()->offset) {
+ set_offset(p_value);
+ } else if (p_name==SceneStringNames::get_singleton()->unit_offset) {
+ set_unit_offset(p_value);
+ } else if (p_name==SceneStringNames::get_singleton()->rotation_mode) {
+ set_rotation_mode(RotationMode(p_value.operator int()));
+ } else if (p_name==SceneStringNames::get_singleton()->v_offset) {
+ set_v_offset(p_value);
+ } else if (p_name==SceneStringNames::get_singleton()->h_offset) {
+ set_h_offset(p_value);
+ } else if (String(p_name)=="cubic_interp") {
+ set_cubic_interpolation(p_value);
+ } else if (String(p_name)=="loop") {
+ set_loop(p_value);
+ } else if (String(p_name)=="lookahead") {
+ set_lookahead(p_value);
+ } else
+ return false;
+
+ return true;
+}
+
+bool PathFollow::_get(const StringName& p_name,Variant &r_ret) const{
+
+ if (p_name==SceneStringNames::get_singleton()->offset) {
+ r_ret=get_offset();
+ } else if (p_name==SceneStringNames::get_singleton()->unit_offset) {
+ r_ret=get_unit_offset();
+ } else if (p_name==SceneStringNames::get_singleton()->rotation_mode) {
+ r_ret=get_rotation_mode();
+ } else if (p_name==SceneStringNames::get_singleton()->v_offset) {
+ r_ret=get_v_offset();
+ } else if (p_name==SceneStringNames::get_singleton()->h_offset) {
+ r_ret=get_h_offset();
+ } else if (String(p_name)=="cubic_interp") {
+ r_ret=cubic;
+ } else if (String(p_name)=="loop") {
+ r_ret=loop;
+ } else if (String(p_name)=="lookahead") {
+ r_ret=lookahead;
+ } else
+ return false;
+
+ return true;
+
+}
+void PathFollow::_get_property_list( List<PropertyInfo> *p_list) const{
+
+ float max=10000;
+ if (path && path->get_curve().is_valid())
+ max=path->get_curve()->get_baked_length();
+ p_list->push_back( PropertyInfo( Variant::REAL, "offset", PROPERTY_HINT_RANGE,"0,"+rtos(max)+",0.01"));
+ p_list->push_back( PropertyInfo( Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE,"0,1,0.0001",PROPERTY_USAGE_EDITOR));
+ p_list->push_back( PropertyInfo( Variant::REAL, "h_offset") );
+ p_list->push_back( PropertyInfo( Variant::REAL, "v_offset") );
+ p_list->push_back( PropertyInfo( Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM,"None,Y,XY,XYZ"));
+ p_list->push_back( PropertyInfo( Variant::BOOL, "cubic_interp"));
+ p_list->push_back( PropertyInfo( Variant::BOOL, "loop"));
+ p_list->push_back( PropertyInfo( Variant::REAL, "lookahead",PROPERTY_HINT_RANGE,"0.001,1024.0,0.001"));
+}
+
+
+void PathFollow::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("set_offset","offset"),&PathFollow::set_offset);
+ ObjectTypeDB::bind_method(_MD("get_offset"),&PathFollow::get_offset);
+
+ ObjectTypeDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow::set_h_offset);
+ ObjectTypeDB::bind_method(_MD("get_h_offset"),&PathFollow::get_h_offset);
+
+ ObjectTypeDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow::set_v_offset);
+ ObjectTypeDB::bind_method(_MD("get_v_offset"),&PathFollow::get_v_offset);
+
+ ObjectTypeDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset);
+ ObjectTypeDB::bind_method(_MD("get_unit_offset"),&PathFollow::get_unit_offset);
+
+ ObjectTypeDB::bind_method(_MD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode);
+ ObjectTypeDB::bind_method(_MD("get_rotation_mode"),&PathFollow::get_rotation_mode);
+
+ ObjectTypeDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation);
+ ObjectTypeDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation);
+
+ ObjectTypeDB::bind_method(_MD("set_loop","loop"),&PathFollow::set_loop);
+ ObjectTypeDB::bind_method(_MD("has_loop"),&PathFollow::has_loop);
+
+ BIND_CONSTANT( ROTATION_NONE );
+ BIND_CONSTANT( ROTATION_Y );
+ BIND_CONSTANT( ROTATION_XY );
+ BIND_CONSTANT( ROTATION_XYZ );
+
+}
+
+void PathFollow::set_offset(float p_offset) {
+
+ offset=p_offset;
+ if (path)
+ _update_transform();
+ _change_notify("offset");
+ _change_notify("unit_offset");
+
+}
+
+void PathFollow::set_h_offset(float p_h_offset) {
+
+ h_offset=p_h_offset;
+ if (path)
+ _update_transform();
+
+}
+
+float PathFollow::get_h_offset() const {
+
+ return h_offset;
+}
+
+void PathFollow::set_v_offset(float p_v_offset) {
+
+ v_offset=p_v_offset;
+ if (path)
+ _update_transform();
+
+}
+
+float PathFollow::get_v_offset() const {
+
+ return v_offset;
+}
+
+
+float PathFollow::get_offset() const{
+
+ return offset;
+}
+
+void PathFollow::set_unit_offset(float p_unit_offset) {
+
+ if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
+ set_offset(p_unit_offset*path->get_curve()->get_baked_length());
+
+}
+
+float PathFollow::get_unit_offset() const{
+
+ if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
+ return get_offset()/path->get_curve()->get_baked_length();
+ else
+ return 0;
+}
+
+void PathFollow::set_lookahead(float p_lookahead) {
+
+ lookahead=p_lookahead;
+
+}
+
+float PathFollow::get_lookahead() const{
+
+ return lookahead;
+}
+
+void PathFollow::set_rotation_mode(RotationMode p_rotation_mode) {
+
+ rotation_mode=p_rotation_mode;
+ _update_transform();
+}
+
+PathFollow::RotationMode PathFollow::get_rotation_mode() const {
+
+ return rotation_mode;
+}
+
+void PathFollow::set_loop(bool p_loop) {
+
+ loop=p_loop;
+}
+
+bool PathFollow::has_loop() const{
+
+ return loop;
+}
+
+
+PathFollow::PathFollow() {
+
+ offset=0;
+ h_offset=0;
+ v_offset=0;
+ path=NULL;
+ rotation_mode=ROTATION_XYZ;
+ cubic=true;
+ loop=true;
+ lookahead=0.1;
+}
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 15ec60514a..a80fdce64c 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -193,7 +193,7 @@ StaticBody::~StaticBody() {
-void RigidBody::_body_enter_scene(ObjectID p_id) {
+void RigidBody::_body_enter_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
@@ -201,9 +201,9 @@ void RigidBody::_body_enter_scene(ObjectID p_id) {
Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(E->get().in_scene);
+ ERR_FAIL_COND(E->get().in_tree);
- E->get().in_scene=true;
+ E->get().in_tree=true;
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -213,15 +213,15 @@ void RigidBody::_body_enter_scene(ObjectID p_id) {
}
-void RigidBody::_body_exit_scene(ObjectID p_id) {
+void RigidBody::_body_exit_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_FAIL_COND(!node);
Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.find(p_id);
ERR_FAIL_COND(!E);
- ERR_FAIL_COND(!E->get().in_scene);
- E->get().in_scene=false;
+ ERR_FAIL_COND(!E->get().in_tree);
+ E->get().in_tree=false;
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -246,11 +246,11 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
E = contact_monitor->body_map.insert(objid,BodyState());
//E->get().rc=0;
- E->get().in_scene=node && node->is_inside_scene();
+ E->get().in_tree=node && node->is_inside_tree();
if (node) {
- node->connect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene,make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene,make_binds(objid));
- if (E->get().in_scene) {
+ node->connect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree,make_binds(objid));
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
}
}
@@ -261,7 +261,7 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
E->get().shapes.insert(ShapePair(p_body_shape,p_local_shape));
- if (E->get().in_scene) {
+ if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,objid,node,p_body_shape,p_local_shape);
}
@@ -272,21 +272,21 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
if (node)
E->get().shapes.erase(ShapePair(p_body_shape,p_local_shape));
- bool in_scene = E->get().in_scene;
+ bool in_tree = E->get().in_tree;
if (E->get().shapes.empty()) {
if (node) {
- node->disconnect(SceneStringNames::get_singleton()->enter_scene,this,SceneStringNames::get_singleton()->_body_enter_scene);
- node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,SceneStringNames::get_singleton()->_body_exit_scene);
- if (in_scene)
+ node->disconnect(SceneStringNames::get_singleton()->enter_tree,this,SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,SceneStringNames::get_singleton()->_body_exit_tree);
+ if (in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exit,obj);
}
contact_monitor->body_map.erase(E);
}
- if (node && in_scene) {
+ if (node && in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,objid,obj,p_body_shape,p_local_shape);
}
@@ -682,8 +682,8 @@ void RigidBody::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_able_to_sleep"),&RigidBody::is_able_to_sleep);
ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&RigidBody::_direct_state_changed);
- ObjectTypeDB::bind_method(_MD("_body_enter_scene"),&RigidBody::_body_enter_scene);
- ObjectTypeDB::bind_method(_MD("_body_exit_scene"),&RigidBody::_body_exit_scene);
+ ObjectTypeDB::bind_method(_MD("_body_enter_tree"),&RigidBody::_body_enter_tree);
+ ObjectTypeDB::bind_method(_MD("_body_exit_tree"),&RigidBody::_body_exit_tree);
ObjectTypeDB::bind_method(_MD("set_axis_lock","axis_lock"),&RigidBody::set_axis_lock);
ObjectTypeDB::bind_method(_MD("get_axis_lock"),&RigidBody::get_axis_lock);
@@ -792,7 +792,7 @@ Vector3 KinematicBody::move(const Vector3& p_motion) {
colliding=false;
- ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
+ ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space());
ERR_FAIL_COND_V(!dss,Vector3());
const int max_shapes=32;
@@ -989,7 +989,7 @@ Vector3 KinematicBody::move_to(const Vector3& p_position) {
bool KinematicBody::can_move_to(const Vector3& p_position, bool p_discrete) {
- ERR_FAIL_COND_V(!is_inside_scene(),false);
+ ERR_FAIL_COND_V(!is_inside_tree(),false);
PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space());
ERR_FAIL_COND_V(!dss,false);
@@ -1029,7 +1029,7 @@ bool KinematicBody::can_move_to(const Vector3& p_position, bool p_discrete) {
bool KinematicBody::is_colliding() const {
- ERR_FAIL_COND_V(!is_inside_scene(),false);
+ ERR_FAIL_COND_V(!is_inside_tree(),false);
return colliding;
}
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index a19ad48c87..f9f028e20d 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -163,7 +163,7 @@ private:
struct BodyState {
//int rc;
- bool in_scene;
+ bool in_tree;
VSet<ShapePair> shapes;
};
@@ -176,8 +176,8 @@ private:
ContactMonitor *contact_monitor;
- void _body_enter_scene(ObjectID p_id);
- void _body_exit_scene(ObjectID p_id);
+ void _body_enter_tree(ObjectID p_id);
+ void _body_exit_tree(ObjectID p_id);
void _body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape);
diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp
index 8a79e17d87..8d9257a273 100644
--- a/scene/3d/physics_joint.cpp
+++ b/scene/3d/physics_joint.cpp
@@ -42,7 +42,7 @@ void Joint::_update_joint(bool p_only_free) {
bb=RID();
}
- if (p_only_free || !is_inside_scene())
+ if (p_only_free || !is_inside_tree())
return;
Node *node_a = has_node( get_node_a() ) ? get_node( get_node_a() ) : (Node*)NULL;
@@ -131,7 +131,7 @@ void Joint::_notification(int p_what) {
case NOTIFICATION_READY: {
_update_joint();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (joint.is_valid()) {
_update_joint(true);
PhysicsServer::get_singleton()->free(joint);
diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp
index b3378c7698..a30a23aa53 100644
--- a/scene/3d/proximity_group.cpp
+++ b/scene/3d/proximity_group.cpp
@@ -119,7 +119,7 @@ void ProximityGroup::_notification(int what) {
switch (what) {
- case NOTIFICATION_EXIT_SCENE:
+ case NOTIFICATION_EXIT_TREE:
++group_version;
clear_groups();
break;
@@ -135,7 +135,7 @@ void ProximityGroup::broadcast(String p_name, Variant p_params) {
E = groups.front();
while (E) {
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_DEFAULT, E->key(), "_proximity_group_broadcast", p_name, p_params);
+ get_tree()->call_group(SceneTree::GROUP_CALL_DEFAULT, E->key(), "_proximity_group_broadcast", p_name, p_params);
E = E->next();
};
diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp
index 78dd56141c..8ee232fef4 100644
--- a/scene/3d/quad.cpp
+++ b/scene/3d/quad.cpp
@@ -31,7 +31,7 @@
void Quad::_update() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Vector3 normal;
@@ -171,14 +171,14 @@ void Quad::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (pending_update)
_update();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
pending_update=true;
diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp
index e36e2da14f..6bc0c677c0 100644
--- a/scene/3d/ray_cast.cpp
+++ b/scene/3d/ray_cast.cpp
@@ -33,7 +33,7 @@
void RayCast::set_cast_to(const Vector3& p_point) {
cast_to=p_point;
- if (is_inside_scene() && get_scene()->is_editor_hint())
+ if (is_inside_tree() && get_tree()->is_editor_hint())
update_gizmo();
}
@@ -72,7 +72,7 @@ Vector3 RayCast::get_collision_normal() const{
void RayCast::set_enabled(bool p_enabled) {
enabled=p_enabled;
- if (is_inside_scene() && !get_scene()->is_editor_hint())
+ if (is_inside_tree() && !get_tree()->is_editor_hint())
set_fixed_process(p_enabled);
if (!p_enabled)
collided=false;
@@ -91,9 +91,9 @@ void RayCast::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
- if (enabled && !get_scene()->is_editor_hint()) {
+ if (enabled && !get_tree()->is_editor_hint()) {
set_fixed_process(true);
Node *p = get_parent();
while( p && p->cast_to<Spatial>() ) {
@@ -113,7 +113,7 @@ void RayCast::_notification(int p_what) {
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (enabled) {
set_fixed_process(false);
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
index fa1d3ecf6b..3f9e6c7f13 100644
--- a/scene/3d/room_instance.cpp
+++ b/scene/3d/room_instance.cpp
@@ -147,7 +147,7 @@ void Room::set_room( const Ref<RoomBounds>& p_room ) {
set_base(RID());
}
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 737f7d2dce..f53ee7d6bf 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -243,10 +243,10 @@ void Skeleton::set_bone_global_pose(int p_bone,const Transform& p_pose) {
ERR_FAIL_INDEX(p_bone,bones.size());
if (bones[p_bone].parent==-1) {
- set_bone_pose(p_bone,bones[p_bone].rest.inverse() * p_pose);
+ set_bone_pose(p_bone,bones[p_bone].rest_global_inverse * p_pose); //fast
} else {
- set_bone_pose(p_bone, bones[p_bone].rest.inverse() * (get_bone_global_pose(bones[p_bone].parent).affine_inverse() * p_pose));
+ set_bone_pose(p_bone, bones[p_bone].rest.affine_inverse() * (get_bone_global_pose(bones[p_bone].parent).affine_inverse() * p_pose)); //slow
}
@@ -404,7 +404,7 @@ void Skeleton::clear_bones() {
void Skeleton::set_bone_pose(int p_bone, const Transform& p_pose) {
ERR_FAIL_INDEX( p_bone, bones.size() );
- ERR_FAIL_COND( !is_inside_scene() );
+ ERR_FAIL_COND( !is_inside_tree() );
bones[p_bone].pose=p_pose;
@@ -442,7 +442,7 @@ void Skeleton::_make_dirty() {
if (dirty)
return;
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
dirty=true;
return;
}
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index d304095d33..a5b009823c 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -76,7 +76,7 @@ void Spatial::_notify_dirty() {
if (!data.ignore_notification && !xform_change.in_list()) {
- get_scene()->xform_change_list.add(&xform_change);
+ get_tree()->xform_change_list.add(&xform_change);
}
}
@@ -91,7 +91,7 @@ void Spatial::_update_local_transform() const {
}
void Spatial::_propagate_transform_changed(Spatial *p_origin) {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
return;
}
@@ -110,7 +110,7 @@ void Spatial::_propagate_transform_changed(Spatial *p_origin) {
if (!data.ignore_notification && !xform_change.in_list()) {
- get_scene()->xform_change_list.add(&xform_change);
+ get_tree()->xform_change_list.add(&xform_change);
}
data.dirty|=DIRTY_GLOBAL;
@@ -121,7 +121,7 @@ void Spatial::_propagate_transform_changed(Spatial *p_origin) {
void Spatial::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
Node *p = get_parent();
if (p)
@@ -132,7 +132,7 @@ void Spatial::_notification(int p_what) {
else
data.C=NULL;
- if (data.toplevel && !get_scene()->is_editor_hint()) {
+ if (data.toplevel && !get_tree()->is_editor_hint()) {
if (data.parent) {
data.local_transform = data.parent->get_global_transform() * get_transform();
@@ -147,11 +147,11 @@ void Spatial::_notification(int p_what) {
notification(NOTIFICATION_ENTER_WORLD);
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
notification(NOTIFICATION_EXIT_WORLD,true);
if (xform_change.in_list())
- get_scene()->xform_change_list.remove(&xform_change);
+ get_tree()->xform_change_list.remove(&xform_change);
if (data.C)
data.parent->data.children.erase(data.C);
data.parent=NULL;
@@ -177,10 +177,10 @@ void Spatial::_notification(int p_what) {
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world,NULL,0);
}
#ifdef TOOLS_ENABLED
- if (get_scene()->is_editor_hint()) {
+ if (get_tree()->is_editor_hint()) {
// get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this);
- get_scene()->call_group(0,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this);
+ get_tree()->call_group(0,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this);
if (!data.gizmo_disabled) {
if (data.gizmo.is_valid())
@@ -257,7 +257,7 @@ Transform Spatial::get_transform() const {
}
Transform Spatial::get_global_transform() const {
- ERR_FAIL_COND_V(!is_inside_scene(), Transform());
+ ERR_FAIL_COND_V(!is_inside_tree(), Transform());
if (data.dirty & DIRTY_GLOBAL) {
@@ -460,7 +460,7 @@ void Spatial::set_as_toplevel(bool p_enabled) {
if (data.toplevel==p_enabled)
return;
- if (is_inside_scene() && !get_scene()->is_editor_hint()) {
+ if (is_inside_tree() && !get_tree()->is_editor_hint()) {
if (p_enabled)
set_transform(get_global_transform());
@@ -537,7 +537,7 @@ void Spatial::show() {
data.visible=true;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (!data.parent || is_visible()) {
diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h
index 7036ef63ca..49ecf5779b 100644
--- a/scene/3d/spatial.h
+++ b/scene/3d/spatial.h
@@ -130,7 +130,7 @@ public:
enum {
- NOTIFICATION_TRANSFORM_CHANGED=SceneMainLoop::NOTIFICATION_TRANSFORM_CHANGED,
+ NOTIFICATION_TRANSFORM_CHANGED=SceneTree::NOTIFICATION_TRANSFORM_CHANGED,
NOTIFICATION_ENTER_WORLD=41,
NOTIFICATION_EXIT_WORLD=42,
NOTIFICATION_VISIBILITY_CHANGED=43,
diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp
index 25448498cb..51009662d6 100644
--- a/scene/3d/spatial_stream_player.cpp
+++ b/scene/3d/spatial_stream_player.cpp
@@ -74,7 +74,7 @@ Ref<AudioStream> SpatialStreamPlayer::get_stream() const {
void SpatialStreamPlayer::play() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (stream.is_null())
return;
@@ -89,7 +89,7 @@ void SpatialStreamPlayer::play() {
void SpatialStreamPlayer::stop() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (stream.is_null())
return;
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 334a15e724..a6a8919d13 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -37,7 +37,7 @@ void SpriteBase3D::_propagate_color_changed() {
void SpriteBase3D::_notification(int p_what) {
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
if (!pending_update)
_im_update();
@@ -52,7 +52,7 @@ void SpriteBase3D::_notification(int p_what) {
}
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
if (parent_sprite) {
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 4cf905e4ee..ba30c118f0 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -57,7 +57,7 @@ public:
void VehicleWheel::_notification(int p_what) {
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
if (!get_parent())
return;
@@ -73,7 +73,7 @@ void VehicleWheel::_notification(int p_what) {
m_wheelAxleCS = get_transform().basis.get_axis(Vector3::AXIS_X).normalized();
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
if (!get_parent())
return;
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index 60e311cefe..d4ef2931e9 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -183,7 +183,7 @@ void VisibilityEnabler::_find_nodes(Node* p_node) {
if (add) {
- p_node->connect(SceneStringNames::get_singleton()->exit_scene,this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
+ p_node->connect(SceneStringNames::get_singleton()->exit_tree,this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
nodes[p_node]=meta;
_change_node_state(p_node,false);
}
@@ -200,9 +200,9 @@ void VisibilityEnabler::_find_nodes(Node* p_node) {
void VisibilityEnabler::_notification(int p_what){
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
return;
@@ -215,9 +215,9 @@ void VisibilityEnabler::_notification(int p_what){
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
return;
@@ -228,7 +228,7 @@ void VisibilityEnabler::_notification(int p_what){
if (!visible)
_change_node_state(E->key(),true);
- E->key()->disconnect(SceneStringNames::get_singleton()->exit_scene,this,"_node_removed");
+ E->key()->disconnect(SceneStringNames::get_singleton()->exit_tree,this,"_node_removed");
}
nodes.clear();
@@ -271,7 +271,7 @@ void VisibilityEnabler::_node_removed(Node* p_node) {
if (!visible)
_change_node_state(p_node,true);
- p_node->disconnect(SceneStringNames::get_singleton()->exit_scene,this,"_node_removed");
+ p_node->disconnect(SceneStringNames::get_singleton()->exit_tree,this,"_node_removed");
nodes.erase(p_node);
}
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 398fbdea82..5b40a4d7e5 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -257,7 +257,7 @@ void GeometryInstance::_find_baked_light() {
void GeometryInstance::_update_visibility() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
_change_notify("geometry/visible");
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp
index 38cfe0d8a9..46eb8d7e88 100644
--- a/scene/animation/animation_cache.cpp
+++ b/scene/animation/animation_cache.cpp
@@ -30,7 +30,7 @@
-void AnimationCache::_node_exit_scene(Node *p_node) {
+void AnimationCache::_node_exit_tree(Node *p_node) {
//it is one shot, so it disconnects upon arrival
@@ -59,7 +59,7 @@ void AnimationCache::_clear_cache() {
while(connected_nodes.size()) {
- connected_nodes.front()->get()->disconnect("exit_scene",this,"_node_exit_scene");
+ connected_nodes.front()->get()->disconnect("exit_tree",this,"_node_exit_tree");
connected_nodes.erase(connected_nodes.front());
}
path_cache.clear();;
@@ -73,7 +73,7 @@ void AnimationCache::_update_cache() {
cache_valid=false;
ERR_FAIL_COND(!root);
- ERR_FAIL_COND(!root->is_inside_scene());
+ ERR_FAIL_COND(!root->is_inside_tree());
ERR_FAIL_COND(animation.is_null());
for(int i=0;i<animation->get_track_count();i++) {
@@ -206,7 +206,7 @@ void AnimationCache::_update_cache() {
if (!connected_nodes.has(path.node)) {
connected_nodes.insert(path.node);
- path.node->connect("exit_scene",this,"_node_exit_scene",Node::make_binds(path.node),CONNECT_ONESHOT);
+ path.node->connect("exit_tree",this,"_node_exit_tree",Node::make_binds(path.node),CONNECT_ONESHOT);
}
@@ -368,7 +368,7 @@ void AnimationCache::set_animation(const Ref<Animation>& p_animation) {
void AnimationCache::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_node_exit_scene"),&AnimationCache::_node_exit_scene);
+ ObjectTypeDB::bind_method(_MD("_node_exit_tree"),&AnimationCache::_node_exit_tree);
ObjectTypeDB::bind_method(_MD("_animation_changed"),&AnimationCache::_animation_changed);
}
diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h
index 72ee8f1860..d00b122faa 100644
--- a/scene/animation/animation_cache.h
+++ b/scene/animation/animation_cache.h
@@ -58,7 +58,7 @@ class AnimationCache : public Object {
bool cache_dirty;
bool cache_valid;
- void _node_exit_scene(Node *p_node);
+ void _node_exit_tree(Node *p_node);
void _clear_cache();
void _update_cache();
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 9a3c7e71ec..2fbbd54d9f 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -189,7 +189,7 @@ void AnimationPlayer::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (!processing) {
//make sure that a previous process state was not saved
@@ -202,7 +202,7 @@ void AnimationPlayer::_notification(int p_what) {
} break;
case NOTIFICATION_READY: {
- if (!get_scene()->is_editor_hint() && animation_set.has(autoplay)) {
+ if (!get_tree()->is_editor_hint() && animation_set.has(autoplay)) {
play(autoplay);
}
} break;
@@ -221,7 +221,7 @@ void AnimationPlayer::_notification(int p_what) {
if (processing)
_animation_process( get_fixed_process_delta_time() );
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
stop_all();
clear_caches();
@@ -261,8 +261,8 @@ void AnimationPlayer::_generate_node_caches(AnimationData* p_anim) {
}
{
- if (!child->is_connected("exit_scene",this,"_node_removed"))
- child->connect("exit_scene",this,"_node_removed",make_binds(child),CONNECT_ONESHOT);
+ if (!child->is_connected("exit_tree",this,"_node_removed"))
+ child->connect("exit_tree",this,"_node_removed",make_binds(child),CONNECT_ONESHOT);
}
TrackNodeCacheKey key;
@@ -348,7 +348,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p
Animation *a=p_anim->animation.operator->();
- bool can_call = is_inside_scene() && !get_scene()->is_editor_hint();
+ bool can_call = is_inside_tree() && !get_tree()->is_editor_hint();
for (int i=0;i<a->get_track_count();i++) {
@@ -922,7 +922,7 @@ void AnimationPlayer::play(const StringName& p_name, float p_custom_blend, float
_set_process(true); // always process when starting an animation
playing = true;
- if (is_inside_scene() && get_scene()->is_editor_hint())
+ if (is_inside_tree() && get_tree()->is_editor_hint())
return; // no next in this case
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index 2d1821bc5c..b55cc0d1a3 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -1586,7 +1586,7 @@ void AnimationTreePlayer::_update_sources() {
if (master==NodePath())
return;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Node *m = get_node(master);
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index 7e7d57c3c2..59793815f5 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -75,7 +75,7 @@ void Tween::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (!processing) {
//make sure that a previous process state was not saved
@@ -102,7 +102,7 @@ void Tween::_notification(int p_what) {
if (processing)
_tween_process( get_fixed_process_delta_time() );
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
stop_all();
} break;
diff --git a/scene/audio/event_player.cpp b/scene/audio/event_player.cpp
index e5b2be53ca..dc46f4711c 100644
--- a/scene/audio/event_player.cpp
+++ b/scene/audio/event_player.cpp
@@ -33,13 +33,13 @@ void EventPlayer::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
//set_idle_process(false); //don't annoy
- if (playback.is_valid() && autoplay && !get_scene()->is_editor_hint())
+ if (playback.is_valid() && autoplay && !get_tree()->is_editor_hint())
play();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
stop(); //wathever it may be doing, stop
} break;
@@ -75,7 +75,7 @@ Ref<EventStream> EventPlayer::get_stream() const {
void EventPlayer::play() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
if (playback.is_null()) {
return;
}
@@ -93,7 +93,7 @@ void EventPlayer::play() {
void EventPlayer::stop() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (playback.is_null())
return;
@@ -241,7 +241,7 @@ bool EventPlayer::is_paused() const {
void EventPlayer::_set_play(bool p_play) {
_play=p_play;
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if(_play)
play();
else
diff --git a/scene/audio/sound_room_params.cpp b/scene/audio/sound_room_params.cpp
index 3e0a64b3f1..01d373ebff 100644
--- a/scene/audio/sound_room_params.cpp
+++ b/scene/audio/sound_room_params.cpp
@@ -53,7 +53,7 @@ void SoundRoomParams::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
#if 0
Node *n=this;
Room *room_instance=NULL;
@@ -81,7 +81,7 @@ void SoundRoomParams::_notification(int p_what) {
#endif
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
room=RID();
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 5084c1295b..73025fb52c 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -33,13 +33,13 @@ void StreamPlayer::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
//set_idle_process(false); //don't annoy
- if (stream.is_valid() && autoplay && !get_scene()->is_editor_hint())
+ if (stream.is_valid() && autoplay && !get_tree()->is_editor_hint())
play();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
stop(); //wathever it may be doing, stop
} break;
@@ -75,7 +75,7 @@ Ref<AudioStream> StreamPlayer::get_stream() const {
void StreamPlayer::play() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
if (stream.is_null())
return;
if (stream->is_playing())
@@ -91,7 +91,7 @@ void StreamPlayer::play() {
void StreamPlayer::stop() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (stream.is_null())
return;
@@ -214,7 +214,7 @@ bool StreamPlayer::is_paused() const {
void StreamPlayer::_set_play(bool p_play) {
_play=p_play;
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if(_play)
play();
else
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index cf9fcfa72a..442fd286dd 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -211,7 +211,7 @@ void BaseButton::_notification(int p_what) {
}
}
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
CanvasItem *ci=this;
while(ci) {
@@ -227,7 +227,7 @@ void BaseButton::_notification(int p_what) {
}
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
if (group)
group->_remove_button(this);
diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp
index 58b323c24d..94cc0a8d51 100644
--- a/scene/gui/button_group.cpp
+++ b/scene/gui/button_group.cpp
@@ -117,7 +117,7 @@ BaseButton *ButtonGroup::get_focused_button() const{
int ButtonGroup::get_pressed_button_index() const {
//in tree order, this is bizarre
- ERR_FAIL_COND_V(!is_inside_scene(),0);
+ ERR_FAIL_COND_V(!is_inside_tree(),0);
BaseButton *pressed = get_pressed_button();
if (!pressed)
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index 6543a0388d..bb61723acf 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -67,7 +67,7 @@ void Container::remove_child_notify(Node *p_child) {
void Container::_sort_children() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
notification(NOTIFICATION_SORT_CHILDREN);
@@ -101,7 +101,7 @@ void Container::fit_child_in_rect(Control *p_child,const Rect2& p_rect) {
void Container::queue_sort() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (pending_sort)
@@ -115,7 +115,7 @@ void Container::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
pending_sort=false;
queue_sort();
} break;
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index fc24294a70..aea0aacf42 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -183,7 +183,7 @@ bool Control::_set(const StringName& p_name, const Variant& p_value) {
void Control::_update_minimum_size() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
data.pending_min_size_update=false;
@@ -341,7 +341,7 @@ void Control::_notification(int p_notification) {
switch(p_notification) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (data.window==this) {
@@ -365,7 +365,7 @@ void Control::_notification(int p_notification) {
window->drag_attempted=false;
window->drag_preview=NULL;
- if (get_scene()->is_editor_hint()) {
+ if (get_tree()->is_editor_hint()) {
Node *n = this;
while(n) {
@@ -385,7 +385,7 @@ void Control::_notification(int p_notification) {
_size_changed();
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
if (data.window) {
@@ -630,7 +630,7 @@ void Control::_notification(int p_notification) {
}
} break;
- case SceneMainLoop::NOTIFICATION_WM_UNFOCUS_REQUEST: {
+ case SceneTree::NOTIFICATION_WM_UNFOCUS_REQUEST: {
if (!window)
return;
@@ -710,7 +710,7 @@ void Control::drop_data(const Point2& p_point,const Variant& p_data){
void Control::force_drag(const Variant& p_data,Control *p_control) {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND(!data.window);
ERR_FAIL_COND(p_data.get_type()==Variant::NIL);
@@ -728,8 +728,8 @@ void Control::set_drag_preview(Control *p_control) {
ERR_FAIL_NULL(p_control);
ERR_FAIL_COND( !((Object*)p_control)->cast_to<Control>());
- ERR_FAIL_COND(!is_inside_scene() || !data.window);
- ERR_FAIL_COND(p_control->is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree() || !data.window);
+ ERR_FAIL_COND(p_control->is_inside_tree());
ERR_FAIL_COND(p_control->get_parent()!=NULL);
if (data.window->window->drag_preview) {
@@ -963,8 +963,8 @@ void Control::_window_input_event(InputEvent p_event) {
if (top->data.modal_exclusive) {
//cancel event, sorry, modal exclusive EATS UP ALL
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
- get_scene()->set_input_as_handled();
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->set_input_as_handled();
return; // no one gets the event if exclusive NO ONE
}
@@ -1034,8 +1034,8 @@ void Control::_window_input_event(InputEvent p_event) {
_window_call_input(window->mouse_focus,p_event);
}
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
- get_scene()->set_input_as_handled();
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->set_input_as_handled();
} else {
@@ -1079,8 +1079,8 @@ void Control::_window_input_event(InputEvent p_event) {
}
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
- get_scene()->set_input_as_handled();
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->set_input_as_handled();
}
} break;
@@ -1147,7 +1147,7 @@ void Control::_window_input_event(InputEvent p_event) {
window->mouse_over=over;
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_tooltip");
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_tooltip");
if (window->drag_preview) {
window->drag_preview->set_pos(pos);
@@ -1203,8 +1203,8 @@ void Control::_window_input_event(InputEvent p_event) {
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
- get_scene()->set_input_as_handled();
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->set_input_as_handled();
if (window->drag_data.get_type()!=Variant::NIL && p_event.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
@@ -1230,7 +1230,7 @@ void Control::_window_input_event(InputEvent p_event) {
if (window->key_event_accepted) {
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
break;
}
}
@@ -1290,7 +1290,7 @@ void Control::_window_input_event(InputEvent p_event) {
if (next) {
next->grab_focus();
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
}
}
@@ -1305,7 +1305,7 @@ Control *Control::get_window() const {
bool Control::is_window() const {
- return (is_inside_scene() && window);
+ return (is_inside_tree() && window);
}
@@ -1607,7 +1607,7 @@ bool Control::has_constant(const StringName& p_name,const StringName& p_type) co
Size2 Control::get_parent_area_size() const {
- ERR_FAIL_COND_V(!is_inside_scene(),Size2());
+ ERR_FAIL_COND_V(!is_inside_tree(),Size2());
Size2 parent_size;
@@ -1624,7 +1624,7 @@ Size2 Control::get_parent_area_size() const {
void Control::_size_changed() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Size2 parent_size = get_parent_area_size();
@@ -1677,7 +1677,7 @@ void Control::_size_changed() {
float Control::_get_parent_range(int p_idx) const {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
return 1.0;
@@ -1748,7 +1748,7 @@ float Control::_a2s(float p_val, AnchorType p_anchor,float p_range) const {
void Control::set_anchor(Margin p_margin,AnchorType p_anchor) {
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
data.anchor[p_margin]=p_anchor;
} else {
@@ -1980,7 +1980,7 @@ void Control::add_constant_override(const StringName& p_name, int p_constant) {
void Control::set_focus_mode(FocusMode p_focus_mode) {
- if (is_inside_scene() && p_focus_mode == FOCUS_NONE && data.focus_mode!=FOCUS_NONE && has_focus())
+ if (is_inside_tree() && p_focus_mode == FOCUS_NONE && data.focus_mode!=FOCUS_NONE && has_focus())
release_focus();
data.focus_mode=p_focus_mode;
@@ -2178,7 +2178,7 @@ bool Control::has_focus() const {
void Control::grab_focus() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND(!data.window);
if (data.focus_mode==FOCUS_NONE)
@@ -2188,7 +2188,7 @@ void Control::grab_focus() {
if (data.window->window->key_focus && data.window->window->key_focus==this)
return;
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_window_remove_focus");
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_window_remove_focus");
data.window->window->key_focus=this;
notification(NOTIFICATION_FOCUS_ENTER);
#ifdef DEBUG_ENABLED
@@ -2202,13 +2202,13 @@ void Control::grab_focus() {
void Control::release_focus() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND(!data.window);
if (!has_focus())
return;
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,"windows","_window_remove_focus");
+ get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_window_remove_focus");
//data.window->window->key_focus=this;
//notification(NOTIFICATION_FOCUS_ENTER);
update();
@@ -2217,12 +2217,12 @@ void Control::release_focus() {
bool Control::is_toplevel_control() const {
- return is_inside_scene() && (!data.parent_canvas_item && !window && is_set_as_toplevel());
+ return is_inside_tree() && (!data.parent_canvas_item && !window && is_set_as_toplevel());
}
void Control::show_modal(bool p_exclusive) {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND(!data.SI && data.window!=this);
ERR_FAIL_COND(!data.window);
@@ -2282,7 +2282,7 @@ void Control::_modal_stack_remove() {
if (!pfoc)
return;
- if (!pfoc->is_inside_scene() || !pfoc->is_visible())
+ if (!pfoc->is_inside_tree() || !pfoc->is_visible())
return;
pfoc->grab_focus();
} else {
@@ -2332,13 +2332,13 @@ void Control::set_theme(const Ref<Theme>& p_theme) {
void Control::_window_accept_event() {
window->key_event_accepted=true;
- if (is_inside_scene())
- get_scene()->set_input_as_handled();
+ if (is_inside_tree())
+ get_tree()->set_input_as_handled();
}
void Control::accept_event() {
- if (is_inside_scene() && get_window())
+ if (is_inside_tree() && get_window())
get_window()->_window_accept_event();
}
@@ -2585,7 +2585,7 @@ float Control::get_stretch_ratio() const {
void Control::grab_click_focus() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
if (data.window && data.window->window->mouse_focus) {
@@ -2620,7 +2620,7 @@ void Control::grab_click_focus() {
void Control::minimum_size_changed() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (data.pending_min_size_update)
@@ -2663,7 +2663,7 @@ bool Control::is_stopping_mouse() const {
Control *Control::get_focus_owner() const {
- ERR_FAIL_COND_V(!is_inside_scene(),NULL);
+ ERR_FAIL_COND_V(!is_inside_tree(),NULL);
ERR_FAIL_COND_V(!window,NULL);
return window->key_focus;
}
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 90393a1296..a82cfc7ea6 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -93,7 +93,7 @@ void WindowDialog::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED:
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
close_button->set_normal_texture( get_icon("close","WindowDialog"));
close_button->set_pressed_texture( get_icon("close","WindowDialog"));
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 36940655d4..d2e1e7f0b9 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -339,7 +339,7 @@ int Label::get_longest_line_width() const {
int Label::get_line_count() const {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return 1;
if (word_cache_dirty)
const_cast<Label*>(this)->regenerate_word_cache();
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index a77a40327f..68c990033a 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -572,7 +572,7 @@ void LineEdit::set_cursor_pos(int p_pos) {
// set_window_pos(cursor_pos-get_window_lengt//h());
// }
- if (!is_inside_scene()) {
+ if (!is_inside_tree()) {
window_pos=cursor_pos;
return;
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index fa4a313115..78cc1bcdef 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -192,7 +192,7 @@ void OptionButton::_select(int p_idx,bool p_emit) {
set_text( popup->get_item_text( current ) );
set_icon( popup->get_item_icon( current ) );
- if (is_inside_scene() && p_emit)
+ if (is_inside_tree() && p_emit)
emit_signal("item_selected",current);
}
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index bc0fa9675e..4d0b678925 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -42,7 +42,7 @@ void Range::Shared::emit_value_changed() {
for (Set<Range*>::Element *E=owners.front();E;E=E->next()) {
Range *r=E->get();
- if (!r->is_inside_scene())
+ if (!r->is_inside_tree())
continue;
r->_value_changed_notify();
}
@@ -59,7 +59,7 @@ void Range::Shared::emit_changed() {
for (Set<Range*>::Element *E=owners.front();E;E=E->next()) {
Range *r=E->get();
- if (!r->is_inside_scene())
+ if (!r->is_inside_tree())
continue;
r->_changed_notify();
}
diff --git a/scene/gui/reference_frame.cpp b/scene/gui/reference_frame.cpp
index 679c2cc1e2..44ba3a8972 100644
--- a/scene/gui/reference_frame.cpp
+++ b/scene/gui/reference_frame.cpp
@@ -32,9 +32,9 @@ void ReferenceFrame::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
- if (get_scene()->is_editor_hint())
+ if (get_tree()->is_editor_hint())
draw_style_box(get_stylebox("border"),Rect2(Point2(),get_size())) ;
}
}
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index c661a804b3..aaf96114c6 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -293,7 +293,7 @@ void ScrollBar::_notification(int p_what) {
}
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
if (has_node(drag_slave_path)) {
@@ -303,16 +303,16 @@ void ScrollBar::_notification(int p_what) {
if (drag_slave) {
drag_slave->connect("input_event",this,"_drag_slave_input");
- drag_slave->connect("exit_scene",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT);
+ drag_slave->connect("exit_tree",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT);
}
}
- if (p_what==NOTIFICATION_EXIT_SCENE) {
+ if (p_what==NOTIFICATION_EXIT_TREE) {
if (drag_slave) {
drag_slave->disconnect("input_event",this,"_drag_slave_input");
- drag_slave->disconnect("exit_scene",this,"_drag_slave_exit");
+ drag_slave->disconnect("exit_tree",this,"_drag_slave_exit");
}
drag_slave=NULL;
@@ -635,18 +635,18 @@ void ScrollBar::_drag_slave_input(const InputEvent& p_input) {
void ScrollBar::set_drag_slave(const NodePath& p_path) {
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if (drag_slave) {
drag_slave->disconnect("input_event",this,"_drag_slave_input");
- drag_slave->disconnect("exit_scene",this,"_drag_slave_exit");
+ drag_slave->disconnect("exit_tree",this,"_drag_slave_exit");
}
}
drag_slave=NULL;
drag_slave_path=p_path;
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if (has_node(p_path)) {
Node *n = get_node(p_path);
@@ -655,7 +655,7 @@ void ScrollBar::set_drag_slave(const NodePath& p_path) {
if (drag_slave) {
drag_slave->connect("input_event",this,"_drag_slave_input");
- drag_slave->connect("exit_scene",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT);
+ drag_slave->connect("exit_tree",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT);
}
}
}
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index c8f9ed16b5..95354df519 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -169,7 +169,7 @@ void ScrollContainer::_update_scrollbar_pos() {
void ScrollContainer::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_SCENE || p_what == NOTIFICATION_THEME_CHANGED) {
+ if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
call_deferred("_update_scrollbar_pos");
};
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 59f4386996..9ac67e92f5 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -122,7 +122,7 @@ void SpinBox::_notification(int p_what) {
//_value_changed(0);
- } else if (p_what==NOTIFICATION_ENTER_SCENE) {
+ } else if (p_what==NOTIFICATION_ENTER_TREE) {
_value_changed(0);
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6aabfa35a8..4a0a77e6db 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -360,7 +360,7 @@ void TextEdit::_update_scrollbars() {
void TextEdit::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
_update_caches();
if (cursor_changed_dirty)
@@ -1868,7 +1868,7 @@ void TextEdit::_base_insert_text(int p_line, int p_char,const String& p_text,int
if (!text_changed_dirty && !setting_text) {
- if (is_inside_scene())
+ if (is_inside_tree())
MessageQueue::get_singleton()->push_call(this,"_text_changed_emit");
text_changed_dirty=true;
}
@@ -1921,7 +1921,7 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column,int p_to_lin
if (!text_changed_dirty && !setting_text) {
- if (is_inside_scene())
+ if (is_inside_tree())
MessageQueue::get_singleton()->push_call(this,"_text_changed_emit");
text_changed_dirty=true;
}
@@ -2133,7 +2133,7 @@ void TextEdit::cursor_set_column(int p_col) {
if (!cursor_changed_dirty) {
- if (is_inside_scene())
+ if (is_inside_tree())
MessageQueue::get_singleton()->push_call(this,"_cursor_changed_emit");
cursor_changed_dirty=true;
}
@@ -2165,7 +2165,7 @@ void TextEdit::cursor_set_line(int p_row) {
if (!cursor_changed_dirty) {
- if (is_inside_scene())
+ if (is_inside_tree())
MessageQueue::get_singleton()->push_call(this,"_cursor_changed_emit");
cursor_changed_dirty=true;
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index a39c61ecac..db9142cb99 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1499,7 +1499,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
case TreeItem::CELL_MODE_STRING: {
//nothing in particular
- if (select_mode==SELECT_MULTI && (get_scene()->get_last_event_id() == focus_in_id || !already_cursor)) {
+ if (select_mode==SELECT_MULTI && (get_tree()->get_last_event_id() == focus_in_id || !already_cursor)) {
bring_up_editor=false;
}
@@ -1575,7 +1575,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
editor_text=String::num( p_item->cells[col].val, Math::decimals( p_item->cells[col].step ) );
bring_up_value_editor=false;
- if (select_mode==SELECT_MULTI && get_scene()->get_last_event_id() == focus_in_id)
+ if (select_mode==SELECT_MULTI && get_tree()->get_last_event_id() == focus_in_id)
bring_up_editor=false;
}
@@ -2343,7 +2343,7 @@ void Tree::_notification(int p_what) {
if (p_what==NOTIFICATION_FOCUS_ENTER) {
- focus_in_id=get_scene()->get_last_event_id();
+ focus_in_id=get_tree()->get_last_event_id();
}
if (p_what==NOTIFICATION_MOUSE_EXIT) {
@@ -2353,7 +2353,7 @@ void Tree::_notification(int p_what) {
}
}
- if (p_what==NOTIFICATION_ENTER_SCENE) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
update_cache();;
}
@@ -2811,7 +2811,7 @@ int Tree::get_item_offset(TreeItem *p_item) const {
void Tree::ensure_cursor_is_visible() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
TreeItem *selected = get_selected();
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 0d77560d7b..857ea25d0f 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -32,10 +32,10 @@ void VideoPlayer::_notification(int p_notification) {
switch (p_notification) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
//set_idle_process(false); //don't annoy
- if (stream.is_valid() && autoplay && !get_scene()->is_editor_hint())
+ if (stream.is_valid() && autoplay && !get_tree()->is_editor_hint())
play();
} break;
@@ -48,7 +48,7 @@ void VideoPlayer::_notification(int p_notification) {
if (!stream->is_playing())
return;
- stream->update(get_scene()->get_idle_process_time());
+ stream->update(get_tree()->get_idle_process_time());
int prev_width = texture->get_width();
stream->pop_frame(texture);
if (prev_width == 0) {
@@ -118,7 +118,7 @@ Ref<VideoStream> VideoPlayer::get_stream() const {
void VideoPlayer::play() {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
if (stream.is_null())
return;
stream->play();
@@ -127,7 +127,7 @@ void VideoPlayer::play() {
void VideoPlayer::stop() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (stream.is_null())
return;
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 5006f55daf..ae842577a9 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -144,7 +144,7 @@ void CanvasLayer::_notification(int p_what) {
switch(p_what) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
Node *n = this;
vp=NULL;
@@ -169,7 +169,7 @@ void CanvasLayer::_notification(int p_what) {
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
VisualServer::get_singleton()->viewport_remove_canvas(viewport,canvas->get_canvas());
viewport=RID();
@@ -180,7 +180,7 @@ void CanvasLayer::_notification(int p_what) {
Size2 CanvasLayer::get_viewport_size() const {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return Size2(1,1);
Rect2 r = vp->get_visible_rect();
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 667b4639a9..292e4d1a7b 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -64,7 +64,7 @@ void Node::_notification(int p_notification) {
}
} break;
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (data.pause_mode==PAUSE_MODE_INHERIT) {
@@ -83,12 +83,12 @@ void Node::_notification(int p_notification) {
if (data.unhandled_key_input)
add_to_group("_vp_unhandled_key_input"+itos(get_viewport()->get_instance_ID()));
- get_scene()->node_count++;
+ get_tree()->node_count++;
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
- get_scene()->node_count--;
+ get_tree()->node_count--;
if (data.input)
remove_from_group("_vp_input"+itos(get_viewport()->get_instance_ID()));
if (data.unhandled_input)
@@ -104,7 +104,7 @@ void Node::_notification(int p_notification) {
Variant::CallError err;
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready,NULL,0);
}
- //emit_signal(SceneStringNames::get_singleton()->enter_scene);
+ //emit_signal(SceneStringNames::get_singleton()->enter_tree);
} break;
case NOTIFICATION_POSTINITIALIZE: {
@@ -150,11 +150,11 @@ void Node::_propagate_ready() {
}
-void Node::_propagate_enter_scene() {
- // this needs to happen to all childs before any ENTER_SCENE
+void Node::_propagate_enter_tree() {
+ // this needs to happen to all childs before any enter_tree
if (data.parent) {
- data.scene=data.parent->data.scene;
+ data.tree=data.parent->data.tree;
data.depth=data.parent->data.depth+1;
} else {
@@ -165,25 +165,25 @@ void Node::_propagate_enter_scene() {
if (!data.viewport)
data.viewport = data.parent->data.viewport;
- data.inside_scene=true;
+ data.inside_tree=true;
const StringName *K=NULL;
while ((K=data.grouped.next(K))) {
- data.scene->add_to_group(*K,this);
+ data.tree->add_to_group(*K,this);
}
- notification(NOTIFICATION_ENTER_SCENE);
+ notification(NOTIFICATION_ENTER_TREE);
if (get_script_instance()) {
Variant::CallError err;
- get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_scene,NULL,0);
+ get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_tree,NULL,0);
}
- emit_signal(SceneStringNames::get_singleton()->enter_scene);
+ emit_signal(SceneStringNames::get_singleton()->enter_tree);
data.blocked++;
@@ -191,8 +191,8 @@ void Node::_propagate_enter_scene() {
for (int i=0;i<data.children.size();i++) {
- if (!data.children[i]->is_inside_scene()) // could have been added in ENTER_SCENE
- data.children[i]->_propagate_enter_scene();
+ if (!data.children[i]->is_inside_tree()) // could have been added in enter_tree
+ data.children[i]->_propagate_enter_tree();
}
data.blocked--;
@@ -201,7 +201,7 @@ void Node::_propagate_enter_scene() {
-void Node::_propagate_exit_scene() {
+void Node::_propagate_exit_tree() {
//block while removing children
@@ -209,7 +209,7 @@ void Node::_propagate_exit_scene() {
for (int i=data.children.size()-1;i>=0;i--) {
- data.children[i]->_propagate_exit_scene();
+ data.children[i]->_propagate_exit_tree();
}
data.blocked--;
@@ -217,29 +217,29 @@ void Node::_propagate_exit_scene() {
if (get_script_instance()) {
Variant::CallError err;
- get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_scene,NULL,0);
+ get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_tree,NULL,0);
}
- emit_signal(SceneStringNames::get_singleton()->exit_scene);
+ emit_signal(SceneStringNames::get_singleton()->exit_tree);
- notification(NOTIFICATION_EXIT_SCENE,true);
- if (data.scene)
- data.scene->node_removed(this);
+ notification(NOTIFICATION_EXIT_TREE,true);
+ if (data.tree)
+ data.tree->node_removed(this);
// exit groups
const StringName *K=NULL;
while ((K=data.grouped.next(K))) {
- data.scene->remove_from_group(*K,this);
+ data.tree->remove_from_group(*K,this);
}
data.viewport = NULL;
- if (data.scene)
- data.scene->tree_changed();
+ if (data.tree)
+ data.tree->tree_changed();
- data.inside_scene=false;
- data.scene=NULL;
+ data.inside_tree=false;
+ data.tree=NULL;
data.depth=-1;
}
@@ -260,8 +260,8 @@ void Node::move_child(Node *p_child,int p_pos) {
data.children.remove( p_child->data.pos );
data.children.insert( p_pos, p_child );
- if (data.scene) {
- data.scene->tree_changed();
+ if (data.tree) {
+ data.tree->tree_changed();
}
data.blocked++;
@@ -333,7 +333,7 @@ void Node::set_pause_mode(PauseMode p_mode) {
bool prev_inherits=data.pause_mode==PAUSE_MODE_INHERIT;
data.pause_mode=p_mode;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return; //pointless
if ((data.pause_mode==PAUSE_MODE_INHERIT) == prev_inherits)
return; ///nothing changed
@@ -372,9 +372,9 @@ void Node::_propagate_pause_owner(Node*p_owner) {
bool Node::can_process() const {
- ERR_FAIL_COND_V( !is_inside_scene(), false );
+ ERR_FAIL_COND_V( !is_inside_tree(), false );
- if (get_scene()->is_paused()) {
+ if (get_tree()->is_paused()) {
if (data.pause_mode==PAUSE_MODE_PROCESS)
return true;
@@ -395,8 +395,8 @@ bool Node::can_process() const {
float Node::get_fixed_process_delta_time() const {
- if (data.scene)
- return data.scene->get_fixed_process_time();
+ if (data.tree)
+ return data.tree->get_fixed_process_time();
else
return 0;
}
@@ -419,8 +419,8 @@ void Node::set_process(bool p_idle_process) {
float Node::get_process_delta_time() const {
- if (data.scene)
- return data.scene->get_idle_process_time();
+ if (data.tree)
+ return data.tree->get_idle_process_time();
else
return 0;
}
@@ -442,7 +442,7 @@ void Node::set_process_input(bool p_enable) {
return;
data.input=p_enable;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (p_enable)
@@ -462,7 +462,7 @@ void Node::set_process_unhandled_input(bool p_enable) {
if (p_enable==data.unhandled_input)
return;
data.unhandled_input=p_enable;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (p_enable)
@@ -482,7 +482,7 @@ void Node::set_process_unhandled_key_input(bool p_enable) {
if (p_enable==data.unhandled_key_input)
return;
data.unhandled_key_input=p_enable;
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
if (p_enable)
@@ -520,10 +520,10 @@ void Node::set_name(const String& p_name) {
data.parent->_validate_child_name(this);
}
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
emit_signal("renamed");
- get_scene()->tree_changed();
+ get_tree()->tree_changed();
}
}
@@ -630,8 +630,8 @@ void Node::_add_child_nocheck(Node* p_child,const StringName& p_name) {
data.children.push_back( p_child );
p_child->data.parent=this;
- if (data.scene) {
- p_child->_set_scene(data.scene);
+ if (data.tree) {
+ p_child->_set_tree(data.tree);
}
/* Notify */
@@ -719,7 +719,7 @@ void Node::remove_child(Node *p_child) {
//if (data.scene) { does not matter
- p_child->_set_scene(NULL);
+ p_child->_set_tree(NULL);
//}
remove_child_notify(p_child);
@@ -755,7 +755,7 @@ Node *Node::get_child(int p_index) const {
Node *Node::_get_node(const NodePath& p_path) const {
- ERR_FAIL_COND_V( !data.inside_scene && p_path.is_absolute(), NULL );
+ ERR_FAIL_COND_V( !data.inside_tree && p_path.is_absolute(), NULL );
Node *current=NULL;
Node *root=NULL;
@@ -851,8 +851,8 @@ bool Node::is_a_parent_of(const Node *p_node) const {
bool Node::is_greater_than(const Node *p_node) const {
ERR_FAIL_NULL_V(p_node,false);
- ERR_FAIL_COND_V( !data.inside_scene, false );
- ERR_FAIL_COND_V( !p_node->data.inside_scene, false );
+ ERR_FAIL_COND_V( !data.inside_tree, false );
+ ERR_FAIL_COND_V( !p_node->data.inside_tree, false );
ERR_FAIL_COND_V( data.depth<0, false);
ERR_FAIL_COND_V( p_node->data.depth<0, false);
@@ -1023,7 +1023,7 @@ NodePath Node::get_path_to(const Node *p_node) const {
NodePath Node::get_path() const {
- ERR_FAIL_COND_V(!is_inside_scene(),NodePath());
+ ERR_FAIL_COND_V(!is_inside_tree(),NodePath());
const Node *n = this;
Vector<StringName> path;
@@ -1052,8 +1052,8 @@ void Node::add_to_group(const StringName& p_identifier,bool p_persistent) {
GroupData gd;
- if (data.scene)
- data.scene->add_to_group(p_identifier,this);
+ if (data.tree)
+ data.tree->add_to_group(p_identifier,this);
gd.persistent=p_persistent;
@@ -1070,8 +1070,8 @@ void Node::remove_from_group(const StringName& p_identifier) {
ERR_FAIL_COND(!g);
- if (data.scene)
- data.scene->remove_from_group(p_identifier,this);
+ if (data.tree)
+ data.tree->remove_from_group(p_identifier,this);
data.grouped.erase(p_identifier);
@@ -1131,7 +1131,7 @@ void Node::_propagate_reverse_notification(int p_notification) {
void Node::_propagate_deferred_notification(int p_notification, bool p_reverse) {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
data.blocked++;
@@ -1624,29 +1624,29 @@ Node *Node::get_node_and_resource(const NodePath& p_path,RES& r_res) const {
return node;
}
-void Node::_set_scene(SceneMainLoop *p_scene) {
+void Node::_set_tree(SceneTree *p_tree) {
- SceneMainLoop *tree_changed_a=NULL;
- SceneMainLoop *tree_changed_b=NULL;
+ SceneTree *tree_changed_a=NULL;
+ SceneTree *tree_changed_b=NULL;
// ERR_FAIL_COND(p_scene && data.parent && !data.parent->data.scene); //nobug if both are null
- if (data.scene) {
- _propagate_exit_scene();
+ if (data.tree) {
+ _propagate_exit_tree();
- tree_changed_a=data.scene;
+ tree_changed_a=data.tree;
}
- data.scene=p_scene;
+ data.tree=p_tree;
- if (data.scene) {
+ if (data.tree) {
- _propagate_enter_scene();
+ _propagate_enter_tree();
_propagate_ready(); //reverse_notification(NOTIFICATION_READY);
- tree_changed_b=data.scene;
+ tree_changed_b=data.tree;
}
@@ -1664,7 +1664,7 @@ static void _Node_debug_sn(Object *p_obj) {
if (!n)
return;
- if (n->is_inside_scene())
+ if (n->is_inside_tree())
return;
Node *p=n;
@@ -1696,8 +1696,8 @@ void Node::print_stray_nodes() {
void Node::queue_delete() {
- ERR_FAIL_COND( !is_inside_scene() );
- get_scene()->queue_delete(this);
+ ERR_FAIL_COND( !is_inside_tree() );
+ get_tree()->queue_delete(this);
}
Array Node::_get_children() const {
@@ -1742,7 +1742,7 @@ void Node::_bind_methods() {
ObjectTypeDB::bind_method(_MD("has_node_and_resource","path"),&Node::has_node_and_resource);
ObjectTypeDB::bind_method(_MD("get_node_and_resource","path"),&Node::_get_node_and_resource);
- ObjectTypeDB::bind_method(_MD("is_inside_scene"),&Node::is_inside_scene);
+ ObjectTypeDB::bind_method(_MD("is_inside_tree"),&Node::is_inside_tree);
ObjectTypeDB::bind_method(_MD("is_a_parent_of","node:Node"),&Node::is_a_parent_of);
ObjectTypeDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than);
ObjectTypeDB::bind_method(_MD("get_path"),&Node::get_path);
@@ -1779,7 +1779,7 @@ void Node::_bind_methods() {
ObjectTypeDB::bind_method(_MD("print_stray_nodes"),&Node::_print_stray_nodes);
ObjectTypeDB::bind_method(_MD("get_position_in_parent"),&Node::get_position_in_parent);
- ObjectTypeDB::bind_method(_MD("get_scene:SceneMainLoop"),&Node::get_scene);
+ ObjectTypeDB::bind_method(_MD("get_tree:SceneTree"),&Node::get_tree);
ObjectTypeDB::bind_method(_MD("duplicate:Node"),&Node::duplicate);
ObjectTypeDB::bind_method(_MD("replace_by","node:Node","keep_data"),&Node::replace_by,DEFVAL(false));
@@ -1794,8 +1794,8 @@ void Node::_bind_methods() {
#endif
- BIND_CONSTANT( NOTIFICATION_ENTER_SCENE );
- BIND_CONSTANT( NOTIFICATION_EXIT_SCENE );
+ BIND_CONSTANT( NOTIFICATION_ENTER_TREE );
+ BIND_CONSTANT( NOTIFICATION_EXIT_TREE );
BIND_CONSTANT( NOTIFICATION_MOVED_IN_PARENT );
//BIND_CONSTANT( NOTIFICATION_PARENT_DECONFIGURED );
BIND_CONSTANT( NOTIFICATION_READY );
@@ -1812,8 +1812,8 @@ void Node::_bind_methods() {
BIND_CONSTANT( PAUSE_MODE_PROCESS );
ADD_SIGNAL( MethodInfo("renamed") );
- ADD_SIGNAL( MethodInfo("enter_scene") );
- ADD_SIGNAL( MethodInfo("exit_scene") );
+ ADD_SIGNAL( MethodInfo("enter_tree") );
+ ADD_SIGNAL( MethodInfo("exit_tree") );
// ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),_SCS("set_process"),_SCS("is_processing") );
// ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), _SCS("set_fixed_process"),_SCS("is_fixed_processing") );
@@ -1823,8 +1823,8 @@ void Node::_bind_methods() {
BIND_VMETHOD( MethodInfo("_process",PropertyInfo(Variant::REAL,"delta")) );
BIND_VMETHOD( MethodInfo("_fixed_process",PropertyInfo(Variant::REAL,"delta")) );
- BIND_VMETHOD( MethodInfo("_enter_scene") );
- BIND_VMETHOD( MethodInfo("_exit_scene") );
+ BIND_VMETHOD( MethodInfo("_enter_tree") );
+ BIND_VMETHOD( MethodInfo("_exit_tree") );
BIND_VMETHOD( MethodInfo("_ready") );
BIND_VMETHOD( MethodInfo("_input",PropertyInfo(Variant::INPUT_EVENT,"event")) );
BIND_VMETHOD( MethodInfo("_unhandled_input",PropertyInfo(Variant::INPUT_EVENT,"event")) );
@@ -1841,10 +1841,10 @@ Node::Node() {
data.depth=-1;
data.blocked=0;
data.parent=NULL;
- data.scene=NULL;
+ data.tree=NULL;
data.fixed_process=false;
data.idle_process=false;
- data.inside_scene=false;
+ data.inside_tree=false;
data.owner=NULL;
data.OW=NULL;
diff --git a/scene/main/node.h b/scene/main/node.h
index f1ecf497e0..9229e2f9bb 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -80,8 +80,8 @@ private:
int depth;
int blocked; // safeguard that throws an error when attempting to modify the tree in a harmful way while being traversed.
StringName name;
- SceneMainLoop *scene;
- bool inside_scene;
+ SceneTree *tree;
+ bool inside_tree;
#ifdef TOOLS_ENABLED
NodePath import_path; //path used when imported, used by scene editors to keep tracking
#endif
@@ -118,9 +118,9 @@ private:
void _propagate_reverse_notification(int p_notification);
void _propagate_deferred_notification(int p_notification, bool p_reverse);
- void _propagate_enter_scene();
+ void _propagate_enter_tree();
void _propagate_ready();
- void _propagate_exit_scene();
+ void _propagate_exit_tree();
void _propagate_validate_owner();
void _print_stray_nodes();
void _propagate_pause_owner(Node*p_owner);
@@ -130,9 +130,9 @@ private:
Array _get_children() const;
Array _get_groups() const;
-friend class SceneMainLoop;
+friend class SceneTree;
- void _set_scene(SceneMainLoop *p_scene);
+ void _set_tree(SceneTree *p_tree);
protected:
void _block() { data.blocked++; }
@@ -158,8 +158,8 @@ public:
enum {
// you can make your own, but don't use the same numbers as other notifications in other nodes
- NOTIFICATION_ENTER_SCENE=10,
- NOTIFICATION_EXIT_SCENE =11,
+ NOTIFICATION_ENTER_TREE=10,
+ NOTIFICATION_EXIT_TREE =11,
NOTIFICATION_MOVED_IN_PARENT =12,
NOTIFICATION_READY=13,
//NOTIFICATION_PARENT_DECONFIGURED =15, - it's confusing, it's going away
@@ -187,9 +187,9 @@ public:
Node *get_node_and_resource(const NodePath& p_path,RES& r_res) const;
Node *get_parent() const;
- _FORCE_INLINE_ SceneMainLoop *get_scene() const { ERR_FAIL_COND_V( !data.scene, NULL ); return data.scene; }
+ _FORCE_INLINE_ SceneTree *get_tree() const { ERR_FAIL_COND_V( !data.tree, NULL ); return data.tree; }
- _FORCE_INLINE_ bool is_inside_scene() const { return data.inside_scene; }
+ _FORCE_INLINE_ bool is_inside_tree() const { return data.inside_tree; }
bool is_a_parent_of(const Node *p_node) const;
bool is_greater_than(const Node *p_node) const;
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index c51974167d..47089638bb 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -43,13 +43,13 @@
#include "viewport.h"
-void SceneMainLoop::tree_changed() {
+void SceneTree::tree_changed() {
tree_version++;
emit_signal(tree_changed_name);
}
-void SceneMainLoop::node_removed(Node *p_node) {
+void SceneTree::node_removed(Node *p_node) {
emit_signal(node_removed_name,p_node);
if (call_lock>0)
@@ -59,7 +59,7 @@ void SceneMainLoop::node_removed(Node *p_node) {
}
-void SceneMainLoop::add_to_group(const StringName& p_group, Node *p_node) {
+void SceneTree::add_to_group(const StringName& p_group, Node *p_node) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E) {
@@ -74,7 +74,7 @@ void SceneMainLoop::add_to_group(const StringName& p_group, Node *p_node) {
E->get().last_tree_version=0;
}
-void SceneMainLoop::remove_from_group(const StringName& p_group, Node *p_node) {
+void SceneTree::remove_from_group(const StringName& p_group, Node *p_node) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
ERR_FAIL_COND(!E);
@@ -85,7 +85,7 @@ void SceneMainLoop::remove_from_group(const StringName& p_group, Node *p_node) {
group_map.erase(E);
}
-void SceneMainLoop::_flush_transform_notifications() {
+void SceneTree::_flush_transform_notifications() {
SelfList<Node>* n = xform_change_list.first();
while(n) {
@@ -98,7 +98,7 @@ void SceneMainLoop::_flush_transform_notifications() {
}
}
-void SceneMainLoop::_flush_ugc() {
+void SceneTree::_flush_ugc() {
ugc_locked=true;
@@ -118,7 +118,7 @@ void SceneMainLoop::_flush_ugc() {
ugc_locked=false;
}
-void SceneMainLoop::_update_group_order(Group& g) {
+void SceneTree::_update_group_order(Group& g) {
if (g.last_tree_version==tree_version)
return;
@@ -134,7 +134,7 @@ void SceneMainLoop::_update_group_order(Group& g) {
}
-void SceneMainLoop::call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_DECLARE) {
+void SceneTree::call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_DECLARE) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E)
@@ -216,7 +216,7 @@ void SceneMainLoop::call_group(uint32_t p_call_flags,const StringName& p_group,c
call_skip.clear();
}
-void SceneMainLoop::notify_group(uint32_t p_call_flags,const StringName& p_group,int p_notification) {
+void SceneTree::notify_group(uint32_t p_call_flags,const StringName& p_group,int p_notification) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E)
@@ -266,7 +266,7 @@ void SceneMainLoop::notify_group(uint32_t p_call_flags,const StringName& p_group
call_skip.clear();
}
-void SceneMainLoop::set_group(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value) {
+void SceneTree::set_group(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E)
@@ -316,12 +316,12 @@ void SceneMainLoop::set_group(uint32_t p_call_flags,const StringName& p_group,co
call_skip.clear();
}
-void SceneMainLoop::set_input_as_handled() {
+void SceneTree::set_input_as_handled() {
input_handled=true;
}
-void SceneMainLoop::input_text( const String& p_text ) {
+void SceneTree::input_text( const String& p_text ) {
root_lock++;
@@ -330,16 +330,17 @@ void SceneMainLoop::input_text( const String& p_text ) {
}
-void SceneMainLoop::input_event( const InputEvent& p_event ) {
+void SceneTree::input_event( const InputEvent& p_event ) {
root_lock++;
- last_id=p_event.ID;
+ //last_id=p_event.ID;
input_handled=false;
InputEvent ev = p_event;
+ ev.ID=++last_id; //this should work better
#if 0
switch(ev.type) {
@@ -393,7 +394,7 @@ void SceneMainLoop::input_event( const InputEvent& p_event ) {
#endif
- MainLoop::input_event(p_event);
+ MainLoop::input_event(ev);
#if 0
_call_input_pause("input","_input",ev);
@@ -415,7 +416,7 @@ void SceneMainLoop::input_event( const InputEvent& p_event ) {
//transform for the rest
#else
- call_group(GROUP_CALL_REALTIME,"_viewports","_vp_input",p_event); //special one for GUI, as controls use their own process check
+ call_group(GROUP_CALL_REALTIME,"_viewports","_vp_input",ev); //special one for GUI, as controls use their own process check
#endif
if (ScriptDebugger::get_singleton() && ScriptDebugger::get_singleton()->is_remote() && ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F8) {
@@ -440,7 +441,7 @@ void SceneMainLoop::input_event( const InputEvent& p_event ) {
}
#else
- call_group(GROUP_CALL_REALTIME,"_viewports","_vp_unhandled_input",p_event); //special one for GUI, as controls use their own process check
+ call_group(GROUP_CALL_REALTIME,"_viewports","_vp_unhandled_input",ev); //special one for GUI, as controls use their own process check
#endif
input_handled=true;
@@ -455,7 +456,7 @@ void SceneMainLoop::input_event( const InputEvent& p_event ) {
}
-void SceneMainLoop::init() {
+void SceneTree::init() {
//_quit=false;
accept_quit=true;
@@ -466,12 +467,12 @@ void SceneMainLoop::init() {
editor_hint=false;
pause=false;
- root->_set_scene(this);
+ root->_set_tree(this);
MainLoop::init();
}
-bool SceneMainLoop::iteration(float p_time) {
+bool SceneTree::iteration(float p_time) {
root_lock++;
@@ -496,7 +497,7 @@ bool SceneMainLoop::iteration(float p_time) {
return _quit;
}
-bool SceneMainLoop::idle(float p_time){
+bool SceneTree::idle(float p_time){
// print_line("ram: "+itos(OS::get_singleton()->get_static_memory_usage())+" sram: "+itos(OS::get_singleton()->get_dynamic_memory_usage()));
@@ -538,7 +539,7 @@ bool SceneMainLoop::idle(float p_time){
return _quit;
}
-void SceneMainLoop::finish() {
+void SceneTree::finish() {
_flush_delete_queue();
@@ -549,7 +550,7 @@ void SceneMainLoop::finish() {
MainLoop::finish();
if (root) {
- root->_set_scene(NULL);
+ root->_set_tree(NULL);
memdelete(root); //delete root
}
@@ -564,12 +565,12 @@ void SceneMainLoop::finish() {
}
-void SceneMainLoop::quit() {
+void SceneTree::quit() {
_quit=true;
}
-void SceneMainLoop::_notification(int p_notification) {
+void SceneTree::_notification(int p_notification) {
@@ -602,22 +603,22 @@ void SceneMainLoop::_notification(int p_notification) {
};
-void SceneMainLoop::set_auto_accept_quit(bool p_enable) {
+void SceneTree::set_auto_accept_quit(bool p_enable) {
accept_quit=p_enable;
}
-void SceneMainLoop::set_editor_hint(bool p_enabled) {
+void SceneTree::set_editor_hint(bool p_enabled) {
editor_hint=p_enabled;
}
-bool SceneMainLoop::is_editor_hint() const {
+bool SceneTree::is_editor_hint() const {
return editor_hint;
}
-void SceneMainLoop::set_pause(bool p_enabled) {
+void SceneTree::set_pause(bool p_enabled) {
if (p_enabled==pause)
return;
@@ -628,12 +629,12 @@ void SceneMainLoop::set_pause(bool p_enabled) {
get_root()->propagate_notification(p_enabled ? Node::NOTIFICATION_PAUSED : Node::NOTIFICATION_UNPAUSED);
}
-bool SceneMainLoop::is_paused() const {
+bool SceneTree::is_paused() const {
return pause;
}
-void SceneMainLoop::_call_input_pause(const StringName& p_group,const StringName& p_method,const InputEvent& p_input) {
+void SceneTree::_call_input_pause(const StringName& p_group,const StringName& p_method,const InputEvent& p_input) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E)
@@ -678,7 +679,7 @@ void SceneMainLoop::_call_input_pause(const StringName& p_group,const StringName
call_skip.clear();
}
-void SceneMainLoop::_notify_group_pause(const StringName& p_group,int p_notification) {
+void SceneTree::_notify_group_pause(const StringName& p_group,int p_notification) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
if (!E)
@@ -728,13 +729,13 @@ void SceneMainLoop::_update_listener_2d() {
}
*/
-uint32_t SceneMainLoop::get_last_event_id() const {
+uint32_t SceneTree::get_last_event_id() const {
return last_id;
}
-Variant SceneMainLoop::_call_group(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {
+Variant SceneTree::_call_group(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {
r_error.error=Variant::CallError::CALL_OK;
@@ -759,13 +760,13 @@ Variant SceneMainLoop::_call_group(const Variant** p_args, int p_argcount, Varia
}
-int64_t SceneMainLoop::get_frame() const {
+int64_t SceneTree::get_frame() const {
return current_frame;
}
-Array SceneMainLoop::_get_nodes_in_group(const StringName& p_group) {
+Array SceneTree::_get_nodes_in_group(const StringName& p_group) {
Array ret;
Map<StringName,Group>::Element *E=group_map.find(p_group);
@@ -788,7 +789,7 @@ Array SceneMainLoop::_get_nodes_in_group(const StringName& p_group) {
return ret;
}
-void SceneMainLoop::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) {
+void SceneTree::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) {
Map<StringName,Group>::Element *E=group_map.find(p_group);
@@ -818,9 +819,9 @@ static void _fill_array(Node *p_node, Array& array, int p_level) {
}
}
-void SceneMainLoop::_debugger_request_tree(void *self) {
+void SceneTree::_debugger_request_tree(void *self) {
- SceneMainLoop *sml = (SceneMainLoop *)self;
+ SceneTree *sml = (SceneTree *)self;
Array arr;
_fill_array(sml->root,arr,0);
@@ -828,7 +829,7 @@ void SceneMainLoop::_debugger_request_tree(void *self) {
}
-void SceneMainLoop::_flush_delete_queue() {
+void SceneTree::_flush_delete_queue() {
_THREAD_SAFE_METHOD_
@@ -842,7 +843,7 @@ void SceneMainLoop::_flush_delete_queue() {
}
}
-void SceneMainLoop::queue_delete(Object *p_object) {
+void SceneTree::queue_delete(Object *p_object) {
_THREAD_SAFE_METHOD_
ERR_FAIL_NULL(p_object);
@@ -850,13 +851,13 @@ void SceneMainLoop::queue_delete(Object *p_object) {
}
-int SceneMainLoop::get_node_count() const {
+int SceneTree::get_node_count() const {
return node_count;
}
-void SceneMainLoop::_update_root_rect() {
+void SceneTree::_update_root_rect() {
if (stretch_mode==STRETCH_MODE_DISABLED) {
@@ -959,7 +960,7 @@ void SceneMainLoop::_update_root_rect() {
}
-void SceneMainLoop::set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize) {
+void SceneTree::set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize) {
stretch_mode=p_mode;
stretch_aspect=p_aspect;
@@ -969,50 +970,50 @@ void SceneMainLoop::set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect
#ifdef TOOLS_ENABLED
-void SceneMainLoop::set_edited_scene_root(Node *p_node) {
+void SceneTree::set_edited_scene_root(Node *p_node) {
edited_scene_root=p_node;
}
-Node *SceneMainLoop::get_edited_scene_root() const {
+Node *SceneTree::get_edited_scene_root() const {
return edited_scene_root;
}
#endif
-void SceneMainLoop::_bind_methods() {
+void SceneTree::_bind_methods() {
//ObjectTypeDB::bind_method(_MD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant()));
- ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneMainLoop::notify_group);
- ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneMainLoop::set_group);
+ ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group);
+ ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group);
- ObjectTypeDB::bind_method(_MD("get_nodes_in_group"),&SceneMainLoop::_get_nodes_in_group);
+ ObjectTypeDB::bind_method(_MD("get_nodes_in_group"),&SceneTree::_get_nodes_in_group);
- ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneMainLoop::get_root);
+ ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root);
- ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneMainLoop::set_auto_accept_quit);
+ ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit);
- ObjectTypeDB::bind_method(_MD("set_editor_hint","enable"),&SceneMainLoop::set_editor_hint);
- ObjectTypeDB::bind_method(_MD("is_editor_hint"),&SceneMainLoop::is_editor_hint);
+ ObjectTypeDB::bind_method(_MD("set_editor_hint","enable"),&SceneTree::set_editor_hint);
+ ObjectTypeDB::bind_method(_MD("is_editor_hint"),&SceneTree::is_editor_hint);
#ifdef TOOLS_ENABLED
- ObjectTypeDB::bind_method(_MD("set_edited_scene_root","scene"),&SceneMainLoop::set_edited_scene_root);
- ObjectTypeDB::bind_method(_MD("get_edited_scene_root"),&SceneMainLoop::get_edited_scene_root);
+ ObjectTypeDB::bind_method(_MD("set_edited_scene_root","scene"),&SceneTree::set_edited_scene_root);
+ ObjectTypeDB::bind_method(_MD("get_edited_scene_root"),&SceneTree::get_edited_scene_root);
#endif
- ObjectTypeDB::bind_method(_MD("set_pause","enable"),&SceneMainLoop::set_pause);
- ObjectTypeDB::bind_method(_MD("is_paused"),&SceneMainLoop::is_paused);
- ObjectTypeDB::bind_method(_MD("set_input_as_handled"),&SceneMainLoop::set_input_as_handled);
+ ObjectTypeDB::bind_method(_MD("set_pause","enable"),&SceneTree::set_pause);
+ ObjectTypeDB::bind_method(_MD("is_paused"),&SceneTree::is_paused);
+ ObjectTypeDB::bind_method(_MD("set_input_as_handled"),&SceneTree::set_input_as_handled);
- ObjectTypeDB::bind_method(_MD("get_node_count"),&SceneMainLoop::get_node_count);
- ObjectTypeDB::bind_method(_MD("get_frame"),&SceneMainLoop::get_frame);
- ObjectTypeDB::bind_method(_MD("quit"),&SceneMainLoop::quit);
+ ObjectTypeDB::bind_method(_MD("get_node_count"),&SceneTree::get_node_count);
+ ObjectTypeDB::bind_method(_MD("get_frame"),&SceneTree::get_frame);
+ ObjectTypeDB::bind_method(_MD("quit"),&SceneTree::quit);
- ObjectTypeDB::bind_method(_MD("set_screen_stretch","mode","aspect","minsize"),&SceneMainLoop::set_screen_stretch);
+ ObjectTypeDB::bind_method(_MD("set_screen_stretch","mode","aspect","minsize"),&SceneTree::set_screen_stretch);
- ObjectTypeDB::bind_method(_MD("queue_delete","obj"),&SceneMainLoop::queue_delete);
+ ObjectTypeDB::bind_method(_MD("queue_delete","obj"),&SceneTree::queue_delete);
MethodInfo mi;
@@ -1026,7 +1027,7 @@ void SceneMainLoop::_bind_methods() {
defargs.push_back(Variant());
}
- ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneMainLoop::_call_group,mi,defargs);
+ ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi,defargs);
ADD_SIGNAL( MethodInfo("tree_changed") );
ADD_SIGNAL( MethodInfo("node_removed",PropertyInfo( Variant::OBJECT, "node") ) );
@@ -1047,14 +1048,14 @@ void SceneMainLoop::_bind_methods() {
}
-SceneMainLoop::SceneMainLoop() {
+SceneTree::SceneTree() {
_quit=false;
initialized=false;
tree_version=1;
fixed_process_time=1;
idle_process_time=1;
- last_id=0;
+ last_id=1;
root=NULL;
current_frame=0;
tree_changed_name="tree_changed";
@@ -1095,7 +1096,7 @@ SceneMainLoop::SceneMainLoop() {
}
-SceneMainLoop::~SceneMainLoop() {
+SceneTree::~SceneTree() {
}
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index bfa755ff7c..31a823ab1a 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -41,16 +41,16 @@
*/
-class SceneMainLoop;
+class SceneTree;
class Node;
class Viewport;
-class SceneMainLoop : public MainLoop {
+class SceneTree : public MainLoop {
_THREAD_SAFE_CLASS_
- OBJ_TYPE( SceneMainLoop, MainLoop );
+ OBJ_TYPE( SceneTree, MainLoop );
public:
@@ -234,14 +234,14 @@ public:
Node *get_edited_scene_root() const;
#endif
- SceneMainLoop();
- ~SceneMainLoop();
+ SceneTree();
+ ~SceneTree();
};
-VARIANT_ENUM_CAST( SceneMainLoop::StretchMode );
-VARIANT_ENUM_CAST( SceneMainLoop::StretchAspect );
+VARIANT_ENUM_CAST( SceneTree::StretchMode );
+VARIANT_ENUM_CAST( SceneTree::StretchAspect );
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index 8e80f868c6..2ae918f3f3 100644
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -38,7 +38,7 @@ void Timer::_notification(int p_what) {
if (autostart) {
#ifdef TOOLS_ENABLED
- if (get_scene()->is_editor_hint() && get_scene()->get_edited_scene_root() && (get_scene()->get_edited_scene_root()==this || get_scene()->get_edited_scene_root()->is_a_parent_of(this)))
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root()==this || get_tree()->get_edited_scene_root()->is_a_parent_of(this)))
break;
#endif start();
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ac496cac4e..e6c787cf9e 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -113,7 +113,7 @@ void Viewport::_update_stretch_transform() {
void Viewport::_update_rect() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Node *parent = get_parent();
@@ -175,7 +175,7 @@ void Viewport::_parent_visibility_changed() {
}
-void Viewport::_vp_enter_scene() {
+void Viewport::_vp_enter_tree() {
Node *parent = get_parent();
//none?
@@ -200,7 +200,7 @@ void Viewport::_vp_enter_scene() {
}
-void Viewport::_vp_exit_scene() {
+void Viewport::_vp_exit_tree() {
Node *parent = get_parent();
if (parent && parent->cast_to<Control>()) {
@@ -231,14 +231,14 @@ void Viewport::_vp_exit_scene() {
void Viewport::update_worlds() {
- if (!is_inside_scene())
+ if (!is_inside_tree())
return;
Rect2 xformed_rect = (global_canvas_transform * canvas_transform).affine_inverse().xform(get_visible_rect());
find_world_2d()->_update_viewport(this,xformed_rect);
find_world_2d()->_update();
- find_world()->_update(get_scene()->get_frame());
+ find_world()->_update(get_tree()->get_frame());
}
@@ -280,11 +280,11 @@ void Viewport::_notification(int p_what) {
switch( p_what ) {
- case NOTIFICATION_ENTER_SCENE: {
+ case NOTIFICATION_ENTER_TREE: {
if (!render_target)
- _vp_enter_scene();
+ _vp_enter_tree();
this->parent=NULL;
Node *parent=get_parent();
@@ -334,7 +334,7 @@ void Viewport::_notification(int p_what) {
}
#endif
} break;
- case NOTIFICATION_EXIT_SCENE: {
+ case NOTIFICATION_EXIT_TREE: {
@@ -342,7 +342,7 @@ void Viewport::_notification(int p_what) {
world_2d->_remove_viewport(this);
if (!render_target)
- _vp_exit_scene();
+ _vp_exit_tree();
VisualServer::get_singleton()->viewport_set_scenario(viewport,RID());
SpatialSoundServer::get_singleton()->listener_set_space(listener,RID());
@@ -551,7 +551,7 @@ Rect2 Viewport::get_rect() const {
void Viewport::_update_listener() {
- if (is_inside_scene() && audio_listener && camera && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible()))) {
+ if (is_inside_tree() && audio_listener && camera && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible()))) {
SpatialSoundServer::get_singleton()->listener_set_space(listener,find_world()->get_sound_space());
} else {
SpatialSoundServer::get_singleton()->listener_set_space(listener,RID());
@@ -562,7 +562,7 @@ void Viewport::_update_listener() {
void Viewport::_update_listener_2d() {
- if (is_inside_scene() && audio_listener && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible())))
+ if (is_inside_tree() && audio_listener && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible())))
SpatialSound2DServer::get_singleton()->listener_set_space(listener_2d,find_world_2d()->get_sound_space());
else
SpatialSound2DServer::get_singleton()->listener_set_space(listener_2d,RID());
@@ -741,7 +741,7 @@ void Viewport::_propagate_enter_world(Node *p_node) {
if (p_node!=this) {
- if (!p_node->is_inside_scene()) //may not have entered scene yet
+ if (!p_node->is_inside_tree()) //may not have entered scene yet
return;
Spatial *s = p_node->cast_to<Spatial>();
@@ -770,7 +770,7 @@ void Viewport::_propagate_exit_world(Node *p_node) {
if (p_node!=this) {
- if (!p_node->is_inside_scene()) //may have exited scene already
+ if (!p_node->is_inside_tree()) //may have exited scene already
return;
Spatial *s = p_node->cast_to<Spatial>();
@@ -801,7 +801,7 @@ void Viewport::set_world(const Ref<World>& p_world) {
if (world==p_world)
return;
- if (is_inside_scene())
+ if (is_inside_tree())
_propagate_exit_world(this);
#ifndef _3D_DISABLED
@@ -811,7 +811,7 @@ void Viewport::set_world(const Ref<World>& p_world) {
world=p_world;
- if (is_inside_scene())
+ if (is_inside_tree())
_propagate_enter_world(this);
#ifndef _3D_DISABLED
@@ -821,7 +821,7 @@ void Viewport::set_world(const Ref<World>& p_world) {
//propagate exit
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());
}
@@ -909,12 +909,12 @@ void Viewport::set_as_render_target(bool p_enable){
render_target=p_enable;
VS::get_singleton()->viewport_set_as_render_target(viewport,p_enable);
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
if (p_enable)
- _vp_exit_scene();
+ _vp_exit_tree();
else
- _vp_enter_scene();
+ _vp_enter_tree();
}
if (p_enable) {
@@ -1102,24 +1102,24 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) {
void Viewport::input(const InputEvent& p_event) {
- ERR_FAIL_COND(!is_inside_scene());
- get_scene()->_call_input_pause(input_group,"_input",p_event);
- get_scene()->call_group(SceneMainLoop::GROUP_CALL_REVERSE|SceneMainLoop::GROUP_CALL_REALTIME|SceneMainLoop::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
+ ERR_FAIL_COND(!is_inside_tree());
+ get_tree()->_call_input_pause(input_group,"_input",p_event);
+ get_tree()->call_group(SceneTree::GROUP_CALL_REVERSE|SceneTree::GROUP_CALL_REALTIME|SceneTree::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
}
void Viewport::unhandled_input(const InputEvent& p_event) {
- ERR_FAIL_COND(!is_inside_scene());
+ ERR_FAIL_COND(!is_inside_tree());
- get_scene()->_call_input_pause(unhandled_input_group,"_unhandled_input",p_event);
+ get_tree()->_call_input_pause(unhandled_input_group,"_unhandled_input",p_event);
//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_input","_unhandled_input",ev);
- if (!get_scene()->input_handled && p_event.type==InputEvent::KEY) {
- get_scene()->_call_input_pause(unhandled_key_input_group,"_unhandled_key_input",p_event);
+ if (!get_tree()->input_handled && p_event.type==InputEvent::KEY) {
+ get_tree()->_call_input_pause(unhandled_key_input_group,"_unhandled_key_input",p_event);
//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_key_input","_unhandled_key_input",ev);
}
- if (physics_object_picking && !get_scene()->input_handled) {
+ if (physics_object_picking && !get_tree()->input_handled) {
if (p_event.type==InputEvent::MOUSE_BUTTON || p_event.type==InputEvent::MOUSE_MOTION || p_event.type==InputEvent::SCREEN_DRAG || p_event.type==InputEvent::SCREEN_TOUCH) {
physics_picking_events.push_back(p_event);
@@ -1134,7 +1134,7 @@ void Viewport::set_use_own_world(bool p_world) {
return;
- if (is_inside_scene())
+ if (is_inside_tree())
_propagate_exit_world(this);
#ifndef _3D_DISABLED
@@ -1147,7 +1147,7 @@ void Viewport::set_use_own_world(bool p_world) {
else
own_world=Ref<World>( memnew( World ));
- if (is_inside_scene())
+ if (is_inside_tree())
_propagate_enter_world(this);
#ifndef _3D_DISABLED
@@ -1157,7 +1157,7 @@ void Viewport::set_use_own_world(bool p_world) {
//propagate exit
- if (is_inside_scene()) {
+ if (is_inside_tree()) {
VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());
}
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 37f1b357c6..4bb5735731 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -159,8 +159,8 @@ friend class RenderTargetTexture;
_FORCE_INLINE_ Matrix32 _get_input_pre_xform() const;
- void _vp_enter_scene();
- void _vp_exit_scene();
+ void _vp_enter_tree();
+ void _vp_exit_tree();
void _vp_input(const InputEvent& p_ev);
void _vp_unhandled_input(const InputEvent& p_ev);
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 679f474ada..741deccdbe 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -566,7 +566,7 @@ void register_scene_types() {
ObjectTypeDB::register_type<PackedScene>();
- ObjectTypeDB::register_type<SceneMainLoop>();
+ ObjectTypeDB::register_type<SceneTree>();
OS::get_singleton()->yield(); //may take time to init
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index 1d99eb6d1f..df9b02ea3f 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -41,8 +41,8 @@ SceneStringNames::SceneStringNames() {
visibility_changed=StaticCString::create("visibility_changed");
input_event=StaticCString::create("input_event");
shader_shader=StaticCString::create("shader/shader");
- enter_scene=StaticCString::create("enter_scene");
- exit_scene=StaticCString::create("exit_scene");
+ enter_tree=StaticCString::create("enter_tree");
+ exit_tree=StaticCString::create("exit_tree");
item_rect_changed=StaticCString::create("item_rect_changed");
size_flags_changed=StaticCString::create("size_flags_changed");
minimum_size_changed=StaticCString::create("minimum_size_changed");
@@ -74,8 +74,8 @@ SceneStringNames::SceneStringNames() {
_fixed_process=StaticCString::create("_fixed_process");
_process=StaticCString::create("_process");
- _enter_scene=StaticCString::create("_enter_scene");
- _exit_scene=StaticCString::create("_exit_scene");
+ _enter_tree=StaticCString::create("_enter_tree");
+ _exit_tree=StaticCString::create("_exit_tree");
_enter_world=StaticCString::create("_enter_world");
_exit_world=StaticCString::create("_exit_world");
_ready=StaticCString::create("_ready");
@@ -98,8 +98,8 @@ SceneStringNames::SceneStringNames() {
enter_camera=StaticCString::create("enter_camera");
exit_camera=StaticCString::create("exit_camera");
- _body_enter_scene = StaticCString::create("_body_enter_scene");
- _body_exit_scene = StaticCString::create("_body_exit_scene");
+ _body_enter_tree = StaticCString::create("_body_enter_tree");
+ _body_exit_tree = StaticCString::create("_body_exit_tree");
_input_event=StaticCString::create("_input_event");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index dd4f8789c2..11799b9e86 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -56,8 +56,8 @@ public:
StringName _input_event;
StringName item_rect_changed;
StringName shader_shader;
- StringName enter_scene;
- StringName exit_scene;
+ StringName enter_tree;
+ StringName exit_tree;
StringName size_flags_changed;
StringName minimum_size_changed;
StringName idle;
@@ -89,8 +89,8 @@ public:
StringName _process;
StringName _enter_world;
StringName _exit_world;
- StringName _enter_scene;
- StringName _exit_scene;
+ StringName _enter_tree;
+ StringName _exit_tree;
StringName _draw;
StringName _input;
StringName _ready;
@@ -116,8 +116,8 @@ public:
StringName enter_camera;
StringName exit_camera;
- StringName _body_enter_scene;
- StringName _body_exit_scene;
+ StringName _body_enter_tree;
+ StringName _body_exit_tree;
StringName changed;
StringName _shader_changed;