From 3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33 Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Wed, 6 Jul 2016 19:04:21 +0200 Subject: Removed unused variables (second pass) + dead code Fixes various gcc 5.4.0 warnings for -Wunused-variable and -Wunused-but-set-variable --- tools/editor/scene_tree_dock.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'tools/editor/scene_tree_dock.cpp') diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 0d0d9ff95..4526fa26a 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -382,11 +382,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { ERR_FAIL_COND(!top_node->get_parent()); ERR_FAIL_COND(!bottom_node->get_parent()); - int top_node_pos = top_node->get_index(); int bottom_node_pos = bottom_node->get_index(); - - int top_node_pos_next = top_node_pos + (MOVING_DOWN ? 1 : -1); - int bottom_node_pos_next = bottom_node_pos + (MOVING_DOWN ? 1 : -1); + int top_node_pos_next = top_node->get_index() + (MOVING_DOWN ? 1 : -1); editor_data->get_undo_redo().add_do_method(top_node->get_parent(), "move_child", top_node, top_node_pos_next); editor_data->get_undo_redo().add_undo_method(bottom_node->get_parent(), "move_child", bottom_node, bottom_node_pos); @@ -1108,17 +1105,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to()->get_global_transform()); if (node->cast_to()) editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to()->get_global_transform()); - if (node->cast_to()) { - bool can_do_it=false; - Control *c=node->cast_to(); - if (c->get_parent()->cast_to()) - can_do_it=false; - for(int i=0;i<4;i++) { - if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN) - can_do_it=false; - } + if (node->cast_to()) editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to()->get_global_pos()); - } } editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners); @@ -1161,17 +1149,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to()->get_transform()); if (node->cast_to()) editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to()->get_transform()); - if (node->cast_to()) { - bool can_do_it=false; - Control *c=node->cast_to(); - if (c->get_parent()->cast_to()) - can_do_it=false; - for(int i=0;i<4;i++) { - if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN) - can_do_it=false; - } + if (node->cast_to()) editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to()->get_pos()); - } } -- cgit v1.2.3-70-g09d2