diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-12 08:56:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 08:56:07 +0100 |
commit | d1858cd7291ca1b17b8bf56260152e7110968c80 (patch) | |
tree | d463c182a3d2668973444ce1b935dd825cc530bf /editor | |
parent | a05f136fb0f3df5f2f9d511cb2bf6a6433f3f8cc (diff) | |
parent | ed337085cf0a211619688467d7a90222f23eff58 (diff) |
Merge pull request #23655 from ibrahn/uninit-cleanup-plugins
Fixed various uninitialised member variables in editor plugins.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 78 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h | 5 | ||||
-rw-r--r-- | editor/plugins/particles_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/skeleton_editor_plugin.cpp | 1 |
4 files changed, 46 insertions, 39 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index a0763e03f1..1add99bdcc 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4504,6 +4504,46 @@ void CanvasItemEditor::focus_selection() { CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { + key_pos = true; + key_rot = true; + key_scale = false; + + show_grid = false; + show_origin = true; + show_viewport = true; + show_helpers = false; + show_rulers = true; + show_guides = true; + show_edit_locks = true; + zoom = 1; + view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH); + previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen + grid_offset = Point2(); + grid_step = Point2(10, 10); + grid_step_multiplier = 0; + snap_rotation_offset = 0; + snap_rotation_step = 15 / (180 / Math_PI); + snap_active = false; + snap_node_parent = true; + snap_node_anchors = true; + snap_node_sides = true; + snap_node_center = true; + snap_other_nodes = true; + snap_grid = true; + snap_guides = true; + snap_rotation = false; + snap_pixel = false; + + skeleton_show_bones = true; + + drag_type = DRAG_NONE; + drag_from = Vector2(); + drag_to = Vector2(); + dragged_guide_pos = Point2(); + dragged_guide_index = -1; + + bone_last_frame = 0; + bone_list_dirty = false; tool = TOOL_SELECT; undo_redo = p_editor->get_undo_redo(); @@ -4826,49 +4866,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { multiply_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/multiply_grid_step", TTR("Multiply grid step by 2"), KEY_KP_MULTIPLY); divide_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/divide_grid_step", TTR("Divide grid step by 2"), KEY_KP_DIVIDE); - key_pos = true; - key_rot = true; - key_scale = false; - - show_grid = false; - show_origin = true; - show_viewport = true; - show_helpers = false; - show_rulers = true; - show_guides = true; - show_edit_locks = true; - zoom = 1; - view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH); - previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen - grid_offset = Point2(); - grid_step = Point2(10, 10); - grid_step_multiplier = 0; - snap_rotation_offset = 0; - snap_rotation_step = 15 / (180 / Math_PI); - snap_active = false; - snap_node_parent = true; - snap_node_anchors = true; - snap_node_sides = true; - snap_node_center = true; - snap_other_nodes = true; - snap_grid = true; - snap_guides = true; - snap_rotation = false; - snap_pixel = false; - skeleton_show_bones = true; skeleton_menu->get_popup()->set_item_checked(skeleton_menu->get_popup()->get_item_index(SKELETON_SHOW_BONES), true); singleton = this; set_process_unhandled_key_input(true); - drag_type = DRAG_NONE; - drag_from = Vector2(); - drag_to = Vector2(); - dragged_guide_pos = Point2(); - dragged_guide_index = -1; - - bone_last_frame = 0; - // Update the menus' checkboxes call_deferred("set_state", get_state()); } diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 59777fb085..f71eb1b605 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -64,7 +64,10 @@ public: Dictionary undo_state; - CanvasItemEditorSelectedItem() { prev_rot = 0; } + CanvasItemEditorSelectedItem() : + prev_anchors() { + prev_rot = 0; + } }; class CanvasItemEditor : public VBoxContainer { diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 6b41946918..f2dfae7a9f 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -453,6 +453,7 @@ void ParticlesEditor::_bind_methods() { ParticlesEditor::ParticlesEditor() { + node = NULL; particles_editor_hb = memnew(HBoxContainer); SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); options = memnew(MenuButton); diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp index e7d9f1b702..8b0beefb3e 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_editor_plugin.cpp @@ -151,6 +151,7 @@ void SkeletonEditor::_bind_methods() { } SkeletonEditor::SkeletonEditor() { + skeleton = NULL; options = memnew(MenuButton); SpatialEditor::get_singleton()->add_control_to_menu_panel(options); |