summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-12 09:25:34 +0100
committerGitHub <noreply@github.com>2018-12-12 09:25:34 +0100
commitc8a5400654ebc73c9af28d051f367b8eaa75212e (patch)
treef982f6204781746b460fb1909f90224433df744a /editor
parentecc588867482c0b32c3896591f55630baba1ef7c (diff)
parent08f22f1cf0e0d133b7ea763dc3886cf462c6fcb2 (diff)
Merge pull request #24241 from Rubonnek/move-to-initializer-list
Moved member variables to initializer list
Diffstat (limited to 'editor')
-rw-r--r--editor/collada/collada.h41
-rw-r--r--editor/editor_export.cpp9
-rw-r--r--editor/editor_export.h6
-rw-r--r--editor/editor_help_search.cpp22
-rw-r--r--editor/editor_plugin.cpp10
-rw-r--r--editor/editor_sectioned_inspector.cpp15
-rw-r--r--editor/editor_settings.h32
-rw-r--r--editor/import/editor_scene_importer_gltf.h28
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp10
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.h6
10 files changed, 82 insertions, 97 deletions
diff --git a/editor/collada/collada.h b/editor/collada/collada.h
index b777fa04c2..2d5819902c 100644
--- a/editor/collada/collada.h
+++ b/editor/collada/collada.h
@@ -110,14 +110,13 @@ public:
float z_near;
float z_far;
- CameraData() {
-
- mode = MODE_PERSPECTIVE;
- perspective.y_fov = 0;
+ CameraData() :
+ mode(MODE_PERSPECTIVE),
+ aspect(1),
+ z_near(0.1),
+ z_far(100) {
perspective.x_fov = 0;
- aspect = 1;
- z_near = 0.1;
- z_far = 100;
+ perspective.y_fov = 0;
}
};
@@ -141,16 +140,14 @@ public:
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;
+ 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) {
}
};
@@ -580,11 +577,11 @@ public:
float animation_length;
- State() {
- unit_scale = 1.0;
- up_axis = Vector3::AXIS_Y;
- import_flags = 0;
- animation_length = 0;
+ State() :
+ import_flags(0),
+ unit_scale(1.0),
+ up_axis(Vector3::AXIS_Y),
+ animation_length(0) {
}
} state;
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 9df0f30ca4..71315f1377 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -222,11 +222,10 @@ String EditorExportPreset::get_custom_features() const {
return custom_features;
}
-EditorExportPreset::EditorExportPreset() {
-
- export_path = "";
- export_filter = EXPORT_ALL_RESOURCES;
- runnable = false;
+EditorExportPreset::EditorExportPreset() :
+ export_filter(EXPORT_ALL_RESOURCES),
+ export_path(""),
+ runnable(false) {
}
///////////////////////////////////
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 483af489a3..881e86fb12 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -206,9 +206,9 @@ public:
PropertyInfo option;
Variant default_value;
- ExportOption(const PropertyInfo &p_info, const Variant &p_default) {
- option = p_info;
- default_value = p_default;
+ ExportOption(const PropertyInfo &p_info, const Variant &p_default) :
+ option(p_info),
+ default_value(p_default) {
}
ExportOption() {}
};
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index d6dc812d38..a9f7be0fff 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -579,18 +579,12 @@ bool EditorHelpSearch::Runner::work(uint64_t slot) {
return true;
}
-EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags) {
-
- ui_service = p_icon_service;
- results_tree = p_results_tree;
- term = p_term.strip_edges();
- search_flags = p_search_flags;
-
- if ((search_flags & SEARCH_CASE_SENSITIVE) == 0)
- term = term.to_lower();
-
- empty_icon = ui_service->get_icon("ArrowRight", "EditorIcons");
- disabled_color = ui_service->get_color("disabled_font_color", "Editor");
-
- phase = 0;
+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()),
+ search_flags(p_search_flags),
+ empty_icon(ui_service->get_icon("ArrowRight", "EditorIcons")),
+ disabled_color(ui_service->get_color("disabled_font_color", "Editor")) {
}
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 86b2db877e..cd024ff870 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -829,11 +829,11 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
}
-EditorPlugin::EditorPlugin() {
- undo_redo = NULL;
- input_event_forwarding_always_enabled = false;
- force_draw_over_forwarding_enabled = false;
- last_main_screen_name = "";
+EditorPlugin::EditorPlugin() :
+ undo_redo(NULL),
+ input_event_forwarding_always_enabled(false),
+ force_draw_over_forwarding_enabled(false),
+ last_main_screen_name("") {
}
EditorPlugin::~EditorPlugin() {
diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp
index 9d3ab59116..a28d071d77 100644
--- a/editor/editor_sectioned_inspector.cpp
+++ b/editor/editor_sectioned_inspector.cpp
@@ -298,19 +298,18 @@ EditorInspector *SectionedInspector::get_inspector() {
return inspector;
}
-SectionedInspector::SectionedInspector() {
-
- obj = -1;
-
- search_box = NULL;
-
+SectionedInspector::SectionedInspector() :
+ obj(-1),
+ sections(memnew(Tree)),
+ filter(memnew(SectionedInspectorFilter)),
+ inspector(memnew(EditorInspector)),
+ search_box(NULL) {
add_constant_override("autohide", 1); // Fixes the dragger always showing up
VBoxContainer *left_vb = memnew(VBoxContainer);
left_vb->set_custom_minimum_size(Size2(170, 0) * EDSCALE);
add_child(left_vb);
- sections = memnew(Tree);
sections->set_v_size_flags(SIZE_EXPAND_FILL);
sections->set_hide_root(true);
@@ -321,8 +320,6 @@ SectionedInspector::SectionedInspector() {
right_vb->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(right_vb);
- filter = memnew(SectionedInspectorFilter);
- inspector = memnew(EditorInspector);
inspector->set_v_size_flags(SIZE_EXPAND_FILL);
right_vb->add_child(inspector, true);
inspector->set_use_doc_hints(true);
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 7b0de9617c..dabe697f10 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -71,23 +71,23 @@ private:
bool hide_from_editor;
bool save;
bool restart_if_changed;
- VariantContainer() {
- variant = Variant();
- initial = Variant();
- order = 0;
- hide_from_editor = false;
- has_default_value = false;
- save = false;
- restart_if_changed = false;
+ VariantContainer() :
+ order(0),
+ variant(Variant()),
+ initial(Variant()),
+ has_default_value(false),
+ hide_from_editor(false),
+ save(false),
+ restart_if_changed(false) {
}
- VariantContainer(const Variant &p_variant, int p_order) {
- variant = p_variant;
- initial = Variant();
- order = p_order;
- hide_from_editor = false;
- has_default_value = false;
- save = false;
- restart_if_changed = false;
+ VariantContainer(const Variant &p_variant, int p_order) :
+ order(p_order),
+ variant(p_variant),
+ initial(Variant()),
+ has_default_value(false),
+ hide_from_editor(false),
+ save(false),
+ restart_if_changed(false) {
}
};
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
index 8258ec41fd..721db30112 100644
--- a/editor/import/editor_scene_importer_gltf.h
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -114,14 +114,14 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Vector<int> children;
Vector<Node *> godot_nodes;
- GLTFNode() {
- // child_of_skeleton = -1;
- // skeleton_skin = -1;
- mesh = -1;
- camera = -1;
- parent = -1;
- skin = -1;
- scale = Vector3(1, 1, 1);
+ GLTFNode() :
+ parent(-1),
+ mesh(-1),
+ camera(-1),
+ skin(-1),
+ //skeleton_skin(-1),
+ //child_of_skeleton(-1),
+ scale(Vector3(1, 1, 1)) {
}
};
@@ -134,12 +134,12 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
bool indices;
//matrices need to be transformed to this
- GLTFBufferView() {
- buffer = 0;
- byte_offset = 0;
- byte_length = 0;
- byte_stride = 0;
- indices = false;
+ GLTFBufferView() :
+ buffer(0),
+ byte_offset(0),
+ byte_length(0),
+ byte_stride(0),
+ indices(false) {
}
};
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index a85f4456f7..cc030dac4c 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -826,13 +826,11 @@ void AbstractPolygon2DEditorPlugin::make_visible(bool p_visible) {
}
}
-AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(EditorNode *p_node, AbstractPolygon2DEditor *p_polygon_editor, String p_class) {
-
- editor = p_node;
- polygon_editor = p_polygon_editor;
- klass = p_class;
+AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(EditorNode *p_node, AbstractPolygon2DEditor *p_polygon_editor, String p_class) :
+ polygon_editor(p_polygon_editor),
+ editor(p_node),
+ klass(p_class) {
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(polygon_editor);
-
polygon_editor->hide();
}
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h
index e2daefdec6..e7934ea3a0 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.h
+++ b/editor/plugins/animation_blend_tree_editor_plugin.h
@@ -70,9 +70,9 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
String name;
String type;
Ref<Script> script;
- AddOption(const String &p_name = String(), const String &p_type = String()) {
- name = p_name;
- type = p_type;
+ AddOption(const String &p_name = String(), const String &p_type = String()) :
+ name(p_name),
+ type(p_type) {
}
};