summaryrefslogtreecommitdiff
path: root/editor/plugins/tiles/tile_atlas_view.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/plugins/tiles/tile_atlas_view.h
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
Diffstat (limited to 'editor/plugins/tiles/tile_atlas_view.h')
-rw-r--r--editor/plugins/tiles/tile_atlas_view.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/editor/plugins/tiles/tile_atlas_view.h b/editor/plugins/tiles/tile_atlas_view.h
index caf3ef9e4b..6e74858b08 100644
--- a/editor/plugins/tiles/tile_atlas_view.h
+++ b/editor/plugins/tiles/tile_atlas_view.h
@@ -45,8 +45,8 @@ class TileAtlasView : public Control {
GDCLASS(TileAtlasView, Control);
private:
- TileSet *tile_set;
- TileSetAtlasSource *tile_set_atlas_source;
+ TileSet *tile_set = nullptr;
+ TileSetAtlasSource *tile_set_atlas_source = nullptr;
int source_id = TileSet::INVALID_SOURCE;
enum DragType {
@@ -55,9 +55,9 @@ private:
};
DragType drag_type = DRAG_TYPE_NONE;
float previous_zoom = 1.0;
- EditorZoomWidget *zoom_widget;
- Button *button_center_view;
- CenterContainer *center_container;
+ EditorZoomWidget *zoom_widget = nullptr;
+ Button *button_center_view = nullptr;
+ CenterContainer *center_container = nullptr;
Vector2 panning;
void _update_zoom_and_panning(bool p_zoom_on_mouse_pos = false);
void _zoom_widget_changed();
@@ -72,41 +72,41 @@ private:
Map<Vector2, Map<int, Rect2i>> alternative_tiles_rect_cache;
void _update_alternative_tiles_rect_cache();
- MarginContainer *margin_container;
+ MarginContainer *margin_container = nullptr;
int margin_container_paddings[4] = { 0, 0, 0, 0 };
- HBoxContainer *hbox;
- Label *missing_source_label;
+ HBoxContainer *hbox = nullptr;
+ Label *missing_source_label = nullptr;
// Background
- Control *background_left;
+ Control *background_left = nullptr;
void _draw_background_left();
- Control *background_right;
+ Control *background_right = nullptr;
void _draw_background_right();
// Left side.
- Control *base_tiles_root_control;
+ Control *base_tiles_root_control = nullptr;
void _base_tiles_root_control_gui_input(const Ref<InputEvent> &p_event);
- Control *base_tiles_drawing_root;
+ Control *base_tiles_drawing_root = nullptr;
- Control *base_tiles_draw;
+ Control *base_tiles_draw = nullptr;
void _draw_base_tiles();
- Control *base_tiles_texture_grid;
+ Control *base_tiles_texture_grid = nullptr;
void _draw_base_tiles_texture_grid();
- Control *base_tiles_shape_grid;
+ Control *base_tiles_shape_grid = nullptr;
void _draw_base_tiles_shape_grid();
Size2i _compute_base_tiles_control_size();
// Right side.
- Control *alternative_tiles_root_control;
+ Control *alternative_tiles_root_control = nullptr;
void _alternative_tiles_root_control_gui_input(const Ref<InputEvent> &p_event);
- Control *alternative_tiles_drawing_root;
+ Control *alternative_tiles_drawing_root = nullptr;
- Control *alternatives_draw;
+ Control *alternatives_draw = nullptr;
void _draw_alternatives();
Size2i _compute_alternative_tiles_control_size();