diff options
Diffstat (limited to 'editor')
25 files changed, 173 insertions, 330 deletions
diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h index e1dfbefcf3..f0ee7a2535 100644 --- a/editor/debugger/editor_debugger_inspector.h +++ b/editor/debugger/editor_debugger_inspector.h @@ -61,7 +61,7 @@ public: void update() { _change_notify(); } - EditorDebuggerRemoteObject(){}; + EditorDebuggerRemoteObject() {} }; class EditorDebuggerInspector : public EditorInspector { diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h index 7546febd05..88b82d37fd 100644 --- a/editor/debugger/editor_debugger_node.h +++ b/editor/debugger/editor_debugger_node.h @@ -76,7 +76,7 @@ private: return line < p_b.line; } - Breakpoint(){}; + Breakpoint() {} Breakpoint(const String &p_source, int p_line) { line = p_line; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index c80ae5f21b..39c94cc523 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1480,11 +1480,7 @@ void EditorAudioMeterNotches::_draw_audio_notches() { } } -EditorAudioMeterNotches::EditorAudioMeterNotches() : - line_length(5.0f), - label_space(2.0f), - btm_padding(9.0f), - top_padding(5.0f) { +EditorAudioMeterNotches::EditorAudioMeterNotches() { notch_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1, 1, 1) : Color(0, 0, 0); } diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index be1551629d..3e911bcc65 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -246,10 +246,10 @@ private: List<AudioNotch> notches; public: - float line_length; - float label_space; - float btm_padding; - float top_padding; + float line_length = 5.0f; + float label_space = 2.0f; + float btm_padding = 9.0f; + float top_padding = 5.0f; Color notch_color; void add_notch(float p_normalized_offset, float p_db_value, bool p_render_value = false); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 24a69fe003..62996caa3d 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -252,13 +252,6 @@ String EditorExportPreset::get_script_encryption_key() const { return script_key; } -EditorExportPreset::EditorExportPreset() : - export_filter(EXPORT_ALL_RESOURCES), - export_path(""), - runnable(false), - script_mode(MODE_SCRIPT_COMPILED) { -} - /////////////////////////////////// void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) { diff --git a/editor/editor_export.h b/editor/editor_export.h index 50d1ff66c6..1dedc21350 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -61,14 +61,14 @@ public: private: Ref<EditorExportPlatform> platform; - ExportFilter export_filter; + ExportFilter export_filter = EXPORT_ALL_RESOURCES; String include_filter; String exclude_filter; String export_path; String exporter; Set<String> selected_files; - bool runnable; + bool runnable = false; Vector<String> patches; @@ -82,7 +82,7 @@ private: String custom_features; - int script_mode; + int script_mode = MODE_SCRIPT_COMPILED; String script_key; protected: @@ -136,7 +136,7 @@ public: const List<PropertyInfo> &get_properties() const { return properties; } - EditorExportPreset(); + EditorExportPreset() {} }; struct SharedObject { diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 01a50cad2c..1a865de23d 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -595,7 +595,6 @@ bool EditorHelpSearch::Runner::work(uint64_t slot) { } EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags) : - phase(0), ui_service(p_icon_service), results_tree(p_results_tree), term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()), diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index feff96d2e5..9f58c7244f 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -95,7 +95,7 @@ class EditorHelpSearch::Runner : public Reference { PHASE_SELECT_MATCH, PHASE_MAX }; - int phase; + int phase = 0; struct ClassMatch { DocData::ClassDoc *doc; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 42eef2d130..c38f705c1b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -42,7 +42,6 @@ #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/path_remap.h" #include "core/print_string.h" #include "core/project_settings.h" #include "core/translation.h" diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 746ebc8292..8689cad45b 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -913,16 +913,6 @@ void EditorPlugin::_bind_methods() { BIND_ENUM_CONSTANT(DOCK_SLOT_MAX); } -EditorPlugin::EditorPlugin() : - undo_redo(nullptr), - input_event_forwarding_always_enabled(false), - force_draw_over_forwarding_enabled(false), - last_main_screen_name("") { -} - -EditorPlugin::~EditorPlugin() { -} - EditorPluginCreateFunc EditorPlugins::creation_funcs[MAX_CREATE_FUNCS]; int EditorPlugins::creation_func_count = 0; diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 2ca96ceed2..a939d58752 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -113,12 +113,12 @@ class EditorPlugin : public Node { GDCLASS(EditorPlugin, Node); friend class EditorData; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; UndoRedo *_get_undo_redo() { return undo_redo; } - bool input_event_forwarding_always_enabled; - bool force_draw_over_forwarding_enabled; + bool input_event_forwarding_always_enabled = false; + bool force_draw_over_forwarding_enabled = false; String last_main_screen_name; @@ -242,8 +242,8 @@ public: void enable_plugin(); void disable_plugin(); - EditorPlugin(); - virtual ~EditorPlugin(); + EditorPlugin() {} + virtual ~EditorPlugin() {} }; VARIANT_ENUM_CAST(EditorPlugin::CustomControlContainer); diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index bccc38ca1b..3bb7072eac 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -29,7 +29,9 @@ /*************************************************************************/ #include "editor_sectioned_inspector.h" + #include "editor_scale.h" + class SectionedInspectorFilter : public Object { GDCLASS(SectionedInspectorFilter, Object); @@ -307,8 +309,7 @@ EditorInspector *SectionedInspector::get_inspector() { SectionedInspector::SectionedInspector() : sections(memnew(Tree)), filter(memnew(SectionedInspectorFilter)), - inspector(memnew(EditorInspector)), - search_box(nullptr) { + inspector(memnew(EditorInspector)) { add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up VBoxContainer *left_vb = memnew(VBoxContainer); diff --git a/editor/editor_sectioned_inspector.h b/editor/editor_sectioned_inspector.h index 7073b73751..f01e6e250e 100644 --- a/editor/editor_sectioned_inspector.h +++ b/editor/editor_sectioned_inspector.h @@ -48,7 +48,7 @@ class SectionedInspector : public HSplitContainer { Map<String, TreeItem *> section_map; EditorInspector *inspector; - LineEdit *search_box; + LineEdit *search_box = nullptr; String selected_category; diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 29b89ef1a8..8f1a3c8333 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -64,27 +64,19 @@ public: private: struct VariantContainer { - int order; + int order = 0; Variant variant; Variant initial; - bool has_default_value; - bool hide_from_editor; - bool save; - bool restart_if_changed; - VariantContainer() : - order(0), - has_default_value(false), - hide_from_editor(false), - save(false), - restart_if_changed(false) { - } + bool has_default_value = false; + bool hide_from_editor = false; + bool save = false; + bool restart_if_changed = false; + + VariantContainer() {} + VariantContainer(const Variant &p_variant, int p_order) : order(p_order), - variant(p_variant), - has_default_value(false), - hide_from_editor(false), - save(false), - restart_if_changed(false) { + variant(p_variant) { } }; diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 6d2d8510d1..08c2124ae8 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -148,11 +148,9 @@ private: class FileOrFolder { public: String path; - bool is_file; + bool is_file = false; - FileOrFolder() : - path(""), - is_file(false) {} + FileOrFolder() {} FileOrFolder(const String &p_path, bool p_is_file) : path(p_path), is_file(p_is_file) {} diff --git a/editor/import/collada.h b/editor/import/collada.h index b74332fb22..187a8092da 100644 --- a/editor/import/collada.h +++ b/editor/import/collada.h @@ -61,26 +61,22 @@ public: struct Channel { - int uv_idx; + int uv_idx = 0; String texture; Color color; - Channel() { uv_idx = 0; } + Channel() {} }; Channel diffuse, specular, emission, bump; - float shininess; - bool found_double_sided; - bool double_sided; - bool unshaded; + float shininess = 40; + bool found_double_sided = false; + bool double_sided = true; + bool unshaded = false; String get_texture_path(const String &p_source, Collada &state) const; Effect() { diffuse.color = Color(1, 1, 1, 1); - double_sided = true; - found_double_sided = false; - shininess = 40; - unshaded = false; } }; @@ -91,31 +87,24 @@ public: MODE_ORTHOGONAL }; - Mode mode; + Mode mode = MODE_PERSPECTIVE; union { struct { - float x_fov; - float y_fov; + float x_fov = 0; + float y_fov = 0; } perspective; struct { - float x_mag; - float y_mag; + float x_mag = 0; + float y_mag = 0; } orthogonal; }; - float aspect; - float z_near; - float z_far; - - CameraData() : - mode(MODE_PERSPECTIVE), - aspect(1), - z_near(0.1), - z_far(100) { - perspective.x_fov = 0; - perspective.y_fov = 0; - } + float aspect = 1; + float z_near = 0.1; + float z_far = 100; + + CameraData() {} }; struct LightData { @@ -127,26 +116,18 @@ public: MODE_SPOT }; - Mode mode; + Mode mode = MODE_AMBIENT; - Color color; + Color color = Color(1, 1, 1, 1); - float constant_att; - float linear_att; - float quad_att; - - float spot_angle; - float spot_exp; - - LightData() : - mode(MODE_AMBIENT), - color(Color(1, 1, 1, 1)), - constant_att(0), - linear_att(0), - quad_att(0), - spot_angle(45), - spot_exp(1) { - } + float constant_att = 0; + float linear_att = 0; + float quad_att = 0; + + float spot_angle = 45; + float spot_exp = 1; + + LightData() {} }; struct MeshData { @@ -185,19 +166,16 @@ public: Vector<Primitives> primitives; - bool found_double_sided; - bool double_sided; + bool found_double_sided = false; + bool double_sided = true; - MeshData() { - found_double_sided = false; - double_sided = true; - } + MeshData() {} }; struct CurveData { String name; - bool closed; + bool closed = false; struct Source { @@ -210,15 +188,13 @@ public: Map<String, String> control_vertices; - CurveData() { - - closed = false; - } + CurveData() {} }; + struct SkinControllerData { String base; - bool use_idrefs; + bool use_idrefs = false; Transform bind_shape; @@ -226,10 +202,8 @@ public: Vector<String> sarray; //maybe for names Vector<float> array; - int stride; - Source() { - stride = 1; - } + int stride = 1; + Source() {} }; Map<String, Source> sources; @@ -256,7 +230,7 @@ public: Map<String, Transform> bone_rest_map; - SkinControllerData() { use_idrefs = false; } + SkinControllerData() {} }; struct MorphControllerData { @@ -266,10 +240,10 @@ public: struct Source { - int stride; + int stride = 1; Vector<String> sarray; //maybe for names Vector<float> array; - Source() { stride = 1; } + Source() {} }; Map<String, Source> sources; @@ -280,14 +254,14 @@ public: struct Vertex { - int idx; + int idx = 0; Vector3 vertex; Vector3 normal; Vector3 uv; Vector3 uv2; Plane tangent; Color color; - int uid; + int uid = 0; struct Weight { int bone_idx; float weight; @@ -350,11 +324,9 @@ public: return uid < p_vert.uid; } - Vertex() { - uid = 0; - idx = 0; - } + Vertex() {} }; + struct Node { enum Type { @@ -382,31 +354,26 @@ public: Vector<float> data; }; - Type type; + Type type = TYPE_NODE; String name; String id; String empty_draw_type; - bool noname; + bool noname = false; Vector<XForm> xform_list; Transform default_transform; Transform post_transform; Vector<Node *> children; - Node *parent; + Node *parent = nullptr; Transform compute_transform(Collada &state) const; Transform get_global_transform() const; Transform get_transform() const; - bool ignore_anim; + bool ignore_anim = false; - Node() { - noname = false; - type = TYPE_NODE; - parent = nullptr; - ignore_anim = false; - } + Node() {} virtual ~Node() { for (int i = 0; i < children.size(); i++) memdelete(children[i]); @@ -420,11 +387,10 @@ public: struct NodeJoint : public Node { - NodeSkeleton *owner; + NodeSkeleton *owner = nullptr; String sid; NodeJoint() { type = TYPE_JOINT; - owner = nullptr; } }; @@ -471,14 +437,11 @@ public: struct AnimationClip { String name; - float begin; - float end; + float begin = 0; + float end = 1; Vector<String> tracks; - AnimationClip() { - begin = 0; - end = 1; - } + AnimationClip() {} }; struct AnimationTrack { @@ -487,7 +450,7 @@ public: String target; String param; String component; - bool property; + bool property = false; enum InterpolationType { INTERP_LINEAR, @@ -505,16 +468,16 @@ public: Vector<float> data; Point2 in_tangent; Point2 out_tangent; - InterpolationType interp_type; + InterpolationType interp_type = INTERP_LINEAR; - Key() { interp_type = INTERP_LINEAR; } + Key() {} }; Vector<float> get_value_at_time(float p_time) const; Vector<Key> keys; - AnimationTrack() { property = false; } + AnimationTrack() {} }; /****************/ @@ -523,10 +486,10 @@ public: struct State { - int import_flags; + int import_flags = 0; - float unit_scale; - Vector3::Axis up_axis; + float unit_scale = 1.0; + Vector3::Axis up_axis = Vector3::AXIS_Y; bool z_up; struct Version { @@ -573,14 +536,9 @@ public: Map<String, Vector<int>> referenced_tracks; Map<String, Vector<int>> by_id_tracks; - float animation_length; + float animation_length = 0; - State() : - import_flags(0), - unit_scale(1.0), - up_axis(Vector3::AXIS_Y), - animation_length(0) { - } + State() {} } state; Error load(const String &p_path, int p_flags = 0); diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index d127a87782..86d7e627a3 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -94,90 +94,60 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { struct GLTFNode { //matrices need to be transformed to this - GLTFNodeIndex parent; - int height; + GLTFNodeIndex parent = -1; + int height = -1; Transform xform; String name; - GLTFMeshIndex mesh; - GLTFCameraIndex camera; - GLTFSkinIndex skin; + GLTFMeshIndex mesh = -1; + GLTFCameraIndex camera = -1; + GLTFSkinIndex skin = -1; - GLTFSkeletonIndex skeleton; - bool joint; + GLTFSkeletonIndex skeleton = -1; + bool joint = false; Vector3 translation; Quat rotation; - Vector3 scale; + Vector3 scale = Vector3(1, 1, 1); Vector<int> children; - GLTFNodeIndex fake_joint_parent; - - GLTFNode() : - parent(-1), - height(-1), - mesh(-1), - camera(-1), - skin(-1), - skeleton(-1), - joint(false), - translation(0, 0, 0), - scale(Vector3(1, 1, 1)), - fake_joint_parent(-1) {} + GLTFNodeIndex fake_joint_parent = -1; + + GLTFNode() {} }; struct GLTFBufferView { - GLTFBufferIndex buffer; - int byte_offset; - int byte_length; - int byte_stride; - bool indices; + GLTFBufferIndex buffer = -1; + int byte_offset = 0; + int byte_length = 0; + int byte_stride = 0; + bool indices = false; //matrices need to be transformed to this - GLTFBufferView() : - buffer(-1), - byte_offset(0), - byte_length(0), - byte_stride(0), - indices(false) { - } + GLTFBufferView() {} }; struct GLTFAccessor { - GLTFBufferViewIndex buffer_view; - int byte_offset; - int component_type; - bool normalized; - int count; + GLTFBufferViewIndex buffer_view = 0; + int byte_offset = 0; + int component_type = 0; + bool normalized = false; + int count = 0; GLTFType type; - float min; - float max; - int sparse_count; - int sparse_indices_buffer_view; - int sparse_indices_byte_offset; - int sparse_indices_component_type; - int sparse_values_buffer_view; - int sparse_values_byte_offset; - - GLTFAccessor() { - buffer_view = 0; - byte_offset = 0; - component_type = 0; - normalized = false; - count = 0; - min = 0; - max = 0; - sparse_count = 0; - sparse_indices_buffer_view = 0; - sparse_indices_byte_offset = 0; - sparse_indices_component_type = 0; - sparse_values_buffer_view = 0; - sparse_values_byte_offset = 0; - } + float min = 0; + float max = 0; + int sparse_count = 0; + int sparse_indices_buffer_view = 0; + int sparse_indices_byte_offset = 0; + int sparse_indices_component_type = 0; + int sparse_values_buffer_view = 0; + int sparse_values_byte_offset = 0; + + GLTFAccessor() {} }; struct GLTFTexture { GLTFImageIndex src_image; @@ -192,21 +162,19 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { Vector<GLTFNodeIndex> roots; // The created Skeleton for the scene - Skeleton3D *godot_skeleton; + Skeleton3D *godot_skeleton = nullptr; // Set of unique bone names for the skeleton Set<String> unique_names; - GLTFSkeleton() : - godot_skeleton(nullptr) { - } + GLTFSkeleton() {} }; struct GLTFSkin { String name; // The "skeleton" property defined in the gltf spec. -1 = Scene Root - GLTFNodeIndex skin_root; + GLTFNodeIndex skin_root = -1; Vector<GLTFNodeIndex> joints_original; Vector<Transform> inverse_binds; @@ -226,7 +194,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { Vector<GLTFNodeIndex> roots; // The GLTF Skeleton this Skin points to (after we determine skeletons) - GLTFSkeletonIndex skeleton; + GLTFSkeletonIndex skeleton = -1; // A mapping from the joint indices (in the order of joints_original) to the // Godot Skeleton's bone_indices @@ -237,9 +205,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { // to the generated skeleton for the mesh instances. Ref<Skin> godot_skin; - GLTFSkin() : - skin_root(-1), - skeleton(-1) {} + GLTFSkin() {} }; struct GLTFMesh { @@ -249,17 +215,12 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { struct GLTFCamera { - bool perspective; - float fov_size; - float zfar; - float znear; + bool perspective = true; + float fov_size = 64; + float zfar = 500; + float znear = 0.1; - GLTFCamera() { - perspective = true; - fov_size = 65; - zfar = 500; - znear = 0.1; - } + GLTFCamera() {} }; struct GLTFAnimation { diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index c26daa3857..beb3d760c0 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -34,24 +34,6 @@ #include "core/os/keyboard.h" #include "editor/editor_scale.h" -AbstractPolygon2DEditor::Vertex::Vertex() : - polygon(-1), - vertex(-1) { - // invalid vertex -} - -AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex) : - polygon(-1), - vertex(p_vertex) { - // vertex p_vertex of current wip polygon -} - -AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex) : - polygon(p_polygon), - vertex(p_vertex) { - // vertex p_vertex of polygon p_polygon -} - bool AbstractPolygon2DEditor::Vertex::operator==(const AbstractPolygon2DEditor::Vertex &p_vertex) const { return polygon == p_vertex.polygon && vertex == p_vertex.vertex; @@ -67,20 +49,6 @@ bool AbstractPolygon2DEditor::Vertex::valid() const { return vertex >= 0; } -AbstractPolygon2DEditor::PosVertex::PosVertex() { - // invalid vertex -} - -AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) : - Vertex(p_vertex.polygon, p_vertex.vertex), - pos(p_pos) { -} - -AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) : - Vertex(p_polygon, p_vertex), - pos(p_pos) { -} - bool AbstractPolygon2DEditor::_is_empty() const { if (!_get_node()) diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h index 6ed6d0a257..7d4a3a0f98 100644 --- a/editor/plugins/abstract_polygon_2d_editor.h +++ b/editor/plugins/abstract_polygon_2d_editor.h @@ -47,23 +47,30 @@ class AbstractPolygon2DEditor : public HBoxContainer { ToolButton *button_delete; struct Vertex { - Vertex(); - Vertex(int p_vertex); - Vertex(int p_polygon, int p_vertex); + Vertex() {} + Vertex(int p_vertex) : + vertex(p_vertex) {} + Vertex(int p_polygon, int p_vertex) : + polygon(p_polygon), + vertex(p_vertex) {} bool operator==(const Vertex &p_vertex) const; bool operator!=(const Vertex &p_vertex) const; bool valid() const; - int polygon; - int vertex; + int polygon = -1; + int vertex = -1; }; struct PosVertex : public Vertex { - PosVertex(); - PosVertex(const Vertex &p_vertex, const Vector2 &p_pos); - PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos); + PosVertex() {} + PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) : + Vertex(p_vertex.polygon, p_vertex.vertex), + pos(p_pos) {} + PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) : + Vertex(p_polygon, p_vertex), + pos(p_pos) {} Vector2 pos; }; diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 9f1a92f563..77f23dfd6d 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -48,10 +48,10 @@ class CanvasItemEditorSelectedItem : public Object { public: Transform2D prev_xform; - float prev_rot; + float prev_rot = 0; Rect2 prev_rect; Vector2 prev_pivot; - float prev_anchors[4]; + float prev_anchors[4] = { 0.0f }; Transform2D pre_drag_xform; Rect2 pre_drag_rect; @@ -61,10 +61,7 @@ public: Dictionary undo_state; - CanvasItemEditorSelectedItem() : - prev_anchors() { - prev_rot = 0; - } + CanvasItemEditorSelectedItem() {} }; class CanvasItemEditor : public VBoxContainer { @@ -314,12 +311,10 @@ private: struct BoneList { Transform2D xform; - float length; - uint64_t last_pass; + float length = 0.f; + uint64_t last_pass = 0; - BoneList() : - length(0.f), - last_pass(0) {} + BoneList() {} }; uint64_t bone_last_frame; diff --git a/editor/plugins/physical_bone_3d_editor_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index 6d38f7f318..567d58922f 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -48,8 +48,7 @@ void PhysicalBone3DEditor::_set_move_joint() { } PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) : - editor(p_editor), - selected(nullptr) { + editor(p_editor) { spatial_editor_hb = memnew(HBoxContainer); spatial_editor_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -69,8 +68,6 @@ PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) : hide(); } -PhysicalBone3DEditor::~PhysicalBone3DEditor() {} - void PhysicalBone3DEditor::set_selected(PhysicalBone3D *p_pb) { button_transform_joint->set_pressed(false); @@ -90,7 +87,6 @@ void PhysicalBone3DEditor::show() { PhysicalBone3DEditorPlugin::PhysicalBone3DEditorPlugin(EditorNode *p_editor) : editor(p_editor), - selected(nullptr), physical_bone_editor(editor) {} void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) { diff --git a/editor/plugins/physical_bone_3d_editor_plugin.h b/editor/plugins/physical_bone_3d_editor_plugin.h index 74932710d6..79c7cc4bb1 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.h +++ b/editor/plugins/physical_bone_3d_editor_plugin.h @@ -40,7 +40,7 @@ class PhysicalBone3DEditor : public Object { HBoxContainer *spatial_editor_hb; ToolButton *button_transform_joint; - PhysicalBone3D *selected; + PhysicalBone3D *selected = nullptr; protected: static void _bind_methods(); @@ -51,7 +51,7 @@ private: public: PhysicalBone3DEditor(EditorNode *p_editor); - ~PhysicalBone3DEditor(); + ~PhysicalBone3DEditor() {} void set_selected(PhysicalBone3D *p_pb); @@ -63,7 +63,7 @@ class PhysicalBone3DEditorPlugin : public EditorPlugin { GDCLASS(PhysicalBone3DEditorPlugin, EditorPlugin); EditorNode *editor; - PhysicalBone3D *selected; + PhysicalBone3D *selected = nullptr; PhysicalBone3DEditor physical_bone_editor; public: diff --git a/editor/plugins/skeleton_3d_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h index 2ba5a817bc..1bcf27e2f2 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.h +++ b/editor/plugins/skeleton_3d_editor_plugin.h @@ -46,10 +46,9 @@ class Skeleton3DEditor : public Node { }; struct BoneInfo { - PhysicalBone3D *physical_bone; + PhysicalBone3D *physical_bone = nullptr; Transform relative_rest; // Relative to skeleton node - BoneInfo() : - physical_bone(nullptr) {} + BoneInfo() {} }; Skeleton3D *skeleton; diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index f43e5bb5cb..28b0e9b6db 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" - #include "scene/2d/tile_map.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" @@ -127,34 +126,26 @@ class TileMapEditor : public VBoxContainer { List<Point2i> bucket_queue; struct CellOp { - int idx; - bool xf; - bool yf; - bool tr; + int idx = TileMap::INVALID_CELL; + bool xf = false; + bool yf = false; + bool tr = false; Vector2 ac; - CellOp() : - idx(TileMap::INVALID_CELL), - xf(false), - yf(false), - tr(false) {} + CellOp() {} }; Map<Point2i, CellOp> paint_undo; struct TileData { Point2i pos; - int cell; - bool flip_h; - bool flip_v; - bool transpose; + int cell = TileMap::INVALID_CELL; + bool flip_h = false; + bool flip_v = false; + bool transpose = false; Point2i autotile_coord; - TileData() : - cell(TileMap::INVALID_CELL), - flip_h(false), - flip_v(false), - transpose(false) {} + TileData() {} }; List<TileData> copydata; diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h index 194dd57648..280bd00d95 100644 --- a/editor/rename_dialog.h +++ b/editor/rename_dialog.h @@ -48,7 +48,7 @@ class RenameDialog : public ConfirmationDialog { GDCLASS(RenameDialog, ConfirmationDialog); virtual void ok_pressed() { rename(); }; - void _cancel_pressed(){}; + void _cancel_pressed() {} void _features_toggled(bool pressed); void _insert_text(String text); void _update_substitute(); @@ -111,7 +111,7 @@ public: void rename(); RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo = nullptr); - ~RenameDialog(){}; + ~RenameDialog() {} }; #endif |