diff --git a/editor/animation_bezier_editor.h b/editor/animation_bezier_editor.h index 44b6f8889a..7e92a9eb0e 100644 --- a/editor/animation_bezier_editor.h +++ b/editor/animation_bezier_editor.h @@ -49,16 +49,16 @@ class AnimationBezierTrackEdit : public Control { }; HandleMode handle_mode; - OptionButton *handle_mode_option; + OptionButton *handle_mode_option = nullptr; - AnimationTimelineEdit *timeline; - UndoRedo *undo_redo; - Node *root; - Control *play_position; //separate control used to draw so updates for only position changed are much faster - float play_position_pos; + AnimationTimelineEdit *timeline = nullptr; + UndoRedo *undo_redo = nullptr; + Node *root = nullptr; + Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster + float play_position_pos = 0.0; Ref animation; - int track; + int track = 0; Vector view_rects; @@ -70,37 +70,37 @@ class AnimationBezierTrackEdit : public Control { Map subtracks; - float v_scroll; - float v_zoom; + float v_scroll = 0.0; + float v_zoom = 0.0; - PopupMenu *menu; + PopupMenu *menu = nullptr; void _zoom_changed(); void _gui_input(const Ref &p_event); void _menu_selected(int p_index); - bool *block_animation_update_ptr; //used to block all tracks re-gen (speed up) + bool *block_animation_update_ptr = nullptr; //used to block all tracks re-gen (speed up) void _play_position_draw(); Vector2 insert_at_pos; - bool moving_selection_attempt; - int select_single_attempt; - bool moving_selection; - int moving_selection_from_key; + bool moving_selection_attempt = false; + int select_single_attempt = 0; + bool moving_selection = false; + int moving_selection_from_key = 0; Vector2 moving_selection_offset; - bool box_selecting_attempt; - bool box_selecting; - bool box_selecting_add; + bool box_selecting_attempt = false; + bool box_selecting = false; + bool box_selecting_add = false; Vector2 box_selection_from; Vector2 box_selection_to; - int moving_handle; //0 no move -1 or +1 out - int moving_handle_key; + int moving_handle = 0; //0 no move -1 or +1 out + int moving_handle_key = 0; Vector2 moving_handle_left; Vector2 moving_handle_right; @@ -111,13 +111,13 @@ class AnimationBezierTrackEdit : public Control { Vector2 menu_insert_key; struct AnimMoveRestore { - int track; - float time; + int track = 0; + float time = 0.0; Variant key; - float transition; + float transition = 0.0; }; - AnimationTrackEditor *editor; + AnimationTrackEditor *editor = nullptr; struct EditPoint { Rect2 point_rect; @@ -129,9 +129,9 @@ class AnimationBezierTrackEdit : public Control { Set selection; - bool panning_timeline; - float panning_timeline_from; - float panning_timeline_at; + bool panning_timeline = false; + float panning_timeline_from = 0.0; + float panning_timeline_at = 0.0; void _draw_line_clipped(const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, int p_clip_left, int p_clip_right); void _draw_track(int p_track, const Color &p_color); diff --git a/editor/animation_track_editor_plugins.h b/editor/animation_track_editor_plugins.h index a697c29bf8..f0d2731b10 100644 --- a/editor/animation_track_editor_plugins.h +++ b/editor/animation_track_editor_plugins.h @@ -81,7 +81,7 @@ class AnimationTrackEditSpriteFrame : public AnimationTrackEdit { GDCLASS(AnimationTrackEditSpriteFrame, AnimationTrackEdit); ObjectID id; - bool is_coords; + bool is_coords = false; public: virtual int get_key_height() const; @@ -114,11 +114,11 @@ class AnimationTrackEditTypeAudio : public AnimationTrackEdit { void _preview_changed(ObjectID p_which); - bool len_resizing; - bool len_resizing_start; - int len_resizing_index; - float len_resizing_from_px; - float len_resizing_rel; + bool len_resizing = false; + bool len_resizing_start = false; + int len_resizing_index = 0; + float len_resizing_from_px = 0.0; + float len_resizing_rel = 0.0; protected: static void _bind_methods(); diff --git a/editor/array_property_edit.h b/editor/array_property_edit.h index dd495b57f4..da6530dc82 100644 --- a/editor/array_property_edit.h +++ b/editor/array_property_edit.h @@ -36,7 +36,7 @@ class ArrayPropertyEdit : public Reference { GDCLASS(ArrayPropertyEdit, Reference); - int page; + int page = 0; ObjectID obj; StringName property; String vtypes; diff --git a/editor/audio_stream_preview.h b/editor/audio_stream_preview.h index 4725fb727c..a4590bf03a 100644 --- a/editor/audio_stream_preview.h +++ b/editor/audio_stream_preview.h @@ -40,7 +40,7 @@ class AudioStreamPreview : public Reference { GDCLASS(AudioStreamPreview, Reference); friend class AudioStream; Vector preview; - float length; + float length = 0.0; friend class AudioStreamPreviewGenerator; @@ -63,7 +63,7 @@ class AudioStreamPreviewGenerator : public Node { Ref playback; SafeFlag generating; ObjectID id; - Thread *thread; + Thread *thread = nullptr; // Needed for the bookkeeping of the Map Preview &operator=(const Preview &p_rhs) { diff --git a/editor/code_editor.h b/editor/code_editor.h index 13feea3a7d..c66b6b169e 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -43,10 +43,10 @@ class GotoLineDialog : public ConfirmationDialog { GDCLASS(GotoLineDialog, ConfirmationDialog); - Label *line_label; - LineEdit *line; + Label *line_label = nullptr; + LineEdit *line = nullptr; - TextEdit *text_editor; + TextEdit *text_editor = nullptr; virtual void ok_pressed(); @@ -61,31 +61,31 @@ public: class FindReplaceBar : public HBoxContainer { GDCLASS(FindReplaceBar, HBoxContainer); - LineEdit *search_text; - Label *matches_label; - ToolButton *find_prev; - ToolButton *find_next; - CheckBox *case_sensitive; - CheckBox *whole_words; - TextureButton *hide_button; + LineEdit *search_text = nullptr; + Label *matches_label = nullptr; + ToolButton *find_prev = nullptr; + ToolButton *find_next = nullptr; + CheckBox *case_sensitive = nullptr; + CheckBox *whole_words = nullptr; + TextureButton *hide_button = nullptr; - LineEdit *replace_text; - Button *replace; - Button *replace_all; - CheckBox *selection_only; + LineEdit *replace_text = nullptr; + Button *replace = nullptr; + Button *replace_all = nullptr; + CheckBox *selection_only = nullptr; - VBoxContainer *vbc_lineedit; - HBoxContainer *hbc_button_replace; - HBoxContainer *hbc_option_replace; + VBoxContainer *vbc_lineedit = nullptr; + HBoxContainer *hbc_button_replace = nullptr; + HBoxContainer *hbc_option_replace = nullptr; - TextEdit *text_edit; + TextEdit *text_edit = nullptr; - int result_line; - int result_col; - int results_count; + int result_line = 0; + int result_col = 0; + int results_count = 0; - bool replace_all_mode; - bool preserve_cursor; + bool replace_all_mode = false; + bool preserve_cursor = false; void _get_search_from(int &r_line, int &r_col); void _update_results_count(); @@ -138,27 +138,27 @@ typedef void (*CodeTextEditorCodeCompleteFunc)(void *p_ud, const String &p_code, class CodeTextEditor : public VBoxContainer { GDCLASS(CodeTextEditor, VBoxContainer); - TextEdit *text_editor; - FindReplaceBar *find_replace_bar; - HBoxContainer *status_bar; + TextEdit *text_editor = nullptr; + FindReplaceBar *find_replace_bar = nullptr; + HBoxContainer *status_bar = nullptr; - ToolButton *toggle_scripts_button; - ToolButton *warning_button; - Label *warning_count_label; + ToolButton *toggle_scripts_button = nullptr; + ToolButton *warning_button = nullptr; + Label *warning_count_label = nullptr; - Label *line_and_col_txt; + Label *line_and_col_txt = nullptr; - Label *info; - Timer *idle; - Timer *code_complete_timer; + Label *info = nullptr; + Timer *idle = nullptr; + Timer *code_complete_timer = nullptr; - Timer *font_resize_timer; - int font_resize_val; + Timer *font_resize_timer = nullptr; + int font_resize_val = 0; real_t font_size; - Label *error; - int error_line; - int error_column; + Label *error = nullptr; + int error_line = 0; + int error_column = 0; void _on_settings_change(); @@ -176,7 +176,7 @@ class CodeTextEditor : public VBoxContainer { void _reset_zoom(); CodeTextEditorCodeCompleteFunc code_complete_func; - void *code_complete_ud; + void *code_complete_ud = nullptr; void _warning_label_gui_input(const Ref &p_event); void _warning_button_pressed(); @@ -198,7 +198,7 @@ protected: void _notification(int); static void _bind_methods(); - bool is_warnings_panel_opened; + bool is_warnings_panel_opened = false; public: void trim_trailing_whitespace();