summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp32
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.h23
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h17
-rw-r--r--editor/plugins/physical_bone_3d_editor_plugin.cpp6
-rw-r--r--editor/plugins/physical_bone_3d_editor_plugin.h6
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.h5
-rw-r--r--editor/plugins/tile_map_editor_plugin.h29
7 files changed, 37 insertions, 81 deletions
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;