diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 15:06:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 19:49:50 +0200 |
commit | f8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch) | |
tree | a9d2df2e2df939c189135b1c36a01e06b37b80b2 | |
parent | 53317bbe146dd19a919685df8d846c55568daba1 (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.
258 files changed, 2457 insertions, 2480 deletions
diff --git a/core/config/engine.h b/core/config/engine.h index 1adab9b96f..eac96852b3 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -40,7 +40,7 @@ class Engine { public: struct Singleton { StringName name; - Object *ptr; + Object *ptr = nullptr; StringName class_name; //used for binding generation hinting bool user_created = false; Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr, const StringName &p_class_name = StringName()); diff --git a/core/core_bind.h b/core/core_bind.h index 907f37c5fa..4d26698f99 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -447,7 +447,7 @@ public: class Directory : public RefCounted { GDCLASS(Directory, RefCounted); - DirAccess *d; + DirAccess *d = nullptr; bool dir_open = false; bool include_navigational = false; diff --git a/core/io/file_access.h b/core/io/file_access.h index a6cb5d9fc6..a5150010da 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -183,7 +183,7 @@ struct FileAccessRef { operator bool() const { return f != nullptr; } - FileAccess *f; + FileAccess *f = nullptr; operator FileAccess *() { return f; } diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 6eee2f593d..fe4b12aef6 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -64,7 +64,7 @@ public: uint64_t offset; //if offset is ZERO, the file was ERASED uint64_t size; uint8_t md5[16]; - PackSource *src; + PackSource *src = nullptr; bool encrypted; }; @@ -103,7 +103,7 @@ private: Vector<PackSource *> sources; - PackedDir *root; + PackedDir *root = nullptr; static PackedData *singleton; bool disabled = false; @@ -150,7 +150,7 @@ class FileAccessPack : public FileAccess { mutable bool eof; uint64_t off; - FileAccess *f; + FileAccess *f = nullptr; virtual Error _open(const String &p_path, int p_mode_flags); virtual uint64_t _get_modified_time(const String &p_file) { return 0; } virtual uint32_t _get_unix_permissions(const String &p_file) { return 0; } diff --git a/core/io/ip.h b/core/io/ip.h index ebd944a949..06ff8a4d70 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -62,7 +62,7 @@ public: typedef int ResolverID; private: - _IP_ResolverPrivate *resolver; + _IP_ResolverPrivate *resolver = nullptr; protected: static IP *singleton; diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index c80c9b0ac9..5403168a53 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -127,7 +127,7 @@ class ResourceFormatSaverBinaryInstance { bool skip_editor; bool big_endian; bool takeover_paths; - FileAccess *f; + FileAccess *f = nullptr; String magic; Set<RES> resource_set; diff --git a/core/io/resource_uid.h b/core/io/resource_uid.h index 1ea44b9d06..0b7ffdf6d0 100644 --- a/core/io/resource_uid.h +++ b/core/io/resource_uid.h @@ -46,7 +46,7 @@ public: static String get_cache_file(); private: - void *crypto; // CryptoCore::RandomGenerator (avoid including crypto_core.h) + void *crypto = nullptr; // CryptoCore::RandomGenerator (avoid including crypto_core.h) Mutex mutex; struct Cache { CharString cs; diff --git a/core/io/udp_server.h b/core/io/udp_server.h index 4a7546fddf..47f06b2490 100644 --- a/core/io/udp_server.h +++ b/core/io/udp_server.h @@ -43,7 +43,7 @@ protected: }; struct Peer { - PacketPeerUDP *peer; + PacketPeerUDP *peer = nullptr; IPAddress ip; uint16_t port = 0; diff --git a/core/math/bvh.h b/core/math/bvh.h index f429ce189b..9f6ab9f736 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -763,19 +763,19 @@ private: tree._extra[p_handle.id()].last_updated_tick = 0; } - PairCallback pair_callback; - UnpairCallback unpair_callback; - CheckPairCallback check_pair_callback; - void *pair_callback_userdata; - void *unpair_callback_userdata; - void *check_pair_callback_userdata; + PairCallback pair_callback = nullptr; + UnpairCallback unpair_callback = nullptr; + CheckPairCallback check_pair_callback = nullptr; + void *pair_callback_userdata = nullptr; + void *unpair_callback_userdata = nullptr; + void *check_pair_callback_userdata = nullptr; BVHTREE_CLASS tree; // for collision pairing, // maintain a list of all items moved etc on each frame / tick LocalVector<BVHHandle, uint32_t, true> changed_items; - uint32_t _tick; + uint32_t _tick = 1; // Start from 1 so items with 0 indicate never updated. class BVHLockedFunction { public: @@ -801,23 +801,16 @@ private: } private: - Mutex *_mutex; + Mutex *_mutex = nullptr; }; Mutex _mutex; // local toggle for turning on and off thread safety in project settings - bool _thread_safe; + bool _thread_safe = BVH_THREAD_SAFE; public: - BVH_Manager() { - _tick = 1; // start from 1 so items with 0 indicate never updated - pair_callback = nullptr; - unpair_callback = nullptr; - pair_callback_userdata = nullptr; - unpair_callback_userdata = nullptr; - _thread_safe = BVH_THREAD_SAFE; - } + BVH_Manager() {} }; #undef BVHTREE_CLASS diff --git a/core/math/dynamic_bvh.h b/core/math/dynamic_bvh.h index 50ec2c2b30..74831089f3 100644 --- a/core/math/dynamic_bvh.h +++ b/core/math/dynamic_bvh.h @@ -183,7 +183,7 @@ private: Node *parent = nullptr; union { Node *childs[2]; - void *data; + void *data = nullptr; }; _FORCE_INLINE_ bool is_leaf() const { return childs[1] == nullptr; } @@ -215,10 +215,7 @@ private: return axis.dot(volume.get_center() - org) <= 0; } - Node() { - childs[0] = nullptr; - childs[1] = nullptr; - } + Node() {} }; PagedAllocator<Node> node_allocator; diff --git a/core/math/expression.h b/core/math/expression.h index 9b87bdd6ec..d43cc4091a 100644 --- a/core/math/expression.h +++ b/core/math/expression.h @@ -147,7 +147,7 @@ private: bool is_op = false; union { Variant::Operator op; - ENode *node; + ENode *node = nullptr; }; }; diff --git a/core/math/octree.h b/core/math/octree.h index e73f8213b3..65ab9e2292 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -134,7 +134,7 @@ private: List<PairData *, AL> pair_list; struct OctantOwner { - Octant *octant; + Octant *octant = nullptr; typename List<Element *, AL>::Element *E; }; // an element can be in max 8 octants @@ -147,7 +147,7 @@ private: int refcount; bool intersect; Element *A, *B; - void *ud; + void *ud = nullptr; typename List<PairData *, AL>::Element *eA, *eB; }; @@ -156,18 +156,18 @@ private: ElementMap element_map; PairMap pair_map; - PairCallback pair_callback; - UnpairCallback unpair_callback; - void *pair_callback_userdata; - void *unpair_callback_userdata; + PairCallback pair_callback = nullptr; + UnpairCallback unpair_callback = nullptr; + void *pair_callback_userdata = nullptr; + void *unpair_callback_userdata = nullptr; - OctreeElementID last_element_id; - uint64_t pass; + OctreeElementID last_element_id = 1; + uint64_t pass = 1; - real_t unit_size; - Octant *root; - int octant_count; - int pair_count; + real_t unit_size = 1.0; + Octant *root = nullptr; + int octant_count = 0; + int pair_count = 0; _FORCE_INLINE_ void _pair_check(PairData *p_pair) { bool intersect = p_pair->A->aabb.intersects_inclusive(p_pair->B->aabb); @@ -294,7 +294,7 @@ private: const Vector3 *points; int point_count; T **result_array; - int *result_idx; + int *result_idx = nullptr; int result_max; uint32_t mask; }; @@ -1265,18 +1265,7 @@ void Octree<T, use_pairs, AL>::set_unpair_callback(UnpairCallback p_callback, vo template <class T, bool use_pairs, class AL> Octree<T, use_pairs, AL>::Octree(real_t p_unit_size) { - last_element_id = 1; - pass = 1; unit_size = p_unit_size; - root = nullptr; - - octant_count = 0; - pair_count = 0; - - pair_callback = nullptr; - unpair_callback = nullptr; - pair_callback_userdata = nullptr; - unpair_callback_userdata = nullptr; } #endif // OCTREE_H diff --git a/core/object/callable_method_pointer.h b/core/object/callable_method_pointer.h index 3cd9ad3819..577d4b9fbd 100644 --- a/core/object/callable_method_pointer.h +++ b/core/object/callable_method_pointer.h @@ -38,7 +38,7 @@ #include "core/variant/callable.h" class CallableCustomMethodPointerBase : public CallableCustom { - uint32_t *comp_ptr; + uint32_t *comp_ptr = nullptr; uint32_t comp_size; uint32_t h; #ifdef DEBUG_METHODS_ENABLED diff --git a/core/object/class_db.h b/core/object/class_db.h index b8a4b3ea2b..5da8523743 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -85,8 +85,8 @@ public: int index; StringName setter; StringName getter; - MethodBind *_setptr; - MethodBind *_getptr; + MethodBind *_setptr = nullptr; + MethodBind *_getptr = nullptr; Variant::Type type; }; diff --git a/core/object/message_queue.h b/core/object/message_queue.h index eaab01d0aa..2219cdb8f6 100644 --- a/core/object/message_queue.h +++ b/core/object/message_queue.h @@ -62,10 +62,10 @@ class MessageQueue { }; }; - uint8_t *buffer; + uint8_t *buffer = nullptr; uint32_t buffer_end = 0; uint32_t buffer_max_used = 0; - uint32_t buffer_size; + uint32_t buffer_size = 0; void _call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error); diff --git a/core/object/object.h b/core/object/object.h index b640c4e78a..eeef03dcb9 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -538,8 +538,8 @@ private: std::mutex _instance_binding_mutex; struct InstanceBinding { - void *binding; - void *token; + void *binding = nullptr; + void *token = nullptr; GDNativeInstanceBindingFreeCallback free_callback = nullptr; GDNativeInstanceBindingReferenceCallback reference_callback = nullptr; }; @@ -849,7 +849,7 @@ class ObjectDB { uint64_t validator : OBJECTDB_VALIDATOR_BITS; uint64_t next_free : OBJECTDB_SLOT_MAX_COUNT_BITS; uint64_t is_ref_counted : 1; - Object *object; + Object *object = nullptr; }; static SpinLock spin_lock; diff --git a/core/object/script_language.h b/core/object/script_language.h index af4f276825..08b82d798e 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -430,11 +430,11 @@ public: extern uint8_t script_encryption_key[32]; class PlaceHolderScriptInstance : public ScriptInstance { - Object *owner; + Object *owner = nullptr; List<PropertyInfo> properties; Map<StringName, Variant> values; Map<StringName, Variant> constants; - ScriptLanguage *language; + ScriptLanguage *language = nullptr; Ref<Script> script; public: diff --git a/core/os/memory.h b/core/os/memory.h index 27eaad5010..baa96ef3e9 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -186,9 +186,9 @@ void memdelete_arr(T *p_class) { struct _GlobalNil { int color = 1; - _GlobalNil *right; - _GlobalNil *left; - _GlobalNil *parent; + _GlobalNil *right = nullptr; + _GlobalNil *left = nullptr; + _GlobalNil *parent = nullptr; _GlobalNil(); }; diff --git a/core/os/os.h b/core/os/os.h index 808d704b3d..b3c66ff18c 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -60,8 +60,6 @@ class OS { bool _stdout_enabled = true; bool _stderr_enabled = true; - char *last_error; - CompositeLogger *_logger = nullptr; bool restart_on_exit = false; diff --git a/core/os/pool_allocator.h b/core/os/pool_allocator.h index 11a252bc54..0919a024e2 100644 --- a/core/os/pool_allocator.h +++ b/core/os/pool_allocator.h @@ -75,13 +75,13 @@ private: typedef int EntryArrayPos; typedef int EntryIndicesPos; - Entry *entry_array; - int *entry_indices; + Entry *entry_array = nullptr; + int *entry_indices = nullptr; int entry_max; int entry_count; - uint8_t *pool; - void *mem_ptr; + uint8_t *pool = nullptr; + void *mem_ptr = nullptr; int pool_size; int free_mem; diff --git a/core/string/string_name.h b/core/string/string_name.h index 6f08d32981..f4233854ac 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -70,7 +70,7 @@ class StringName { _Data *_data = nullptr; union _HashUnion { - _Data *ptr; + _Data *ptr = nullptr; uint32_t hash; }; diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h index 1ecb81c2a2..0aa1cfd541 100644 --- a/core/templates/command_queue_mt.h +++ b/core/templates/command_queue_mt.h @@ -311,7 +311,7 @@ class CommandQueueMT { }; struct SyncCommand : public CommandBase { - SyncSemaphore *sync_sem; + SyncSemaphore *sync_sem = nullptr; virtual void post() { sync_sem->sem.post(); diff --git a/core/templates/map.h b/core/templates/map.h index f228640a1e..c54da1dc03 100644 --- a/core/templates/map.h +++ b/core/templates/map.h @@ -178,7 +178,7 @@ public: private: struct _Data { Element *_root = nullptr; - Element *_nil; + Element *_nil = nullptr; int size_cache = 0; _FORCE_INLINE_ _Data() { @@ -344,7 +344,7 @@ private: void _insert_rb_fix(Element *p_new_node) { Element *node = p_new_node; Element *nparent = node->parent; - Element *ngrand_parent; + Element *ngrand_parent = nullptr; while (nparent->color == RED) { ngrand_parent = nparent->parent; @@ -500,7 +500,7 @@ private: Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; - Element *sibling; + Element *sibling = nullptr; if (rp == rp->parent->left) { rp->parent->left = node; sibling = rp->parent->right; diff --git a/core/templates/oa_hash_map.h b/core/templates/oa_hash_map.h index 4e712fccf2..e4d9323c45 100644 --- a/core/templates/oa_hash_map.h +++ b/core/templates/oa_hash_map.h @@ -306,7 +306,7 @@ public: bool valid; const TKey *key; - TValue *value; + TValue *value = nullptr; private: uint32_t pos; diff --git a/core/templates/safe_list.h b/core/templates/safe_list.h index 53fc3fe5f9..ae31525dd0 100644 --- a/core/templates/safe_list.h +++ b/core/templates/safe_list.h @@ -75,8 +75,8 @@ public: class Iterator { friend class SafeList; - SafeListNode *cursor; - SafeList *list; + SafeListNode *cursor = nullptr; + SafeList *list = nullptr; Iterator(SafeListNode *p_cursor, SafeList *p_list) : cursor(p_cursor), list(p_list) { @@ -253,8 +253,8 @@ public: class Iterator { friend class SafeList; - SafeListNode *cursor; - SafeList *list; + SafeListNode *cursor = nullptr; + SafeList *list = nullptr; public: Iterator(SafeListNode *p_cursor, SafeList *p_list) : diff --git a/core/templates/self_list.h b/core/templates/self_list.h index 7f2236fa3a..719b5f2e63 100644 --- a/core/templates/self_list.h +++ b/core/templates/self_list.h @@ -108,7 +108,7 @@ public: private: List *_root = nullptr; - T *_self; + T *_self = nullptr; SelfList<T> *_next = nullptr; SelfList<T> *_prev = nullptr; diff --git a/core/templates/set.h b/core/templates/set.h index cdc6e8447d..a8a0a77712 100644 --- a/core/templates/set.h +++ b/core/templates/set.h @@ -328,7 +328,7 @@ private: void _insert_rb_fix(Element *p_new_node) { Element *node = p_new_node; Element *nparent = node->parent; - Element *ngrand_parent; + Element *ngrand_parent = nullptr; while (nparent->color == RED) { ngrand_parent = nparent->parent; @@ -482,7 +482,7 @@ private: Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; - Element *sibling; + Element *sibling = nullptr; if (rp == rp->parent->left) { rp->parent->left = node; sibling = rp->parent->right; diff --git a/core/templates/thread_work_pool.h b/core/templates/thread_work_pool.h index 957af44f48..d364ac4fd8 100644 --- a/core/templates/thread_work_pool.h +++ b/core/templates/thread_work_pool.h @@ -68,7 +68,7 @@ class ThreadWorkPool { Semaphore start; Semaphore completed; std::atomic<bool> exit; - BaseWork *work; + BaseWork *work = nullptr; }; ThreadData *threads = nullptr; diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 4e825ab8b2..70066c5e2a 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -169,7 +169,7 @@ public: LocalVector<GLsync> fences; uint32_t current_buffer = 0; - InstanceData *instance_data_array; + InstanceData *instance_data_array = nullptr; bool canvas_texscreen_used; CanvasShaderGLES3 canvas_shader; RID canvas_shader_current_version; @@ -198,7 +198,7 @@ public: bool end_batch = false; Transform3D vp; - Light *using_light; + Light *using_light = nullptr; bool using_shadow; bool using_transparent_rt; @@ -220,9 +220,9 @@ public: typedef void Texture; - RasterizerSceneGLES3 *scene_render; + RasterizerSceneGLES3 *scene_render = nullptr; - RasterizerStorageGLES3 *storage; + RasterizerStorageGLES3 *storage = nullptr; void _set_uniforms(); diff --git a/drivers/gles3/storage/material_storage.h b/drivers/gles3/storage/material_storage.h index bf17e66c2f..450ee7191f 100644 --- a/drivers/gles3/storage/material_storage.h +++ b/drivers/gles3/storage/material_storage.h @@ -66,7 +66,7 @@ struct Shader { RID self; RS::ShaderMode mode; - ShaderGLES3 *shader; + ShaderGLES3 *shader = nullptr; String code; SelfList<Material>::List materials; @@ -185,7 +185,7 @@ struct Shader { struct Material { RID self; - Shader *shader; + Shader *shader = nullptr; Map<StringName, Variant> params; SelfList<Material> list; SelfList<Material> dirty_list; diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index 8a921fbe10..7656cdf67e 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -93,7 +93,7 @@ enum OpenGLTextureFlags { struct Texture { RID self; - Texture *proxy; + Texture *proxy = nullptr; Set<Texture *> proxy_owners; String path; @@ -125,20 +125,20 @@ struct Texture { uint16_t stored_cube_sides; - RenderTarget *render_target; + RenderTarget *render_target = nullptr; Vector<Ref<Image>> images; bool redraw_if_visible; RS::TextureDetectCallback detect_3d; - void *detect_3d_ud; + void *detect_3d_ud = nullptr; RS::TextureDetectCallback detect_srgb; - void *detect_srgb_ud; + void *detect_srgb_ud = nullptr; RS::TextureDetectCallback detect_normal; - void *detect_normal_ud; + void *detect_normal_ud = nullptr; CanvasTexture *canvas_texture = nullptr; diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index f90f55605c..b4dc012db2 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -41,7 +41,7 @@ #include <unistd.h> class DirAccessUnix : public DirAccess { - DIR *dir_stream; + DIR *dir_stream = nullptr; static DirAccess *create_fs(); diff --git a/editor/action_map_editor.h b/editor/action_map_editor.h index 34c70c942e..e96139e070 100644 --- a/editor/action_map_editor.h +++ b/editor/action_map_editor.h @@ -63,24 +63,24 @@ private: Ref<InputEvent> event = Ref<InputEvent>(); - TabContainer *tab_container; + TabContainer *tab_container = nullptr; // Listening for input - Label *event_as_text; - ColorRect *mouse_detection_rect; + Label *event_as_text = nullptr; + ColorRect *mouse_detection_rect = nullptr; // List of All Key/Mouse/Joypad input options. int allowed_input_types; - Tree *input_list_tree; - LineEdit *input_list_search; + Tree *input_list_tree = nullptr; + LineEdit *input_list_search = nullptr; // Additional Options, shown depending on event selected - VBoxContainer *additional_options_container; + VBoxContainer *additional_options_container = nullptr; - HBoxContainer *device_container; - OptionButton *device_id_option; + HBoxContainer *device_container = nullptr; + OptionButton *device_id_option = nullptr; - HBoxContainer *mod_container; // Contains the subcontainer and the store command checkbox. + HBoxContainer *mod_container = nullptr; // Contains the subcontainer and the store command checkbox. enum ModCheckbox { MOD_ALT, @@ -93,9 +93,9 @@ private: String mods[MOD_MAX] = { "Alt", "Shift", "Command", "Ctrl", "Metakey" }; CheckBox *mod_checkboxes[MOD_MAX]; - CheckBox *store_command_checkbox; + CheckBox *store_command_checkbox = nullptr; - CheckBox *physical_key_checkbox; + CheckBox *physical_key_checkbox = nullptr; void _set_event(const Ref<InputEvent> &p_event); @@ -149,7 +149,7 @@ private: }; Vector<ActionInfo> actions_cache; - Tree *action_tree; + Tree *action_tree = nullptr; // Storing which action/event is currently being edited in the InputEventConfigurationDialog. @@ -159,17 +159,17 @@ private: // Popups - InputEventConfigurationDialog *event_config_dialog; - AcceptDialog *message; + InputEventConfigurationDialog *event_config_dialog = nullptr; + AcceptDialog *message = nullptr; // Filtering and Adding actions bool show_builtin_actions = false; - CheckButton *show_builtin_actions_checkbutton; - LineEdit *action_list_search; + CheckButton *show_builtin_actions_checkbutton = nullptr; + LineEdit *action_list_search = nullptr; - HBoxContainer *add_hbox; - LineEdit *add_edit; + HBoxContainer *add_hbox = nullptr; + LineEdit *add_edit = nullptr; void _event_config_confirmed(); diff --git a/editor/animation_bezier_editor.h b/editor/animation_bezier_editor.h index fa6fc405f2..dcb6502440 100644 --- a/editor/animation_bezier_editor.h +++ b/editor/animation_bezier_editor.h @@ -49,7 +49,7 @@ class AnimationBezierTrackEdit : public Control { AnimationTimelineEdit *timeline = nullptr; UndoRedo *undo_redo = nullptr; Node *root = nullptr; - Control *play_position; //separate control used to draw so updates for only position changed are much faster + Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster float play_position_pos = 0; Ref<Animation> animation; @@ -130,7 +130,7 @@ class AnimationBezierTrackEdit : public Control { float transition = 0; }; - AnimationTrackEditor *editor; + AnimationTrackEditor *editor = nullptr; struct EditPoint { Rect2 point_rect; diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 1baebc469e..d025dd3d26 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -54,27 +54,27 @@ class AnimationTimelineEdit : public Range { GDCLASS(AnimationTimelineEdit, Range); Ref<Animation> animation; - AnimationTrackEdit *track_edit; + AnimationTrackEdit *track_edit = nullptr; int name_limit; - Range *zoom; - Range *h_scroll; + Range *zoom = nullptr; + Range *h_scroll = nullptr; float play_position_pos; - HBoxContainer *len_hb; - EditorSpinSlider *length; - Button *loop; - TextureRect *time_icon; + HBoxContainer *len_hb = nullptr; + EditorSpinSlider *length = nullptr; + Button *loop = nullptr; + TextureRect *time_icon = nullptr; - MenuButton *add_track; - Control *play_position; //separate control used to draw so updates for only position changed are much faster - HScrollBar *hscroll; + MenuButton *add_track = nullptr; + Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster + HScrollBar *hscroll = nullptr; void _zoom_changed(double); void _anim_length_changed(double p_new_len); void _anim_loop_pressed(); void _play_position_draw(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Rect2 hsize_rect; bool editing = false; @@ -146,12 +146,12 @@ class AnimationTrackEdit : public Control { MENU_KEY_ADD_RESET, MENU_KEY_DELETE }; - AnimationTimelineEdit *timeline; - UndoRedo *undo_redo; - Popup *path_popup; - LineEdit *path; - Node *root; - Control *play_position; //separate control used to draw so updates for only position changed are much faster + AnimationTimelineEdit *timeline = nullptr; + UndoRedo *undo_redo = nullptr; + Popup *path_popup = nullptr; + LineEdit *path = 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; NodePath node_path; @@ -169,7 +169,7 @@ class AnimationTrackEdit : public Control { Ref<Texture2D> type_icon; Ref<Texture2D> selected_icon; - PopupMenu *menu; + PopupMenu *menu = nullptr; bool clicking_on_name = false; @@ -194,7 +194,7 @@ class AnimationTrackEdit : public Control { float moving_selection_from_ofs; bool in_group = false; - AnimationTrackEditor *editor; + AnimationTrackEditor *editor = nullptr; protected: static void _bind_methods(); @@ -285,27 +285,27 @@ class AnimationTrackEditor : public VBoxContainer { GDCLASS(AnimationTrackEditor, VBoxContainer); Ref<Animation> animation; - Node *root; - - MenuButton *edit; + Node *root = nullptr; - PanelContainer *main_panel; - HScrollBar *hscroll; - ScrollContainer *scroll; - VBoxContainer *track_vbox; - AnimationBezierTrackEdit *bezier_edit; + MenuButton *edit = nullptr; - Label *info_message; + PanelContainer *main_panel = nullptr; + HScrollBar *hscroll = nullptr; + ScrollContainer *scroll = nullptr; + VBoxContainer *track_vbox = nullptr; + AnimationBezierTrackEdit *bezier_edit = nullptr; - AnimationTimelineEdit *timeline; - HSlider *zoom; - EditorSpinSlider *step; - TextureRect *zoom_icon; - Button *snap; - Button *bezier_edit_icon; - OptionButton *snap_mode; + Label *info_message = nullptr; - Button *imported_anim_warning; + AnimationTimelineEdit *timeline = nullptr; + HSlider *zoom = nullptr; + EditorSpinSlider *step = nullptr; + TextureRect *zoom_icon = nullptr; + Button *snap = nullptr; + Button *bezier_edit_icon = nullptr; + OptionButton *snap_mode = nullptr; + + Button *imported_anim_warning = nullptr; void _show_imported_anim_warning(); void _snap_mode_changed(int p_mode); @@ -323,7 +323,7 @@ class AnimationTrackEditor : public VBoxContainer { void _track_remove_request(int p_track); void _track_grab_focus(int p_track); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _update_scroll(double); void _update_step(double p_new_step); @@ -336,9 +336,9 @@ class AnimationTrackEditor : public VBoxContainer { void _update_step_spinbox(); - PropertySelector *prop_selector; - PropertySelector *method_selector; - SceneTreeDialog *pick_track; + PropertySelector *prop_selector = nullptr; + PropertySelector *method_selector = nullptr; + SceneTreeDialog *pick_track = nullptr; int adding_track_type; NodePath adding_track_path; @@ -353,10 +353,10 @@ class AnimationTrackEditor : public VBoxContainer { bool advance = false; }; /* insert_data;*/ - Label *insert_confirm_text; - CheckBox *insert_confirm_bezier; - CheckBox *insert_confirm_reset; - ConfirmationDialog *insert_confirm; + Label *insert_confirm_text = nullptr; + CheckBox *insert_confirm_bezier = nullptr; + CheckBox *insert_confirm_reset = nullptr; + ConfirmationDialog *insert_confirm = nullptr; bool insert_queue = false; List<InsertData> insert_data; @@ -419,13 +419,13 @@ class AnimationTrackEditor : public VBoxContainer { void _move_selection_commit(); void _move_selection_cancel(); - AnimationTrackKeyEdit *key_edit; - AnimationMultiTrackKeyEdit *multi_key_edit; + AnimationTrackKeyEdit *key_edit = nullptr; + AnimationMultiTrackKeyEdit *multi_key_edit = nullptr; void _update_key_edit(); void _clear_key_edit(); - Control *box_selection; + Control *box_selection = nullptr; void _box_selection_draw(); bool box_selecting = false; Vector2 box_selecting_from; @@ -440,18 +440,18 @@ class AnimationTrackEditor : public VBoxContainer { ////////////// edit menu stuff - ConfirmationDialog *optimize_dialog; - SpinBox *optimize_linear_error; - SpinBox *optimize_angular_error; - SpinBox *optimize_max_angle; + ConfirmationDialog *optimize_dialog = nullptr; + SpinBox *optimize_linear_error = nullptr; + SpinBox *optimize_angular_error = nullptr; + SpinBox *optimize_max_angle = nullptr; - ConfirmationDialog *cleanup_dialog; - CheckBox *cleanup_keys; - CheckBox *cleanup_tracks; - CheckBox *cleanup_all; + ConfirmationDialog *cleanup_dialog = nullptr; + CheckBox *cleanup_keys = nullptr; + CheckBox *cleanup_tracks = nullptr; + CheckBox *cleanup_all = nullptr; - ConfirmationDialog *scale_dialog; - SpinBox *scale; + ConfirmationDialog *scale_dialog = nullptr; + SpinBox *scale = nullptr; void _select_all_tracks_for_copy(); @@ -464,13 +464,13 @@ class AnimationTrackEditor : public VBoxContainer { void _anim_duplicate_keys(bool transpose); void _view_group_toggle(); - Button *view_group; - Button *selected_filter; + Button *view_group = nullptr; + Button *selected_filter = nullptr; void _selection_changed(); - ConfirmationDialog *track_copy_dialog; - Tree *track_copy_select; + ConfirmationDialog *track_copy_dialog = nullptr; + Tree *track_copy_select = nullptr; struct TrackClipboard { NodePath full_path; diff --git a/editor/code_editor.h b/editor/code_editor.h index bbc45d6ec0..d52f57860c 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; - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; virtual void ok_pressed() override; @@ -62,25 +62,25 @@ class CodeTextEditor; class FindReplaceBar : public HBoxContainer { GDCLASS(FindReplaceBar, HBoxContainer); - LineEdit *search_text; - Label *matches_label; - Button *find_prev; - Button *find_next; - CheckBox *case_sensitive; - CheckBox *whole_words; - TextureButton *hide_button; + LineEdit *search_text = nullptr; + Label *matches_label = nullptr; + Button *find_prev = nullptr; + Button *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; CodeTextEditor *base_text_editor = nullptr; - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; int result_line; int result_col; @@ -139,25 +139,25 @@ typedef void (*CodeTextEditorCodeCompleteFunc)(void *p_ud, const String &p_code, class CodeTextEditor : public VBoxContainer { GDCLASS(CodeTextEditor, VBoxContainer); - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; FindReplaceBar *find_replace_bar = nullptr; - HBoxContainer *status_bar; + HBoxContainer *status_bar = nullptr; - Button *toggle_scripts_button; - Button *error_button; - Button *warning_button; + Button *toggle_scripts_button = nullptr; + Button *error_button = nullptr; + Button *warning_button = 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; + Timer *font_resize_timer = nullptr; int font_resize_val; real_t font_size; - Label *error; + Label *error = nullptr; int error_line; int error_column; @@ -181,7 +181,7 @@ class CodeTextEditor : public VBoxContainer { Color completion_string_color; Color completion_comment_color; CodeTextEditorCodeCompleteFunc code_complete_func; - void *code_complete_ud; + void *code_complete_ud = nullptr; void _error_button_pressed(); void _warning_button_pressed(); diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 58c584b8b2..4b1b8363dd 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -105,27 +105,27 @@ public: }; private: - Label *connect_to_label; - LineEdit *from_signal; - Node *source; + Label *connect_to_label = nullptr; + LineEdit *from_signal = nullptr; + Node *source = nullptr; StringName signal; - LineEdit *dst_method; - ConnectDialogBinds *cdbinds; + LineEdit *dst_method = nullptr; + ConnectDialogBinds *cdbinds = nullptr; bool edit_mode; NodePath dst_path; - VBoxContainer *vbc_right; - - SceneTreeEditor *tree; - AcceptDialog *error; - SpinBox *unbind_count; - EditorInspector *bind_editor; - OptionButton *type_list; - CheckBox *deferred; - CheckBox *oneshot; - CheckButton *advanced; + VBoxContainer *vbc_right = nullptr; + + SceneTreeEditor *tree = nullptr; + AcceptDialog *error = nullptr; + SpinBox *unbind_count = nullptr; + EditorInspector *bind_editor = nullptr; + OptionButton *type_list = nullptr; + CheckBox *deferred = nullptr; + CheckBox *oneshot = nullptr; + CheckButton *advanced = nullptr; Vector<Control *> bind_controls; - Label *error_label; + Label *error_label = nullptr; void ok_pressed() override; void _cancel_pressed(); @@ -186,16 +186,16 @@ class ConnectionsDock : public VBoxContainer { DISCONNECT }; - Node *selected_node; - ConnectionsDockTree *tree; + Node *selected_node = nullptr; + ConnectionsDockTree *tree = nullptr; - ConfirmationDialog *disconnect_all_dialog; - ConnectDialog *connect_dialog; - Button *connect_button; - PopupMenu *signal_menu; - PopupMenu *slot_menu; - UndoRedo *undo_redo; - LineEdit *search_box; + ConfirmationDialog *disconnect_all_dialog = nullptr; + ConnectDialog *connect_dialog = nullptr; + Button *connect_button = nullptr; + PopupMenu *signal_menu = nullptr; + PopupMenu *slot_menu = nullptr; + UndoRedo *undo_redo = nullptr; + LineEdit *search_box = nullptr; Map<StringName, Map<StringName, String>> descr_cache; diff --git a/editor/create_dialog.h b/editor/create_dialog.h index fe7c89c059..31761be6fe 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -47,18 +47,18 @@ class CreateDialog : public ConfirmationDialog { OTHER_TYPE }; - LineEdit *search_box; - Tree *search_options; + LineEdit *search_box = nullptr; + Tree *search_options = nullptr; String base_type; String icon_fallback; String preferred_search_result_type; - Button *favorite; + Button *favorite = nullptr; Vector<String> favorite_list; - Tree *favorites; - ItemList *recent; - EditorHelpBit *help_bit; + Tree *favorites = nullptr; + ItemList *recent = nullptr; + EditorHelpBit *help_bit = nullptr; HashMap<String, TreeItem *> search_options_types; HashMap<String, String> custom_type_parents; diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.h b/editor/debugger/debug_adapter/debug_adapter_protocol.h index b54a5f1f3f..e4760bea54 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.h +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.h @@ -76,7 +76,7 @@ class DebugAdapterProtocol : public Object { private: static DebugAdapterProtocol *singleton; - DebugAdapterParser *parser; + DebugAdapterParser *parser = nullptr; List<Ref<DAPeer>> clients; Ref<TCPServer> server; diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h index 5cdc4417d0..8f523bfbdc 100644 --- a/editor/debugger/editor_debugger_inspector.h +++ b/editor/debugger/editor_debugger_inspector.h @@ -70,7 +70,7 @@ private: ObjectID inspected_object_id; Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects; Set<RES> remote_dependencies; - EditorDebuggerRemoteObject *variables; + EditorDebuggerRemoteObject *variables = nullptr; void _object_selected(ObjectID p_object); void _object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value); diff --git a/editor/debugger/editor_network_profiler.h b/editor/debugger/editor_network_profiler.h index 3e95eb0de6..3a604f5564 100644 --- a/editor/debugger/editor_network_profiler.h +++ b/editor/debugger/editor_network_profiler.h @@ -42,13 +42,13 @@ class EditorNetworkProfiler : public VBoxContainer { GDCLASS(EditorNetworkProfiler, VBoxContainer) private: - Button *activate; - Button *clear_button; - Tree *counters_display; - LineEdit *incoming_bandwidth_text; - LineEdit *outgoing_bandwidth_text; + Button *activate = nullptr; + Button *clear_button = nullptr; + Tree *counters_display = nullptr; + LineEdit *incoming_bandwidth_text = nullptr; + LineEdit *outgoing_bandwidth_text = nullptr; - Timer *frame_delay; + Timer *frame_delay = nullptr; Map<ObjectID, SceneDebugger::RPCNodeInfo> nodes_data; diff --git a/editor/debugger/editor_performance_profiler.h b/editor/debugger/editor_performance_profiler.h index 998ecc5bb6..a917ddbe28 100644 --- a/editor/debugger/editor_performance_profiler.h +++ b/editor/debugger/editor_performance_profiler.h @@ -62,9 +62,9 @@ private: OrderedHashMap<StringName, Monitor> monitors; Map<StringName, TreeItem *> base_map; - Tree *monitor_tree; - Control *monitor_draw; - Label *info_message; + Tree *monitor_tree = nullptr; + Control *monitor_draw = nullptr; + Label *info_message = nullptr; StringName marker_key; int marker_frame; const int MARGIN = 4; diff --git a/editor/debugger/editor_profiler.h b/editor/debugger/editor_profiler.h index 45f7ac39c1..34f34be7c3 100644 --- a/editor/debugger/editor_profiler.h +++ b/editor/debugger/editor_profiler.h @@ -90,20 +90,20 @@ public: }; private: - Button *activate; - Button *clear_button; - TextureRect *graph; + Button *activate = nullptr; + Button *clear_button = nullptr; + TextureRect *graph = nullptr; Ref<ImageTexture> graph_texture; Vector<uint8_t> graph_image; - Tree *variables; - HSplitContainer *h_split; + Tree *variables = nullptr; + HSplitContainer *h_split = nullptr; Set<StringName> plot_sigs; - OptionButton *display_mode; - OptionButton *display_time; + OptionButton *display_mode = nullptr; + OptionButton *display_time = nullptr; - SpinBox *cursor_metric_edit; + SpinBox *cursor_metric_edit = nullptr; Vector<Metric> frame_metrics; int total_metrics; @@ -119,8 +119,8 @@ private: bool seeking; - Timer *frame_delay; - Timer *plot_delay; + Timer *frame_delay = nullptr; + Timer *plot_delay = nullptr; void _update_frame(); diff --git a/editor/debugger/editor_visual_profiler.h b/editor/debugger/editor_visual_profiler.h index 55ba725ae8..14eacca02d 100644 --- a/editor/debugger/editor_visual_profiler.h +++ b/editor/debugger/editor_visual_profiler.h @@ -67,20 +67,20 @@ public: }; private: - Button *activate; - Button *clear_button; + Button *activate = nullptr; + Button *clear_button = nullptr; - TextureRect *graph; + TextureRect *graph = nullptr; Ref<ImageTexture> graph_texture; Vector<uint8_t> graph_image; - Tree *variables; - HSplitContainer *h_split; - CheckBox *frame_relative; - CheckBox *linked; + Tree *variables = nullptr; + HSplitContainer *h_split = nullptr; + CheckBox *frame_relative = nullptr; + CheckBox *linked = nullptr; - OptionButton *display_mode; + OptionButton *display_mode = nullptr; - SpinBox *cursor_metric_edit; + SpinBox *cursor_metric_edit = nullptr; Vector<Metric> frame_metrics; int last_metric; @@ -99,8 +99,8 @@ private: bool seeking; - Timer *frame_delay; - Timer *plot_delay; + Timer *frame_delay = nullptr; + Timer *plot_delay = nullptr; void _update_frame(bool p_focus_selected = false); diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index 486ac26ef7..ad90e63c16 100644 --- a/editor/debugger/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -85,26 +85,26 @@ private: ACTION_DELETE_ALL_BREAKPOINTS, }; - AcceptDialog *msgdialog; - - LineEdit *clicked_ctrl; - LineEdit *clicked_ctrl_type; - LineEdit *live_edit_root; - Button *le_set; - Button *le_clear; - Button *export_csv; - - VBoxContainer *errors_tab; - Tree *error_tree; - Button *expand_all_button; - Button *collapse_all_button; - Button *clear_button; - PopupMenu *item_menu; - - Tree *breakpoints_tree; - PopupMenu *breakpoints_menu; - - EditorFileDialog *file_dialog; + AcceptDialog *msgdialog = nullptr; + + LineEdit *clicked_ctrl = nullptr; + LineEdit *clicked_ctrl_type = nullptr; + LineEdit *live_edit_root = nullptr; + Button *le_set = nullptr; + Button *le_clear = nullptr; + Button *export_csv = nullptr; + + VBoxContainer *errors_tab = nullptr; + Tree *error_tree = nullptr; + Button *expand_all_button = nullptr; + Button *collapse_all_button = nullptr; + Button *clear_button = nullptr; + PopupMenu *item_menu = nullptr; + + Tree *breakpoints_tree = nullptr; + PopupMenu *breakpoints_menu = nullptr; + + EditorFileDialog *file_dialog = nullptr; enum FileDialogPurpose { SAVE_MONITORS_CSV, SAVE_VRAM_CSV, @@ -117,31 +117,31 @@ private: bool skip_breakpoints_value = false; Ref<Script> stack_script; - TabContainer *tabs; + TabContainer *tabs = nullptr; - Label *reason; + Label *reason = nullptr; - Button *skip_breakpoints; - Button *copy; - Button *step; - Button *next; - Button *dobreak; - Button *docontinue; + Button *skip_breakpoints = nullptr; + Button *copy = nullptr; + Button *step = nullptr; + Button *next = nullptr; + Button *dobreak = nullptr; + Button *docontinue = nullptr; // Reference to "Remote" tab in scene tree. Needed by _live_edit_set and buttons state. // Each debugger should have it's tree in the future I guess. const Tree *editor_remote_tree = nullptr; Map<int, String> profiler_signature; - Tree *vmem_tree; - Button *vmem_refresh; - Button *vmem_export; - LineEdit *vmem_total; + Tree *vmem_tree = nullptr; + Button *vmem_refresh = nullptr; + Button *vmem_export = nullptr; + LineEdit *vmem_total = nullptr; - Tree *stack_dump; + Tree *stack_dump = nullptr; LineEdit *search = nullptr; - EditorDebuggerInspector *inspector; - SceneDebuggerTree *scene_tree; + EditorDebuggerInspector *inspector = nullptr; + SceneDebuggerTree *scene_tree = nullptr; Ref<RemoteDebuggerPeer> peer; @@ -149,10 +149,10 @@ private: int last_path_id; Map<String, int> res_path_cache; - EditorProfiler *profiler; - EditorVisualProfiler *visual_profiler; - EditorNetworkProfiler *network_profiler; - EditorPerformanceProfiler *performance_profiler; + EditorProfiler *profiler = nullptr; + EditorVisualProfiler *visual_profiler = nullptr; + EditorNetworkProfiler *network_profiler = nullptr; + EditorPerformanceProfiler *performance_profiler = nullptr; OS::ProcessID remote_pid = 0; bool breaked = false; diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h index 84642edd79..d1dc470c79 100644 --- a/editor/dependency_editor.h +++ b/editor/dependency_editor.h @@ -42,10 +42,10 @@ class EditorFileSystemDirectory; class DependencyEditor : public AcceptDialog { GDCLASS(DependencyEditor, AcceptDialog); - Tree *tree; - Button *fixdeps; + Tree *tree = nullptr; + Button *fixdeps = nullptr; - EditorFileDialog *search; + EditorFileDialog *search = nullptr; String replacing; String editing; @@ -71,8 +71,8 @@ public: class DependencyEditorOwners : public AcceptDialog { GDCLASS(DependencyEditorOwners, AcceptDialog); - ItemList *owners; - PopupMenu *file_options; + ItemList *owners = nullptr; + PopupMenu *file_options = nullptr; String editing; void _fill_owners(EditorFileSystemDirectory *efsd); @@ -95,8 +95,8 @@ public: class DependencyRemoveDialog : public ConfirmationDialog { GDCLASS(DependencyRemoveDialog, ConfirmationDialog); - Label *text; - Tree *owners; + Label *text = nullptr; + Tree *owners = nullptr; Map<String, String> all_remove_files; Vector<String> dirs_to_delete; @@ -142,9 +142,9 @@ public: private: String for_file; Mode mode; - Button *fdep; - Label *text; - Tree *files; + Button *fdep = nullptr; + Label *text = nullptr; + Tree *files = nullptr; void ok_pressed() override; void custom_action(const String &) override; @@ -156,9 +156,9 @@ public: class OrphanResourcesDialog : public ConfirmationDialog { GDCLASS(OrphanResourcesDialog, ConfirmationDialog); - DependencyEditor *dep_edit; - Tree *files; - ConfirmationDialog *delete_confirm; + DependencyEditor *dep_edit = nullptr; + Tree *files = nullptr; + ConfirmationDialog *delete_confirm = nullptr; void ok_pressed() override; bool _fill_owners(EditorFileSystemDirectory *efsd, HashMap<String, int> &refs, TreeItem *p_parent); diff --git a/editor/editor_about.h b/editor/editor_about.h index 5a3b1e1987..6f05700582 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -56,11 +56,11 @@ private: void _version_button_pressed(); ScrollContainer *_populate_list(const String &p_name, const List<String> &p_sections, const char *const *const p_src[], const int p_flag_single_column = 0); - LinkButton *version_btn; - Tree *_tpl_tree; - RichTextLabel *_license_text; - RichTextLabel *_tpl_text; - TextureRect *_logo; + LinkButton *version_btn = nullptr; + Tree *_tpl_tree = nullptr; + RichTextLabel *_license_text = nullptr; + RichTextLabel *_tpl_text = nullptr; + TextureRect *_logo = nullptr; void _theme_changed(); diff --git a/editor/editor_asset_installer.h b/editor/editor_asset_installer.h index 58c232f351..deb320e7fa 100644 --- a/editor/editor_asset_installer.h +++ b/editor/editor_asset_installer.h @@ -36,11 +36,11 @@ class EditorAssetInstaller : public ConfirmationDialog { GDCLASS(EditorAssetInstaller, ConfirmationDialog); - Tree *tree; - Label *asset_contents; + Tree *tree = nullptr; + Label *asset_contents = nullptr; String package_path; String asset_name; - AcceptDialog *error; + AcceptDialog *error = nullptr; Map<String, TreeItem *> status_map; bool updating = false; void _item_edited(); diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index 0020b61370..81a6e5b86d 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -52,9 +52,9 @@ class EditorAudioBus : public PanelContainer { GDCLASS(EditorAudioBus, PanelContainer); Ref<Texture2D> disabled_vu; - LineEdit *track_name; - MenuButton *bus_options; - VSlider *slider; + LineEdit *track_name = nullptr; + MenuButton *bus_options = nullptr; + VSlider *slider = nullptr; int cc; static const int CHANNELS_MAX = 4; @@ -69,21 +69,21 @@ class EditorAudioBus : public PanelContainer { TextureProgressBar *vu_r = nullptr; } channel[CHANNELS_MAX]; - OptionButton *send; + OptionButton *send = nullptr; - PopupMenu *effect_options; - PopupMenu *bus_popup; - PopupMenu *delete_effect_popup; + PopupMenu *effect_options = nullptr; + PopupMenu *bus_popup = nullptr; + PopupMenu *delete_effect_popup = nullptr; - Panel *audio_value_preview_box; - Label *audio_value_preview_label; - Timer *preview_timer; + Panel *audio_value_preview_box = nullptr; + Label *audio_value_preview_label = nullptr; + Timer *preview_timer = nullptr; - Button *solo; - Button *mute; - Button *bypass; + Button *solo = nullptr; + Button *mute = nullptr; + Button *bypass = nullptr; - Tree *effects; + Tree *effects = nullptr; bool updating_bus = false; bool is_master; @@ -121,7 +121,7 @@ class EditorAudioBus : public PanelContainer { friend class EditorAudioBuses; - EditorAudioBuses *buses; + EditorAudioBuses *buses = nullptr; protected: static void _bind_methods(); @@ -153,22 +153,22 @@ public: class EditorAudioBuses : public VBoxContainer { GDCLASS(EditorAudioBuses, VBoxContainer); - HBoxContainer *top_hb; + HBoxContainer *top_hb = nullptr; - ScrollContainer *bus_scroll; - HBoxContainer *bus_hb; + ScrollContainer *bus_scroll = nullptr; + HBoxContainer *bus_hb = nullptr; - EditorAudioBusDrop *drop_end; + EditorAudioBusDrop *drop_end = nullptr; - Label *file; + Label *file = nullptr; - Button *add; - Button *load; - Button *save_as; - Button *_default; - Button *_new; + Button *add = nullptr; + Button *load = nullptr; + Button *save_as = nullptr; + Button *_default = nullptr; + Button *_new = nullptr; - Timer *save_timer; + Timer *save_timer = nullptr; String edited_path; void _add_bus(); @@ -191,7 +191,7 @@ class EditorAudioBuses : public VBoxContainer { void _load_default_layout(); void _new_layout(); - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; bool new_layout; void _file_dialog_callback(const String &p_string); @@ -262,7 +262,7 @@ public: class AudioBusesEditorPlugin : public EditorPlugin { GDCLASS(AudioBusesEditorPlugin, EditorPlugin); - EditorAudioBuses *audio_bus_editor; + EditorAudioBuses *audio_bus_editor = nullptr; public: virtual String get_name() const override { return "SampleLibrary"; } diff --git a/editor/editor_command_palette.h b/editor/editor_command_palette.h index 41141af0c3..124703cca4 100644 --- a/editor/editor_command_palette.h +++ b/editor/editor_command_palette.h @@ -40,8 +40,8 @@ class EditorCommandPalette : public ConfirmationDialog { GDCLASS(EditorCommandPalette, ConfirmationDialog); static EditorCommandPalette *singleton; - LineEdit *command_search_box; - Tree *search_options; + LineEdit *command_search_box = nullptr; + Tree *search_options = nullptr; struct Command { Callable callable; diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h index e97b5ce8af..9baa37793b 100644 --- a/editor/editor_dir_dialog.h +++ b/editor/editor_dir_dialog.h @@ -39,14 +39,14 @@ class EditorDirDialog : public ConfirmationDialog { GDCLASS(EditorDirDialog, ConfirmationDialog); - ConfirmationDialog *makedialog; - LineEdit *makedirname; - AcceptDialog *mkdirerr; + ConfirmationDialog *makedialog = nullptr; + LineEdit *makedirname = nullptr; + AcceptDialog *mkdirerr = nullptr; - Button *makedir; + Button *makedir = nullptr; Set<String> opened_paths; - Tree *tree; + Tree *tree = nullptr; bool updating = false; void _item_collapsed(Object *p_item); diff --git a/editor/editor_export.h b/editor/editor_export.h index 7c61e7cff6..4d5aebc770 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -380,7 +380,7 @@ class EditorExport : public Node { StringName _export_presets_updated; - Timer *save_timer; + Timer *save_timer = nullptr; bool block_save = false; static EditorExport *singleton; diff --git a/editor/editor_feature_profile.h b/editor/editor_feature_profile.h index 881f14638f..19df8a9686 100644 --- a/editor/editor_feature_profile.h +++ b/editor/editor_feature_profile.h @@ -117,25 +117,25 @@ class EditorFeatureProfileManager : public AcceptDialog { CLASS_OPTION_DISABLE_EDITOR }; - ConfirmationDialog *erase_profile_dialog; - ConfirmationDialog *new_profile_dialog; - LineEdit *new_profile_name; + ConfirmationDialog *erase_profile_dialog = nullptr; + ConfirmationDialog *new_profile_dialog = nullptr; + LineEdit *new_profile_name = nullptr; - LineEdit *current_profile_name; - OptionButton *profile_list; + LineEdit *current_profile_name = nullptr; + OptionButton *profile_list = nullptr; Button *profile_actions[PROFILE_MAX]; - HSplitContainer *h_split; + HSplitContainer *h_split = nullptr; - VBoxContainer *class_list_vbc; - Tree *class_list; - VBoxContainer *property_list_vbc; - Tree *property_list; - EditorHelpBit *description_bit; - Label *no_profile_selected_help; + VBoxContainer *class_list_vbc = nullptr; + Tree *class_list = nullptr; + VBoxContainer *property_list_vbc = nullptr; + Tree *property_list = nullptr; + EditorHelpBit *description_bit = nullptr; + Label *no_profile_selected_help = nullptr; - EditorFileDialog *import_profiles; - EditorFileDialog *export_profile; + EditorFileDialog *import_profiles = nullptr; + EditorFileDialog *export_profile = nullptr; void _profile_action(int p_action); void _profile_selected(int p_what); @@ -163,7 +163,7 @@ class EditorFeatureProfileManager : public AcceptDialog { void _property_item_edited(); void _save_and_update(); - Timer *update_timer; + Timer *update_timer = nullptr; void _emit_current_profile_changed(); static EditorFeatureProfileManager *singleton; diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index a747255ce8..07af8c5435 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -84,50 +84,50 @@ private: ITEM_MENU_SHOW_IN_EXPLORER }; - ConfirmationDialog *makedialog; - LineEdit *makedirname; + ConfirmationDialog *makedialog = nullptr; + LineEdit *makedirname = nullptr; - Button *makedir; + Button *makedir = nullptr; Access access; - VBoxContainer *vbox; + VBoxContainer *vbox = nullptr; FileMode mode; bool can_create_dir; - LineEdit *dir; - - Button *dir_prev; - Button *dir_next; - Button *dir_up; - - HBoxContainer *drives_container; - HBoxContainer *shortcuts_container; - OptionButton *drives; - ItemList *item_list; - PopupMenu *item_menu; - TextureRect *preview; - VBoxContainer *preview_vb; - HSplitContainer *list_hb; - HBoxContainer *file_box; - LineEdit *file; - OptionButton *filter; - AcceptDialog *error_dialog; - DirAccess *dir_access; - ConfirmationDialog *confirm_save; - DependencyRemoveDialog *dep_remove_dialog; - ConfirmationDialog *global_remove_dialog; - - Button *mode_thumbnails; - Button *mode_list; - - Button *refresh; - Button *favorite; - Button *show_hidden; - - Button *fav_up; - Button *fav_down; - - ItemList *favorites; - ItemList *recent; + LineEdit *dir = nullptr; + + Button *dir_prev = nullptr; + Button *dir_next = nullptr; + Button *dir_up = nullptr; + + HBoxContainer *drives_container = nullptr; + HBoxContainer *shortcuts_container = nullptr; + OptionButton *drives = nullptr; + ItemList *item_list = nullptr; + PopupMenu *item_menu = nullptr; + TextureRect *preview = nullptr; + VBoxContainer *preview_vb = nullptr; + HSplitContainer *list_hb = nullptr; + HBoxContainer *file_box = nullptr; + LineEdit *file = nullptr; + OptionButton *filter = nullptr; + AcceptDialog *error_dialog = nullptr; + DirAccess *dir_access = nullptr; + ConfirmationDialog *confirm_save = nullptr; + DependencyRemoveDialog *dep_remove_dialog = nullptr; + ConfirmationDialog *global_remove_dialog = nullptr; + + Button *mode_thumbnails = nullptr; + Button *mode_list = nullptr; + + Button *refresh = nullptr; + Button *favorite = nullptr; + Button *show_hidden = nullptr; + + Button *fav_up = nullptr; + Button *fav_down = nullptr; + + ItemList *favorites = nullptr; + ItemList *recent = nullptr; Vector<String> local_history; int local_history_pos; diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 0ddac65839..05b55d4e1b 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -49,7 +49,7 @@ class EditorFileSystemDirectory : public Object { uint64_t modified_time; bool verified = false; //used for checking changes - EditorFileSystemDirectory *parent; + EditorFileSystemDirectory *parent = nullptr; Vector<EditorFileSystemDirectory *> subdirs; struct FileInfo { @@ -167,7 +167,7 @@ class EditorFileSystem : public Node { Thread thread; static void _thread_func(void *_userdata); - EditorFileSystemDirectory *new_filesystem; + EditorFileSystemDirectory *new_filesystem = nullptr; bool abort_scan = false; bool scanning = false; @@ -184,7 +184,7 @@ class EditorFileSystem : public Node { void _save_late_updated_files(); - EditorFileSystemDirectory *filesystem; + EditorFileSystemDirectory *filesystem = nullptr; static EditorFileSystem *singleton; diff --git a/editor/editor_help.h b/editor/editor_help.h index b40d1709b6..054fd84af6 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -47,14 +47,14 @@ class FindBar : public HBoxContainer { GDCLASS(FindBar, HBoxContainer); - LineEdit *search_text; - Button *find_prev; - Button *find_next; - Label *matches_label; - TextureButton *hide_button; + LineEdit *search_text = nullptr; + Button *find_prev = nullptr; + Button *find_next = nullptr; + Label *matches_label = nullptr; + TextureButton *hide_button = nullptr; String prev_search; - RichTextLabel *rich_text_label; + RichTextLabel *rich_text_label = nullptr; int results_count; @@ -114,15 +114,15 @@ class EditorHelp : public VBoxContainer { Map<String, Map<String, int>> enum_values_line; int description_line; - RichTextLabel *class_desc; - HSplitContainer *h_split; + RichTextLabel *class_desc = nullptr; + HSplitContainer *h_split = nullptr; static DocTools *doc; - ConfirmationDialog *search_dialog; - LineEdit *search; - FindBar *find_bar; - HBoxContainer *status_bar; - Button *toggle_scripts_button; + ConfirmationDialog *search_dialog = nullptr; + LineEdit *search = nullptr; + FindBar *find_bar = nullptr; + HBoxContainer *status_bar = nullptr; + Button *toggle_scripts_button = nullptr; String base_path; @@ -210,7 +210,7 @@ public: class EditorHelpBit : public MarginContainer { GDCLASS(EditorHelpBit, MarginContainer); - RichTextLabel *rich_text; + RichTextLabel *rich_text = nullptr; void _go_to_help(String p_what); void _meta_clicked(String p_select); diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index bf69fe1693..d89bb0959c 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -55,11 +55,11 @@ class EditorHelpSearch : public ConfirmationDialog { SEARCH_SHOW_HIERARCHY = 1 << 30 }; - LineEdit *search_box; - Button *case_sensitive_button; - Button *hierarchy_button; - OptionButton *filter_combo; - Tree *results_tree; + LineEdit *search_box = nullptr; + Button *case_sensitive_button = nullptr; + Button *hierarchy_button = nullptr; + OptionButton *filter_combo = nullptr; + Tree *results_tree = nullptr; bool old_search = false; String old_term; @@ -114,8 +114,8 @@ class EditorHelpSearch::Runner : public RefCounted { } }; - Control *ui_service; - Tree *results_tree; + Control *ui_service = nullptr; + Tree *results_tree = nullptr; String term; int search_flags; diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 87703564b9..c9e8a1672e 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -68,7 +68,7 @@ private: String label; int text_size; friend class EditorInspector; - Object *object; + Object *object = nullptr; StringName property; String property_path; @@ -111,9 +111,9 @@ private: float split_ratio; Vector<Control *> focusables; - Control *label_reference; - Control *bottom_editor; - PopupMenu *menu; + Control *label_reference = nullptr; + Control *bottom_editor = nullptr; + PopupMenu *menu = nullptr; mutable String tooltip_text; @@ -269,14 +269,14 @@ class EditorInspectorSection : public Container { bool foldable = false; int indent_depth = 0; - Timer *dropping_unfold_timer; + Timer *dropping_unfold_timer = nullptr; bool dropping = false; void _test_unfold(); protected: Object *object = nullptr; - VBoxContainer *vbox; + VBoxContainer *vbox = nullptr; void _notification(int p_what); static void _bind_methods(); @@ -297,7 +297,7 @@ public: class EditorInspectorArray : public EditorInspectorSection { GDCLASS(EditorInspectorArray, EditorInspectorSection); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; enum Mode { MODE_NONE, @@ -309,16 +309,16 @@ class EditorInspectorArray : public EditorInspectorSection { int count = 0; - VBoxContainer *elements_vbox; + VBoxContainer *elements_vbox = nullptr; - Control *control_dropping; + Control *control_dropping = nullptr; bool dropping = false; - Button *add_button; + Button *add_button = nullptr; - AcceptDialog *resize_dialog; + AcceptDialog *resize_dialog = nullptr; int new_size = 0; - LineEdit *new_size_line_edit; + LineEdit *new_size_line_edit = nullptr; // Pagination int page_length = 5; @@ -337,14 +337,14 @@ class EditorInspectorArray : public EditorInspectorSection { OPTION_RESIZE_ARRAY, }; int popup_array_index_pressed = -1; - PopupMenu *rmb_popup; + PopupMenu *rmb_popup = nullptr; struct ArrayElement { - PanelContainer *panel; - MarginContainer *margin; - HBoxContainer *hbox; - TextureRect *move_texture_rect; - VBoxContainer *vbox; + PanelContainer *panel = nullptr; + MarginContainer *margin = nullptr; + HBoxContainer *hbox = nullptr; + TextureRect *move_texture_rect = nullptr; + VBoxContainer *vbox = nullptr; }; LocalVector<ArrayElement> array_elements; @@ -399,12 +399,12 @@ class EditorPaginator : public HBoxContainer { int page = 0; int max_page = 0; - Button *first_page_button; - Button *prev_page_button; - LineEdit *page_line_edit; - Label *page_count_label; - Button *next_page_button; - Button *last_page_button; + Button *first_page_button = nullptr; + Button *prev_page_button = nullptr; + LineEdit *page_line_edit = nullptr; + Label *page_count_label = nullptr; + Button *next_page_button = nullptr; + Button *last_page_button = nullptr; void _first_page_button_pressed(); void _prev_page_button_pressed(); @@ -425,14 +425,14 @@ public: class EditorInspector : public ScrollContainer { GDCLASS(EditorInspector, ScrollContainer); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; enum { MAX_PLUGINS = 1024 }; static Ref<EditorInspectorPlugin> inspector_plugins[MAX_PLUGINS]; static int inspector_plugin_count; - VBoxContainer *main_vbox; + VBoxContainer *main_vbox = nullptr; //map use to cache the instantiated editors Map<StringName, List<EditorProperty *>> editor_property_map; @@ -440,11 +440,11 @@ class EditorInspector : public ScrollContainer { Set<StringName> pending; void _clear(); - Object *object; + Object *object = nullptr; // - LineEdit *search_box; + LineEdit *search_box = nullptr; bool show_categories = false; bool hide_script = true; bool hide_metadata = true; diff --git a/editor/editor_layouts_dialog.h b/editor/editor_layouts_dialog.h index bbdffd6722..a597ac38cc 100644 --- a/editor/editor_layouts_dialog.h +++ b/editor/editor_layouts_dialog.h @@ -39,9 +39,9 @@ class ItemList; class EditorLayoutsDialog : public ConfirmationDialog { GDCLASS(EditorLayoutsDialog, ConfirmationDialog); - LineEdit *name; - ItemList *layout_names; - VBoxContainer *makevb; + LineEdit *name = nullptr; + ItemList *layout_names = nullptr; + VBoxContainer *makevb = nullptr; void _line_gui_input(const Ref<InputEvent> &p_event); diff --git a/editor/editor_log.h b/editor/editor_log.h index e66b732ffe..267ad406d4 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -117,23 +117,23 @@ private: // Maps MessageTypes to LogFilters for convenient access and storage (don't need 1 member per filter). Map<MessageType, LogFilter *> type_filter_map; - RichTextLabel *log; + RichTextLabel *log = nullptr; - Button *clear_button; - Button *copy_button; + Button *clear_button = nullptr; + Button *copy_button = nullptr; - Button *collapse_button; + Button *collapse_button = nullptr; bool collapse = false; - Button *show_search_button; - LineEdit *search_box; + Button *show_search_button = nullptr; + LineEdit *search_box = nullptr; // Reference to the "Output" button on the toolbar so we can update it's icon when // Warnings or Errors are encounetered. - Button *tool_button; + Button *tool_button = nullptr; bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try trigger a save, which happens during loading). - Timer *save_state_timer; + Timer *save_state_timer = nullptr; static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type); diff --git a/editor/editor_node.h b/editor/editor_node.h index 7d24cfe758..5f09d4e518 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -275,161 +275,161 @@ private: bool _initializing_plugins = false; Map<String, EditorPlugin *> addon_name_to_plugin; - PanelContainer *scene_root_parent; - Control *theme_base; - Control *gui_base; - VBoxContainer *main_vbox; - OptionButton *rendering_driver; + PanelContainer *scene_root_parent = nullptr; + Control *theme_base = nullptr; + Control *gui_base = nullptr; + VBoxContainer *main_vbox = nullptr; + OptionButton *rendering_driver = nullptr; - ConfirmationDialog *video_restart_dialog; + ConfirmationDialog *video_restart_dialog = nullptr; int rendering_driver_current; String rendering_driver_request; // Split containers. - HSplitContainer *left_l_hsplit; - VSplitContainer *left_l_vsplit; - HSplitContainer *left_r_hsplit; - VSplitContainer *left_r_vsplit; - HSplitContainer *main_hsplit; - HSplitContainer *right_hsplit; - VSplitContainer *right_l_vsplit; - VSplitContainer *right_r_vsplit; - VSplitContainer *center_split; + HSplitContainer *left_l_hsplit = nullptr; + VSplitContainer *left_l_vsplit = nullptr; + HSplitContainer *left_r_hsplit = nullptr; + VSplitContainer *left_r_vsplit = nullptr; + HSplitContainer *main_hsplit = nullptr; + HSplitContainer *right_hsplit = nullptr; + VSplitContainer *right_l_vsplit = nullptr; + VSplitContainer *right_r_vsplit = nullptr; + VSplitContainer *center_split = nullptr; // To access those easily by index. Vector<VSplitContainer *> vsplits; Vector<HSplitContainer *> hsplits; // Main tabs. - TabBar *scene_tabs; - PopupMenu *scene_tabs_context_menu; - Panel *tab_preview_panel; - TextureRect *tab_preview; + TabBar *scene_tabs = nullptr; + PopupMenu *scene_tabs_context_menu = nullptr; + Panel *tab_preview_panel = nullptr; + TextureRect *tab_preview = nullptr; int tab_closing_idx; bool exiting = false; bool dimmed = false; int old_split_ofs; - VSplitContainer *top_split; - HBoxContainer *bottom_hb; - Control *vp_base; - - HBoxContainer *menu_hb; - Control *main_control; - MenuButton *file_menu; - MenuButton *project_menu; - MenuButton *debug_menu; - MenuButton *settings_menu; - MenuButton *help_menu; - PopupMenu *tool_menu; - Button *export_button; - Button *prev_scene; - Button *play_button; - Button *pause_button; - Button *stop_button; - Button *run_settings_button; - Button *play_scene_button; - Button *play_custom_scene_button; - Button *search_button; - TextureProgressBar *audio_vu; - - Timer *screenshot_timer; - - PluginConfigDialog *plugin_config_dialog; - - RichTextLabel *load_errors; - AcceptDialog *load_error_dialog; - - RichTextLabel *execute_outputs; - AcceptDialog *execute_output_dialog; + VSplitContainer *top_split = nullptr; + HBoxContainer *bottom_hb = nullptr; + Control *vp_base = nullptr; + + HBoxContainer *menu_hb = nullptr; + Control *main_control = nullptr; + MenuButton *file_menu = nullptr; + MenuButton *project_menu = nullptr; + MenuButton *debug_menu = nullptr; + MenuButton *settings_menu = nullptr; + MenuButton *help_menu = nullptr; + PopupMenu *tool_menu = nullptr; + Button *export_button = nullptr; + Button *prev_scene = nullptr; + Button *play_button = nullptr; + Button *pause_button = nullptr; + Button *stop_button = nullptr; + Button *run_settings_button = nullptr; + Button *play_scene_button = nullptr; + Button *play_custom_scene_button = nullptr; + Button *search_button = nullptr; + TextureProgressBar *audio_vu = nullptr; + + Timer *screenshot_timer = nullptr; + + PluginConfigDialog *plugin_config_dialog = nullptr; + + RichTextLabel *load_errors = nullptr; + AcceptDialog *load_error_dialog = nullptr; + + RichTextLabel *execute_outputs = nullptr; + AcceptDialog *execute_output_dialog = nullptr; Ref<Theme> theme; - PopupMenu *recent_scenes; + PopupMenu *recent_scenes = nullptr; String _recent_scene; List<String> previous_scenes; String defer_load_scene; - Node *_last_instantiated_scene; - - ConfirmationDialog *confirmation; - ConfirmationDialog *save_confirmation; - ConfirmationDialog *import_confirmation; - ConfirmationDialog *pick_main_scene; - Button *select_current_scene_button; - AcceptDialog *accept; - AcceptDialog *save_accept; - EditorAbout *about; - AcceptDialog *warning; + Node *_last_instantiated_scene = nullptr; + + ConfirmationDialog *confirmation = nullptr; + ConfirmationDialog *save_confirmation = nullptr; + ConfirmationDialog *import_confirmation = nullptr; + ConfirmationDialog *pick_main_scene = nullptr; + Button *select_current_scene_button = nullptr; + AcceptDialog *accept = nullptr; + AcceptDialog *save_accept = nullptr; + EditorAbout *about = nullptr; + AcceptDialog *warning = nullptr; int overridden_default_layout; Ref<ConfigFile> default_layout; - PopupMenu *editor_layouts; - EditorLayoutsDialog *layout_dialog; - - ConfirmationDialog *custom_build_manage_templates; - ConfirmationDialog *install_android_build_template; - ConfirmationDialog *remove_android_build_template; - - PopupMenu *vcs_actions_menu; - EditorFileDialog *file; - ExportTemplateManager *export_template_manager; - EditorFeatureProfileManager *feature_profile_manager; - EditorFileDialog *file_templates; - EditorFileDialog *file_export_lib; - EditorFileDialog *file_script; - EditorFileDialog *file_android_build_source; - CheckBox *file_export_lib_merge; - CheckBox *file_export_lib_apply_xforms; + PopupMenu *editor_layouts = nullptr; + EditorLayoutsDialog *layout_dialog = nullptr; + + ConfirmationDialog *custom_build_manage_templates = nullptr; + ConfirmationDialog *install_android_build_template = nullptr; + ConfirmationDialog *remove_android_build_template = nullptr; + + PopupMenu *vcs_actions_menu = nullptr; + EditorFileDialog *file = nullptr; + ExportTemplateManager *export_template_manager = nullptr; + EditorFeatureProfileManager *feature_profile_manager = nullptr; + EditorFileDialog *file_templates = nullptr; + EditorFileDialog *file_export_lib = nullptr; + EditorFileDialog *file_script = nullptr; + EditorFileDialog *file_android_build_source = nullptr; + CheckBox *file_export_lib_merge = nullptr; + CheckBox *file_export_lib_apply_xforms = nullptr; String current_path; - MenuButton *update_spinner; + MenuButton *update_spinner = nullptr; - HBoxContainer *main_editor_button_vb; + HBoxContainer *main_editor_button_vb = nullptr; Vector<Button *> main_editor_buttons; Vector<EditorPlugin *> editor_table; - AudioStreamPreviewGenerator *audio_preview_gen; - ProgressDialog *progress_dialog; - BackgroundProgress *progress_hb; + AudioStreamPreviewGenerator *audio_preview_gen = nullptr; + ProgressDialog *progress_dialog = nullptr; + BackgroundProgress *progress_hb = nullptr; - DependencyErrorDialog *dependency_error; + DependencyErrorDialog *dependency_error = nullptr; Map<String, Set<String>> dependency_errors; - DependencyEditor *dependency_fixer; - OrphanResourcesDialog *orphan_resources; - ConfirmationDialog *open_imported; - Button *new_inherited_button; + DependencyEditor *dependency_fixer = nullptr; + OrphanResourcesDialog *orphan_resources = nullptr; + ConfirmationDialog *open_imported = nullptr; + Button *new_inherited_button = nullptr; String open_import_request; Vector<Control *> floating_docks; - Button *dock_float; - Button *dock_tab_move_left; - Button *dock_tab_move_right; - Control *dock_select; - PopupPanel *dock_select_popup; + Button *dock_float = nullptr; + Button *dock_tab_move_left = nullptr; + Button *dock_tab_move_right = nullptr; + Control *dock_select = nullptr; + PopupPanel *dock_select_popup = nullptr; Rect2 dock_select_rect[DOCK_SLOT_MAX]; TabContainer *dock_slot[DOCK_SLOT_MAX]; - Timer *dock_drag_timer; + Timer *dock_drag_timer = nullptr; bool docks_visible = true; int dock_popup_selected_idx; int dock_select_rect_over_idx; - HBoxContainer *tabbar_container; - Button *distraction_free; - Button *scene_tab_add; - Control *scene_tab_add_ph; + HBoxContainer *tabbar_container = nullptr; + Button *distraction_free = nullptr; + Button *scene_tab_add = nullptr; + Control *scene_tab_add_ph = nullptr; Vector<BottomPanelItem> bottom_panel_items; - PanelContainer *bottom_panel; - HBoxContainer *bottom_panel_hb; - HBoxContainer *bottom_panel_hb_editors; - VBoxContainer *bottom_panel_vb; - EditorToaster *editor_toaster; - LinkButton *version_btn; - Button *bottom_panel_raise; + PanelContainer *bottom_panel = nullptr; + HBoxContainer *bottom_panel_hb = nullptr; + HBoxContainer *bottom_panel_hb_editors = nullptr; + VBoxContainer *bottom_panel_vb = nullptr; + EditorToaster *editor_toaster = nullptr; + LinkButton *version_btn = nullptr; + Button *bottom_panel_raise = nullptr; - Tree *disk_changed_list; - ConfirmationDialog *disk_changed; + Tree *disk_changed_list = nullptr; + ConfirmationDialog *disk_changed = nullptr; bool scene_distraction_free = false; bool script_distraction_free = false; @@ -447,8 +447,8 @@ private: int current_menu_option; - SubViewport *scene_root; // Root of the scene being edited. - Object *current; + SubViewport *scene_root = nullptr; // Root of the scene being edited. + Object *current = nullptr; Ref<Resource> saving_resource; @@ -464,8 +464,8 @@ private: uint64_t saved_version; uint64_t last_checked_version; - DynamicFontImportSettings *fontdata_import_settings; - SceneImportSettings *scene_import_settings; + DynamicFontImportSettings *fontdata_import_settings = nullptr; + SceneImportSettings *scene_import_settings = nullptr; String import_reload_fn; diff --git a/editor/editor_path.h b/editor/editor_path.h index 1e19344d9e..afc7a20bad 100644 --- a/editor/editor_path.h +++ b/editor/editor_path.h @@ -42,12 +42,12 @@ class EditorSelectionHistory; class EditorPath : public Button { GDCLASS(EditorPath, Button); - EditorSelectionHistory *history; + EditorSelectionHistory *history = nullptr; - TextureRect *current_object_icon; - Label *current_object_label; - TextureRect *sub_objects_icon; - PopupMenu *sub_objects_menu; + TextureRect *current_object_icon = nullptr; + Label *current_object_label = nullptr; + TextureRect *sub_objects_icon = nullptr; + PopupMenu *sub_objects_menu = nullptr; Vector<ObjectID> objects; diff --git a/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h index c239b735de..826bb8c00f 100644 --- a/editor/editor_plugin_settings.h +++ b/editor/editor_plugin_settings.h @@ -44,10 +44,10 @@ class EditorPluginSettings : public VBoxContainer { BUTTON_PLUGIN_EDIT }; - PluginConfigDialog *plugin_config_dialog; - Button *create_plugin; - Button *update_list; - Tree *plugin_list; + PluginConfigDialog *plugin_config_dialog = nullptr; + Button *create_plugin = nullptr; + Button *update_list = nullptr; + Tree *plugin_list = nullptr; bool updating = false; void _plugin_activity_changed(); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index c21e0e0b4d..1f40a7fe7b 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -52,7 +52,7 @@ public: class EditorPropertyText : public EditorProperty { GDCLASS(EditorPropertyText, EditorProperty); - LineEdit *text; + LineEdit *text = nullptr; bool updating = false; bool string_name = false; @@ -72,11 +72,11 @@ public: class EditorPropertyMultilineText : public EditorProperty { GDCLASS(EditorPropertyMultilineText, EditorProperty); - TextEdit *text; + TextEdit *text = nullptr; - AcceptDialog *big_text_dialog; - TextEdit *big_text; - Button *open_big_text; + AcceptDialog *big_text_dialog = nullptr; + TextEdit *big_text = nullptr; + Button *open_big_text = nullptr; void _big_text_changed(); void _text_changed(); @@ -95,15 +95,15 @@ public: class EditorPropertyTextEnum : public EditorProperty { GDCLASS(EditorPropertyTextEnum, EditorProperty); - HBoxContainer *default_layout; - HBoxContainer *edit_custom_layout; + HBoxContainer *default_layout = nullptr; + HBoxContainer *edit_custom_layout = nullptr; - OptionButton *option_button; - Button *edit_button; + OptionButton *option_button = nullptr; + Button *edit_button = nullptr; - LineEdit *custom_value_edit; - Button *accept_button; - Button *cancel_button; + LineEdit *custom_value_edit = nullptr; + Button *accept_button = nullptr; + Button *cancel_button = nullptr; Vector<String> options; bool string_name = false; @@ -134,9 +134,9 @@ class EditorPropertyPath : public EditorProperty { bool folder = false; bool global = false; bool save_mode = false; - EditorFileDialog *dialog; - LineEdit *path; - Button *path_edit; + EditorFileDialog *dialog = nullptr; + LineEdit *path = nullptr; + Button *path_edit = nullptr; void _path_selected(const String &p_path); void _path_pressed(); @@ -156,9 +156,9 @@ public: class EditorPropertyLocale : public EditorProperty { GDCLASS(EditorPropertyLocale, EditorProperty); - EditorLocaleDialog *dialog; - LineEdit *locale; - Button *locale_edit; + EditorLocaleDialog *dialog = nullptr; + LineEdit *locale = nullptr; + Button *locale_edit = nullptr; void _locale_selected(const String &p_locale); void _locale_pressed(); @@ -178,8 +178,8 @@ class EditorPropertyClassName : public EditorProperty { GDCLASS(EditorPropertyClassName, EditorProperty); private: - CreateDialog *dialog; - Button *property; + CreateDialog *dialog = nullptr; + Button *property = nullptr; String selected_type; String base_type; void _property_selected(); @@ -212,8 +212,8 @@ public: private: Type hint; - PropertySelector *selector; - Button *property; + PropertySelector *selector = nullptr; + Button *property = nullptr; String hint_text; void _property_selected(const String &p_selected); @@ -231,7 +231,7 @@ public: class EditorPropertyCheck : public EditorProperty { GDCLASS(EditorPropertyCheck, EditorProperty); - CheckBox *checkbox; + CheckBox *checkbox = nullptr; void _checkbox_pressed(); @@ -246,7 +246,7 @@ public: class EditorPropertyEnum : public EditorProperty { GDCLASS(EditorPropertyEnum, EditorProperty); - OptionButton *options; + OptionButton *options = nullptr; void _option_selected(int p_which); @@ -263,7 +263,7 @@ public: class EditorPropertyFlags : public EditorProperty { GDCLASS(EditorPropertyFlags, EditorProperty); - VBoxContainer *vbox; + VBoxContainer *vbox = nullptr; Vector<CheckBox *> flags; Vector<int> flag_indices; @@ -293,9 +293,9 @@ private: int hovered_index = -1; bool read_only = false; int renamed_layer_index = -1; - PopupMenu *layer_rename; - ConfirmationDialog *rename_dialog; - LineEdit *rename_dialog_text; + PopupMenu *layer_rename = nullptr; + ConfirmationDialog *rename_dialog = nullptr; + LineEdit *rename_dialog_text = nullptr; void _rename_pressed(int p_menu); void _rename_operation_confirm(); @@ -334,12 +334,12 @@ public: }; private: - EditorPropertyLayersGrid *grid; + EditorPropertyLayersGrid *grid = nullptr; void _grid_changed(uint32_t p_grid); String basename; LayerType layer_type; - PopupMenu *layers; - Button *button; + PopupMenu *layers = nullptr; + Button *button = nullptr; void _button_pressed(); void _menu_pressed(int p_menu); @@ -358,7 +358,7 @@ public: class EditorPropertyInteger : public EditorProperty { GDCLASS(EditorPropertyInteger, EditorProperty); - EditorSpinSlider *spin; + EditorSpinSlider *spin = nullptr; bool setting = false; void _value_changed(int64_t p_val); @@ -374,7 +374,7 @@ public: class EditorPropertyObjectID : public EditorProperty { GDCLASS(EditorPropertyObjectID, EditorProperty); - Button *edit; + Button *edit = nullptr; String base_type; void _edit_pressed(); @@ -390,7 +390,7 @@ public: class EditorPropertyFloat : public EditorProperty { GDCLASS(EditorPropertyFloat, EditorProperty); - EditorSpinSlider *spin; + EditorSpinSlider *spin = nullptr; bool setting = false; bool angle_in_radians = false; void _value_changed(double p_val); @@ -407,9 +407,9 @@ public: class EditorPropertyEasing : public EditorProperty { GDCLASS(EditorPropertyEasing, EditorProperty); - Control *easing_draw; - PopupMenu *preset; - EditorSpinSlider *spin; + Control *easing_draw = nullptr; + PopupMenu *preset = nullptr; + EditorSpinSlider *spin = nullptr; bool setting = false; bool dragging = false; @@ -657,7 +657,7 @@ public: class EditorPropertyColor : public EditorProperty { GDCLASS(EditorPropertyColor, EditorProperty); - ColorPickerButton *picker; + ColorPickerButton *picker = nullptr; void _color_changed(const Color &p_color); void _popup_closed(); void _picker_created(); @@ -677,9 +677,9 @@ public: class EditorPropertyNodePath : public EditorProperty { GDCLASS(EditorPropertyNodePath, EditorProperty); - Button *assign; - Button *clear; - SceneTreeDialog *scene_tree; + Button *assign = nullptr; + Button *clear = nullptr; + SceneTreeDialog *scene_tree = nullptr; NodePath base_hint; bool use_path_from_scene_root = false; @@ -705,7 +705,7 @@ public: class EditorPropertyRID : public EditorProperty { GDCLASS(EditorPropertyRID, EditorProperty); - Label *label; + Label *label = nullptr; public: virtual void update_property() override; diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index 3d9fe90b20..070353c538 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -80,7 +80,7 @@ public: class EditorPropertyArray : public EditorProperty { GDCLASS(EditorPropertyArray, EditorProperty); - PopupMenu *change_type; + PopupMenu *change_type = nullptr; bool updating = false; bool dropping = false; @@ -88,12 +88,12 @@ class EditorPropertyArray : public EditorProperty { int page_length = 20; int page_index = 0; int changing_type_index; - Button *edit; - VBoxContainer *vbox; - VBoxContainer *property_vbox; - EditorSpinSlider *size_slider; - Button *button_add_item; - EditorPaginator *paginator; + Button *edit = nullptr; + VBoxContainer *vbox = nullptr; + VBoxContainer *property_vbox = nullptr; + EditorSpinSlider *size_slider = nullptr; + Button *button_add_item = nullptr; + EditorPaginator *paginator = nullptr; Variant::Type array_type; Variant::Type subtype; PropertyHint subtype_hint; @@ -138,19 +138,19 @@ public: class EditorPropertyDictionary : public EditorProperty { GDCLASS(EditorPropertyDictionary, EditorProperty); - PopupMenu *change_type; + PopupMenu *change_type = nullptr; bool updating = false; Ref<EditorPropertyDictionaryObject> object; int page_length = 20; int page_index = 0; int changing_type_index; - Button *edit; - VBoxContainer *vbox; - VBoxContainer *property_vbox; - EditorSpinSlider *size_slider; - Button *button_add_item; - EditorPaginator *paginator; + Button *edit = nullptr; + VBoxContainer *vbox = nullptr; + VBoxContainer *property_vbox = nullptr; + EditorSpinSlider *size_slider = nullptr; + Button *button_add_item = nullptr; + EditorPaginator *paginator = nullptr; void _page_changed(int p_page); void _edit_pressed(); @@ -173,19 +173,19 @@ public: class EditorPropertyLocalizableString : public EditorProperty { GDCLASS(EditorPropertyLocalizableString, EditorProperty); - EditorLocaleDialog *locale_select; + EditorLocaleDialog *locale_select = nullptr; bool updating; Ref<EditorPropertyDictionaryObject> object; int page_length = 20; int page_index = 0; - Button *edit; - VBoxContainer *vbox; - VBoxContainer *property_vbox; - EditorSpinSlider *size_slider; - Button *button_add_item; - EditorPaginator *paginator; + Button *edit = nullptr; + VBoxContainer *vbox = nullptr; + VBoxContainer *property_vbox = nullptr; + EditorSpinSlider *size_slider = nullptr; + Button *button_add_item = nullptr; + EditorPaginator *paginator = nullptr; void _page_changed(int p_page); void _edit_pressed(); diff --git a/editor/editor_resource_picker.h b/editor/editor_resource_picker.h index a6eff760e7..cd7e507984 100644 --- a/editor/editor_resource_picker.h +++ b/editor/editor_resource_picker.h @@ -52,9 +52,9 @@ class EditorResourcePicker : public HBoxContainer { Vector<String> inheritors_array; - Button *assign_button; - TextureRect *preview_rect; - Button *edit_button; + Button *assign_button = nullptr; + TextureRect *preview_rect = nullptr; + Button *edit_button = nullptr; EditorFileDialog *file_dialog = nullptr; EditorQuickOpen *quick_open = nullptr; diff --git a/editor/editor_run_script.h b/editor/editor_run_script.h index 28a854aaeb..a2399bd780 100644 --- a/editor/editor_run_script.h +++ b/editor/editor_run_script.h @@ -39,7 +39,7 @@ class EditorNode; class EditorScript : public RefCounted { GDCLASS(EditorScript, RefCounted); - EditorNode *editor; + EditorNode *editor = nullptr; protected: static void _bind_methods(); diff --git a/editor/editor_sectioned_inspector.h b/editor/editor_sectioned_inspector.h index 7c21e00c03..0ccffa0048 100644 --- a/editor/editor_sectioned_inspector.h +++ b/editor/editor_sectioned_inspector.h @@ -42,11 +42,11 @@ class SectionedInspector : public HSplitContainer { ObjectID obj; - Tree *sections; - SectionedInspectorFilter *filter; + Tree *sections = nullptr; + SectionedInspectorFilter *filter = nullptr; Map<String, TreeItem *> section_map; - EditorInspector *inspector; + EditorInspector *inspector = nullptr; LineEdit *search_box = nullptr; String selected_category; diff --git a/editor/editor_settings_dialog.h b/editor/editor_settings_dialog.h index e3139bb07a..42831c9ebd 100644 --- a/editor/editor_settings_dialog.h +++ b/editor/editor_settings_dialog.h @@ -45,13 +45,13 @@ class EditorSettingsDialog : public AcceptDialog { bool updating = false; - TabContainer *tabs; - Control *tab_general; - Control *tab_shortcuts; + TabContainer *tabs = nullptr; + Control *tab_general = nullptr; + Control *tab_shortcuts = nullptr; - LineEdit *search_box; - LineEdit *shortcut_search_box; - SectionedInspector *inspector; + LineEdit *search_box = nullptr; + LineEdit *shortcut_search_box = nullptr; + SectionedInspector *inspector = nullptr; // Shortcuts enum ShortcutButton { @@ -61,19 +61,19 @@ class EditorSettingsDialog : public AcceptDialog { SHORTCUT_REVERT }; - Tree *shortcuts; + Tree *shortcuts = nullptr; String shortcut_filter; - InputEventConfigurationDialog *shortcut_editor; + InputEventConfigurationDialog *shortcut_editor = nullptr; bool is_editing_action = false; String current_edited_identifier; Array current_events; int current_event_index = -1; - Timer *timer; + Timer *timer = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void cancel_pressed() override; virtual void ok_pressed() override; @@ -110,10 +110,10 @@ class EditorSettingsDialog : public AcceptDialog { static void _undo_redo_callback(void *p_self, const String &p_name); - Label *restart_label; - TextureRect *restart_icon; - PanelContainer *restart_container; - Button *restart_close_button; + Label *restart_label = nullptr; + TextureRect *restart_icon = nullptr; + PanelContainer *restart_container = nullptr; + Button *restart_close_button = nullptr; void _editor_restart_request(); void _editor_restart(); diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h index 405c3bfc22..fc9f6b8722 100644 --- a/editor/editor_spin_slider.h +++ b/editor/editor_spin_slider.h @@ -44,7 +44,7 @@ class EditorSpinSlider : public Range { bool hover_updown = false; bool mouse_hover = false; - TextureRect *grabber; + TextureRect *grabber = nullptr; int grabber_range; bool mouse_over_spin = false; diff --git a/editor/editor_toaster.h b/editor/editor_toaster.h index 059245ce66..791a146a8d 100644 --- a/editor/editor_toaster.h +++ b/editor/editor_toaster.h @@ -61,11 +61,11 @@ private: Ref<StyleBoxFlat> warning_panel_style_progress; Ref<StyleBoxFlat> error_panel_style_progress; - Button *main_button; - PanelContainer *disable_notifications_panel; - Button *disable_notifications_button; + Button *main_button = nullptr; + PanelContainer *disable_notifications_panel = nullptr; + Button *disable_notifications_button = nullptr; - VBoxContainer *vbox_container; + VBoxContainer *vbox_container = nullptr; const int max_temporary_count = 5; struct Toast { Severity severity = SEVERITY_INFO; diff --git a/editor/editor_zoom_widget.h b/editor/editor_zoom_widget.h index bf8358ff1a..4690a57a2b 100644 --- a/editor/editor_zoom_widget.h +++ b/editor/editor_zoom_widget.h @@ -37,9 +37,9 @@ class EditorZoomWidget : public HBoxContainer { GDCLASS(EditorZoomWidget, HBoxContainer); - Button *zoom_minus; - Button *zoom_reset; - Button *zoom_plus; + Button *zoom_minus = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_plus = nullptr; float zoom = 1.0; void _update_zoom_label(); diff --git a/editor/export_template_manager.h b/editor/export_template_manager.h index cf7585635d..61df212f1f 100644 --- a/editor/export_template_manager.h +++ b/editor/export_template_manager.h @@ -51,42 +51,42 @@ class ExportTemplateManager : public AcceptDialog { bool is_downloading_templates = false; float update_countdown = 0; - Label *current_value; - Label *current_missing_label; - Label *current_installed_label; + Label *current_value = nullptr; + Label *current_missing_label = nullptr; + Label *current_installed_label = nullptr; - HBoxContainer *current_installed_hb; - LineEdit *current_installed_path; - Button *current_open_button; - Button *current_uninstall_button; + HBoxContainer *current_installed_hb = nullptr; + LineEdit *current_installed_path = nullptr; + Button *current_open_button = nullptr; + Button *current_uninstall_button = nullptr; - VBoxContainer *install_options_vb; - OptionButton *mirrors_list; + VBoxContainer *install_options_vb = nullptr; + OptionButton *mirrors_list = nullptr; enum MirrorAction { VISIT_WEB_MIRROR, COPY_MIRROR_URL, }; - MenuButton *mirror_options_button; - HBoxContainer *download_progress_hb; - ProgressBar *download_progress_bar; - Label *download_progress_label; - HTTPRequest *download_templates; - Button *install_file_button; - HTTPRequest *request_mirrors; + MenuButton *mirror_options_button = nullptr; + HBoxContainer *download_progress_hb = nullptr; + ProgressBar *download_progress_bar = nullptr; + Label *download_progress_label = nullptr; + HTTPRequest *download_templates = nullptr; + Button *install_file_button = nullptr; + HTTPRequest *request_mirrors = nullptr; enum TemplatesAction { OPEN_TEMPLATE_FOLDER, UNINSTALL_TEMPLATE, }; - Tree *installed_table; + Tree *installed_table = nullptr; - ConfirmationDialog *uninstall_confirm; + ConfirmationDialog *uninstall_confirm = nullptr; String uninstall_version; - FileDialog *install_file_dialog; - AcceptDialog *hide_dialog_accept; + FileDialog *install_file_dialog = nullptr; + AcceptDialog *hide_dialog_accept = nullptr; void _update_template_status(); diff --git a/editor/fileserver/editor_file_server.h b/editor/fileserver/editor_file_server.h index 7807e72800..a1bb7ecf4e 100644 --- a/editor/fileserver/editor_file_server.h +++ b/editor/fileserver/editor_file_server.h @@ -47,7 +47,7 @@ class EditorFileServer : public Object { }; struct ClientData { - Thread *thread; + Thread *thread = nullptr; Ref<StreamPeerTCP> connection; Map<int, FileAccess *> files; EditorFileServer *efs = nullptr; diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 92dac374ec..15fade2d95 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -102,57 +102,57 @@ private: FileSortOption file_sort = FILE_SORT_NAME; - VBoxContainer *scanning_vb; - ProgressBar *scanning_progress; - VSplitContainer *split_box; - VBoxContainer *file_list_vb; + VBoxContainer *scanning_vb = nullptr; + ProgressBar *scanning_progress = nullptr; + VSplitContainer *split_box = nullptr; + VBoxContainer *file_list_vb = nullptr; Set<String> favorites; - Button *button_toggle_display_mode; - Button *button_reload; - Button *button_file_list_display_mode; - Button *button_hist_next; - Button *button_hist_prev; - LineEdit *current_path; + Button *button_toggle_display_mode = nullptr; + Button *button_reload = nullptr; + Button *button_file_list_display_mode = nullptr; + Button *button_hist_next = nullptr; + Button *button_hist_prev = nullptr; + LineEdit *current_path = nullptr; - HBoxContainer *toolbar2_hbc; - LineEdit *tree_search_box; - MenuButton *tree_button_sort; + HBoxContainer *toolbar2_hbc = nullptr; + LineEdit *tree_search_box = nullptr; + MenuButton *tree_button_sort = nullptr; - LineEdit *file_list_search_box; - MenuButton *file_list_button_sort; + LineEdit *file_list_search_box = nullptr; + MenuButton *file_list_button_sort = nullptr; String searched_string; Vector<String> uncollapsed_paths_before_search; - TextureRect *search_icon; - HBoxContainer *path_hb; + TextureRect *search_icon = nullptr; + HBoxContainer *path_hb = nullptr; FileListDisplayMode file_list_display_mode; DisplayMode display_mode; DisplayMode old_display_mode; - PopupMenu *file_list_popup; - PopupMenu *tree_popup; - - DependencyEditor *deps_editor; - DependencyEditorOwners *owners_editor; - DependencyRemoveDialog *remove_dialog; - - EditorDirDialog *move_dialog; - ConfirmationDialog *rename_dialog; - LineEdit *rename_dialog_text; - ConfirmationDialog *duplicate_dialog; - LineEdit *duplicate_dialog_text; - ConfirmationDialog *make_dir_dialog; - LineEdit *make_dir_dialog_text; - ConfirmationDialog *make_scene_dialog; - LineEdit *make_scene_dialog_text; - ConfirmationDialog *overwrite_dialog; - ScriptCreateDialog *make_script_dialog; - ShaderCreateDialog *make_shader_dialog; - CreateDialog *new_resource_dialog; + PopupMenu *file_list_popup = nullptr; + PopupMenu *tree_popup = nullptr; + + DependencyEditor *deps_editor = nullptr; + DependencyEditorOwners *owners_editor = nullptr; + DependencyRemoveDialog *remove_dialog = nullptr; + + EditorDirDialog *move_dialog = nullptr; + ConfirmationDialog *rename_dialog = nullptr; + LineEdit *rename_dialog_text = nullptr; + ConfirmationDialog *duplicate_dialog = nullptr; + LineEdit *duplicate_dialog_text = nullptr; + ConfirmationDialog *make_dir_dialog = nullptr; + LineEdit *make_dir_dialog_text = nullptr; + ConfirmationDialog *make_scene_dialog = nullptr; + LineEdit *make_scene_dialog_text = nullptr; + ConfirmationDialog *overwrite_dialog = nullptr; + ScriptCreateDialog *make_script_dialog = nullptr; + ShaderCreateDialog *make_shader_dialog = nullptr; + CreateDialog *new_resource_dialog = nullptr; bool always_show_folders = false; @@ -181,8 +181,8 @@ private: bool updating_tree = false; int tree_update_id; - Tree *tree; - ItemList *files; + Tree *tree = nullptr; + ItemList *files = nullptr; bool import_dock_needs_update = false; bool holding_branch = false; diff --git a/editor/find_in_files.h b/editor/find_in_files.h index cf14f3d5c3..9def190b5b 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -132,18 +132,18 @@ private: void _on_replace_text_submitted(String text); FindInFilesMode _mode; - LineEdit *_search_text_line_edit; - - Label *_replace_label; - LineEdit *_replace_text_line_edit; - - LineEdit *_folder_line_edit; - CheckBox *_match_case_checkbox; - CheckBox *_whole_words_checkbox; - Button *_find_button; - Button *_replace_button; - FileDialog *_folder_dialog; - HBoxContainer *_filters_container; + LineEdit *_search_text_line_edit = nullptr; + + Label *_replace_label = nullptr; + LineEdit *_replace_text_line_edit = nullptr; + + LineEdit *_folder_line_edit = nullptr; + CheckBox *_match_case_checkbox = nullptr; + CheckBox *_whole_words_checkbox = nullptr; + Button *_find_button = nullptr; + Button *_replace_button = nullptr; + FileDialog *_folder_dialog = nullptr; + HBoxContainer *_filters_container = nullptr; HashMap<String, bool> _filters_preferences; }; @@ -201,20 +201,20 @@ private: void set_progress_visible(bool visible); void clear(); - FindInFiles *_finder; - Label *_search_text_label; - Tree *_results_display; - Label *_status_label; - Button *_refresh_button; - Button *_cancel_button; - ProgressBar *_progress_bar; + FindInFiles *_finder = nullptr; + Label *_search_text_label = nullptr; + Tree *_results_display = nullptr; + Label *_status_label = nullptr; + Button *_refresh_button = nullptr; + Button *_cancel_button = nullptr; + ProgressBar *_progress_bar = nullptr; Map<String, TreeItem *> _file_items; Map<TreeItem *, Result> _result_items; bool _with_replace = false; - HBoxContainer *_replace_container; - LineEdit *_replace_line_edit; - Button *_replace_all_button; + HBoxContainer *_replace_container = nullptr; + LineEdit *_replace_line_edit = nullptr; + Button *_replace_all_button = nullptr; }; #endif // FIND_IN_FILES_H diff --git a/editor/groups_editor.h b/editor/groups_editor.h index aa70ac5bc4..b6a6204013 100644 --- a/editor/groups_editor.h +++ b/editor/groups_editor.h @@ -43,32 +43,32 @@ class GroupDialog : public AcceptDialog { GDCLASS(GroupDialog, AcceptDialog); - ConfirmationDialog *error; + ConfirmationDialog *error = nullptr; - SceneTree *scene_tree; - TreeItem *groups_root; + SceneTree *scene_tree = nullptr; + TreeItem *groups_root = nullptr; - LineEdit *add_group_text; - Button *add_group_button; + LineEdit *add_group_text = nullptr; + Button *add_group_button = nullptr; - Tree *groups; + Tree *groups = nullptr; - Tree *nodes_to_add; - TreeItem *add_node_root; - LineEdit *add_filter; + Tree *nodes_to_add = nullptr; + TreeItem *add_node_root = nullptr; + LineEdit *add_filter = nullptr; - Tree *nodes_to_remove; - TreeItem *remove_node_root; - LineEdit *remove_filter; + Tree *nodes_to_remove = nullptr; + TreeItem *remove_node_root = nullptr; + LineEdit *remove_filter = nullptr; - Label *group_empty; + Label *group_empty = nullptr; - Button *add_button; - Button *remove_button; + Button *add_button = nullptr; + Button *remove_button = nullptr; String selected_group; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _group_selected(); @@ -111,15 +111,15 @@ public: class GroupsEditor : public VBoxContainer { GDCLASS(GroupsEditor, VBoxContainer); - Node *node; + Node *node = nullptr; - GroupDialog *group_dialog; + GroupDialog *group_dialog = nullptr; - LineEdit *group_name; - Button *add; - Tree *tree; + LineEdit *group_name = nullptr; + Button *add = nullptr; + Tree *tree = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void update_tree(); void _add_group(const String &p_group = ""); diff --git a/editor/import/dynamic_font_import_settings.h b/editor/import/dynamic_font_import_settings.h index 7b2a9184a4..c1e868403f 100644 --- a/editor/import/dynamic_font_import_settings.h +++ b/editor/import/dynamic_font_import_settings.h @@ -66,7 +66,7 @@ class DynamicFontImportSettings : public ConfirmationDialog { List<ResourceImporter::ImportOption> options_variations; List<ResourceImporter::ImportOption> options_general; - EditorLocaleDialog *locale_select; + EditorLocaleDialog *locale_select = nullptr; Vector<String> script_codes; // Root layout diff --git a/editor/import/scene_import_settings.h b/editor/import/scene_import_settings.h index b51f342729..3cf708740b 100644 --- a/editor/import/scene_import_settings.h +++ b/editor/import/scene_import_settings.h @@ -62,26 +62,26 @@ class SceneImportSettings : public ConfirmationDialog { Node *scene = nullptr; - HSplitContainer *tree_split; - HSplitContainer *property_split; - TabContainer *data_mode; - Tree *scene_tree; - Tree *mesh_tree; - Tree *material_tree; + HSplitContainer *tree_split = nullptr; + HSplitContainer *property_split = nullptr; + TabContainer *data_mode = nullptr; + Tree *scene_tree = nullptr; + Tree *mesh_tree = nullptr; + Tree *material_tree = nullptr; - EditorInspector *inspector; + EditorInspector *inspector = nullptr; - SubViewport *base_viewport; + SubViewport *base_viewport = nullptr; - Camera3D *camera; + Camera3D *camera = nullptr; bool first_aabb = false; AABB contents_aabb; - DirectionalLight3D *light; + DirectionalLight3D *light = nullptr; Ref<ArrayMesh> selection_mesh; - MeshInstance3D *node_selected; + MeshInstance3D *node_selected = nullptr; - MeshInstance3D *mesh_preview; + MeshInstance3D *mesh_preview = nullptr; Ref<SphereMesh> material_preview; Ref<StandardMaterial3D> collider_mat; @@ -95,9 +95,9 @@ class SceneImportSettings : public ConfirmationDialog { struct MaterialData { bool has_import_id; Ref<Material> material; - TreeItem *scene_node; - TreeItem *mesh_node; - TreeItem *material_node; + TreeItem *scene_node = nullptr; + TreeItem *mesh_node = nullptr; + TreeItem *material_node = nullptr; float cam_rot_x = -Math_PI / 4; float cam_rot_y = -Math_PI / 4; @@ -110,8 +110,8 @@ class SceneImportSettings : public ConfirmationDialog { struct MeshData { bool has_import_id; Ref<Mesh> mesh; - TreeItem *scene_node; - TreeItem *mesh_node; + TreeItem *scene_node = nullptr; + TreeItem *mesh_node = nullptr; float cam_rot_x = -Math_PI / 4; float cam_rot_y = -Math_PI / 4; @@ -122,14 +122,14 @@ class SceneImportSettings : public ConfirmationDialog { struct AnimationData { Ref<Animation> animation; - TreeItem *scene_node; + TreeItem *scene_node = nullptr; Map<StringName, Variant> settings; }; Map<String, AnimationData> animation_map; struct NodeData { - Node *node; - TreeItem *scene_node; + Node *node = nullptr; + TreeItem *scene_node = nullptr; Map<StringName, Variant> settings; }; Map<String, NodeData> node_map; @@ -158,20 +158,20 @@ class SceneImportSettings : public ConfirmationDialog { Map<StringName, Variant> defaults; - SceneImportSettingsData *scene_import_settings_data; + SceneImportSettingsData *scene_import_settings_data = nullptr; void _re_import(); String base_path; - MenuButton *action_menu; + MenuButton *action_menu = nullptr; - ConfirmationDialog *external_paths; - Tree *external_path_tree; - EditorFileDialog *save_path; - OptionButton *external_extension_type; + ConfirmationDialog *external_paths = nullptr; + Tree *external_path_tree = nullptr; + EditorFileDialog *save_path = nullptr; + OptionButton *external_extension_type = nullptr; - EditorFileDialog *item_save_path; + EditorFileDialog *item_save_path = nullptr; void _menu_callback(int p_id); void _save_dir_callback(const String &p_path); diff --git a/editor/import_defaults_editor.h b/editor/import_defaults_editor.h index ed94fe6156..f0433f6065 100644 --- a/editor/import_defaults_editor.h +++ b/editor/import_defaults_editor.h @@ -41,13 +41,13 @@ class EditorInspector; class ImportDefaultsEditor : public VBoxContainer { GDCLASS(ImportDefaultsEditor, VBoxContainer) - OptionButton *importers; - Button *save_defaults; - Button *reset_defaults; + OptionButton *importers = nullptr; + Button *save_defaults = nullptr; + Button *reset_defaults = nullptr; - EditorInspector *inspector; + EditorInspector *inspector = nullptr; - ImportDefaultsEditorSettings *settings; + ImportDefaultsEditorSettings *settings = nullptr; void _update_importer(); void _importer_selected(int p_index); diff --git a/editor/import_dock.h b/editor/import_dock.h index c5cdc4ac40..f522b0bced 100644 --- a/editor/import_dock.h +++ b/editor/import_dock.h @@ -45,25 +45,25 @@ class ImportDockParameters; class ImportDock : public VBoxContainer { GDCLASS(ImportDock, VBoxContainer); - Label *imported; - OptionButton *import_as; - MenuButton *preset; - EditorInspector *import_opts; + Label *imported = nullptr; + OptionButton *import_as = nullptr; + MenuButton *preset = nullptr; + EditorInspector *import_opts = nullptr; List<PropertyInfo> properties; Map<StringName, Variant> property_values; - ConfirmationDialog *reimport_confirm; - Label *label_warning; - Button *import; + ConfirmationDialog *reimport_confirm = nullptr; + Label *label_warning = nullptr; + Button *import = nullptr; - Control *advanced_spacer; - Button *advanced; + Control *advanced_spacer = nullptr; + Button *advanced = nullptr; - ImportDockParameters *params; + ImportDockParameters *params = nullptr; - VBoxContainer *content; - Label *select_a_resource; + VBoxContainer *content = nullptr; + Label *select_a_resource = nullptr; void _preset_selected(int p_idx); void _importer_selected(int i_idx); diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h index 7e653c4750..86733c992d 100644 --- a/editor/inspector_dock.h +++ b/editor/inspector_dock.h @@ -70,34 +70,34 @@ class InspectorDock : public VBoxContainer { OBJECT_METHOD_BASE = 500 }; - EditorData *editor_data; + EditorData *editor_data = nullptr; - EditorInspector *inspector; + EditorInspector *inspector = nullptr; - Object *current; + Object *current = nullptr; - Button *backward_button; - Button *forward_button; + Button *backward_button = nullptr; + Button *forward_button = nullptr; - EditorFileDialog *load_resource_dialog; - CreateDialog *new_resource_dialog; - Button *resource_new_button; - Button *resource_load_button; - MenuButton *resource_save_button; - MenuButton *resource_extra_button; - MenuButton *history_menu; - LineEdit *search; + EditorFileDialog *load_resource_dialog = nullptr; + CreateDialog *new_resource_dialog = nullptr; + Button *resource_new_button = nullptr; + Button *resource_load_button = nullptr; + MenuButton *resource_save_button = nullptr; + MenuButton *resource_extra_button = nullptr; + MenuButton *history_menu = nullptr; + LineEdit *search = nullptr; - Button *open_docs_button; - MenuButton *object_menu; - EditorPath *editor_path; + Button *open_docs_button = nullptr; + MenuButton *object_menu = nullptr; + EditorPath *editor_path = nullptr; - Button *warning; - AcceptDialog *warning_dialog; + Button *warning = nullptr; + AcceptDialog *warning_dialog = nullptr; int current_option = -1; - ConfirmationDialog *unique_resources_confirmation; - Tree *unique_resources_list_tree; + ConfirmationDialog *unique_resources_confirmation = nullptr; + Tree *unique_resources_list_tree = nullptr; EditorPropertyNameProcessor::Style property_name_style; diff --git a/editor/localization_editor.h b/editor/localization_editor.h index 3424ba7c55..966ef0f36e 100644 --- a/editor/localization_editor.h +++ b/editor/localization_editor.h @@ -40,22 +40,22 @@ class EditorFileDialog; class LocalizationEditor : public VBoxContainer { GDCLASS(LocalizationEditor, VBoxContainer); - Tree *translation_list; + Tree *translation_list = nullptr; - EditorLocaleDialog *locale_select; - EditorFileDialog *translation_file_open; + EditorLocaleDialog *locale_select = nullptr; + EditorFileDialog *translation_file_open = nullptr; - Button *translation_res_option_add_button; - EditorFileDialog *translation_res_file_open_dialog; - EditorFileDialog *translation_res_option_file_open_dialog; - Tree *translation_remap; - Tree *translation_remap_options; + Button *translation_res_option_add_button = nullptr; + EditorFileDialog *translation_res_file_open_dialog = nullptr; + EditorFileDialog *translation_res_option_file_open_dialog = nullptr; + Tree *translation_remap = nullptr; + Tree *translation_remap_options = nullptr; - Tree *translation_pot_list; - EditorFileDialog *pot_file_open_dialog; - EditorFileDialog *pot_generate_dialog; + Tree *translation_pot_list = nullptr; + EditorFileDialog *pot_file_open_dialog = nullptr; + EditorFileDialog *pot_generate_dialog = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool updating_translations = false; String localization_changed; diff --git a/editor/node_dock.h b/editor/node_dock.h index 4c814ab65f..35af1a8121 100644 --- a/editor/node_dock.h +++ b/editor/node_dock.h @@ -38,15 +38,15 @@ class ConnectionsDock; class NodeDock : public VBoxContainer { GDCLASS(NodeDock, VBoxContainer); - Button *connections_button; - Button *groups_button; + Button *connections_button = nullptr; + Button *groups_button = nullptr; - ConnectionsDock *connections; - GroupsEditor *groups; + ConnectionsDock *connections = nullptr; + GroupsEditor *groups = nullptr; - HBoxContainer *mode_hb; + HBoxContainer *mode_hb = nullptr; - Label *select_a_node; + Label *select_a_node = nullptr; private: static NodeDock *singleton; diff --git a/editor/plugin_config_dialog.h b/editor/plugin_config_dialog.h index 0dc2e84a98..76fec636f3 100644 --- a/editor/plugin_config_dialog.h +++ b/editor/plugin_config_dialog.h @@ -41,18 +41,18 @@ class PluginConfigDialog : public ConfirmationDialog { GDCLASS(PluginConfigDialog, ConfirmationDialog); - LineEdit *name_edit; - LineEdit *subfolder_edit; - TextEdit *desc_edit; - LineEdit *author_edit; - LineEdit *version_edit; - OptionButton *script_option_edit; - LineEdit *script_edit; - CheckBox *active_edit; + LineEdit *name_edit = nullptr; + LineEdit *subfolder_edit = nullptr; + TextEdit *desc_edit = nullptr; + LineEdit *author_edit = nullptr; + LineEdit *version_edit = nullptr; + OptionButton *script_option_edit = nullptr; + LineEdit *script_edit = nullptr; + CheckBox *active_edit = nullptr; - TextureRect *name_validation; - TextureRect *subfolder_validation; - TextureRect *script_validation; + TextureRect *name_validation = nullptr; + TextureRect *subfolder_validation = nullptr; + TextureRect *script_validation = nullptr; bool _edit_mode; diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h index c0e7c1be2e..b0483cbb62 100644 --- a/editor/plugins/abstract_polygon_2d_editor.h +++ b/editor/plugins/abstract_polygon_2d_editor.h @@ -40,9 +40,9 @@ class CanvasItemEditor; class AbstractPolygon2DEditor : public HBoxContainer { GDCLASS(AbstractPolygon2DEditor, HBoxContainer); - Button *button_create; - Button *button_edit; - Button *button_delete; + Button *button_create = nullptr; + Button *button_edit = nullptr; + Button *button_delete = nullptr; struct Vertex { Vertex() {} @@ -85,9 +85,9 @@ class AbstractPolygon2DEditor : public HBoxContainer { bool _polygon_editing_enabled; - CanvasItemEditor *canvas_item_editor; - Panel *panel; - ConfirmationDialog *create_resource; + CanvasItemEditor *canvas_item_editor = nullptr; + Panel *panel = nullptr; + ConfirmationDialog *create_resource = nullptr; protected: enum { @@ -99,7 +99,7 @@ protected: int mode; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _menu_option(int p_option); void _wip_changed(); @@ -149,7 +149,7 @@ public: class AbstractPolygon2DEditorPlugin : public EditorPlugin { GDCLASS(AbstractPolygon2DEditorPlugin, EditorPlugin); - AbstractPolygon2DEditor *polygon_editor; + AbstractPolygon2DEditor *polygon_editor = nullptr; String klass; public: diff --git a/editor/plugins/animation_blend_space_1d_editor.h b/editor/plugins/animation_blend_space_1d_editor.h index 54cded6048..816c2555ca 100644 --- a/editor/plugins/animation_blend_space_1d_editor.h +++ b/editor/plugins/animation_blend_space_1d_editor.h @@ -45,36 +45,36 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeBlendSpace1D> blend_space; - HBoxContainer *goto_parent_hb; - Button *goto_parent; - - PanelContainer *panel; - Button *tool_blend; - Button *tool_select; - Button *tool_create; - VSeparator *tool_erase_sep; - Button *tool_erase; - Button *snap; - SpinBox *snap_value; - - LineEdit *label_value; - SpinBox *max_value; - SpinBox *min_value; - - HBoxContainer *edit_hb; - SpinBox *edit_value; - Button *open_editor; + HBoxContainer *goto_parent_hb = nullptr; + Button *goto_parent = nullptr; + + PanelContainer *panel = nullptr; + Button *tool_blend = nullptr; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + VSeparator *tool_erase_sep = nullptr; + Button *tool_erase = nullptr; + Button *snap = nullptr; + SpinBox *snap_value = nullptr; + + LineEdit *label_value = nullptr; + SpinBox *max_value = nullptr; + SpinBox *min_value = nullptr; + + HBoxContainer *edit_hb = nullptr; + SpinBox *edit_value = nullptr; + Button *open_editor = nullptr; int selected_point; - Control *blend_space_draw; + Control *blend_space_draw = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeBlendSpace1DEditor *singleton; @@ -87,8 +87,8 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { void _labels_changed(String); void _snap_toggled(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; float add_point_pos; Vector<real_t> points; @@ -108,7 +108,7 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { void _edit_point_pos(double); void _open_editor(); - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_blend_space_2d_editor.h b/editor/plugins/animation_blend_space_2d_editor.h index 933d2bd96d..db54e84254 100644 --- a/editor/plugins/animation_blend_space_2d_editor.h +++ b/editor/plugins/animation_blend_space_2d_editor.h @@ -45,43 +45,43 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeBlendSpace2D> blend_space; - PanelContainer *panel; - Button *tool_blend; - Button *tool_select; - Button *tool_create; - Button *tool_triangle; - VSeparator *tool_erase_sep; - Button *tool_erase; - Button *snap; - SpinBox *snap_x; - SpinBox *snap_y; - OptionButton *interpolation; - - Button *auto_triangles; - - LineEdit *label_x; - LineEdit *label_y; - SpinBox *max_x_value; - SpinBox *min_x_value; - SpinBox *max_y_value; - SpinBox *min_y_value; - - HBoxContainer *edit_hb; - SpinBox *edit_x; - SpinBox *edit_y; - Button *open_editor; + PanelContainer *panel = nullptr; + Button *tool_blend = nullptr; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + Button *tool_triangle = nullptr; + VSeparator *tool_erase_sep = nullptr; + Button *tool_erase = nullptr; + Button *snap = nullptr; + SpinBox *snap_x = nullptr; + SpinBox *snap_y = nullptr; + OptionButton *interpolation = nullptr; + + Button *auto_triangles = nullptr; + + LineEdit *label_x = nullptr; + LineEdit *label_y = nullptr; + SpinBox *max_x_value = nullptr; + SpinBox *min_x_value = nullptr; + SpinBox *max_y_value = nullptr; + SpinBox *min_y_value = nullptr; + + HBoxContainer *edit_hb = nullptr; + SpinBox *edit_x = nullptr; + SpinBox *edit_y = nullptr; + Button *open_editor = nullptr; int selected_point; int selected_triangle; - Control *blend_space_draw; + Control *blend_space_draw = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeBlendSpace2DEditor *singleton; @@ -94,8 +94,8 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { void _labels_changed(String); void _snap_toggled(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; Vector2 add_point_pos; Vector<Vector2> points; @@ -123,7 +123,7 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { StringName get_blend_position_path() const; - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h index c111f9245e..cacf8379f9 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.h +++ b/editor/plugins/animation_blend_tree_editor_plugin.h @@ -47,19 +47,19 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { GDCLASS(AnimationNodeBlendTreeEditor, AnimationTreeNodeEditorPlugin); Ref<AnimationNodeBlendTree> blend_tree; - GraphEdit *graph; - MenuButton *add_node; + GraphEdit *graph = nullptr; + MenuButton *add_node = nullptr; Vector2 position_from_popup_menu; bool use_position_from_popup_menu; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; - AcceptDialog *filter_dialog; - Tree *filters; - CheckBox *filter_enabled; + AcceptDialog *filter_dialog = nullptr; + Tree *filters = nullptr; + CheckBox *filter_enabled = nullptr; Map<StringName, ProgressBar *> animations; Vector<EditorProperty *> visible_properties; @@ -122,7 +122,7 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { void _update_editor_settings(); void _update_theme(); - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index 5bb32e25e6..850751e47a 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -46,8 +46,8 @@ class AnimationPlayerEditorPlugin; class AnimationPlayerEditor : public VBoxContainer { GDCLASS(AnimationPlayerEditor, VBoxContainer); - AnimationPlayerEditorPlugin *plugin; - AnimationPlayer *player; + AnimationPlayerEditorPlugin *plugin = nullptr; + AnimationPlayer *player = nullptr; enum { TOOL_NEW_ANIM, @@ -88,31 +88,31 @@ class AnimationPlayerEditor : public VBoxContainer { RESOURCE_SAVE }; - OptionButton *animation; - Button *stop; - Button *play; - Button *play_from; - Button *play_bw; - Button *play_bw_from; - Button *autoplay; - - MenuButton *tool_anim; - Button *onion_toggle; - MenuButton *onion_skinning; - Button *pin; - SpinBox *frame; - LineEdit *scale; - LineEdit *name; - Label *name_title; - UndoRedo *undo_redo; + OptionButton *animation = nullptr; + Button *stop = nullptr; + Button *play = nullptr; + Button *play_from = nullptr; + Button *play_bw = nullptr; + Button *play_bw_from = nullptr; + Button *autoplay = nullptr; + + MenuButton *tool_anim = nullptr; + Button *onion_toggle = nullptr; + MenuButton *onion_skinning = nullptr; + Button *pin = nullptr; + SpinBox *frame = nullptr; + LineEdit *scale = nullptr; + LineEdit *name = nullptr; + Label *name_title = nullptr; + UndoRedo *undo_redo = nullptr; Ref<Texture2D> autoplay_icon; Ref<Texture2D> reset_icon; Ref<ImageTexture> autoplay_reset_icon; bool last_active; float timeline_position; - EditorFileDialog *file; - ConfirmationDialog *delete_dialog; + EditorFileDialog *file = nullptr; + ConfirmationDialog *delete_dialog = nullptr; struct BlendEditor { AcceptDialog *dialog = nullptr; @@ -121,14 +121,14 @@ class AnimationPlayerEditor : public VBoxContainer { } blend_editor; - ConfirmationDialog *name_dialog; - ConfirmationDialog *error_dialog; + ConfirmationDialog *name_dialog = nullptr; + ConfirmationDialog *error_dialog = nullptr; int name_dialog_op = TOOL_NEW_ANIM; bool updating; bool updating_blends; - AnimationTrackEditor *track_editor; + AnimationTrackEditor *track_editor = nullptr; static AnimationPlayerEditor *singleton; // Onion skinning. @@ -250,7 +250,7 @@ public: class AnimationPlayerEditorPlugin : public EditorPlugin { GDCLASS(AnimationPlayerEditorPlugin, EditorPlugin); - AnimationPlayerEditor *anim_editor; + AnimationPlayerEditor *anim_editor = nullptr; protected: void _notification(int p_what); diff --git a/editor/plugins/animation_state_machine_editor.h b/editor/plugins/animation_state_machine_editor.h index 03991d00f9..bf3f7e93cf 100644 --- a/editor/plugins/animation_state_machine_editor.h +++ b/editor/plugins/animation_state_machine_editor.h @@ -47,36 +47,36 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeStateMachine> state_machine; - Button *tool_select; - Button *tool_create; - Button *tool_connect; - Popup *name_edit_popup; - LineEdit *name_edit; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + Button *tool_connect = nullptr; + Popup *name_edit_popup = nullptr; + LineEdit *name_edit = nullptr; - HBoxContainer *tool_erase_hb; - Button *tool_erase; - Button *tool_autoplay; - Button *tool_end; + HBoxContainer *tool_erase_hb = nullptr; + Button *tool_erase = nullptr; + Button *tool_autoplay = nullptr; + Button *tool_end = nullptr; - OptionButton *transition_mode; - OptionButton *play_mode; + OptionButton *transition_mode = nullptr; + OptionButton *play_mode = nullptr; - PanelContainer *panel; + PanelContainer *panel = nullptr; StringName selected_node; - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; - Control *state_machine_draw; - Control *state_machine_play_pos; + Control *state_machine_draw = nullptr; + Control *state_machine_play_pos = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeStateMachineEditor *singleton; @@ -87,8 +87,8 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { void _update_graph(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; Vector2 add_node_pos; @@ -166,7 +166,7 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { float error_time; String error_text; - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_tree_editor_plugin.h b/editor/plugins/animation_tree_editor_plugin.h index 5442584a40..ab4ef5a001 100644 --- a/editor/plugins/animation_tree_editor_plugin.h +++ b/editor/plugins/animation_tree_editor_plugin.h @@ -52,11 +52,11 @@ public: class AnimationTreeEditor : public VBoxContainer { GDCLASS(AnimationTreeEditor, VBoxContainer); - ScrollContainer *path_edit; - HBoxContainer *path_hb; + ScrollContainer *path_edit = nullptr; + HBoxContainer *path_hb = nullptr; - AnimationTree *tree; - MarginContainer *editor_base; + AnimationTree *tree = nullptr; + MarginContainer *editor_base = nullptr; Vector<String> button_path; Vector<String> edited_path; @@ -96,8 +96,8 @@ public: class AnimationTreeEditorPlugin : public EditorPlugin { GDCLASS(AnimationTreeEditorPlugin, EditorPlugin); - AnimationTreeEditor *anim_tree_editor; - Button *button; + AnimationTreeEditor *anim_tree_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "AnimationTree"; } diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 493ffc4033..2a04935c47 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -53,12 +53,12 @@ class EditorAssetLibraryItem : public PanelContainer { GDCLASS(EditorAssetLibraryItem, PanelContainer); - TextureButton *icon; - LinkButton *title; - LinkButton *category; - LinkButton *author; + TextureButton *icon = nullptr; + LinkButton *title = nullptr; + LinkButton *category = nullptr; + LinkButton *author = nullptr; TextureRect *stars[5]; - Label *price; + Label *price = nullptr; int asset_id; int category_id; @@ -83,11 +83,11 @@ public: class EditorAssetLibraryItemDescription : public ConfirmationDialog { GDCLASS(EditorAssetLibraryItemDescription, ConfirmationDialog); - EditorAssetLibraryItem *item; - RichTextLabel *description; - ScrollContainer *previews; - HBoxContainer *preview_hb; - PanelContainer *previews_bg; + EditorAssetLibraryItem *item = nullptr; + RichTextLabel *description = nullptr; + ScrollContainer *previews = nullptr; + HBoxContainer *preview_hb = nullptr; + PanelContainer *previews_bg = nullptr; struct Preview { int id = 0; @@ -98,7 +98,7 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog { }; Vector<Preview> preview_images; - TextureRect *preview; + TextureRect *preview = nullptr; void set_image(int p_type, int p_index, const Ref<Texture2D> &p_image); @@ -130,19 +130,19 @@ public: class EditorAssetLibraryItemDownload : public MarginContainer { GDCLASS(EditorAssetLibraryItemDownload, MarginContainer); - PanelContainer *panel; - TextureRect *icon; - Label *title; - ProgressBar *progress; - Button *install_button; - Button *retry_button; - TextureButton *dismiss_button; + PanelContainer *panel = nullptr; + TextureRect *icon = nullptr; + Label *title = nullptr; + ProgressBar *progress = nullptr; + Button *install_button = nullptr; + Button *retry_button = nullptr; + TextureButton *dismiss_button = nullptr; - AcceptDialog *download_error; - HTTPRequest *download; + AcceptDialog *download_error = nullptr; + HTTPRequest *download = nullptr; String host; String sha256; - Label *status; + Label *status = nullptr; int prev_status; @@ -150,7 +150,7 @@ class EditorAssetLibraryItemDownload : public MarginContainer { bool external_install; - EditorAssetInstaller *asset_installer; + EditorAssetInstaller *asset_installer = nullptr; void _close(); void _make_request(); @@ -176,35 +176,35 @@ class EditorAssetLibrary : public PanelContainer { String host; - EditorFileDialog *asset_open; - EditorAssetInstaller *asset_installer; + EditorFileDialog *asset_open = nullptr; + EditorAssetInstaller *asset_installer = nullptr; void _asset_open(); void _asset_file_selected(const String &p_file); void _update_repository_options(); - PanelContainer *library_scroll_bg; - ScrollContainer *library_scroll; - VBoxContainer *library_vb; - Label *library_loading; - Label *library_error; - LineEdit *filter; - Timer *filter_debounce_timer; - OptionButton *categories; - OptionButton *repository; - OptionButton *sort; - HBoxContainer *error_hb; - TextureRect *error_tr; - Label *error_label; - MenuButton *support; - - HBoxContainer *contents; - - HBoxContainer *asset_top_page; - GridContainer *asset_items; - HBoxContainer *asset_bottom_page; - - HTTPRequest *request; + PanelContainer *library_scroll_bg = nullptr; + ScrollContainer *library_scroll = nullptr; + VBoxContainer *library_vb = nullptr; + Label *library_loading = nullptr; + Label *library_error = nullptr; + LineEdit *filter = nullptr; + Timer *filter_debounce_timer = nullptr; + OptionButton *categories = nullptr; + OptionButton *repository = nullptr; + OptionButton *sort = nullptr; + HBoxContainer *error_hb = nullptr; + TextureRect *error_tr = nullptr; + Label *error_label = nullptr; + MenuButton *support = nullptr; + + HBoxContainer *contents = nullptr; + + HBoxContainer *asset_top_page = nullptr; + GridContainer *asset_items = nullptr; + HBoxContainer *asset_bottom_page = nullptr; + + HTTPRequest *request = nullptr; bool templates_only; bool initial_loading; @@ -260,7 +260,7 @@ class EditorAssetLibrary : public PanelContainer { HBoxContainer *_make_pages(int p_page, int p_page_count, int p_page_len, int p_total_items, int p_current_items); // - EditorAssetLibraryItemDescription *description; + EditorAssetLibraryItemDescription *description = nullptr; // enum RequestType { @@ -273,8 +273,8 @@ class EditorAssetLibrary : public PanelContainer { RequestType requesting; Dictionary category_map; - ScrollContainer *downloads_scroll; - HBoxContainer *downloads_hb; + ScrollContainer *downloads_scroll = nullptr; + HBoxContainer *downloads_hb = nullptr; void _install_asset(); @@ -315,7 +315,7 @@ public: class AssetLibraryEditorPlugin : public EditorPlugin { GDCLASS(AssetLibraryEditorPlugin, EditorPlugin); - EditorAssetLibrary *addon_library; + EditorAssetLibrary *addon_library = nullptr; public: virtual String get_name() const override { return "AssetLib"; } diff --git a/editor/plugins/audio_stream_editor_plugin.h b/editor/plugins/audio_stream_editor_plugin.h index 2478210430..0d927bddd5 100644 --- a/editor/plugins/audio_stream_editor_plugin.h +++ b/editor/plugins/audio_stream_editor_plugin.h @@ -75,7 +75,7 @@ public: class AudioStreamEditorPlugin : public EditorPlugin { GDCLASS(AudioStreamEditorPlugin, EditorPlugin); - AudioStreamEditor *audio_editor; + AudioStreamEditor *audio_editor = nullptr; public: virtual String get_name() const override { return "Audio"; } diff --git a/editor/plugins/camera_3d_editor_plugin.h b/editor/plugins/camera_3d_editor_plugin.h index c1f71d3b1b..a8164f9b85 100644 --- a/editor/plugins/camera_3d_editor_plugin.h +++ b/editor/plugins/camera_3d_editor_plugin.h @@ -37,9 +37,9 @@ class Camera3DEditor : public Control { GDCLASS(Camera3DEditor, Control); - Panel *panel; - Button *preview; - Node *node; + Panel *panel = nullptr; + Button *preview = nullptr; + Node *node = nullptr; void _pressed(); diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 1a9d49a4a8..1b61cdc675 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -183,16 +183,16 @@ private: bool selection_menu_additive_selection; Tool tool = TOOL_SELECT; - Control *viewport; - Control *viewport_scrollable; + Control *viewport = nullptr; + Control *viewport_scrollable = nullptr; - HScrollBar *h_scroll; - VScrollBar *v_scroll; - HBoxContainer *hb; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; + HBoxContainer *hb = nullptr; // Used for secondary menu items which are displayed depending on the currently selected node // (such as MeshInstance's "Mesh" menu). - PanelContainer *context_menu_container; - HBoxContainer *hbc_context_menu; + PanelContainer *context_menu_container = nullptr; + HBoxContainer *hbc_context_menu = nullptr; Transform2D transform; GridVisibility grid_visibility = GRID_VISIBILITY_SHOW_WHEN_SNAPPING; @@ -293,47 +293,47 @@ private: }; List<PoseClipboard> pose_clipboard; - Button *select_button; + Button *select_button = nullptr; - Button *move_button; - Button *scale_button; - Button *rotate_button; + Button *move_button = nullptr; + Button *scale_button = nullptr; + Button *rotate_button = nullptr; - Button *list_select_button; - Button *pivot_button; - Button *pan_button; + Button *list_select_button = nullptr; + Button *pivot_button = nullptr; + Button *pan_button = nullptr; - Button *ruler_button; + Button *ruler_button = nullptr; - Button *smart_snap_button; - Button *grid_snap_button; - MenuButton *snap_config_menu; - PopupMenu *smartsnap_config_popup; + Button *smart_snap_button = nullptr; + Button *grid_snap_button = nullptr; + MenuButton *snap_config_menu = nullptr; + PopupMenu *smartsnap_config_popup = nullptr; - Button *lock_button; - Button *unlock_button; + Button *lock_button = nullptr; + Button *unlock_button = nullptr; - Button *group_button; - Button *ungroup_button; + Button *group_button = nullptr; + Button *ungroup_button = nullptr; - MenuButton *skeleton_menu; - Button *override_camera_button; - MenuButton *view_menu; - PopupMenu *grid_menu; - HBoxContainer *animation_hb; - MenuButton *animation_menu; + MenuButton *skeleton_menu = nullptr; + Button *override_camera_button = nullptr; + MenuButton *view_menu = nullptr; + PopupMenu *grid_menu = nullptr; + HBoxContainer *animation_hb = nullptr; + MenuButton *animation_menu = nullptr; - Button *key_loc_button; - Button *key_rot_button; - Button *key_scale_button; - Button *key_insert_button; - Button *key_auto_insert_button; + Button *key_loc_button = nullptr; + Button *key_rot_button = nullptr; + Button *key_scale_button = nullptr; + Button *key_insert_button = nullptr; + Button *key_auto_insert_button = nullptr; - PopupMenu *selection_menu; - PopupMenu *add_node_menu; + PopupMenu *selection_menu = nullptr; + PopupMenu *add_node_menu = nullptr; - Control *top_ruler; - Control *left_ruler; + Control *top_ruler = nullptr; + Control *left_ruler = nullptr; Point2 drag_start_origin; DragType drag_type = DRAG_NONE; @@ -374,9 +374,9 @@ private: void _find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_node, List<CanvasItem *> *r_items, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D()); bool _select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append); - ConfirmationDialog *snap_dialog; + ConfirmationDialog *snap_dialog = nullptr; - CanvasItem *ref_item; + CanvasItem *ref_item = nullptr; void _save_canvas_item_state(List<CanvasItem *> p_canvas_items, bool save_bones = false); void _restore_canvas_item_state(List<CanvasItem *> p_canvas_items, bool restore_bones = false); @@ -400,7 +400,7 @@ private: void _prepare_grid_menu(); void _on_grid_menu_id_pressed(int p_id); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; List<CanvasItem *> _get_edited_canvas_items(bool retrieve_locked = false, bool remove_canvas_item_if_parent_in_selection = true); Rect2 _get_encompassing_rect_from_list(List<CanvasItem *> p_list); @@ -476,8 +476,8 @@ private: const SnapTarget p_snap_target, List<const CanvasItem *> p_exceptions, const Node *p_current); - VBoxContainer *controls_vb; - EditorZoomWidget *zoom_widget; + VBoxContainer *controls_vb = nullptr; + EditorZoomWidget *zoom_widget = nullptr; void _update_zoom(real_t p_zoom); void _shortcut_zoom_set(real_t p_zoom); void _zoom_on_position(real_t p_zoom, Point2 p_position = Point2()); @@ -488,9 +488,9 @@ private: void _update_override_camera_button(bool p_game_running); - HSplitContainer *left_panel_split; - HSplitContainer *right_panel_split; - VSplitContainer *bottom_split; + HSplitContainer *left_panel_split = nullptr; + HSplitContainer *right_panel_split = nullptr; + VSplitContainer *bottom_split = nullptr; void _update_context_menu_stylebox(); @@ -555,7 +555,7 @@ public: void focus_selection(); - EditorSelection *editor_selection; + EditorSelection *editor_selection = nullptr; CanvasItemEditor(); }; @@ -563,7 +563,7 @@ public: class CanvasItemEditorPlugin : public EditorPlugin { GDCLASS(CanvasItemEditorPlugin, EditorPlugin); - CanvasItemEditor *canvas_item_editor; + CanvasItemEditor *canvas_item_editor = nullptr; public: virtual String get_name() const override { return "2D"; } @@ -589,18 +589,18 @@ class CanvasItemEditorViewport : public Control { Vector<String> texture_node_types; Vector<String> selected_files; - Node *target_node; + Node *target_node = nullptr; Point2 drop_pos; - EditorData *editor_data; - CanvasItemEditor *canvas_item_editor; - Control *preview_node; - AcceptDialog *accept; - AcceptDialog *selector; - Label *selector_label; - Label *label; - Label *label_desc; - VBoxContainer *btn_group; + EditorData *editor_data = nullptr; + CanvasItemEditor *canvas_item_editor = nullptr; + Control *preview_node = nullptr; + AcceptDialog *accept = nullptr; + AcceptDialog *selector = nullptr; + Label *selector_label = nullptr; + Label *label = nullptr; + Label *label_desc = nullptr; + VBoxContainer *btn_group = nullptr; Ref<ButtonGroup> button_group; void _on_mouse_exit(); diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h index bdd4228b3b..0225d5d620 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -37,7 +37,7 @@ class CollisionPolygon2DEditor : public AbstractPolygon2DEditor { GDCLASS(CollisionPolygon2DEditor, AbstractPolygon2DEditor); - CollisionPolygon2D *node; + CollisionPolygon2D *node = nullptr; protected: virtual Node2D *_get_node() const override; diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 033ea3db93..da9e9f339f 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -61,9 +61,9 @@ class CollisionShape2DEditor : public Control { Point2(1, -1), }; - UndoRedo *undo_redo; - CanvasItemEditor *canvas_item_editor; - CollisionShape2D *node; + UndoRedo *undo_redo = nullptr; + CanvasItemEditor *canvas_item_editor = nullptr; + CollisionShape2D *node = nullptr; Vector<Point2> handles; @@ -96,7 +96,7 @@ public: class CollisionShape2DEditorPlugin : public EditorPlugin { GDCLASS(CollisionShape2DEditorPlugin, EditorPlugin); - CollisionShape2DEditor *collision_shape_2d_editor; + CollisionShape2DEditor *collision_shape_2d_editor = nullptr; public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) override { return collision_shape_2d_editor->forward_canvas_gui_input(p_event); } diff --git a/editor/plugins/control_editor_plugin.h b/editor/plugins/control_editor_plugin.h index 37d218abb9..96451f7dcf 100644 --- a/editor/plugins/control_editor_plugin.h +++ b/editor/plugins/control_editor_plugin.h @@ -70,7 +70,7 @@ public: class EditorPropertyAnchorsPreset : public EditorProperty { GDCLASS(EditorPropertyAnchorsPreset, EditorProperty); - OptionButton *options; + OptionButton *options = nullptr; void _option_selected(int p_which); @@ -94,9 +94,9 @@ class EditorPropertySizeFlags : public EditorProperty { SIZE_FLAGS_PRESET_CUSTOM, }; - OptionButton *flag_presets; - CheckBox *flag_expand; - VBoxContainer *flag_options; + OptionButton *flag_presets = nullptr; + CheckBox *flag_expand = nullptr; + VBoxContainer *flag_options = nullptr; Vector<CheckBox *> flag_checks; bool vertical = false; @@ -128,8 +128,8 @@ public: class ControlEditorToolbar : public HBoxContainer { GDCLASS(ControlEditorToolbar, HBoxContainer); - UndoRedo *undo_redo; - EditorSelection *editor_selection; + UndoRedo *undo_redo = nullptr; + EditorSelection *editor_selection = nullptr; enum MenuOption { ANCHORS_AND_OFFSETS_PRESET_TOP_LEFT, @@ -198,12 +198,12 @@ class ControlEditorToolbar : public HBoxContainer { CONTAINERS_V_PRESET_SHRINK_END, }; - MenuButton *anchor_presets_menu; - PopupMenu *anchors_popup; - MenuButton *container_h_presets_menu; - MenuButton *container_v_presets_menu; + MenuButton *anchor_presets_menu = nullptr; + PopupMenu *anchors_popup = nullptr; + MenuButton *container_h_presets_menu = nullptr; + MenuButton *container_v_presets_menu = nullptr; - Button *anchor_mode_button; + Button *anchor_mode_button = nullptr; bool anchors_mode = false; @@ -239,7 +239,7 @@ public: class ControlEditorPlugin : public EditorPlugin { GDCLASS(ControlEditorPlugin, EditorPlugin); - ControlEditorToolbar *toolbar; + ControlEditorToolbar *toolbar = nullptr; public: virtual String get_name() const override { return "Control"; } diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.h b/editor/plugins/cpu_particles_2d_editor_plugin.h index b10ed73e38..cc59bc924f 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.h +++ b/editor/plugins/cpu_particles_2d_editor_plugin.h @@ -55,22 +55,22 @@ class CPUParticles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - CPUParticles2D *particles; + CPUParticles2D *particles = nullptr; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - HBoxContainer *toolbar; - MenuButton *menu; + HBoxContainer *toolbar = nullptr; + MenuButton *menu = nullptr; - SpinBox *epoints; + SpinBox *epoints = nullptr; - ConfirmationDialog *emission_mask; - OptionButton *emission_mask_mode; - CheckBox *emission_colors; + ConfirmationDialog *emission_mask = nullptr; + OptionButton *emission_mask_mode = nullptr; + CheckBox *emission_colors = nullptr; String source_emission_file; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _file_selected(const String &p_file); void _menu_callback(int p_idx); void _generate_emission_mask(); diff --git a/editor/plugins/cpu_particles_3d_editor_plugin.h b/editor/plugins/cpu_particles_3d_editor_plugin.h index 0501936574..70f2da4b2d 100644 --- a/editor/plugins/cpu_particles_3d_editor_plugin.h +++ b/editor/plugins/cpu_particles_3d_editor_plugin.h @@ -44,7 +44,7 @@ class CPUParticles3DEditor : public GPUParticles3DEditorBase { }; - CPUParticles3D *node; + CPUParticles3D *node = nullptr; void _menu_option(int); @@ -65,7 +65,7 @@ public: class CPUParticles3DEditorPlugin : public EditorPlugin { GDCLASS(CPUParticles3DEditorPlugin, EditorPlugin); - CPUParticles3DEditor *particles_editor; + CPUParticles3DEditor *particles_editor = nullptr; public: virtual String get_name() const override { return "CPUParticles3D"; } diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index 4aba2fffd0..5cf3b16a06 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -99,8 +99,8 @@ private: Transform2D _world_to_view; Ref<Curve> _curve_ref; - PopupMenu *_context_menu; - PopupMenu *_presets_menu; + PopupMenu *_context_menu = nullptr; + PopupMenu *_presets_menu = nullptr; Array _undo_data; bool _has_undo_data; diff --git a/editor/plugins/debugger_editor_plugin.h b/editor/plugins/debugger_editor_plugin.h index c024526285..10e1a27933 100644 --- a/editor/plugins/debugger_editor_plugin.h +++ b/editor/plugins/debugger_editor_plugin.h @@ -41,9 +41,9 @@ class DebuggerEditorPlugin : public EditorPlugin { GDCLASS(DebuggerEditorPlugin, EditorPlugin); private: - MenuButton *debug_menu; - EditorFileServer *file_server; - PopupMenu *instances_menu; + MenuButton *debug_menu = nullptr; + EditorFileServer *file_server = nullptr; + PopupMenu *instances_menu = nullptr; enum MenuOptions { RUN_FILE_SERVER, diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.h b/editor/plugins/gpu_particles_2d_editor_plugin.h index f94ce632e9..75f68617d1 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.h +++ b/editor/plugins/gpu_particles_2d_editor_plugin.h @@ -56,26 +56,26 @@ class GPUParticles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - GPUParticles2D *particles; + GPUParticles2D *particles = nullptr; List<GPUParticles2D *> selected_particles; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - HBoxContainer *toolbar; - MenuButton *menu; + HBoxContainer *toolbar = nullptr; + MenuButton *menu = nullptr; - SpinBox *epoints; + SpinBox *epoints = nullptr; - ConfirmationDialog *generate_visibility_rect; - SpinBox *generate_seconds; + ConfirmationDialog *generate_visibility_rect = nullptr; + SpinBox *generate_seconds = nullptr; - ConfirmationDialog *emission_mask; - OptionButton *emission_mask_mode; - CheckBox *emission_colors; + ConfirmationDialog *emission_mask = nullptr; + OptionButton *emission_mask_mode = nullptr; + CheckBox *emission_colors = nullptr; String source_emission_file; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _file_selected(const String &p_file); void _menu_callback(int p_idx); void _generate_visibility_rect(); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h index 39aa596ece..190fb9954b 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.h +++ b/editor/plugins/gpu_particles_3d_editor_plugin.h @@ -41,16 +41,16 @@ class GPUParticles3DEditorBase : public Control { GDCLASS(GPUParticles3DEditorBase, Control); protected: - Node3D *base_node; - Panel *panel; - MenuButton *options; - HBoxContainer *particles_editor_hb; + Node3D *base_node = nullptr; + Panel *panel = nullptr; + MenuButton *options = nullptr; + HBoxContainer *particles_editor_hb = nullptr; - SceneTreeDialog *emission_tree_dialog; + SceneTreeDialog *emission_tree_dialog = nullptr; - ConfirmationDialog *emission_dialog; - SpinBox *emission_amount; - OptionButton *emission_fill; + ConfirmationDialog *emission_dialog = nullptr; + SpinBox *emission_amount = nullptr; + OptionButton *emission_fill = nullptr; Vector<Face3> geometry; @@ -67,9 +67,9 @@ public: class GPUParticles3DEditor : public GPUParticles3DEditorBase { GDCLASS(GPUParticles3DEditor, GPUParticles3DEditorBase); - ConfirmationDialog *generate_aabb; - SpinBox *generate_seconds; - GPUParticles3D *node; + ConfirmationDialog *generate_aabb = nullptr; + SpinBox *generate_seconds = nullptr; + GPUParticles3D *node = nullptr; enum Menu { MENU_OPTION_GENERATE_AABB, @@ -101,7 +101,7 @@ public: class GPUParticles3DEditorPlugin : public EditorPlugin { GDCLASS(GPUParticles3DEditorPlugin, EditorPlugin); - GPUParticles3DEditor *particles_editor; + GPUParticles3DEditor *particles_editor = nullptr; public: virtual String get_name() const override { return "GPUParticles3D"; } diff --git a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h index f6e4fd3dec..684279039a 100644 --- a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h +++ b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h @@ -41,12 +41,12 @@ class EditorFileDialog; class GPUParticlesCollisionSDF3DEditorPlugin : public EditorPlugin { GDCLASS(GPUParticlesCollisionSDF3DEditorPlugin, EditorPlugin); - GPUParticlesCollisionSDF3D *col_sdf; + GPUParticlesCollisionSDF3D *col_sdf = nullptr; - HBoxContainer *bake_hb; - Button *bake; + HBoxContainer *bake_hb = nullptr; + Button *bake = nullptr; - EditorFileDialog *probe_file; + EditorFileDialog *probe_file = nullptr; static EditorProgress *tmp_progress; static void bake_func_begin(int p_steps); diff --git a/editor/plugins/gradient_editor_plugin.h b/editor/plugins/gradient_editor_plugin.h index 9857ea018d..26bf76fecd 100644 --- a/editor/plugins/gradient_editor_plugin.h +++ b/editor/plugins/gradient_editor_plugin.h @@ -65,9 +65,9 @@ class GradientReverseButton : public BaseButton { class EditorInspectorPluginGradient : public EditorInspectorPlugin { GDCLASS(EditorInspectorPluginGradient, EditorInspectorPlugin); - GradientEditor *editor; - HBoxContainer *gradient_tools_hbox; - GradientReverseButton *reverse_btn; + GradientEditor *editor = nullptr; + HBoxContainer *gradient_tools_hbox = nullptr; + GradientReverseButton *reverse_btn = nullptr; void _reverse_button_pressed(); diff --git a/editor/plugins/input_event_editor_plugin.h b/editor/plugins/input_event_editor_plugin.h index ab948462ab..3c658a86e9 100644 --- a/editor/plugins/input_event_editor_plugin.h +++ b/editor/plugins/input_event_editor_plugin.h @@ -38,11 +38,11 @@ class InputEventConfigContainer : public HBoxContainer { GDCLASS(InputEventConfigContainer, HBoxContainer); - Label *input_event_text; - Button *open_config_button; + Label *input_event_text = nullptr; + Button *open_config_button = nullptr; Ref<InputEvent> input_event; - InputEventConfigurationDialog *config_dialog; + InputEventConfigurationDialog *config_dialog = nullptr; void _config_dialog_confirmed(); void _configure_pressed(); diff --git a/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h index 557e8bf292..aeee12b5b6 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/editor/plugins/light_occluder_2d_editor_plugin.h @@ -37,7 +37,7 @@ class LightOccluder2DEditor : public AbstractPolygon2DEditor { GDCLASS(LightOccluder2DEditor, AbstractPolygon2DEditor); - LightOccluder2D *node; + LightOccluder2D *node = nullptr; Ref<OccluderPolygon2D> _ensure_occluder() const; diff --git a/editor/plugins/lightmap_gi_editor_plugin.h b/editor/plugins/lightmap_gi_editor_plugin.h index e658230181..1202efe8fc 100644 --- a/editor/plugins/lightmap_gi_editor_plugin.h +++ b/editor/plugins/lightmap_gi_editor_plugin.h @@ -41,11 +41,11 @@ class EditorFileDialog; class LightmapGIEditorPlugin : public EditorPlugin { GDCLASS(LightmapGIEditorPlugin, EditorPlugin); - LightmapGI *lightmap; + LightmapGI *lightmap = nullptr; - Button *bake; + Button *bake = nullptr; - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; static EditorProgress *tmp_progress; static bool bake_func_step(float p_progress, const String &p_description, void *, bool p_refresh); static void bake_func_end(uint64_t p_time_started); diff --git a/editor/plugins/line_2d_editor_plugin.h b/editor/plugins/line_2d_editor_plugin.h index 307cf11207..0d407b3150 100644 --- a/editor/plugins/line_2d_editor_plugin.h +++ b/editor/plugins/line_2d_editor_plugin.h @@ -37,7 +37,7 @@ class Line2DEditor : public AbstractPolygon2DEditor { GDCLASS(Line2DEditor, AbstractPolygon2DEditor); - Line2D *node; + Line2D *node = nullptr; protected: virtual Node2D *_get_node() const override; diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 37464c98fe..3554b3c1e9 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -44,17 +44,17 @@ class MeshEditor : public SubViewportContainer { float rot_x; float rot_y; - SubViewport *viewport; - MeshInstance3D *mesh_instance; - Node3D *rotation; - DirectionalLight3D *light1; - DirectionalLight3D *light2; - Camera3D *camera; + SubViewport *viewport = nullptr; + MeshInstance3D *mesh_instance = nullptr; + Node3D *rotation = nullptr; + DirectionalLight3D *light1 = nullptr; + DirectionalLight3D *light2 = nullptr; + Camera3D *camera = nullptr; Ref<Mesh> mesh; - TextureButton *light_1_switch; - TextureButton *light_2_switch; + TextureButton *light_1_switch = nullptr; + TextureButton *light_2_switch = nullptr; void _button_pressed(Node *p_button); bool first_enter; diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.h b/editor/plugins/mesh_instance_3d_editor_plugin.h index 9c59c5fb9f..36d8eacd98 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.h +++ b/editor/plugins/mesh_instance_3d_editor_plugin.h @@ -51,17 +51,17 @@ class MeshInstance3DEditor : public Control { MENU_OPTION_DEBUG_UV2, }; - MeshInstance3D *node; + MeshInstance3D *node = nullptr; - MenuButton *options; + MenuButton *options = nullptr; - ConfirmationDialog *outline_dialog; - SpinBox *outline_size; + ConfirmationDialog *outline_dialog = nullptr; + SpinBox *outline_size = nullptr; - AcceptDialog *err_dialog; + AcceptDialog *err_dialog = nullptr; - AcceptDialog *debug_uv_dialog; - Control *debug_uv; + AcceptDialog *debug_uv_dialog = nullptr; + Control *debug_uv = nullptr; Vector<Vector2> uv_lines; void _menu_option(int p_option); @@ -84,7 +84,7 @@ public: class MeshInstance3DEditorPlugin : public EditorPlugin { GDCLASS(MeshInstance3DEditorPlugin, EditorPlugin); - MeshInstance3DEditor *mesh_editor; + MeshInstance3DEditor *mesh_editor = nullptr; public: virtual String get_name() const override { return "MeshInstance3D"; } diff --git a/editor/plugins/mesh_library_editor_plugin.h b/editor/plugins/mesh_library_editor_plugin.h index 6bc992869b..85ead35534 100644 --- a/editor/plugins/mesh_library_editor_plugin.h +++ b/editor/plugins/mesh_library_editor_plugin.h @@ -43,10 +43,10 @@ class MeshLibraryEditor : public Control { Ref<MeshLibrary> mesh_library; - MenuButton *menu; - ConfirmationDialog *cd_remove; - ConfirmationDialog *cd_update; - EditorFileDialog *file; + MenuButton *menu = nullptr; + ConfirmationDialog *cd_remove = nullptr; + ConfirmationDialog *cd_update = nullptr; + EditorFileDialog *file = nullptr; bool apply_xforms; int to_erase; @@ -81,7 +81,7 @@ public: class MeshLibraryEditorPlugin : public EditorPlugin { GDCLASS(MeshLibraryEditorPlugin, EditorPlugin); - MeshLibraryEditor *mesh_library_editor; + MeshLibraryEditor *mesh_library_editor = nullptr; public: virtual String get_name() const override { return "MeshLibrary"; } diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h index 846e6d17f3..9f5e85216c 100644 --- a/editor/plugins/multimesh_editor_plugin.h +++ b/editor/plugins/multimesh_editor_plugin.h @@ -43,26 +43,26 @@ class MultiMeshEditor : public Control { friend class MultiMeshEditorPlugin; - AcceptDialog *err_dialog; - MenuButton *options; - MultiMeshInstance3D *_last_pp_node; + AcceptDialog *err_dialog = nullptr; + MenuButton *options = nullptr; + MultiMeshInstance3D *_last_pp_node = nullptr; bool browsing_source; - Panel *panel; - MultiMeshInstance3D *node; + Panel *panel = nullptr; + MultiMeshInstance3D *node = nullptr; - LineEdit *surface_source; - LineEdit *mesh_source; + LineEdit *surface_source = nullptr; + LineEdit *mesh_source = nullptr; - SceneTreeDialog *std; + SceneTreeDialog *std = nullptr; - ConfirmationDialog *populate_dialog; - OptionButton *populate_axis; - HSlider *populate_rotate_random; - HSlider *populate_tilt_random; - SpinBox *populate_scale_random; - SpinBox *populate_scale; - SpinBox *populate_amount; + ConfirmationDialog *populate_dialog = nullptr; + OptionButton *populate_axis = nullptr; + HSlider *populate_rotate_random = nullptr; + HSlider *populate_tilt_random = nullptr; + SpinBox *populate_scale_random = nullptr; + SpinBox *populate_scale = nullptr; + SpinBox *populate_amount = nullptr; enum Menu { MENU_OPTION_POPULATE @@ -85,7 +85,7 @@ public: class MultiMeshEditorPlugin : public EditorPlugin { GDCLASS(MultiMeshEditorPlugin, EditorPlugin); - MultiMeshEditor *multimesh_editor; + MultiMeshEditor *multimesh_editor = nullptr; public: virtual String get_name() const override { return "MultiMesh"; } diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 16fbb241e9..7550b75fa3 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -37,7 +37,7 @@ class NavigationPolygonEditor : public AbstractPolygon2DEditor { GDCLASS(NavigationPolygonEditor, AbstractPolygon2DEditor); - NavigationRegion2D *node; + NavigationRegion2D *node = nullptr; Ref<NavigationPolygon> _ensure_navpoly() const; diff --git a/editor/plugins/node_3d_editor_gizmos.h b/editor/plugins/node_3d_editor_gizmos.h index fa55651d26..3b67b898e3 100644 --- a/editor/plugins/node_3d_editor_gizmos.h +++ b/editor/plugins/node_3d_editor_gizmos.h @@ -70,14 +70,14 @@ class EditorNode3DGizmo : public Node3DGizmo { bool valid; bool hidden; Vector<Instance> instances; - Node3D *spatial_node; + Node3D *spatial_node = nullptr; void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Node3D>(p_node)); } protected: static void _bind_methods(); - EditorNode3DGizmoPlugin *gizmo_plugin; + EditorNode3DGizmoPlugin *gizmo_plugin = nullptr; GDVIRTUAL0(_redraw) GDVIRTUAL2RC(String, _get_handle_name, int, bool) @@ -618,7 +618,7 @@ public: class Joint3DGizmoPlugin : public EditorNode3DGizmoPlugin { GDCLASS(Joint3DGizmoPlugin, EditorNode3DGizmoPlugin); - Timer *update_timer; + Timer *update_timer = nullptr; uint64_t update_idx = 0; void incremental_update_gizmos(); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 5c0bfab34e..5447befedd 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -190,27 +190,27 @@ private: ViewType view_type; void _menu_option(int p_option); void _set_auto_orthogonal(); - Node3D *preview_node; - AABB *preview_bounds; + Node3D *preview_node = nullptr; + AABB *preview_bounds = nullptr; Vector<String> selected_files; - AcceptDialog *accept; + AcceptDialog *accept = nullptr; - Node *target_node; + Node *target_node = nullptr; Point2 drop_pos; - EditorData *editor_data; - EditorSelection *editor_selection; - UndoRedo *undo_redo; + EditorData *editor_data = nullptr; + EditorSelection *editor_selection = nullptr; + UndoRedo *undo_redo = nullptr; - CheckBox *preview_camera; - SubViewportContainer *subviewport_container; + CheckBox *preview_camera = nullptr; + SubViewportContainer *subviewport_container = nullptr; - MenuButton *view_menu; - PopupMenu *display_submenu; + MenuButton *view_menu = nullptr; + PopupMenu *display_submenu = nullptr; - Control *surface; - SubViewport *viewport; - Camera3D *camera; + Control *surface = nullptr; + SubViewport *viewport = nullptr; + Camera3D *camera = nullptr; bool transforming; bool orthogonal; bool auto_orthogonal; @@ -221,17 +221,17 @@ private: real_t freelook_speed; Vector2 previous_mouse_position; - Label *info_label; - Label *cinema_label; - Label *locked_label; - Label *zoom_limit_label; + Label *info_label = nullptr; + Label *cinema_label = nullptr; + Label *locked_label = nullptr; + Label *zoom_limit_label = nullptr; - VBoxContainer *top_right_vbox; - ViewportRotationControl *rotation_control; - Gradient *frame_time_gradient; - Label *cpu_time_label; - Label *gpu_time_label; - Label *fps_label; + VBoxContainer *top_right_vbox = nullptr; + ViewportRotationControl *rotation_control = nullptr; + Gradient *frame_time_gradient = nullptr; + Label *cpu_time_label = nullptr; + Label *gpu_time_label = nullptr; + Label *fps_label = nullptr; struct _RayResult { Node3D *item = nullptr; @@ -274,7 +274,7 @@ private: bool clicked_wants_append; bool selection_in_progress = false; - PopupMenu *selection_menu; + PopupMenu *selection_menu = nullptr; enum NavigationZoomStyle { NAVIGATION_ZOOM_VERTICAL, @@ -375,9 +375,9 @@ private: void _sinput(const Ref<InputEvent> &p_event); void _update_freelook(real_t delta); - Node3DEditor *spatial_editor; + Node3DEditor *spatial_editor = nullptr; - Camera3D *previewing; + Camera3D *previewing = nullptr; Camera3D *preview = nullptr; bool previewing_cinema; @@ -455,7 +455,7 @@ public: Transform3D original_local; Transform3D last_xform; // last transform bool last_xform_dirty; - Node3D *sp; + Node3D *sp = nullptr; RID sbox_instance; RID sbox_instance_offset; RID sbox_instance_xray; @@ -537,13 +537,13 @@ public: }; private: - EditorSelection *editor_selection; + EditorSelection *editor_selection = nullptr; - Node3DEditorViewportContainer *viewport_base; + Node3DEditorViewportContainer *viewport_base = nullptr; Node3DEditorViewport *viewports[VIEWPORTS_COUNT]; - VSplitContainer *shader_split; - HSplitContainer *left_panel_split; - HSplitContainer *right_panel_split; + VSplitContainer *shader_split = nullptr; + HSplitContainer *left_panel_split = nullptr; + HSplitContainer *right_panel_split = nullptr; ///// @@ -588,7 +588,7 @@ private: Ref<StandardMaterial3D> cursor_material; // Scene drag and drop support - Node3D *preview_node; + Node3D *preview_node = nullptr; AABB preview_bounds; struct Gizmo { @@ -628,31 +628,31 @@ private: Button *tool_button[TOOL_MAX]; Button *tool_option_button[TOOL_OPT_MAX]; - MenuButton *transform_menu; - PopupMenu *gizmos_menu; - MenuButton *view_menu; + MenuButton *transform_menu = nullptr; + PopupMenu *gizmos_menu = nullptr; + MenuButton *view_menu = nullptr; - AcceptDialog *accept; + AcceptDialog *accept = nullptr; - ConfirmationDialog *snap_dialog; - ConfirmationDialog *xform_dialog; - ConfirmationDialog *settings_dialog; + ConfirmationDialog *snap_dialog = nullptr; + ConfirmationDialog *xform_dialog = nullptr; + ConfirmationDialog *settings_dialog = nullptr; bool snap_enabled; bool snap_key_enabled; - LineEdit *snap_translate; - LineEdit *snap_rotate; - LineEdit *snap_scale; + LineEdit *snap_translate = nullptr; + LineEdit *snap_rotate = nullptr; + LineEdit *snap_scale = nullptr; LineEdit *xform_translate[3]; LineEdit *xform_rotate[3]; LineEdit *xform_scale[3]; - OptionButton *xform_type; + OptionButton *xform_type = nullptr; - VBoxContainer *settings_vbc; - SpinBox *settings_fov; - SpinBox *settings_znear; - SpinBox *settings_zfar; + VBoxContainer *settings_vbc = nullptr; + SpinBox *settings_fov = nullptr; + SpinBox *settings_znear = nullptr; + SpinBox *settings_zfar = nullptr; void _snap_changed(); void _snap_update(); @@ -662,14 +662,14 @@ private: void _menu_gizmo_toggled(int p_option); void _update_camera_override_button(bool p_game_running); void _update_camera_override_viewport(Object *p_viewport); - HBoxContainer *hbc_menu; + HBoxContainer *hbc_menu = nullptr; // Used for secondary menu items which are displayed depending on the currently selected node // (such as MeshInstance's "Mesh" menu). - PanelContainer *context_menu_container; - HBoxContainer *hbc_context_menu; + PanelContainer *context_menu_container = nullptr; + HBoxContainer *hbc_context_menu = nullptr; void _generate_selection_boxes(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; int camera_override_viewport_id; @@ -683,13 +683,13 @@ private: void _toggle_maximize_view(Object *p_viewport); - Node *custom_camera; + Node *custom_camera = nullptr; Object *_get_editor_data(Object *p_what); Ref<Environment> viewport_environment; - Node3D *selected; + Node3D *selected = nullptr; void _request_gizmo(Object *p_obj); void _set_subgizmo_selection(Object *p_obj, Ref<Node3DGizmo> p_gizmo, int p_id, Transform3D p_transform = Transform3D()); @@ -712,18 +712,18 @@ private: uint32_t world_env_count = 0; uint32_t directional_light_count = 0; - Button *sun_button; - Label *sun_state; - Label *sun_title; - VBoxContainer *sun_vb; - Popup *sun_environ_popup; - Control *sun_direction; - EditorSpinSlider *sun_angle_altitude; - EditorSpinSlider *sun_angle_azimuth; - ColorPickerButton *sun_color; - EditorSpinSlider *sun_energy; - EditorSpinSlider *sun_max_distance; - Button *sun_add_to_scene; + Button *sun_button = nullptr; + Label *sun_state = nullptr; + Label *sun_title = nullptr; + VBoxContainer *sun_vb = nullptr; + Popup *sun_environ_popup = nullptr; + Control *sun_direction = nullptr; + EditorSpinSlider *sun_angle_altitude = nullptr; + EditorSpinSlider *sun_angle_azimuth = nullptr; + ColorPickerButton *sun_color = nullptr; + EditorSpinSlider *sun_energy = nullptr; + EditorSpinSlider *sun_max_distance = nullptr; + Button *sun_add_to_scene = nullptr; void _sun_direction_draw(); void _sun_direction_input(const Ref<InputEvent> &p_event); @@ -734,23 +734,23 @@ private: Ref<Shader> sun_direction_shader; Ref<ShaderMaterial> sun_direction_material; - Button *environ_button; - Label *environ_state; - Label *environ_title; - VBoxContainer *environ_vb; - ColorPickerButton *environ_sky_color; - ColorPickerButton *environ_ground_color; - EditorSpinSlider *environ_energy; - Button *environ_ao_button; - Button *environ_glow_button; - Button *environ_tonemap_button; - Button *environ_gi_button; - Button *environ_add_to_scene; - - Button *sun_environ_settings; - - DirectionalLight3D *preview_sun; - WorldEnvironment *preview_environment; + Button *environ_button = nullptr; + Label *environ_state = nullptr; + Label *environ_title = nullptr; + VBoxContainer *environ_vb = nullptr; + ColorPickerButton *environ_sky_color = nullptr; + ColorPickerButton *environ_ground_color = nullptr; + EditorSpinSlider *environ_energy = nullptr; + Button *environ_ao_button = nullptr; + Button *environ_glow_button = nullptr; + Button *environ_tonemap_button = nullptr; + Button *environ_gi_button = nullptr; + Button *environ_add_to_scene = nullptr; + + Button *sun_environ_settings = nullptr; + + DirectionalLight3D *preview_sun = nullptr; + WorldEnvironment *preview_environment = nullptr; Ref<Environment> environment; Ref<ProceduralSkyMaterial> sky_material; @@ -868,7 +868,7 @@ public: class Node3DEditorPlugin : public EditorPlugin { GDCLASS(Node3DEditorPlugin, EditorPlugin); - Node3DEditor *spatial_editor; + Node3DEditor *spatial_editor = nullptr; public: Node3DEditor *get_spatial_editor() { return spatial_editor; } diff --git a/editor/plugins/occluder_instance_3d_editor_plugin.h b/editor/plugins/occluder_instance_3d_editor_plugin.h index 24f31b2ea8..360b7297cf 100644 --- a/editor/plugins/occluder_instance_3d_editor_plugin.h +++ b/editor/plugins/occluder_instance_3d_editor_plugin.h @@ -40,11 +40,11 @@ class EditorFileDialog; class OccluderInstance3DEditorPlugin : public EditorPlugin { GDCLASS(OccluderInstance3DEditorPlugin, EditorPlugin); - OccluderInstance3D *occluder_instance; + OccluderInstance3D *occluder_instance = nullptr; - Button *bake; + Button *bake = nullptr; - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; void _bake_select_file(const String &p_file); void _bake(); diff --git a/editor/plugins/ot_features_plugin.h b/editor/plugins/ot_features_plugin.h index fcbc8692ca..6639148080 100644 --- a/editor/plugins/ot_features_plugin.h +++ b/editor/plugins/ot_features_plugin.h @@ -38,7 +38,7 @@ class OpenTypeFeaturesEditor : public EditorProperty { GDCLASS(OpenTypeFeaturesEditor, EditorProperty); - EditorSpinSlider *spin; + EditorSpinSlider *spin = nullptr; bool setting = true; void _value_changed(double p_val); Button *button = nullptr; diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index 926a859f8b..ff74aeedf7 100644 --- a/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -40,14 +40,14 @@ class CanvasItemEditor; class Path2DEditor : public HBoxContainer { GDCLASS(Path2DEditor, HBoxContainer); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; - CanvasItemEditor *canvas_item_editor; - Panel *panel; - Path2D *node; + CanvasItemEditor *canvas_item_editor = nullptr; + Panel *panel = nullptr; + Path2D *node = nullptr; - HBoxContainer *base_hb; - Separator *sep; + HBoxContainer *base_hb = nullptr; + Separator *sep = nullptr; enum Mode { MODE_CREATE, @@ -58,12 +58,12 @@ class Path2DEditor : public HBoxContainer { }; Mode mode; - Button *curve_create; - Button *curve_edit; - Button *curve_edit_curve; - Button *curve_del; - Button *curve_close; - MenuButton *handle_menu; + Button *curve_create = nullptr; + Button *curve_edit = nullptr; + Button *curve_edit_curve = nullptr; + Button *curve_del = nullptr; + Button *curve_close = nullptr; + MenuButton *handle_menu = nullptr; bool mirror_handle_angle; bool mirror_handle_length; @@ -110,7 +110,7 @@ public: class Path2DEditorPlugin : public EditorPlugin { GDCLASS(Path2DEditorPlugin, EditorPlugin); - Path2DEditor *path2d_editor; + Path2DEditor *path2d_editor = nullptr; public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) override { return path2d_editor->forward_gui_input(p_event); } diff --git a/editor/plugins/path_3d_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h index 3c6ca65437..72c24732c0 100644 --- a/editor/plugins/path_3d_editor_plugin.h +++ b/editor/plugins/path_3d_editor_plugin.h @@ -40,7 +40,7 @@ class Path3DGizmo : public EditorNode3DGizmo { GDCLASS(Path3DGizmo, EditorNode3DGizmo); - Path3D *path; + Path3D *path = nullptr; mutable Vector3 original; mutable float orig_in_length; mutable float orig_out_length; @@ -70,14 +70,14 @@ public: class Path3DEditorPlugin : public EditorPlugin { GDCLASS(Path3DEditorPlugin, EditorPlugin); - Separator *sep; - Button *curve_create; - Button *curve_edit; - Button *curve_del; - Button *curve_close; - MenuButton *handle_menu; + Separator *sep = nullptr; + Button *curve_create = nullptr; + Button *curve_edit = nullptr; + Button *curve_del = nullptr; + Button *curve_close = nullptr; + MenuButton *handle_menu = nullptr; - Path3D *path; + Path3D *path = nullptr; void _update_theme(); diff --git a/editor/plugins/physical_bone_3d_editor_plugin.h b/editor/plugins/physical_bone_3d_editor_plugin.h index 4051644b54..93e722a432 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.h +++ b/editor/plugins/physical_bone_3d_editor_plugin.h @@ -39,8 +39,8 @@ class PhysicalBone3DEditor : public Object { GDCLASS(PhysicalBone3DEditor, Object); - HBoxContainer *spatial_editor_hb; - Button *button_transform_joint; + HBoxContainer *spatial_editor_hb = nullptr; + Button *button_transform_joint = nullptr; PhysicalBone3D *selected = nullptr; diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 0a5def902c..4403d1e9c7 100644 --- a/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -68,38 +68,38 @@ class Polygon2DEditor : public AbstractPolygon2DEditor { Button *uv_edit_mode[4]; Ref<ButtonGroup> uv_edit_group; - Polygon2D *node; + Polygon2D *node = nullptr; UVMode uv_mode; - AcceptDialog *uv_edit; + AcceptDialog *uv_edit = nullptr; Button *uv_button[UV_MODE_MAX]; - Button *b_snap_enable; - Button *b_snap_grid; - Panel *uv_edit_draw; - HSlider *uv_zoom; - SpinBox *uv_zoom_value; - HScrollBar *uv_hscroll; - VScrollBar *uv_vscroll; - MenuButton *uv_menu; - TextureRect *uv_icon_zoom; + Button *b_snap_enable = nullptr; + Button *b_snap_grid = nullptr; + Panel *uv_edit_draw = nullptr; + HSlider *uv_zoom = nullptr; + SpinBox *uv_zoom_value = nullptr; + HScrollBar *uv_hscroll = nullptr; + VScrollBar *uv_vscroll = nullptr; + MenuButton *uv_menu = nullptr; + TextureRect *uv_icon_zoom = nullptr; Ref<ViewPanner> uv_panner; void _uv_scroll_callback(Vector2 p_scroll_vec, bool p_alt); void _uv_pan_callback(Vector2 p_scroll_vec); void _uv_zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt); - VBoxContainer *bone_scroll_main_vb; - ScrollContainer *bone_scroll; - VBoxContainer *bone_scroll_vb; - Button *sync_bones; - HSlider *bone_paint_strength; - SpinBox *bone_paint_radius; - Label *bone_paint_radius_label; + VBoxContainer *bone_scroll_main_vb = nullptr; + ScrollContainer *bone_scroll = nullptr; + VBoxContainer *bone_scroll_vb = nullptr; + Button *sync_bones = nullptr; + HSlider *bone_paint_strength = nullptr; + SpinBox *bone_paint_radius = nullptr; + Label *bone_paint_radius_label = nullptr; bool bone_painting; int bone_painting_bone; Vector<float> prev_weights; Vector2 bone_paint_pos; - AcceptDialog *grid_settings; + AcceptDialog *grid_settings = nullptr; void _sync_bones(); void _update_bone_list(); @@ -123,9 +123,9 @@ class Polygon2DEditor : public AbstractPolygon2DEditor { Vector2 uv_drag_from; bool updating_uv_scroll; - AcceptDialog *error; + AcceptDialog *error = nullptr; - Button *button_uv; + Button *button_uv = nullptr; bool use_snap; bool snap_show_grid; diff --git a/editor/plugins/polygon_3d_editor_plugin.h b/editor/plugins/polygon_3d_editor_plugin.h index e92dcaf319..3ad7a4df58 100644 --- a/editor/plugins/polygon_3d_editor_plugin.h +++ b/editor/plugins/polygon_3d_editor_plugin.h @@ -41,7 +41,7 @@ class CanvasItemEditor; class Polygon3DEditor : public HBoxContainer { GDCLASS(Polygon3DEditor, HBoxContainer); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; enum Mode { MODE_CREATE, MODE_EDIT, @@ -50,21 +50,21 @@ class Polygon3DEditor : public HBoxContainer { Mode mode; - Button *button_create; - Button *button_edit; + Button *button_create = nullptr; + Button *button_edit = nullptr; Ref<StandardMaterial3D> line_material; Ref<StandardMaterial3D> handle_material; - Panel *panel; - Node3D *node; + Panel *panel = nullptr; + Node3D *node = nullptr; Ref<Resource> node_resource; Ref<ImmediateMesh> imesh; - MeshInstance3D *imgeom; - MeshInstance3D *pointsm; + MeshInstance3D *imgeom = nullptr; + MeshInstance3D *pointsm = nullptr; Ref<ArrayMesh> m; - MenuButton *options; + MenuButton *options = nullptr; int edited_point; Vector2 edited_point_pos; @@ -98,7 +98,7 @@ public: class Polygon3DEditorPlugin : public EditorPlugin { GDCLASS(Polygon3DEditorPlugin, EditorPlugin); - Polygon3DEditor *polygon_editor; + Polygon3DEditor *polygon_editor = nullptr; public: virtual EditorPlugin::AfterGUIInput forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override { return polygon_editor->forward_spatial_gui_input(p_camera, p_event); } diff --git a/editor/plugins/replication_editor_plugin.h b/editor/plugins/replication_editor_plugin.h index 46274d188c..08e86d1617 100644 --- a/editor/plugins/replication_editor_plugin.h +++ b/editor/plugins/replication_editor_plugin.h @@ -51,7 +51,7 @@ private: Ref<SceneReplicationConfig> config; NodePath deleting; - Tree *tree; + Tree *tree = nullptr; bool keying = false; Ref<Texture2D> _get_class_icon(const Node *p_node); @@ -84,7 +84,7 @@ class ReplicationEditorPlugin : public EditorPlugin { GDCLASS(ReplicationEditorPlugin, EditorPlugin); private: - ReplicationEditor *repl_editor; + ReplicationEditor *repl_editor = nullptr; void _node_removed(Node *p_node); void _keying_changed(); diff --git a/editor/plugins/resource_preloader_editor_plugin.h b/editor/plugins/resource_preloader_editor_plugin.h index 8e81239f1b..0b799c13c6 100644 --- a/editor/plugins/resource_preloader_editor_plugin.h +++ b/editor/plugins/resource_preloader_editor_plugin.h @@ -47,16 +47,16 @@ class ResourcePreloaderEditor : public PanelContainer { BUTTON_REMOVE }; - Button *load; - Button *paste; - Tree *tree; + Button *load = nullptr; + Button *paste = nullptr; + Tree *tree = nullptr; bool loading_scene; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - AcceptDialog *dialog; + AcceptDialog *dialog = nullptr; - ResourcePreloader *preloader; + ResourcePreloader *preloader = nullptr; void _load_pressed(); void _files_load_request(const Vector<String> &p_paths); @@ -66,7 +66,7 @@ class ResourcePreloaderEditor : public PanelContainer { void _cell_button_pressed(Object *p_item, int p_column, int p_id); void _item_edited(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -87,8 +87,8 @@ public: class ResourcePreloaderEditorPlugin : public EditorPlugin { GDCLASS(ResourcePreloaderEditorPlugin, EditorPlugin); - ResourcePreloaderEditor *preloader_editor; - Button *button; + ResourcePreloaderEditor *preloader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "ResourcePreloader"; } diff --git a/editor/plugins/root_motion_editor_plugin.h b/editor/plugins/root_motion_editor_plugin.h index c2866f269b..5b8c1d77b3 100644 --- a/editor/plugins/root_motion_editor_plugin.h +++ b/editor/plugins/root_motion_editor_plugin.h @@ -38,12 +38,12 @@ class EditorPropertyRootMotion : public EditorProperty { GDCLASS(EditorPropertyRootMotion, EditorProperty); - Button *assign; - Button *clear; + Button *assign = nullptr; + Button *clear = nullptr; NodePath base_hint; - ConfirmationDialog *filter_dialog; - Tree *filters; + ConfirmationDialog *filter_dialog = nullptr; + Tree *filters = nullptr; void _confirmed(); void _node_assign(); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index a99e269d46..5eeca7a334 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -102,8 +102,8 @@ public: class ScriptEditorQuickOpen : public ConfirmationDialog { GDCLASS(ScriptEditorQuickOpen, ConfirmationDialog); - LineEdit *search_box; - Tree *search_options; + LineEdit *search_box = nullptr; + Tree *search_options = nullptr; String function; void _update_search(); @@ -242,55 +242,55 @@ class ScriptEditor : public PanelContainer { DISPLAY_FULL_PATH, }; - HBoxContainer *menu_hb; - MenuButton *file_menu; - MenuButton *edit_menu; - MenuButton *script_search_menu; - MenuButton *debug_menu; - PopupMenu *context_menu; - Timer *autosave_timer; + HBoxContainer *menu_hb = nullptr; + MenuButton *file_menu = nullptr; + MenuButton *edit_menu = nullptr; + MenuButton *script_search_menu = nullptr; + MenuButton *debug_menu = nullptr; + PopupMenu *context_menu = nullptr; + Timer *autosave_timer = nullptr; uint64_t idle; - PopupMenu *recent_scripts; - PopupMenu *theme_submenu; - - Button *help_search; - Button *site_search; - EditorHelpSearch *help_search_dialog; - - ItemList *script_list; - HSplitContainer *script_split; - ItemList *members_overview; - LineEdit *filter_scripts; - LineEdit *filter_methods; - VBoxContainer *scripts_vbox; - VBoxContainer *overview_vbox; - HBoxContainer *buttons_hbox; - Label *filename; - Button *members_overview_alphabeta_sort_button; + PopupMenu *recent_scripts = nullptr; + PopupMenu *theme_submenu = nullptr; + + Button *help_search = nullptr; + Button *site_search = nullptr; + EditorHelpSearch *help_search_dialog = nullptr; + + ItemList *script_list = nullptr; + HSplitContainer *script_split = nullptr; + ItemList *members_overview = nullptr; + LineEdit *filter_scripts = nullptr; + LineEdit *filter_methods = nullptr; + VBoxContainer *scripts_vbox = nullptr; + VBoxContainer *overview_vbox = nullptr; + HBoxContainer *buttons_hbox = nullptr; + Label *filename = nullptr; + Button *members_overview_alphabeta_sort_button = nullptr; bool members_overview_enabled; - ItemList *help_overview; + ItemList *help_overview = nullptr; bool help_overview_enabled; - VSplitContainer *list_split; - TabContainer *tab_container; - EditorFileDialog *file_dialog; - AcceptDialog *error_dialog; - ConfirmationDialog *erase_tab_confirm; - ScriptCreateDialog *script_create_dialog; - Button *scripts_visible; - FindReplaceBar *find_replace_bar; + VSplitContainer *list_split = nullptr; + TabContainer *tab_container = nullptr; + EditorFileDialog *file_dialog = nullptr; + AcceptDialog *error_dialog = nullptr; + ConfirmationDialog *erase_tab_confirm = nullptr; + ScriptCreateDialog *script_create_dialog = nullptr; + Button *scripts_visible = nullptr; + FindReplaceBar *find_replace_bar = nullptr; String current_theme; - TextureRect *script_icon; - Label *script_name_label; + TextureRect *script_icon = nullptr; + Label *script_name_label = nullptr; - Button *script_back; - Button *script_forward; + Button *script_back = nullptr; + Button *script_forward = nullptr; - FindInFilesDialog *find_in_files_dialog; - FindInFilesPanel *find_in_files; - Button *find_in_files_button; + FindInFilesDialog *find_in_files_dialog = nullptr; + FindInFilesPanel *find_in_files = nullptr; + Button *find_in_files_button = nullptr; enum { SCRIPT_EDITOR_FUNC_MAX = 32, @@ -320,8 +320,8 @@ class ScriptEditor : public PanelContainer { bool _has_script_tab() const; void _prepare_file_menu(); - Tree *disk_changed_list; - ConfirmationDialog *disk_changed; + Tree *disk_changed_list = nullptr; + ConfirmationDialog *disk_changed = nullptr; bool restoring_layout; @@ -361,7 +361,7 @@ class ScriptEditor : public PanelContainer { void _update_selected_editor_menu(); - EditorScriptCodeCompletionCache *completion_cache; + EditorScriptCodeCompletionCache *completion_cache = nullptr; void _editor_stop(); @@ -528,7 +528,7 @@ public: class ScriptEditorPlugin : public EditorPlugin { GDCLASS(ScriptEditorPlugin, EditorPlugin); - ScriptEditor *script_editor; + ScriptEditor *script_editor = nullptr; public: virtual String get_name() const override { return "Script"; } diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index 600b14362e..067711c75c 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -108,19 +108,19 @@ class ShaderEditor : public PanelContainer { HELP_DOCS, }; - MenuButton *edit_menu; - MenuButton *search_menu; - PopupMenu *bookmarks_menu; - MenuButton *help_menu; - PopupMenu *context_menu; + MenuButton *edit_menu = nullptr; + MenuButton *search_menu = nullptr; + PopupMenu *bookmarks_menu = nullptr; + MenuButton *help_menu = nullptr; + PopupMenu *context_menu = nullptr; RichTextLabel *warnings_panel = nullptr; uint64_t idle; - GotoLineDialog *goto_line_dialog; - ConfirmationDialog *erase_tab_confirm; - ConfirmationDialog *disk_changed; + GotoLineDialog *goto_line_dialog = nullptr; + ConfirmationDialog *erase_tab_confirm = nullptr; + ConfirmationDialog *disk_changed = nullptr; - ShaderTextEditor *shader_editor; + ShaderTextEditor *shader_editor = nullptr; void _menu_option(int p_option); mutable Ref<Shader> shader; @@ -161,8 +161,8 @@ class ShaderEditorPlugin : public EditorPlugin { GDCLASS(ShaderEditorPlugin, EditorPlugin); bool _2d; - ShaderEditor *shader_editor; - Button *button; + ShaderEditor *shader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "Shader"; } diff --git a/editor/plugins/shader_file_editor_plugin.h b/editor/plugins/shader_file_editor_plugin.h index 5ee2d01dbf..1ebd644282 100644 --- a/editor/plugins/shader_file_editor_plugin.h +++ b/editor/plugins/shader_file_editor_plugin.h @@ -48,10 +48,10 @@ class ShaderFileEditor : public PanelContainer { Ref<RDShaderFile> shader_file; - HBoxContainer *stage_hb; - ItemList *versions; + HBoxContainer *stage_hb = nullptr; + ItemList *versions = nullptr; Button *stages[RD::SHADER_STAGE_MAX]; - RichTextLabel *error_text; + RichTextLabel *error_text = nullptr; void _update_version(const StringName &p_version_txt, const RenderingDevice::ShaderStage p_stage); void _version_selected(int p_stage); @@ -74,8 +74,8 @@ public: class ShaderFileEditorPlugin : public EditorPlugin { GDCLASS(ShaderFileEditorPlugin, EditorPlugin); - ShaderFileEditor *shader_editor; - Button *button; + ShaderFileEditor *shader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "ShaderFile"; } diff --git a/editor/plugins/skeleton_2d_editor_plugin.h b/editor/plugins/skeleton_2d_editor_plugin.h index 004dac7b05..295725b751 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.h +++ b/editor/plugins/skeleton_2d_editor_plugin.h @@ -43,10 +43,10 @@ class Skeleton2DEditor : public Control { MENU_OPTION_MAKE_REST, }; - Skeleton2D *node; + Skeleton2D *node = nullptr; - MenuButton *options; - AcceptDialog *err_dialog; + MenuButton *options = nullptr; + AcceptDialog *err_dialog = nullptr; void _menu_option(int p_option); @@ -65,7 +65,7 @@ public: class Skeleton2DEditorPlugin : public EditorPlugin { GDCLASS(Skeleton2DEditorPlugin, EditorPlugin); - Skeleton2DEditor *sprite_editor; + Skeleton2DEditor *sprite_editor = nullptr; public: virtual String get_name() const override { return "Skeleton2D"; } diff --git a/editor/plugins/skeleton_3d_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h index 2dbb552428..911e39a34f 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.h +++ b/editor/plugins/skeleton_3d_editor_plugin.h @@ -60,10 +60,10 @@ class BoneTransformEditor : public VBoxContainer { Rect2 background_rects[5]; - Skeleton3D *skeleton; + Skeleton3D *skeleton = nullptr; // String property; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool toggle_enabled = false; bool updating = false; @@ -108,26 +108,26 @@ class Skeleton3DEditor : public VBoxContainer { Transform3D relative_rest; // Relative to skeleton node. }; - EditorInspectorPluginSkeleton *editor_plugin; + EditorInspectorPluginSkeleton *editor_plugin = nullptr; - Skeleton3D *skeleton; + Skeleton3D *skeleton = nullptr; Tree *joint_tree = nullptr; BoneTransformEditor *rest_editor = nullptr; BoneTransformEditor *pose_editor = nullptr; - VSeparator *separator; + VSeparator *separator = nullptr; MenuButton *skeleton_options = nullptr; - Button *edit_mode_button; + Button *edit_mode_button = nullptr; bool edit_mode = false; - HBoxContainer *animation_hb; - Button *key_loc_button; - Button *key_rot_button; - Button *key_scale_button; - Button *key_insert_button; - Button *key_insert_all_button; + HBoxContainer *animation_hb = nullptr; + Button *key_loc_button = nullptr; + Button *key_rot_button = nullptr; + Button *key_scale_button = nullptr; + Button *key_insert_button = nullptr; + Button *key_insert_all_button = nullptr; EditorFileDialog *file_dialog = nullptr; @@ -163,7 +163,7 @@ class Skeleton3DEditor : public VBoxContainer { void set_bone_options_enabled(const bool p_bone_options_enabled); // Handle. - MeshInstance3D *handles_mesh_instance; + MeshInstance3D *handles_mesh_instance = nullptr; Ref<ImmediateMesh> handles_mesh; Ref<ShaderMaterial> handle_material; Ref<Shader> handle_shader; @@ -220,7 +220,7 @@ class EditorInspectorPluginSkeleton : public EditorInspectorPlugin { friend class Skeleton3DEditorPlugin; - Skeleton3DEditor *skel_editor; + Skeleton3DEditor *skel_editor = nullptr; public: virtual bool can_handle(Object *p_object) override; @@ -230,7 +230,7 @@ public: class Skeleton3DEditorPlugin : public EditorPlugin { GDCLASS(Skeleton3DEditorPlugin, EditorPlugin); - EditorInspectorPluginSkeleton *skeleton_plugin; + EditorInspectorPluginSkeleton *skeleton_plugin = nullptr; public: virtual EditorPlugin::AfterGUIInput forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override; diff --git a/editor/plugins/skeleton_ik_3d_editor_plugin.h b/editor/plugins/skeleton_ik_3d_editor_plugin.h index f71e788232..26aead6d67 100644 --- a/editor/plugins/skeleton_ik_3d_editor_plugin.h +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.h @@ -38,9 +38,9 @@ class SkeletonIK3D; class SkeletonIK3DEditorPlugin : public EditorPlugin { GDCLASS(SkeletonIK3DEditorPlugin, EditorPlugin); - SkeletonIK3D *skeleton_ik; + SkeletonIK3D *skeleton_ik = nullptr; - Button *play_btn; + Button *play_btn = nullptr; void _play(); diff --git a/editor/plugins/sprite_2d_editor_plugin.h b/editor/plugins/sprite_2d_editor_plugin.h index 46953b0937..8e3dc19c7e 100644 --- a/editor/plugins/sprite_2d_editor_plugin.h +++ b/editor/plugins/sprite_2d_editor_plugin.h @@ -47,16 +47,16 @@ class Sprite2DEditor : public Control { Menu selected_menu_item; - Sprite2D *node; + Sprite2D *node = nullptr; - MenuButton *options; + MenuButton *options = nullptr; - ConfirmationDialog *outline_dialog; + ConfirmationDialog *outline_dialog = nullptr; - AcceptDialog *err_dialog; + AcceptDialog *err_dialog = nullptr; - ConfirmationDialog *debug_uv_dialog; - Control *debug_uv; + ConfirmationDialog *debug_uv_dialog = nullptr; + Control *debug_uv = nullptr; Vector<Vector2> uv_lines; Vector<Vector<Vector2>> outline_lines; Vector<Vector<Vector2>> computed_outline_lines; @@ -64,10 +64,10 @@ class Sprite2DEditor : public Control { Vector<Vector2> computed_uv; Vector<int> computed_indices; - SpinBox *simplification; - SpinBox *grow_pixels; - SpinBox *shrink_pixels; - Button *update_preview; + SpinBox *simplification = nullptr; + SpinBox *grow_pixels = nullptr; + SpinBox *shrink_pixels = nullptr; + Button *update_preview = nullptr; void _menu_option(int p_option); @@ -98,7 +98,7 @@ public: class Sprite2DEditorPlugin : public EditorPlugin { GDCLASS(Sprite2DEditorPlugin, EditorPlugin); - Sprite2DEditor *sprite_editor; + Sprite2DEditor *sprite_editor = nullptr; public: virtual String get_name() const override { return "Sprite2D"; } diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 872a88e262..b0213012a2 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -48,48 +48,48 @@ class EditorFileDialog; class SpriteFramesEditor : public HSplitContainer { GDCLASS(SpriteFramesEditor, HSplitContainer); - Button *load; - Button *load_sheet; - Button *_delete; - Button *copy; - Button *paste; - Button *empty; - Button *empty2; - Button *move_up; - Button *move_down; - Button *zoom_out; - Button *zoom_reset; - Button *zoom_in; - ItemList *tree; + Button *load = nullptr; + Button *load_sheet = nullptr; + Button *_delete = nullptr; + Button *copy = nullptr; + Button *paste = nullptr; + Button *empty = nullptr; + Button *empty2 = nullptr; + Button *move_up = nullptr; + Button *move_down = nullptr; + Button *zoom_out = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_in = nullptr; + ItemList *tree = nullptr; bool loading_scene; int sel; - Button *new_anim; - Button *remove_anim; + Button *new_anim = nullptr; + Button *remove_anim = nullptr; - Tree *animations; - SpinBox *anim_speed; - CheckButton *anim_loop; + Tree *animations = nullptr; + SpinBox *anim_speed = nullptr; + CheckButton *anim_loop = nullptr; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - AcceptDialog *dialog; + AcceptDialog *dialog = nullptr; - SpriteFrames *frames; + SpriteFrames *frames = nullptr; StringName edited_anim; - ConfirmationDialog *delete_dialog; - - ConfirmationDialog *split_sheet_dialog; - ScrollContainer *split_sheet_scroll; - TextureRect *split_sheet_preview; - SpinBox *split_sheet_h; - SpinBox *split_sheet_v; - Button *split_sheet_zoom_out; - Button *split_sheet_zoom_reset; - Button *split_sheet_zoom_in; - EditorFileDialog *file_split_sheet; + ConfirmationDialog *delete_dialog = nullptr; + + ConfirmationDialog *split_sheet_dialog = nullptr; + ScrollContainer *split_sheet_scroll = nullptr; + TextureRect *split_sheet_preview = nullptr; + SpinBox *split_sheet_h = nullptr; + SpinBox *split_sheet_v = nullptr; + Button *split_sheet_zoom_out = nullptr; + Button *split_sheet_zoom_reset = nullptr; + Button *split_sheet_zoom_in = nullptr; + EditorFileDialog *file_split_sheet = nullptr; Set<int> frames_selected; Set<int> frames_toggled_by_mouse_hover; int last_frame_selected; @@ -129,7 +129,7 @@ class SpriteFramesEditor : public HSplitContainer { bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -164,8 +164,8 @@ public: class SpriteFramesEditorPlugin : public EditorPlugin { GDCLASS(SpriteFramesEditorPlugin, EditorPlugin); - SpriteFramesEditor *frames_editor; - Button *button; + SpriteFramesEditor *frames_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "SpriteFrames"; } diff --git a/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h index bdebebbe1c..663440ae31 100644 --- a/editor/plugins/style_box_editor_plugin.h +++ b/editor/plugins/style_box_editor_plugin.h @@ -40,7 +40,7 @@ class StyleBoxPreview : public VBoxContainer { GDCLASS(StyleBoxPreview, VBoxContainer); - Control *preview; + Control *preview = nullptr; Ref<StyleBox> stylebox; void _sb_changed(); diff --git a/editor/plugins/text_control_editor_plugin.h b/editor/plugins/text_control_editor_plugin.h index 1349003a9c..a475f6eba3 100644 --- a/editor/plugins/text_control_editor_plugin.h +++ b/editor/plugins/text_control_editor_plugin.h @@ -100,7 +100,7 @@ public: class TextControlEditorPlugin : public EditorPlugin { GDCLASS(TextControlEditorPlugin, EditorPlugin); - TextControlEditor *text_ctl_editor; + TextControlEditor *text_ctl_editor = nullptr; public: virtual String get_name() const override { return "TextControlFontEditor"; } diff --git a/editor/plugins/texture_3d_editor_plugin.h b/editor/plugins/texture_3d_editor_plugin.h index d418032477..2f7f6f83bb 100644 --- a/editor/plugins/texture_3d_editor_plugin.h +++ b/editor/plugins/texture_3d_editor_plugin.h @@ -39,14 +39,14 @@ class Texture3DEditor : public Control { GDCLASS(Texture3DEditor, Control); - SpinBox *layer; - Label *info; + SpinBox *layer = nullptr; + Label *info = nullptr; Ref<Texture3D> texture; Ref<Shader> shader; Ref<ShaderMaterial> material; - Control *texture_rect; + Control *texture_rect = nullptr; void _make_shaders(); diff --git a/editor/plugins/texture_layered_editor_plugin.h b/editor/plugins/texture_layered_editor_plugin.h index 1c59ec4db0..830916e954 100644 --- a/editor/plugins/texture_layered_editor_plugin.h +++ b/editor/plugins/texture_layered_editor_plugin.h @@ -39,8 +39,8 @@ class TextureLayeredEditor : public Control { GDCLASS(TextureLayeredEditor, Control); - SpinBox *layer; - Label *info; + SpinBox *layer = nullptr; + Label *info = nullptr; Ref<TextureLayered> texture; Ref<Shader> shaders[3]; @@ -48,7 +48,7 @@ class TextureLayeredEditor : public Control { float x_rot = 0; float y_rot = 0; - Control *texture_rect; + Control *texture_rect = nullptr; void _make_shaders(); diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index 041742c28a..1e1cc2b7b2 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -52,23 +52,23 @@ class TextureRegionEditor : public VBoxContainer { }; friend class TextureRegionEditorPlugin; - OptionButton *snap_mode_button; - Button *zoom_in; - Button *zoom_reset; - Button *zoom_out; - HBoxContainer *hb_grid; //For showing/hiding the grid controls when changing the SnapMode - SpinBox *sb_step_y; - SpinBox *sb_step_x; - SpinBox *sb_off_y; - SpinBox *sb_off_x; - SpinBox *sb_sep_y; - SpinBox *sb_sep_x; - Panel *edit_draw; - - VScrollBar *vscroll; - HScrollBar *hscroll; - - UndoRedo *undo_redo; + OptionButton *snap_mode_button = nullptr; + Button *zoom_in = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_out = nullptr; + HBoxContainer *hb_grid = nullptr; //For showing/hiding the grid controls when changing the SnapMode + SpinBox *sb_step_y = nullptr; + SpinBox *sb_step_x = nullptr; + SpinBox *sb_off_y = nullptr; + SpinBox *sb_off_x = nullptr; + SpinBox *sb_sep_y = nullptr; + SpinBox *sb_sep_x = nullptr; + Panel *edit_draw = nullptr; + + VScrollBar *vscroll = nullptr; + HScrollBar *hscroll = nullptr; + + UndoRedo *undo_redo = nullptr; Vector2 draw_ofs; float draw_zoom; @@ -79,9 +79,9 @@ class TextureRegionEditor : public VBoxContainer { Vector2 snap_step; Vector2 snap_separation; - Sprite2D *node_sprite_2d; - Sprite3D *node_sprite_3d; - NinePatchRect *node_ninepatch; + Sprite2D *node_sprite_2d = nullptr; + Sprite3D *node_sprite_3d = nullptr; + NinePatchRect *node_ninepatch = nullptr; Ref<StyleBoxTexture> obj_styleBox; Ref<AtlasTexture> atlas_tex; @@ -146,8 +146,8 @@ class TextureRegionEditorPlugin : public EditorPlugin { GDCLASS(TextureRegionEditorPlugin, EditorPlugin); bool manually_hidden; - Button *texture_region_button; - TextureRegionEditor *region_editor; + Button *texture_region_button = nullptr; + TextureRegionEditor *region_editor = nullptr; protected: static void _bind_methods(); diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index 7c1b0cda3e..4b49fbb186 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -75,9 +75,9 @@ class ThemeItemImportTree : public VBoxContainer { Map<ThemeItem, ItemCheckedState> selected_items; - LineEdit *import_items_filter; + LineEdit *import_items_filter = nullptr; - Tree *import_items_tree; + Tree *import_items_tree = nullptr; List<TreeItem *> tree_color_items; List<TreeItem *> tree_constant_items; List<TreeItem *> tree_font_items; @@ -92,57 +92,57 @@ class ThemeItemImportTree : public VBoxContainer { IMPORT_ITEM_DATA = 2, }; - TextureRect *select_colors_icon; - Label *select_colors_label; - Button *select_all_colors_button; - Button *select_full_colors_button; - Button *deselect_all_colors_button; - Label *total_selected_colors_label; - - TextureRect *select_constants_icon; - Label *select_constants_label; - Button *select_all_constants_button; - Button *select_full_constants_button; - Button *deselect_all_constants_button; - Label *total_selected_constants_label; - - TextureRect *select_fonts_icon; - Label *select_fonts_label; - Button *select_all_fonts_button; - Button *select_full_fonts_button; - Button *deselect_all_fonts_button; - Label *total_selected_fonts_label; - - TextureRect *select_font_sizes_icon; - Label *select_font_sizes_label; - Button *select_all_font_sizes_button; - Button *select_full_font_sizes_button; - Button *deselect_all_font_sizes_button; - Label *total_selected_font_sizes_label; - - TextureRect *select_icons_icon; - Label *select_icons_label; - Button *select_all_icons_button; - Button *select_full_icons_button; - Button *deselect_all_icons_button; - Label *total_selected_icons_label; - - TextureRect *select_styleboxes_icon; - Label *select_styleboxes_label; - Button *select_all_styleboxes_button; - Button *select_full_styleboxes_button; - Button *deselect_all_styleboxes_button; - Label *total_selected_styleboxes_label; - - HBoxContainer *select_icons_warning_hb; - TextureRect *select_icons_warning_icon; - Label *select_icons_warning; - - Button *import_collapse_types_button; - Button *import_expand_types_button; - Button *import_select_all_button; - Button *import_select_full_button; - Button *import_deselect_all_button; + TextureRect *select_colors_icon = nullptr; + Label *select_colors_label = nullptr; + Button *select_all_colors_button = nullptr; + Button *select_full_colors_button = nullptr; + Button *deselect_all_colors_button = nullptr; + Label *total_selected_colors_label = nullptr; + + TextureRect *select_constants_icon = nullptr; + Label *select_constants_label = nullptr; + Button *select_all_constants_button = nullptr; + Button *select_full_constants_button = nullptr; + Button *deselect_all_constants_button = nullptr; + Label *total_selected_constants_label = nullptr; + + TextureRect *select_fonts_icon = nullptr; + Label *select_fonts_label = nullptr; + Button *select_all_fonts_button = nullptr; + Button *select_full_fonts_button = nullptr; + Button *deselect_all_fonts_button = nullptr; + Label *total_selected_fonts_label = nullptr; + + TextureRect *select_font_sizes_icon = nullptr; + Label *select_font_sizes_label = nullptr; + Button *select_all_font_sizes_button = nullptr; + Button *select_full_font_sizes_button = nullptr; + Button *deselect_all_font_sizes_button = nullptr; + Label *total_selected_font_sizes_label = nullptr; + + TextureRect *select_icons_icon = nullptr; + Label *select_icons_label = nullptr; + Button *select_all_icons_button = nullptr; + Button *select_full_icons_button = nullptr; + Button *deselect_all_icons_button = nullptr; + Label *total_selected_icons_label = nullptr; + + TextureRect *select_styleboxes_icon = nullptr; + Label *select_styleboxes_label = nullptr; + Button *select_all_styleboxes_button = nullptr; + Button *select_full_styleboxes_button = nullptr; + Button *deselect_all_styleboxes_button = nullptr; + Label *total_selected_styleboxes_label = nullptr; + + HBoxContainer *select_icons_warning_hb = nullptr; + TextureRect *select_icons_warning_icon = nullptr; + Label *select_icons_warning = nullptr; + + Button *import_collapse_types_button = nullptr; + Button *import_expand_types_button = nullptr; + Button *import_select_all_button = nullptr; + Button *import_select_full_button = nullptr; + Button *import_deselect_all_button = nullptr; void _update_items_tree(); void _toggle_type_items(bool p_collapse); @@ -186,31 +186,31 @@ class ThemeTypeEditor; class ThemeItemEditorDialog : public AcceptDialog { GDCLASS(ThemeItemEditorDialog, AcceptDialog); - ThemeTypeEditor *theme_type_editor; + ThemeTypeEditor *theme_type_editor = nullptr; Ref<Theme> edited_theme; - TabContainer *tc; + TabContainer *tc = nullptr; enum TypesTreeAction { TYPES_TREE_REMOVE_ITEM, }; - Tree *edit_type_list; - LineEdit *edit_add_type_value; + Tree *edit_type_list = nullptr; + LineEdit *edit_add_type_value = nullptr; String edited_item_type; - Button *edit_items_add_color; - Button *edit_items_add_constant; - Button *edit_items_add_font; - Button *edit_items_add_font_size; - Button *edit_items_add_icon; - Button *edit_items_add_stylebox; - Button *edit_items_remove_class; - Button *edit_items_remove_custom; - Button *edit_items_remove_all; - Tree *edit_items_tree; - Label *edit_items_message; + Button *edit_items_add_color = nullptr; + Button *edit_items_add_constant = nullptr; + Button *edit_items_add_font = nullptr; + Button *edit_items_add_font_size = nullptr; + Button *edit_items_add_icon = nullptr; + Button *edit_items_add_stylebox = nullptr; + Button *edit_items_remove_class = nullptr; + Button *edit_items_remove_custom = nullptr; + Button *edit_items_remove_all = nullptr; + Tree *edit_items_tree = nullptr; + Label *edit_items_message = nullptr; enum ItemsTreeAction { ITEMS_TREE_RENAME_ITEM, @@ -218,10 +218,10 @@ class ThemeItemEditorDialog : public AcceptDialog { ITEMS_TREE_REMOVE_DATA_TYPE, }; - ConfirmationDialog *edit_theme_item_dialog; - VBoxContainer *edit_theme_item_old_vb; - Label *theme_item_old_name; - LineEdit *theme_item_name; + ConfirmationDialog *edit_theme_item_dialog = nullptr; + VBoxContainer *edit_theme_item_old_vb = nullptr; + Label *theme_item_old_name = nullptr; + LineEdit *theme_item_name = nullptr; enum ItemPopupMode { CREATE_THEME_ITEM, @@ -233,15 +233,15 @@ class ThemeItemEditorDialog : public AcceptDialog { String edit_item_old_name; Theme::DataType edit_item_data_type = Theme::DATA_TYPE_MAX; - ThemeItemImportTree *import_default_theme_items; - ThemeItemImportTree *import_editor_theme_items; - ThemeItemImportTree *import_other_theme_items; + ThemeItemImportTree *import_default_theme_items = nullptr; + ThemeItemImportTree *import_editor_theme_items = nullptr; + ThemeItemImportTree *import_other_theme_items = nullptr; - LineEdit *import_another_theme_value; - Button *import_another_theme_button; - EditorFileDialog *import_another_theme_dialog; + LineEdit *import_another_theme_value = nullptr; + Button *import_another_theme_button = nullptr; + EditorFileDialog *import_another_theme_dialog = nullptr; - ConfirmationDialog *confirm_closing_dialog; + ConfirmationDialog *confirm_closing_dialog = nullptr; void ok_pressed() override; void _close_dialog(); @@ -288,9 +288,9 @@ class ThemeTypeDialog : public ConfirmationDialog { String pre_submitted_value; - LineEdit *add_type_filter; - ItemList *add_type_options; - ConfirmationDialog *add_type_confirmation; + LineEdit *add_type_filter = nullptr; + ItemList *add_type_options = nullptr; + ConfirmationDialog *add_type_confirmation = nullptr; void _dialog_about_to_show(); void ok_pressed() override; @@ -332,22 +332,22 @@ class ThemeTypeEditor : public MarginContainer { LeadingStylebox leading_stylebox; - OptionButton *theme_type_list; - Button *add_type_button; + OptionButton *theme_type_list = nullptr; + Button *add_type_button = nullptr; - CheckButton *show_default_items_button; + CheckButton *show_default_items_button = nullptr; - TabContainer *data_type_tabs; - VBoxContainer *color_items_list; - VBoxContainer *constant_items_list; - VBoxContainer *font_items_list; - VBoxContainer *font_size_items_list; - VBoxContainer *icon_items_list; - VBoxContainer *stylebox_items_list; + TabContainer *data_type_tabs = nullptr; + VBoxContainer *color_items_list = nullptr; + VBoxContainer *constant_items_list = nullptr; + VBoxContainer *font_items_list = nullptr; + VBoxContainer *font_size_items_list = nullptr; + VBoxContainer *icon_items_list = nullptr; + VBoxContainer *stylebox_items_list = nullptr; - LineEdit *type_variation_edit; - Button *type_variation_button; - Label *type_variation_locked; + LineEdit *type_variation_edit = nullptr; + Button *type_variation_button = nullptr; + Label *type_variation_locked = nullptr; enum TypeDialogMode { ADD_THEME_TYPE, @@ -355,10 +355,10 @@ class ThemeTypeEditor : public MarginContainer { }; TypeDialogMode add_type_mode = ADD_THEME_TYPE; - ThemeTypeDialog *add_type_dialog; + ThemeTypeDialog *add_type_dialog = nullptr; Vector<Control *> focusables; - Timer *update_debounce_timer; + Timer *update_debounce_timer = nullptr; VBoxContainer *_create_item_list(Theme::DataType p_data_type); void _update_type_list(); @@ -417,15 +417,15 @@ class ThemeEditor : public VBoxContainer { Ref<Theme> theme; - TabBar *preview_tabs; - PanelContainer *preview_tabs_content; - Button *add_preview_button; - EditorFileDialog *preview_scene_dialog; + TabBar *preview_tabs = nullptr; + PanelContainer *preview_tabs_content = nullptr; + Button *add_preview_button = nullptr; + EditorFileDialog *preview_scene_dialog = nullptr; - ThemeTypeEditor *theme_type_editor; + ThemeTypeEditor *theme_type_editor = nullptr; - Label *theme_name; - ThemeItemEditorDialog *theme_edit_dialog; + Label *theme_name = nullptr; + ThemeItemEditorDialog *theme_edit_dialog = nullptr; void _theme_save_button_cbk(bool p_save_as); void _theme_edit_button_cbk(); @@ -452,8 +452,8 @@ public: class ThemeEditorPlugin : public EditorPlugin { GDCLASS(ThemeEditorPlugin, EditorPlugin); - ThemeEditor *theme_editor; - Button *button; + ThemeEditor *theme_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "Theme"; } diff --git a/editor/plugins/theme_editor_preview.h b/editor/plugins/theme_editor_preview.h index 48111df399..d05916afae 100644 --- a/editor/plugins/theme_editor_preview.h +++ b/editor/plugins/theme_editor_preview.h @@ -41,10 +41,10 @@ class ThemeEditorPreview : public VBoxContainer { GDCLASS(ThemeEditorPreview, VBoxContainer); - ScrollContainer *preview_container; - ColorRect *preview_bg; - MarginContainer *preview_overlay; - Control *picker_overlay; + ScrollContainer *preview_container = nullptr; + ColorRect *preview_bg = nullptr; + MarginContainer *preview_overlay = nullptr; + Control *picker_overlay = nullptr; Control *hovered_control = nullptr; struct ThemeCache { @@ -69,9 +69,9 @@ class ThemeEditorPreview : public VBoxContainer { void _reset_picker_overlay(); protected: - HBoxContainer *preview_toolbar; - MarginContainer *preview_content; - Button *picker_button; + HBoxContainer *preview_toolbar = nullptr; + MarginContainer *preview_content = nullptr; + Button *picker_button = nullptr; void add_preview_overlay(Control *p_overlay); @@ -96,7 +96,7 @@ class SceneThemeEditorPreview : public ThemeEditorPreview { Ref<PackedScene> loaded_scene; - Button *reload_scene_button; + Button *reload_scene_button = nullptr; void _reload_scene(); diff --git a/editor/plugins/tiles/atlas_merging_dialog.h b/editor/plugins/tiles/atlas_merging_dialog.h index 6cf555247d..9502d93f6b 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.h +++ b/editor/plugins/tiles/atlas_merging_dialog.h @@ -49,19 +49,19 @@ private: LocalVector<Map<Vector2i, Vector2i>> merged_mapping; Ref<TileSet> tile_set; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; // Settings. int next_line_after_column = 30; // GUI. - ItemList *atlas_merging_atlases_list; - EditorPropertyVector2i *texture_region_size_editor_property; - EditorPropertyInteger *columns_editor_property; - TextureRect *preview; - Label *select_2_atlases_label; - EditorFileDialog *editor_file_dialog; - Button *merge_button; + ItemList *atlas_merging_atlases_list = nullptr; + EditorPropertyVector2i *texture_region_size_editor_property = nullptr; + EditorPropertyInteger *columns_editor_property = nullptr; + TextureRect *preview = nullptr; + Label *select_2_atlases_label = nullptr; + EditorFileDialog *editor_file_dialog = nullptr; + Button *merge_button = nullptr; void _property_changed(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing); 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(); diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h index 99724760a7..3ac9eacb05 100644 --- a/editor/plugins/tiles/tile_data_editors.h +++ b/editor/plugins/tiles/tile_data_editors.h @@ -93,7 +93,7 @@ private: bool multiple_polygon_mode = false; bool use_undo_redo = true; - UndoRedo *editor_undo_redo; + UndoRedo *editor_undo_redo = nullptr; // UI int hovered_polygon_index = -1; @@ -113,20 +113,20 @@ private: Vector2 drag_last_pos; PackedVector2Array drag_old_polygon; - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tools_button_group; - Button *button_create; - Button *button_edit; - Button *button_delete; - Button *button_pixel_snap; - MenuButton *button_advanced_menu; + Button *button_create = nullptr; + Button *button_edit = nullptr; + Button *button_delete = nullptr; + Button *button_pixel_snap = nullptr; + MenuButton *button_advanced_menu = nullptr; Vector<Point2> in_creation_polygon; - Panel *panel; - Control *base_control; - EditorZoomWidget *editor_zoom_widget; - Button *button_center_view; + Panel *panel = nullptr; + Control *base_control = nullptr; + EditorZoomWidget *editor_zoom_widget = nullptr; + Button *button_center_view = nullptr; Vector2 panning; Ref<Texture2D> background_texture; @@ -188,12 +188,12 @@ class TileDataDefaultEditor : public TileDataEditor { private: // Toolbar HBoxContainer *toolbar = memnew(HBoxContainer); - Button *picker_button; + Button *picker_button = nullptr; // UI Ref<Texture2D> tile_bool_checked; Ref<Texture2D> tile_bool_unchecked; - Label *label; + Label *label = nullptr; EditorProperty *property_editor = nullptr; @@ -214,7 +214,7 @@ private: protected: DummyObject *dummy_object = memnew(DummyObject); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; StringName type; String property; @@ -268,7 +268,7 @@ private: int occlusion_layer = -1; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; void _polygon_changed(PackedVector2Array p_polygon); @@ -279,7 +279,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; @@ -299,7 +299,7 @@ class TileDataCollisionEditor : public TileDataDefaultEditor { int physics_layer = -1; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; DummyObject *dummy_object = memnew(DummyObject); Map<StringName, EditorProperty *> property_editors; @@ -314,7 +314,7 @@ class TileDataCollisionEditor : public TileDataDefaultEditor { virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; @@ -335,7 +335,7 @@ class TileDataTerrainsEditor : public TileDataEditor { private: // Toolbar HBoxContainer *toolbar = memnew(HBoxContainer); - Button *picker_button; + Button *picker_button = nullptr; // Painting state. enum DragType { @@ -352,7 +352,7 @@ private: Variant drag_painted_value; // UI - Label *label; + Label *label = nullptr; DummyObject *dummy_object = memnew(DummyObject); EditorPropertyEnum *terrain_set_property_editor = nullptr; EditorPropertyEnum *terrain_property_editor = nullptr; @@ -366,7 +366,7 @@ protected: void _notification(int p_what); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; public: virtual Control *get_toolbar() override { return toolbar; }; @@ -388,7 +388,7 @@ private: PackedVector2Array navigation_polygon; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; void _polygon_changed(PackedVector2Array p_polygon); @@ -399,7 +399,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; diff --git a/editor/plugins/tiles/tile_map_editor.h b/editor/plugins/tiles/tile_map_editor.h index d09061015f..3a0293f48f 100644 --- a/editor/plugins/tiles/tile_map_editor.h +++ b/editor/plugins/tiles/tile_map_editor.h @@ -51,8 +51,8 @@ class UndoRedo; class TileMapEditorPlugin : public Object { public: struct TabData { - Control *toolbar; - Control *panel; + Control *toolbar = nullptr; + Control *panel = nullptr; }; virtual Vector<TabData> get_tabs() const { @@ -69,33 +69,33 @@ class TileMapEditorTilesPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTilesPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; ///// Toolbar ///// - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tool_buttons_group; - Button *select_tool_button; - Button *paint_tool_button; - Button *line_tool_button; - Button *rect_tool_button; - Button *bucket_tool_button; + Button *select_tool_button = nullptr; + Button *paint_tool_button = nullptr; + Button *line_tool_button = nullptr; + Button *rect_tool_button = nullptr; + Button *bucket_tool_button = nullptr; - HBoxContainer *tools_settings; + HBoxContainer *tools_settings = nullptr; - VSeparator *tools_settings_vsep; - Button *picker_button; - Button *erase_button; + VSeparator *tools_settings_vsep = nullptr; + Button *picker_button = nullptr; + Button *erase_button = nullptr; - VSeparator *tools_settings_vsep_2; - CheckBox *bucket_contiguous_checkbox; - CheckBox *random_tile_checkbox; + VSeparator *tools_settings_vsep_2 = nullptr; + CheckBox *bucket_contiguous_checkbox = nullptr; + CheckBox *random_tile_checkbox = nullptr; float scattering = 0.0; - Label *scatter_label; - SpinBox *scatter_spinbox; + Label *scatter_label = nullptr; + SpinBox *scatter_spinbox = nullptr; void _on_random_tile_checkbox_toggled(bool p_pressed); void _on_scattering_spinbox_changed(double p_value); @@ -148,12 +148,12 @@ private: void _tab_changed(); ///// Bottom panel tiles //// - VBoxContainer *tiles_bottom_panel; - Label *missing_source_label; - Label *invalid_source_label; + VBoxContainer *tiles_bottom_panel = nullptr; + Label *missing_source_label = nullptr; + Label *invalid_source_label = nullptr; - ItemList *sources_list; - MenuButton *source_sort_button; + ItemList *sources_list = nullptr; + MenuButton *source_sort_button = nullptr; Ref<Texture2D> missing_atlas_texture_icon; void _update_tile_set_sources_list(); @@ -162,18 +162,18 @@ private: // Atlas sources. TileMapCell hovered_tile; - TileAtlasView *tile_atlas_view; - HSplitContainer *atlas_sources_split_container; + TileAtlasView *tile_atlas_view = nullptr; + HSplitContainer *atlas_sources_split_container = nullptr; bool tile_set_dragging_selection = false; Vector2i tile_set_drag_start_mouse_pos; - Control *tile_atlas_control; + Control *tile_atlas_control = nullptr; void _tile_atlas_control_mouse_exited(); void _tile_atlas_control_gui_input(const Ref<InputEvent> &p_event); void _tile_atlas_control_draw(); - Control *alternative_tiles_control; + Control *alternative_tiles_control = nullptr; void _tile_alternatives_control_draw(); void _tile_alternatives_control_mouse_exited(); void _tile_alternatives_control_gui_input(const Ref<InputEvent> &p_event); @@ -182,7 +182,7 @@ private: void _set_source_sort(int p_sort); // Scenes collection sources. - ItemList *scene_tiles_list; + ItemList *scene_tiles_list = nullptr; void _update_scenes_collection_view(); void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud); @@ -190,9 +190,9 @@ private: void _scenes_list_nothing_selected(); ///// Bottom panel patterns //// - VBoxContainer *patterns_bottom_panel; - ItemList *patterns_item_list; - Label *patterns_help_label; + VBoxContainer *patterns_bottom_panel = nullptr; + ItemList *patterns_item_list = nullptr; + Label *patterns_help_label = nullptr; void _patterns_item_list_gui_input(const Ref<InputEvent> &p_event); void _pattern_preview_done(Ref<TileMapPattern> p_pattern, Ref<Texture2D> p_texture); bool select_last_pattern = false; @@ -220,32 +220,32 @@ class TileMapEditorTerrainsPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTerrainsPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; // Toolbar. - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tool_buttons_group; - Button *paint_tool_button; - Button *line_tool_button; - Button *rect_tool_button; - Button *bucket_tool_button; + Button *paint_tool_button = nullptr; + Button *line_tool_button = nullptr; + Button *rect_tool_button = nullptr; + Button *bucket_tool_button = nullptr; - HBoxContainer *tools_settings; + HBoxContainer *tools_settings = nullptr; - VSeparator *tools_settings_vsep; - Button *picker_button; - Button *erase_button; + VSeparator *tools_settings_vsep = nullptr; + Button *picker_button = nullptr; + Button *erase_button = nullptr; - VSeparator *tools_settings_vsep_2; - CheckBox *bucket_contiguous_checkbox; + VSeparator *tools_settings_vsep_2 = nullptr; + CheckBox *bucket_contiguous_checkbox = nullptr; void _update_toolbar(); // Main vbox. - VBoxContainer *main_vbox_container; + VBoxContainer *main_vbox_container = nullptr; // TileMap editing. bool has_mouse = false; @@ -278,8 +278,8 @@ private: void _update_selection(); // Bottom panel. - Tree *terrains_tree; - ItemList *terrains_tile_list; + Tree *terrains_tree = nullptr; + ItemList *terrains_tile_list = nullptr; // Cache. LocalVector<LocalVector<Set<TileSet::TerrainsPattern>>> per_terrain_terrains_patterns; @@ -306,7 +306,7 @@ class TileMapEditor : public VBoxContainer { GDCLASS(TileMapEditor, VBoxContainer); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tileset_changed_needs_update = false; ObjectID tile_map_id; int tile_map_layer = -1; @@ -315,24 +315,24 @@ private: Vector<TileMapEditorPlugin *> tile_map_editor_plugins; // Toolbar. - HBoxContainer *tile_map_toolbar; + HBoxContainer *tile_map_toolbar = nullptr; - PopupMenu *layers_selection_popup; - Button *layers_selection_button; - Button *toogle_highlight_selected_layer_button; + PopupMenu *layers_selection_popup = nullptr; + Button *layers_selection_button = nullptr; + Button *toogle_highlight_selected_layer_button = nullptr; void _layers_selection_button_draw(); void _layers_selection_button_pressed(); void _layers_selection_id_pressed(int p_id); - Button *toggle_grid_button; + Button *toggle_grid_button = nullptr; void _on_grid_toggled(bool p_pressed); - MenuButton *advanced_menu_button; + MenuButton *advanced_menu_button = nullptr; void _advanced_menu_button_id_pressed(int p_id); // Bottom panel. - Label *missing_tileset_label; - TabBar *tabs_bar; + Label *missing_tileset_label = nullptr; + TabBar *tabs_bar = nullptr; LocalVector<TileMapEditorPlugin::TabData> tabs_data; LocalVector<TileMapEditorPlugin *> tabs_plugins; void _update_bottom_panel(); diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.h b/editor/plugins/tiles/tile_proxies_manager_dialog.h index 3f1461391e..00866544be 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.h +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.h @@ -43,24 +43,24 @@ private: int commited_actions_count = 0; Ref<TileSet> tile_set; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; TileMapCell from; TileMapCell to; // GUI - ItemList *source_level_list; - ItemList *coords_level_list; - ItemList *alternative_level_list; + ItemList *source_level_list = nullptr; + ItemList *coords_level_list = nullptr; + ItemList *alternative_level_list = nullptr; - EditorPropertyInteger *source_from_property_editor; - EditorPropertyVector2i *coords_from_property_editor; - EditorPropertyInteger *alternative_from_property_editor; - EditorPropertyInteger *source_to_property_editor; - EditorPropertyVector2i *coords_to_property_editor; - EditorPropertyInteger *alternative_to_property_editor; + EditorPropertyInteger *source_from_property_editor = nullptr; + EditorPropertyVector2i *coords_from_property_editor = nullptr; + EditorPropertyInteger *alternative_from_property_editor = nullptr; + EditorPropertyInteger *source_to_property_editor = nullptr; + EditorPropertyVector2i *coords_to_property_editor = nullptr; + EditorPropertyInteger *alternative_to_property_editor = nullptr; - PopupMenu *popup_menu; + PopupMenu *popup_menu = nullptr; void _right_clicked(int p_item, Vector2 p_local_mouse_pos, Object *p_item_list); void _menu_id_pressed(int p_id); void _delete_selected_bindings(); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h index 4a90b821f8..b26b7edbfa 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.h +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h @@ -85,7 +85,7 @@ public: GDCLASS(AtlasTileProxyObject, Object); private: - TileSetAtlasSourceEditor *tiles_set_atlas_source_editor; + TileSetAtlasSourceEditor *tiles_set_atlas_source_editor = nullptr; TileSetAtlasSource *tile_set_atlas_source = nullptr; Set<TileSelection> tiles = Set<TileSelection>(); @@ -114,16 +114,16 @@ private: TileSetAtlasSource *tile_set_atlas_source = nullptr; int tile_set_atlas_source_id = TileSet::INVALID_SOURCE; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tile_set_changed_needs_update = false; // -- Properties painting -- - VBoxContainer *tile_data_painting_editor_container; - Label *tile_data_editors_label; - Button *tile_data_editor_dropdown_button; - Popup *tile_data_editors_popup; - Tree *tile_data_editors_tree; + VBoxContainer *tile_data_painting_editor_container = nullptr; + Label *tile_data_editors_label = nullptr; + Button *tile_data_editor_dropdown_button = nullptr; + Popup *tile_data_editors_popup = nullptr; + Tree *tile_data_editors_tree = nullptr; void _tile_data_editor_dropdown_button_draw(); void _tile_data_editor_dropdown_button_pressed(); @@ -135,21 +135,21 @@ private: void _tile_data_editors_tree_selected(); // -- Inspector -- - AtlasTileProxyObject *tile_proxy_object; - Label *tile_inspector_label; - EditorInspector *tile_inspector; - Label *tile_inspector_no_tile_selected_label; + AtlasTileProxyObject *tile_proxy_object = nullptr; + Label *tile_inspector_label = nullptr; + EditorInspector *tile_inspector = nullptr; + Label *tile_inspector_no_tile_selected_label = nullptr; String selected_property; void _inspector_property_selected(String p_property); - TileSetAtlasSourceProxyObject *atlas_source_proxy_object; - Label *atlas_source_inspector_label; - EditorInspector *atlas_source_inspector; + TileSetAtlasSourceProxyObject *atlas_source_proxy_object = nullptr; + Label *atlas_source_inspector_label = nullptr; + EditorInspector *atlas_source_inspector = nullptr; // -- Atlas view -- - HBoxContainer *toolbox; - Label *tile_atlas_view_missing_source_label; - TileAtlasView *tile_atlas_view; + HBoxContainer *toolbox = nullptr; + Label *tile_atlas_view_missing_source_label = nullptr; + TileAtlasView *tile_atlas_view = nullptr; // Dragging enum DragType { @@ -202,17 +202,17 @@ private: // Tool buttons. Ref<ButtonGroup> tools_button_group; - Button *tool_setup_atlas_source_button; - Button *tool_select_button; - Button *tool_paint_button; - Label *tool_tile_id_label; + Button *tool_setup_atlas_source_button = nullptr; + Button *tool_select_button = nullptr; + Button *tool_paint_button = nullptr; + Label *tool_tile_id_label = nullptr; // Tool settings. - HBoxContainer *tool_settings; - VSeparator *tool_settings_vsep; - HBoxContainer *tool_settings_tile_data_toolbar_container; - Button *tools_settings_erase_button; - MenuButton *tool_advanced_menu_buttom; + HBoxContainer *tool_settings = nullptr; + VSeparator *tool_settings_vsep = nullptr; + HBoxContainer *tool_settings_tile_data_toolbar_container = nullptr; + Button *tools_settings_erase_button = nullptr; + MenuButton *tool_advanced_menu_buttom = nullptr; // Selection. Set<TileSelection> selection; @@ -223,12 +223,12 @@ private: // A control on the tile atlas to draw and handle input events. Vector2i hovered_base_tile_coords = TileSetSource::INVALID_ATLAS_COORDS; - PopupMenu *base_tile_popup_menu; - PopupMenu *empty_base_tile_popup_menu; + PopupMenu *base_tile_popup_menu = nullptr; + PopupMenu *empty_base_tile_popup_menu = nullptr; Ref<Texture2D> resize_handle; Ref<Texture2D> resize_handle_disabled; - Control *tile_atlas_control; - Control *tile_atlas_control_unscaled; + Control *tile_atlas_control = nullptr; + Control *tile_atlas_control_unscaled = nullptr; void _tile_atlas_control_draw(); void _tile_atlas_control_unscaled_draw(); void _tile_atlas_control_mouse_exited(); @@ -238,9 +238,9 @@ private: // A control over the alternative tiles. Vector3i hovered_alternative_tile_coords = Vector3i(TileSetSource::INVALID_ATLAS_COORDS.x, TileSetSource::INVALID_ATLAS_COORDS.y, TileSetSource::INVALID_TILE_ALTERNATIVE); - PopupMenu *alternative_tile_popup_menu; - Control *alternative_tiles_control; - Control *alternative_tiles_control_unscaled; + PopupMenu *alternative_tile_popup_menu = nullptr; + Control *alternative_tiles_control = nullptr; + Control *alternative_tiles_control_unscaled = nullptr; void _tile_alternatives_control_draw(); void _tile_alternatives_control_unscaled_draw(); void _tile_alternatives_control_mouse_exited(); @@ -264,7 +264,7 @@ private: // -- Misc -- void _auto_create_tiles(); void _auto_remove_tiles(); - AcceptDialog *confirm_auto_create_tiles; + AcceptDialog *confirm_auto_create_tiles = nullptr; void _tile_set_changed(); void _tile_proxy_object_changed(String p_what); @@ -293,7 +293,7 @@ class EditorPropertyTilePolygon : public EditorProperty { void _add_focusable_children(Node *p_node); - GenericTilePolygonEditor *generic_tile_polygon_editor; + GenericTilePolygonEditor *generic_tile_polygon_editor = nullptr; void _polygons_changed(); public: diff --git a/editor/plugins/tiles/tile_set_editor.h b/editor/plugins/tiles/tile_set_editor.h index b79b37cf2e..e633de37b0 100644 --- a/editor/plugins/tiles/tile_set_editor.h +++ b/editor/plugins/tiles/tile_set_editor.h @@ -47,18 +47,18 @@ class TileSetEditor : public VBoxContainer { private: Ref<TileSet> tile_set; bool tile_set_changed_needs_update = false; - HSplitContainer *split_container; + HSplitContainer *split_container = nullptr; // TabBar. - HBoxContainer *tile_set_toolbar; - TabBar *tabs_bar; + HBoxContainer *tile_set_toolbar = nullptr; + TabBar *tabs_bar = nullptr; // Tiles. - Label *no_source_selected_label; - TileSetAtlasSourceEditor *tile_set_atlas_source_editor; - TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor; + Label *no_source_selected_label = nullptr; + TileSetAtlasSourceEditor *tile_set_atlas_source_editor = nullptr; + TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -66,11 +66,11 @@ private: void _update_sources_list(int force_selected_id = -1); // Sources management. - Button *sources_delete_button; - MenuButton *sources_add_button; - MenuButton *source_sort_button; - MenuButton *sources_advanced_menu_button; - ItemList *sources_list; + Button *sources_delete_button = nullptr; + MenuButton *sources_add_button = nullptr; + MenuButton *source_sort_button = nullptr; + MenuButton *sources_advanced_menu_button = nullptr; + ItemList *sources_list = nullptr; Ref<Texture2D> missing_texture_texture; void _source_selected(int p_source_index); void _source_delete_pressed(); @@ -78,12 +78,12 @@ private: void _sources_advanced_menu_id_pressed(int p_id_pressed); void _set_source_sort(int p_sort); - AtlasMergingDialog *atlas_merging_dialog; - TileProxiesManagerDialog *tile_proxies_manager_dialog; + AtlasMergingDialog *atlas_merging_dialog = nullptr; + TileProxiesManagerDialog *tile_proxies_manager_dialog = nullptr; // Patterns. - ItemList *patterns_item_list; - Label *patterns_help_label; + ItemList *patterns_item_list = nullptr; + Label *patterns_help_label = nullptr; void _patterns_item_list_gui_input(const Ref<InputEvent> &p_event); void _pattern_preview_done(Ref<TileMapPattern> p_pattern, Ref<Texture2D> p_texture); bool select_last_pattern = false; diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h index 8904e8524a..657bfca032 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h @@ -70,7 +70,7 @@ private: GDCLASS(SceneTileProxyObject, Object); private: - TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor; + TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor = nullptr; TileSetScenesCollectionSource *tile_set_scenes_collection_source = nullptr; int source_id; @@ -97,23 +97,23 @@ private: TileSetScenesCollectionSource *tile_set_scenes_collection_source = nullptr; int tile_set_source_id = -1; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tile_set_scenes_collection_source_changed_needs_update = false; // Source inspector. - TileSetScenesCollectionProxyObject *scenes_collection_source_proxy_object; - Label *scenes_collection_source_inspector_label; - EditorInspector *scenes_collection_source_inspector; + TileSetScenesCollectionProxyObject *scenes_collection_source_proxy_object = nullptr; + Label *scenes_collection_source_inspector_label = nullptr; + EditorInspector *scenes_collection_source_inspector = nullptr; // Tile inspector. - SceneTileProxyObject *tile_proxy_object; - Label *tile_inspector_label; - EditorInspector *tile_inspector; + SceneTileProxyObject *tile_proxy_object = nullptr; + Label *tile_inspector_label = nullptr; + EditorInspector *tile_inspector = nullptr; - ItemList *scene_tiles_list; - Button *scene_tile_add_button; - Button *scene_tile_delete_button; + ItemList *scene_tiles_list = nullptr; + Button *scene_tile_add_button = nullptr; + Button *scene_tile_delete_button = nullptr; void _tile_set_scenes_collection_source_changed(); void _scenes_collection_source_proxy_object_changed(String p_what); diff --git a/editor/plugins/tiles/tiles_editor_plugin.h b/editor/plugins/tiles/tiles_editor_plugin.h index eeff4da4e9..a22e782b34 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.h +++ b/editor/plugins/tiles/tiles_editor_plugin.h @@ -57,11 +57,11 @@ private: ObjectID tile_map_id; Ref<TileSet> tile_set; - Button *tilemap_editor_button; - TileMapEditor *tilemap_editor; + Button *tilemap_editor_button = nullptr; + TileMapEditor *tilemap_editor = nullptr; - Button *tileset_editor_button; - TileSetEditor *tileset_editor; + Button *tileset_editor_button = nullptr; + TileSetEditor *tileset_editor = nullptr; void _update_editors(); diff --git a/editor/plugins/version_control_editor_plugin.h b/editor/plugins/version_control_editor_plugin.h index 956c5a334f..39a56de772 100644 --- a/editor/plugins/version_control_editor_plugin.h +++ b/editor/plugins/version_control_editor_plugin.h @@ -57,48 +57,48 @@ private: int staged_files_count; List<StringName> available_addons; - PopupMenu *version_control_actions; - ConfirmationDialog *metadata_dialog; - OptionButton *metadata_selection; - AcceptDialog *set_up_dialog; - VBoxContainer *set_up_vbc; - HBoxContainer *set_up_hbc; - Label *set_up_vcs_label; - OptionButton *set_up_choice; - PanelContainer *set_up_init_settings; - Button *set_up_init_button; - RichTextLabel *set_up_vcs_status; - Button *set_up_ok_button; + PopupMenu *version_control_actions = nullptr; + ConfirmationDialog *metadata_dialog = nullptr; + OptionButton *metadata_selection = nullptr; + AcceptDialog *set_up_dialog = nullptr; + VBoxContainer *set_up_vbc = nullptr; + HBoxContainer *set_up_hbc = nullptr; + Label *set_up_vcs_label = nullptr; + OptionButton *set_up_choice = nullptr; + PanelContainer *set_up_init_settings = nullptr; + Button *set_up_init_button = nullptr; + RichTextLabel *set_up_vcs_status = nullptr; + Button *set_up_ok_button = nullptr; HashMap<ChangeType, String> change_type_to_strings; HashMap<ChangeType, Color> change_type_to_color; - VBoxContainer *version_commit_dock; - VBoxContainer *commit_box_vbc; - HSplitContainer *stage_tools; - Tree *stage_files; - TreeItem *new_files; - TreeItem *modified_files; - TreeItem *renamed_files; - TreeItem *deleted_files; - TreeItem *typechange_files; - Label *staging_area_label; - HSplitContainer *stage_buttons; - Button *stage_all_button; - Button *stage_selected_button; - Button *refresh_button; - TextEdit *commit_message; - Button *commit_button; - Label *commit_status; - - PanelContainer *version_control_dock; - Button *version_control_dock_button; - VBoxContainer *diff_vbc; - HBoxContainer *diff_hbc; - Button *diff_refresh_button; - Label *diff_file_name; - Label *diff_heading; - RichTextLabel *diff; + VBoxContainer *version_commit_dock = nullptr; + VBoxContainer *commit_box_vbc = nullptr; + HSplitContainer *stage_tools = nullptr; + Tree *stage_files = nullptr; + TreeItem *new_files = nullptr; + TreeItem *modified_files = nullptr; + TreeItem *renamed_files = nullptr; + TreeItem *deleted_files = nullptr; + TreeItem *typechange_files = nullptr; + Label *staging_area_label = nullptr; + HSplitContainer *stage_buttons = nullptr; + Button *stage_all_button = nullptr; + Button *stage_selected_button = nullptr; + Button *refresh_button = nullptr; + TextEdit *commit_message = nullptr; + Button *commit_button = nullptr; + Label *commit_status = nullptr; + + PanelContainer *version_control_dock = nullptr; + Button *version_control_dock_button = nullptr; + VBoxContainer *diff_vbc = nullptr; + HBoxContainer *diff_hbc = nullptr; + Button *diff_refresh_button = nullptr; + Label *diff_file_name = nullptr; + Label *diff_heading = nullptr; + RichTextLabel *diff = nullptr; void _populate_available_vcs_names(); void _create_vcs_metadata_files(); diff --git a/editor/plugins/voxel_gi_editor_plugin.h b/editor/plugins/voxel_gi_editor_plugin.h index 67bd1d5105..621e98beef 100644 --- a/editor/plugins/voxel_gi_editor_plugin.h +++ b/editor/plugins/voxel_gi_editor_plugin.h @@ -41,12 +41,12 @@ struct EditorProgress; class VoxelGIEditorPlugin : public EditorPlugin { GDCLASS(VoxelGIEditorPlugin, EditorPlugin); - VoxelGI *voxel_gi; + VoxelGI *voxel_gi = nullptr; - HBoxContainer *bake_hb; - Button *bake; + HBoxContainer *bake_hb = nullptr; + Button *bake = nullptr; - EditorFileDialog *probe_file; + EditorFileDialog *probe_file = nullptr; static EditorProgress *tmp_progress; static void bake_func_begin(int p_steps); diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h index 880e6bc9d4..f395750165 100644 --- a/editor/progress_dialog.h +++ b/editor/progress_dialog.h @@ -74,11 +74,11 @@ class ProgressDialog : public PopupPanel { ProgressBar *progress = nullptr; Label *state = nullptr; }; - HBoxContainer *cancel_hb; - Button *cancel; + HBoxContainer *cancel_hb = nullptr; + Button *cancel = nullptr; Map<String, Task> tasks; - VBoxContainer *main; + VBoxContainer *main = nullptr; uint64_t last_progress_tick; static ProgressDialog *singleton; diff --git a/editor/project_export.h b/editor/project_export.h index 057fd31168..4d1719d6eb 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -58,46 +58,46 @@ class ProjectExportDialog : public ConfirmationDialog { GDCLASS(ProjectExportDialog, ConfirmationDialog); private: - TabContainer *sections; + TabContainer *sections = nullptr; - MenuButton *add_preset; - Button *duplicate_preset; - Button *delete_preset; - ItemList *presets; + MenuButton *add_preset = nullptr; + Button *duplicate_preset = nullptr; + Button *delete_preset = nullptr; + ItemList *presets = nullptr; - LineEdit *name; - EditorPropertyPath *export_path; - EditorInspector *parameters; - CheckButton *runnable; + LineEdit *name = nullptr; + EditorPropertyPath *export_path = nullptr; + EditorInspector *parameters = nullptr; + CheckButton *runnable = nullptr; - Button *button_export; + Button *button_export = nullptr; bool updating = false; - AcceptDialog *error_dialog; - ConfirmationDialog *delete_confirm; + AcceptDialog *error_dialog = nullptr; + ConfirmationDialog *delete_confirm = nullptr; - OptionButton *export_filter; - LineEdit *include_filters; - LineEdit *exclude_filters; - Tree *include_files; + OptionButton *export_filter = nullptr; + LineEdit *include_filters = nullptr; + LineEdit *exclude_filters = nullptr; + Tree *include_files = nullptr; - Label *include_label; - MarginContainer *include_margin; + Label *include_label = nullptr; + MarginContainer *include_margin = nullptr; - Button *export_button; - Button *export_all_button; - AcceptDialog *export_all_dialog; + Button *export_button = nullptr; + Button *export_all_button = nullptr; + AcceptDialog *export_all_dialog = nullptr; - LineEdit *custom_features; - RichTextLabel *custom_feature_display; + LineEdit *custom_features = nullptr; + RichTextLabel *custom_feature_display = nullptr; - OptionButton *script_mode; - LineEdit *script_key; - Label *script_key_error; + OptionButton *script_mode = nullptr; + LineEdit *script_key = nullptr; + Label *script_key_error = nullptr; - Label *export_error; - Label *export_warning; - HBoxContainer *export_templates_error; + Label *export_error = nullptr; + Label *export_warning = nullptr; + HBoxContainer *export_templates_error = nullptr; String default_filename; @@ -127,15 +127,15 @@ private: bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); - EditorFileDialog *export_pck_zip; - EditorFileDialog *export_project; - CheckBox *export_debug; - CheckBox *export_pck_zip_debug; + EditorFileDialog *export_pck_zip = nullptr; + EditorFileDialog *export_project = nullptr; + CheckBox *export_debug = nullptr; + CheckBox *export_pck_zip_debug = nullptr; - CheckButton *enc_pck; - CheckButton *enc_directory; - LineEdit *enc_in_filters; - LineEdit *enc_ex_filters; + CheckButton *enc_pck = nullptr; + CheckButton *enc_directory = nullptr; + LineEdit *enc_in_filters = nullptr; + LineEdit *enc_ex_filters = nullptr; void _open_export_template_manager(); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index 5dc1ddc0a8..c9d849abec 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -47,34 +47,34 @@ class ProjectSettingsEditor : public AcceptDialog { GDCLASS(ProjectSettingsEditor, AcceptDialog); static ProjectSettingsEditor *singleton; - ProjectSettings *ps; - Timer *timer; - - TabContainer *tab_container; - SectionedInspector *general_settings_inspector; - ActionMapEditor *action_map_editor; - LocalizationEditor *localization_editor; - EditorAutoloadSettings *autoload_settings; - ShaderGlobalsEditor *shaders_global_variables_editor; - EditorPluginSettings *plugin_settings; - - LineEdit *search_box; - CheckButton *advanced; - - LineEdit *property_box; - OptionButton *feature_box; - OptionButton *type_box; - Button *add_button; - Button *del_button; - - Label *restart_label; - TextureRect *restart_icon; - PanelContainer *restart_container; - Button *restart_close_button; - - ImportDefaultsEditor *import_defaults_editor; - EditorData *data; - UndoRedo *undo_redo; + ProjectSettings *ps = nullptr; + Timer *timer = nullptr; + + TabContainer *tab_container = nullptr; + SectionedInspector *general_settings_inspector = nullptr; + ActionMapEditor *action_map_editor = nullptr; + LocalizationEditor *localization_editor = nullptr; + EditorAutoloadSettings *autoload_settings = nullptr; + ShaderGlobalsEditor *shaders_global_variables_editor = nullptr; + EditorPluginSettings *plugin_settings = nullptr; + + LineEdit *search_box = nullptr; + CheckButton *advanced = nullptr; + + LineEdit *property_box = nullptr; + OptionButton *feature_box = nullptr; + OptionButton *type_box = nullptr; + Button *add_button = nullptr; + Button *del_button = nullptr; + + Label *restart_label = nullptr; + TextureRect *restart_icon = nullptr; + PanelContainer *restart_container = nullptr; + Button *restart_close_button = nullptr; + + ImportDefaultsEditor *import_defaults_editor = nullptr; + EditorData *data = nullptr; + UndoRedo *undo_redo = nullptr; void _advanced_toggled(bool p_button_pressed); void _property_box_changed(const String &p_text); diff --git a/editor/property_editor.h b/editor/property_editor.h index 73306e0bc2..1a4d88f7fa 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -95,11 +95,11 @@ class CustomPropertyEditor : public PopupPanel { EASING_OUT_IN }; - PopupMenu *menu; - SceneTreeDialog *scene_tree; - EditorFileDialog *file; - EditorLocaleDialog *locale; - ConfirmationDialog *error; + PopupMenu *menu = nullptr; + SceneTreeDialog *scene_tree = nullptr; + EditorFileDialog *file = nullptr; + EditorLocaleDialog *locale = nullptr; + ConfirmationDialog *error = nullptr; String name; Variant::Type type; Variant v; @@ -107,34 +107,34 @@ class CustomPropertyEditor : public PopupPanel { int hint; String hint_text; HBoxContainer *value_hboxes[MAX_VALUE_EDITORS / 4]; - VBoxContainer *value_vbox; + VBoxContainer *value_vbox = nullptr; LineEdit *value_editor[MAX_VALUE_EDITORS]; int focused_value_editor; Label *value_label[MAX_VALUE_EDITORS]; HScrollBar *scroll[4]; - HBoxContainer *action_hboxes; + HBoxContainer *action_hboxes = nullptr; Button *action_buttons[MAX_ACTION_BUTTONS]; - MenuButton *type_button; + MenuButton *type_button = nullptr; Vector<String> inheritors_array; - TextureRect *texture_preview; - ColorPicker *color_picker; - TextEdit *text_edit; + TextureRect *texture_preview = nullptr; + ColorPicker *color_picker = nullptr; + TextEdit *text_edit = nullptr; bool read_only = false; bool picking_viewport; - GridContainer *checks20gc; + GridContainer *checks20gc = nullptr; CheckBox *checks20[20]; - SpinBox *spinbox; - HSlider *slider; + SpinBox *spinbox = nullptr; + HSlider *slider = nullptr; - Control *easing_draw; - CreateDialog *create_dialog; - PropertySelector *property_select; + Control *easing_draw = nullptr; + CreateDialog *create_dialog = nullptr; + PropertySelector *property_select = nullptr; - Object *owner; + Object *owner = nullptr; bool updating = false; - PropertyValueEvaluator *evaluator; + PropertyValueEvaluator *evaluator = nullptr; void _text_edit_changed(); void _file_selected(String p_file); diff --git a/editor/property_selector.h b/editor/property_selector.h index 7e629a847e..597804da31 100644 --- a/editor/property_selector.h +++ b/editor/property_selector.h @@ -38,8 +38,8 @@ class PropertySelector : public ConfirmationDialog { GDCLASS(PropertySelector, ConfirmationDialog); - LineEdit *search_box; - Tree *search_options; + LineEdit *search_box = nullptr; + Tree *search_options = nullptr; void _text_changed(const String &p_newtext); void _sbox_input(const Ref<InputEvent> &p_ie); @@ -48,14 +48,14 @@ class PropertySelector : public ConfirmationDialog { void _item_selected(); void _hide_requested(); - EditorHelpBit *help_bit; + EditorHelpBit *help_bit = nullptr; bool properties; String selected; Variant::Type type; String base_type; ObjectID script; - Object *instance; + Object *instance = nullptr; bool virtuals_only = false; Vector<Variant::Type> type_filter; diff --git a/editor/quick_open.h b/editor/quick_open.h index f50f09604c..843ef47711 100644 --- a/editor/quick_open.h +++ b/editor/quick_open.h @@ -39,8 +39,8 @@ class EditorQuickOpen : public ConfirmationDialog { GDCLASS(EditorQuickOpen, ConfirmationDialog); - LineEdit *search_box; - Tree *search_options; + LineEdit *search_box = nullptr; + Tree *search_options = nullptr; StringName base_type; bool allow_multi_select = false; diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h index c9747795f0..d05e80fc04 100644 --- a/editor/rename_dialog.h +++ b/editor/rename_dialog.h @@ -62,41 +62,41 @@ class RenameDialog : public ConfirmationDialog { void _update_preview_int(int new_value = 0); static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type); - SceneTreeEditor *scene_tree_editor; - UndoRedo *undo_redo; + SceneTreeEditor *scene_tree_editor = nullptr; + UndoRedo *undo_redo = nullptr; int global_count; - LineEdit *lne_search; - LineEdit *lne_replace; - LineEdit *lne_prefix; - LineEdit *lne_suffix; + LineEdit *lne_search = nullptr; + LineEdit *lne_replace = nullptr; + LineEdit *lne_prefix = nullptr; + LineEdit *lne_suffix = nullptr; - TabContainer *tabc_features; + TabContainer *tabc_features = nullptr; - CheckBox *cbut_substitute; - CheckButton *cbut_regex; - CheckBox *cbut_process; - CheckBox *chk_per_level_counter; + CheckBox *cbut_substitute = nullptr; + CheckButton *cbut_regex = nullptr; + CheckBox *cbut_process = nullptr; + CheckBox *chk_per_level_counter = nullptr; - Button *but_insert_name; - Button *but_insert_parent; - Button *but_insert_type; - Button *but_insert_scene; - Button *but_insert_root; - Button *but_insert_count; + Button *but_insert_name = nullptr; + Button *but_insert_parent = nullptr; + Button *but_insert_type = nullptr; + Button *but_insert_scene = nullptr; + Button *but_insert_root = nullptr; + Button *but_insert_count = nullptr; - SpinBox *spn_count_start; - SpinBox *spn_count_step; - SpinBox *spn_count_padding; + SpinBox *spn_count_start = nullptr; + SpinBox *spn_count_step = nullptr; + SpinBox *spn_count_padding = nullptr; - OptionButton *opt_style; - OptionButton *opt_case; + OptionButton *opt_style = nullptr; + OptionButton *opt_case = nullptr; - Label *lbl_preview_title; - Label *lbl_preview; + Label *lbl_preview_title = nullptr; + Label *lbl_preview = nullptr; List<Pair<NodePath, String>> to_rename; - Node *preview_node; + Node *preview_node = nullptr; bool lock_preview_update; ErrorHandlerList eh; bool has_errors; diff --git a/editor/reparent_dialog.h b/editor/reparent_dialog.h index 981829a871..121a86e9f0 100644 --- a/editor/reparent_dialog.h +++ b/editor/reparent_dialog.h @@ -41,8 +41,8 @@ class ReparentDialog : public ConfirmationDialog { GDCLASS(ReparentDialog, ConfirmationDialog); - SceneTreeEditor *tree; - CheckBox *keep_transform; + SceneTreeEditor *tree = nullptr; + CheckBox *keep_transform = nullptr; void _reparent(); void _cancel(); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 938f83725d..711ac5bc53 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -109,29 +109,29 @@ class SceneTreeDock : public VBoxContainer { bool reset_create_dialog = false; int current_option; - CreateDialog *create_dialog; + CreateDialog *create_dialog = nullptr; #ifdef MODULE_REGEX_ENABLED - RenameDialog *rename_dialog; + RenameDialog *rename_dialog = nullptr; #endif // MODULE_REGEX_ENABLED - Button *button_add; - Button *button_instance; - Button *button_create_script; - Button *button_detach_script; - MenuButton *button_tree_menu; + Button *button_add = nullptr; + Button *button_instance = nullptr; + Button *button_create_script = nullptr; + Button *button_detach_script = nullptr; + MenuButton *button_tree_menu = nullptr; - Button *button_2d; - Button *button_3d; - Button *button_ui; - Button *button_custom; - Button *button_clipboard; + Button *button_2d = nullptr; + Button *button_3d = nullptr; + Button *button_ui = nullptr; + Button *button_custom = nullptr; + Button *button_clipboard = nullptr; - HBoxContainer *button_hb; + HBoxContainer *button_hb = nullptr; Button *edit_local, *edit_remote; - SceneTreeEditor *scene_tree; - Control *remote_tree; + SceneTreeEditor *scene_tree = nullptr; + Control *remote_tree = nullptr; - HBoxContainer *tool_hbc; + HBoxContainer *tool_hbc = nullptr; void _tool_selected(int p_tool, bool p_confirm_override = false); void _property_selected(int p_idx); void _node_collapsed(Object *p_obj); @@ -140,40 +140,40 @@ class SceneTreeDock : public VBoxContainer { String resource_drop_path; void _perform_property_drop(Node *p_node, String p_property, RES p_res); - EditorData *editor_data; - EditorSelection *editor_selection; + EditorData *editor_data = nullptr; + EditorSelection *editor_selection = nullptr; List<Node *> node_clipboard; String clipboard_source_scene; HashMap<String, Map<RES, RES>> clipboard_resource_remap; - ScriptCreateDialog *script_create_dialog; - ShaderCreateDialog *shader_create_dialog; - AcceptDialog *accept; - ConfirmationDialog *delete_dialog; - ConfirmationDialog *editable_instance_remove_dialog; - ConfirmationDialog *placeholder_editable_instance_remove_dialog; + ScriptCreateDialog *script_create_dialog = nullptr; + ShaderCreateDialog *shader_create_dialog = nullptr; + AcceptDialog *accept = nullptr; + ConfirmationDialog *delete_dialog = nullptr; + ConfirmationDialog *editable_instance_remove_dialog = nullptr; + ConfirmationDialog *placeholder_editable_instance_remove_dialog = nullptr; - ReparentDialog *reparent_dialog; - EditorQuickOpen *quick_open; - EditorFileDialog *new_scene_from_dialog; + ReparentDialog *reparent_dialog = nullptr; + EditorQuickOpen *quick_open = nullptr; + EditorFileDialog *new_scene_from_dialog = nullptr; - LineEdit *filter; - TextureRect *filter_icon; + LineEdit *filter = nullptr; + TextureRect *filter_icon = nullptr; - PopupMenu *menu; - PopupMenu *menu_subresources; - PopupMenu *menu_properties; - ConfirmationDialog *clear_inherit_confirm; + PopupMenu *menu = nullptr; + PopupMenu *menu_subresources = nullptr; + PopupMenu *menu_properties = nullptr; + ConfirmationDialog *clear_inherit_confirm = nullptr; bool first_enter = true; void _create(); void _do_create(Node *p_parent); - Node *scene_root; - Node *edited_scene; + Node *scene_root = nullptr; + Node *edited_scene = nullptr; - VBoxContainer *create_root_dialog; + VBoxContainer *create_root_dialog = nullptr; String selected_favorite_root; Ref<ShaderMaterial> selected_shader_material; diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 2466b8576a..547a5b57ca 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -41,7 +41,7 @@ class SceneTreeEditor : public Control { GDCLASS(SceneTreeEditor, Control); - EditorSelection *editor_selection; + EditorSelection *editor_selection = nullptr; enum SceneTreeEditorButton { BUTTON_SUBSCENE = 0, @@ -55,14 +55,14 @@ class SceneTreeEditor : public Control { BUTTON_PIN = 8, }; - Tree *tree; - Node *selected; + Tree *tree = nullptr; + Node *selected = nullptr; ObjectID instance_node; String filter; - AcceptDialog *error; - AcceptDialog *warning; + AcceptDialog *error = nullptr; + AcceptDialog *warning = nullptr; bool auto_expand_selected = true; bool connect_to_script_mode = false; @@ -96,7 +96,7 @@ class SceneTreeEditor : public Control { bool show_enabled_subscene = false; void _renamed(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Set<Node *> marked; bool marked_selectable = false; @@ -125,7 +125,7 @@ class SceneTreeEditor : public Control { void _warning_changed(Node *p_for_node); - Timer *update_timer; + Timer *update_timer = nullptr; List<StringName> *script_types; bool _is_script_type(const StringName &p_type) const; @@ -166,10 +166,10 @@ public: class SceneTreeDialog : public ConfirmationDialog { GDCLASS(SceneTreeDialog, ConfirmationDialog); - SceneTreeEditor *tree; + SceneTreeEditor *tree = nullptr; //Button *select; //Button *cancel; - LineEdit *filter; + LineEdit *filter = nullptr; void _select(); void _cancel(); diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index e9f634e2c0..c7d8cfc38a 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -45,27 +45,27 @@ class EditorFileDialog; class ScriptCreateDialog : public ConfirmationDialog { GDCLASS(ScriptCreateDialog, ConfirmationDialog); - LineEdit *class_name; - Label *error_label; - Label *path_error_label; - Label *builtin_warning_label; - Label *script_name_warning_label; - Label *template_info_label; - PanelContainer *status_panel; - LineEdit *parent_name; - Button *parent_browse_button; - Button *parent_search_button; - OptionButton *language_menu; - OptionButton *template_menu; - LineEdit *file_path; - LineEdit *internal_name; - Button *path_button; - EditorFileDialog *file_browse; - CheckBox *internal; - CheckBox *use_templates; - VBoxContainer *path_vb; - AcceptDialog *alert; - CreateDialog *select_class; + LineEdit *class_name = nullptr; + Label *error_label = nullptr; + Label *path_error_label = nullptr; + Label *builtin_warning_label = nullptr; + Label *script_name_warning_label = nullptr; + Label *template_info_label = nullptr; + PanelContainer *status_panel = nullptr; + LineEdit *parent_name = nullptr; + Button *parent_browse_button = nullptr; + Button *parent_search_button = nullptr; + OptionButton *language_menu = nullptr; + OptionButton *template_menu = nullptr; + LineEdit *file_path = nullptr; + LineEdit *internal_name = nullptr; + Button *path_button = nullptr; + EditorFileDialog *file_browse = nullptr; + CheckBox *internal = nullptr; + CheckBox *use_templates = nullptr; + VBoxContainer *path_vb = nullptr; + AcceptDialog *alert = nullptr; + CreateDialog *select_class = nullptr; bool is_browsing_parent = false; String template_inactive_message; String initial_bp; @@ -89,7 +89,7 @@ class ScriptCreateDialog : public ConfirmationDialog { Control *name_controls[2]; Vector<ScriptLanguage::ScriptTemplate> template_list; - ScriptLanguage *language; + ScriptLanguage *language = nullptr; String base_type; diff --git a/editor/shader_globals_editor.h b/editor/shader_globals_editor.h index 3b337e07de..d29052eaee 100644 --- a/editor/shader_globals_editor.h +++ b/editor/shader_globals_editor.h @@ -43,12 +43,12 @@ class ShaderGlobalsEditorInterface; class ShaderGlobalsEditor : public VBoxContainer { GDCLASS(ShaderGlobalsEditor, VBoxContainer) - ShaderGlobalsEditorInterface *interface; - EditorInspector *inspector; + ShaderGlobalsEditorInterface *interface = nullptr; + EditorInspector *inspector = nullptr; - LineEdit *variable_name; - OptionButton *variable_type; - Button *variable_add; + LineEdit *variable_name = nullptr; + OptionButton *variable_type = nullptr; + Button *variable_add = nullptr; void _variable_added(); void _variable_deleted(const String &p_variable); diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index 4721d0c11c..b5d5f97cf3 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -368,7 +368,7 @@ private: PathRotation path_rotation; bool path_local; - Path3D *path; + Path3D *path = nullptr; bool smooth_faces; bool path_continuous_u; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index f7fa967883..82125610c2 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -265,7 +265,7 @@ class GDScriptInstance : public ScriptInstance { friend struct GDScriptUtilityFunctionsDefinitions; ObjectID owner_id; - Object *owner; + Object *owner = nullptr; Ref<GDScript> script; #ifdef DEBUG_ENABLED Map<StringName, int> member_indices_cache; //used only for hot script reloading @@ -311,17 +311,17 @@ class GDScriptLanguage : public ScriptLanguage { static GDScriptLanguage *singleton; - Variant *_global_array; + Variant *_global_array = nullptr; Vector<Variant> global_array; Map<StringName, int> globals; Map<StringName, Variant> named_globals; struct CallLevel { - Variant *stack; - GDScriptFunction *function; - GDScriptInstance *instance; - int *ip; - int *line; + Variant *stack = nullptr; + GDScriptFunction *function = nullptr; + GDScriptInstance *instance = nullptr; + int *ip = nullptr; + int *line = nullptr; }; int _debug_parse_err_line; @@ -329,7 +329,7 @@ class GDScriptLanguage : public ScriptLanguage { String _debug_error; int _debug_call_stack_pos; int _debug_max_call_stack; - CallLevel *_call_stack; + CallLevel *_call_stack = nullptr; void _add_global(const StringName &p_name, const Variant &p_value); diff --git a/modules/gdscript/language_server/gdscript_text_document.h b/modules/gdscript/language_server/gdscript_text_document.h index eb7b2c0240..a0e584e525 100644 --- a/modules/gdscript/language_server/gdscript_text_document.h +++ b/modules/gdscript/language_server/gdscript_text_document.h @@ -40,7 +40,7 @@ class GDScriptTextDocument : public RefCounted { protected: static void _bind_methods(); - FileAccess *file_checker; + FileAccess *file_checker = nullptr; void didOpen(const Variant &p_param); void didClose(const Variant &p_param); diff --git a/modules/gdscript/tests/gdscript_test_runner.h b/modules/gdscript/tests/gdscript_test_runner.h index 1a950c6898..d6c6419e21 100644 --- a/modules/gdscript/tests/gdscript_test_runner.h +++ b/modules/gdscript/tests/gdscript_test_runner.h @@ -63,8 +63,8 @@ public: private: struct ErrorHandlerData { - TestResult *result; - GDScriptTest *self; + TestResult *result = nullptr; + GDScriptTest *self = nullptr; ErrorHandlerData(TestResult *p_result, GDScriptTest *p_this) { result = p_result; self = p_this; diff --git a/modules/gridmap/editor/grid_map_editor_plugin.h b/modules/gridmap/editor/grid_map_editor_plugin.h index adb0da6e2c..3b29397502 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.h +++ b/modules/gridmap/editor/grid_map_editor_plugin.h @@ -62,21 +62,21 @@ class GridMapEditor : public VBoxContainer { DISPLAY_LIST }; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; InputAction input_action = INPUT_NONE; - Panel *panel; - MenuButton *options; - SpinBox *floor; + Panel *panel = nullptr; + MenuButton *options = nullptr; + SpinBox *floor = nullptr; double accumulated_floor_delta = 0.0; - Button *mode_thumbnail; - Button *mode_list; - LineEdit *search_box; - HSlider *size_slider; - HBoxContainer *spatial_editor_hb; - ConfirmationDialog *settings_dialog; - VBoxContainer *settings_vbc; - SpinBox *settings_pick_distance; - Label *spin_box_label; + Button *mode_thumbnail = nullptr; + Button *mode_list = nullptr; + LineEdit *search_box = nullptr; + HSlider *size_slider = nullptr; + HBoxContainer *spatial_editor_hb = nullptr; + ConfirmationDialog *settings_dialog = nullptr; + VBoxContainer *settings_vbc = nullptr; + SpinBox *settings_pick_distance = nullptr; + Label *spin_box_label = nullptr; struct SetItem { Vector3i position; @@ -89,7 +89,7 @@ class GridMapEditor : public VBoxContainer { List<SetItem> set_items; GridMap *node = nullptr; - MeshLibrary *last_mesh_library; + MeshLibrary *last_mesh_library = nullptr; Transform3D grid_xform; Transform3D edit_grid_xform; @@ -173,15 +173,15 @@ class GridMapEditor : public VBoxContainer { }; - Node3DEditorPlugin *spatial_editor; + Node3DEditorPlugin *spatial_editor = nullptr; struct AreaDisplay { RID mesh; RID instance; }; - ItemList *mesh_library_palette; - Label *info_message; + ItemList *mesh_library_palette = nullptr; + Label *info_message = nullptr; void update_grid(); // Change which and where the grid is displayed void _draw_grids(const Vector3 &cell_size); @@ -234,7 +234,7 @@ public: class GridMapEditorPlugin : public EditorPlugin { GDCLASS(GridMapEditorPlugin, EditorPlugin); - GridMapEditor *grid_map_editor; + GridMapEditor *grid_map_editor = nullptr; protected: void _notification(int p_what); diff --git a/modules/mono/glue/arguments_vector.h b/modules/mono/glue/arguments_vector.h index 7c991d87a4..4405809887 100644 --- a/modules/mono/glue/arguments_vector.h +++ b/modules/mono/glue/arguments_vector.h @@ -37,7 +37,7 @@ template <typename T, int POOL_SIZE = 5> struct ArgumentsVector { private: T pool[POOL_SIZE]; - T *_ptr; + T *_ptr = nullptr; int size; ArgumentsVector() = delete; diff --git a/modules/mono/managed_callable.h b/modules/mono/managed_callable.h index ea7231f43b..d50a8a7b08 100644 --- a/modules/mono/managed_callable.h +++ b/modules/mono/managed_callable.h @@ -43,7 +43,7 @@ class ManagedCallable : public CallableCustom { friend class CSharpLanguage; MonoGCHandleData delegate_handle; - GDMonoMethod *delegate_invoke; + GDMonoMethod *delegate_invoke = nullptr; #ifdef GD_MONO_HOT_RELOAD SelfList<ManagedCallable> self_instance = this; diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index aab0b31c37..51fd0f8483 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -94,16 +94,16 @@ private: UnhandledExceptionPolicy unhandled_exception_policy; - MonoDomain *root_domain; - MonoDomain *scripts_domain; + MonoDomain *root_domain = nullptr; + MonoDomain *scripts_domain = nullptr; HashMap<int32_t, HashMap<String, GDMonoAssembly *>> assemblies; - GDMonoAssembly *corlib_assembly; - GDMonoAssembly *project_assembly; + GDMonoAssembly *corlib_assembly = nullptr; + GDMonoAssembly *project_assembly = nullptr; #ifdef TOOLS_ENABLED - GDMonoAssembly *tools_assembly; - GDMonoAssembly *tools_project_editor_assembly; + GDMonoAssembly *tools_assembly = nullptr; + GDMonoAssembly *tools_project_editor_assembly = nullptr; #endif LoadedApiAssembly core_api_assembly; @@ -150,7 +150,7 @@ private: void _init_godot_api_hashes(); void _init_exception_policy(); - GDMonoLog *gdmono_log; + GDMonoLog *gdmono_log = nullptr; #if defined(WINDOWS_ENABLED) && defined(TOOLS_ENABLED) MonoRegInfo mono_reg_info; @@ -250,7 +250,7 @@ public: namespace gdmono { class ScopeDomain { - MonoDomain *prev_domain; + MonoDomain *prev_domain = nullptr; public: ScopeDomain(MonoDomain *p_domain) { @@ -270,7 +270,7 @@ public: }; class ScopeExitDomainUnload { - MonoDomain *domain; + MonoDomain *domain = nullptr; public: ScopeExitDomainUnload(MonoDomain *p_domain) : diff --git a/modules/mono/mono_gd/gd_mono_assembly.h b/modules/mono/mono_gd/gd_mono_assembly.h index b25d773be7..a96357b082 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.h +++ b/modules/mono/mono_gd/gd_mono_assembly.h @@ -68,8 +68,8 @@ class GDMonoAssembly { }; String name; - MonoImage *image; - MonoAssembly *assembly; + MonoImage *image = nullptr; + MonoAssembly *assembly = nullptr; bool attrs_fetched = false; MonoCustomAttrInfo *attributes = nullptr; diff --git a/modules/mono/mono_gd/gd_mono_cache.h b/modules/mono/mono_gd/gd_mono_cache.h index 49f47b0a15..4000342c94 100644 --- a/modules/mono/mono_gd/gd_mono_cache.h +++ b/modules/mono/mono_gd/gd_mono_cache.h @@ -41,91 +41,91 @@ struct CachedData { // corlib classes // Let's use the no-namespace format for these too - GDMonoClass *class_MonoObject; // object - GDMonoClass *class_bool; // bool - GDMonoClass *class_int8_t; // sbyte - GDMonoClass *class_int16_t; // short - GDMonoClass *class_int32_t; // int - GDMonoClass *class_int64_t; // long - GDMonoClass *class_uint8_t; // byte - GDMonoClass *class_uint16_t; // ushort - GDMonoClass *class_uint32_t; // uint - GDMonoClass *class_uint64_t; // ulong - GDMonoClass *class_float; // float - GDMonoClass *class_double; // double - GDMonoClass *class_String; // string - GDMonoClass *class_IntPtr; // System.IntPtr - - GDMonoClass *class_System_Collections_IEnumerable; - GDMonoClass *class_System_Collections_ICollection; - GDMonoClass *class_System_Collections_IDictionary; + GDMonoClass *class_MonoObject = nullptr; // object + GDMonoClass *class_bool = nullptr; // bool + GDMonoClass *class_int8_t = nullptr; // sbyte + GDMonoClass *class_int16_t = nullptr; // short + GDMonoClass *class_int32_t = nullptr; // int + GDMonoClass *class_int64_t = nullptr; // long + GDMonoClass *class_uint8_t = nullptr; // byte + GDMonoClass *class_uint16_t = nullptr; // ushort + GDMonoClass *class_uint32_t = nullptr; // uint + GDMonoClass *class_uint64_t = nullptr; // ulong + GDMonoClass *class_float = nullptr; // float + GDMonoClass *class_double = nullptr; // double + GDMonoClass *class_String = nullptr; // string + GDMonoClass *class_IntPtr = nullptr; // System.IntPtr + + GDMonoClass *class_System_Collections_IEnumerable = nullptr; + GDMonoClass *class_System_Collections_ICollection = nullptr; + GDMonoClass *class_System_Collections_IDictionary = nullptr; #ifdef DEBUG_ENABLED - GDMonoClass *class_System_Diagnostics_StackTrace; + GDMonoClass *class_System_Diagnostics_StackTrace = nullptr; GDMonoMethodThunkR<MonoArray *, MonoObject *> methodthunk_System_Diagnostics_StackTrace_GetFrames; - GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_bool; - GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_Exception_bool; + GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_bool = nullptr; + GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_Exception_bool = nullptr; #endif - GDMonoClass *class_KeyNotFoundException; + GDMonoClass *class_KeyNotFoundException = nullptr; - MonoClass *rawclass_Dictionary; + MonoClass *rawclass_Dictionary = nullptr; // ----------------------------------------------- - GDMonoClass *class_Vector2; - GDMonoClass *class_Vector2i; - GDMonoClass *class_Rect2; - GDMonoClass *class_Rect2i; - GDMonoClass *class_Transform2D; - GDMonoClass *class_Vector3; - GDMonoClass *class_Vector3i; - GDMonoClass *class_Basis; - GDMonoClass *class_Quaternion; - GDMonoClass *class_Transform3D; - GDMonoClass *class_AABB; - GDMonoClass *class_Color; - GDMonoClass *class_Plane; - GDMonoClass *class_StringName; - GDMonoClass *class_NodePath; - GDMonoClass *class_RID; - GDMonoClass *class_GodotObject; - GDMonoClass *class_GodotResource; - GDMonoClass *class_Node; - GDMonoClass *class_Control; - GDMonoClass *class_Node3D; - GDMonoClass *class_WeakRef; - GDMonoClass *class_Callable; - GDMonoClass *class_SignalInfo; - GDMonoClass *class_Array; - GDMonoClass *class_Dictionary; - GDMonoClass *class_MarshalUtils; - GDMonoClass *class_ISerializationListener; + GDMonoClass *class_Vector2 = nullptr; + GDMonoClass *class_Vector2i = nullptr; + GDMonoClass *class_Rect2 = nullptr; + GDMonoClass *class_Rect2i = nullptr; + GDMonoClass *class_Transform2D = nullptr; + GDMonoClass *class_Vector3 = nullptr; + GDMonoClass *class_Vector3i = nullptr; + GDMonoClass *class_Basis = nullptr; + GDMonoClass *class_Quaternion = nullptr; + GDMonoClass *class_Transform3D = nullptr; + GDMonoClass *class_AABB = nullptr; + GDMonoClass *class_Color = nullptr; + GDMonoClass *class_Plane = nullptr; + GDMonoClass *class_StringName = nullptr; + GDMonoClass *class_NodePath = nullptr; + GDMonoClass *class_RID = nullptr; + GDMonoClass *class_GodotObject = nullptr; + GDMonoClass *class_GodotResource = nullptr; + GDMonoClass *class_Node = nullptr; + GDMonoClass *class_Control = nullptr; + GDMonoClass *class_Node3D = nullptr; + GDMonoClass *class_WeakRef = nullptr; + GDMonoClass *class_Callable = nullptr; + GDMonoClass *class_SignalInfo = nullptr; + GDMonoClass *class_Array = nullptr; + GDMonoClass *class_Dictionary = nullptr; + GDMonoClass *class_MarshalUtils = nullptr; + GDMonoClass *class_ISerializationListener = nullptr; #ifdef DEBUG_ENABLED - GDMonoClass *class_DebuggingUtils; + GDMonoClass *class_DebuggingUtils = nullptr; GDMonoMethodThunk<MonoObject *, MonoString **, int *, MonoString **> methodthunk_DebuggingUtils_GetStackFrameInfo; #endif - GDMonoClass *class_ExportAttribute; - GDMonoField *field_ExportAttribute_hint; - GDMonoField *field_ExportAttribute_hintString; - GDMonoClass *class_SignalAttribute; - GDMonoClass *class_ToolAttribute; - GDMonoClass *class_AnyPeerAttribute; - GDMonoClass *class_AuthorityAttribute; - GDMonoClass *class_GodotMethodAttribute; - GDMonoField *field_GodotMethodAttribute_methodName; - GDMonoClass *class_ScriptPathAttribute; - GDMonoField *field_ScriptPathAttribute_path; - GDMonoClass *class_AssemblyHasScriptsAttribute; - GDMonoField *field_AssemblyHasScriptsAttribute_requiresLookup; - GDMonoField *field_AssemblyHasScriptsAttribute_scriptTypes; - - GDMonoField *field_GodotObject_ptr; - GDMonoField *field_StringName_ptr; - GDMonoField *field_NodePath_ptr; - GDMonoField *field_Image_ptr; - GDMonoField *field_RID_ptr; + GDMonoClass *class_ExportAttribute = nullptr; + GDMonoField *field_ExportAttribute_hint = nullptr; + GDMonoField *field_ExportAttribute_hintString = nullptr; + GDMonoClass *class_SignalAttribute = nullptr; + GDMonoClass *class_ToolAttribute = nullptr; + GDMonoClass *class_AnyPeerAttribute = nullptr; + GDMonoClass *class_AuthorityAttribute = nullptr; + GDMonoClass *class_GodotMethodAttribute = nullptr; + GDMonoField *field_GodotMethodAttribute_methodName = nullptr; + GDMonoClass *class_ScriptPathAttribute = nullptr; + GDMonoField *field_ScriptPathAttribute_path = nullptr; + GDMonoClass *class_AssemblyHasScriptsAttribute = nullptr; + GDMonoField *field_AssemblyHasScriptsAttribute_requiresLookup = nullptr; + GDMonoField *field_AssemblyHasScriptsAttribute_scriptTypes = nullptr; + + GDMonoField *field_GodotObject_ptr = nullptr; + GDMonoField *field_StringName_ptr = nullptr; + GDMonoField *field_NodePath_ptr = nullptr; + GDMonoField *field_Image_ptr = nullptr; + GDMonoField *field_RID_ptr = nullptr; GDMonoMethodThunk<MonoObject *> methodthunk_GodotObject_Dispose; GDMonoMethodThunkR<Array *, MonoObject *> methodthunk_Array_GetPtr; diff --git a/modules/mono/mono_gd/gd_mono_class.h b/modules/mono/mono_gd/gd_mono_class.h index bfb5797d4b..b32d561f61 100644 --- a/modules/mono/mono_gd/gd_mono_class.h +++ b/modules/mono/mono_gd/gd_mono_class.h @@ -70,11 +70,11 @@ class GDMonoClass { StringName namespace_name; StringName class_name; - MonoClass *mono_class; - GDMonoAssembly *assembly; + MonoClass *mono_class = nullptr; + GDMonoAssembly *assembly = nullptr; bool attrs_fetched; - MonoCustomAttrInfo *attributes; + MonoCustomAttrInfo *attributes = nullptr; // This contains both the original method names and remapped method names from the native Godot identifiers to the C# functions. // Most method-related functions refer to this and it's possible this is unintuitive for outside users; this may be a prime location for refactoring or renaming. diff --git a/modules/mono/mono_gd/gd_mono_field.h b/modules/mono/mono_gd/gd_mono_field.h index abcdef378c..87ef245f3f 100644 --- a/modules/mono/mono_gd/gd_mono_field.h +++ b/modules/mono/mono_gd/gd_mono_field.h @@ -36,14 +36,14 @@ #include "i_mono_class_member.h" class GDMonoField : public IMonoClassMember { - GDMonoClass *owner; - MonoClassField *mono_field; + GDMonoClass *owner = nullptr; + MonoClassField *mono_field = nullptr; StringName name; ManagedType type; bool attrs_fetched; - MonoCustomAttrInfo *attributes; + MonoCustomAttrInfo *attributes = nullptr; public: virtual GDMonoClass *get_enclosing_class() const final { return owner; } diff --git a/modules/mono/mono_gd/gd_mono_marshal.h b/modules/mono/mono_gd/gd_mono_marshal.h index 20d4743e5c..eb33c6119e 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.h +++ b/modules/mono/mono_gd/gd_mono_marshal.h @@ -196,14 +196,14 @@ PackedVector3Array mono_array_to_PackedVector3Array(MonoArray *p_array); #pragma pack(push, 1) struct M_Callable { - MonoObject *target; - MonoObject *method_string_name; - MonoDelegate *delegate; + MonoObject *target = nullptr; + MonoObject *method_string_name = nullptr; + MonoDelegate *delegate = nullptr; }; struct M_SignalInfo { - MonoObject *owner; - MonoObject *name_string_name; + MonoObject *owner = nullptr; + MonoObject *name_string_name = nullptr; }; #pragma pack(pop) diff --git a/modules/mono/mono_gd/gd_mono_method.h b/modules/mono/mono_gd/gd_mono_method.h index 6e87a60ee2..be11ef5bfe 100644 --- a/modules/mono/mono_gd/gd_mono_method.h +++ b/modules/mono/mono_gd/gd_mono_method.h @@ -54,7 +54,7 @@ class GDMonoMethod : public IMonoClassMember { friend class GDMonoClass; - MonoMethod *mono_method; + MonoMethod *mono_method = nullptr; public: virtual GDMonoClass *get_enclosing_class() const final; diff --git a/modules/mono/mono_gd/gd_mono_property.h b/modules/mono/mono_gd/gd_mono_property.h index 003bcf05e1..6fc681aeb5 100644 --- a/modules/mono/mono_gd/gd_mono_property.h +++ b/modules/mono/mono_gd/gd_mono_property.h @@ -36,14 +36,14 @@ #include "i_mono_class_member.h" class GDMonoProperty : public IMonoClassMember { - GDMonoClass *owner; - MonoProperty *mono_property; + GDMonoClass *owner = nullptr; + MonoProperty *mono_property = nullptr; StringName name; ManagedType type; bool attrs_fetched; - MonoCustomAttrInfo *attributes; + MonoCustomAttrInfo *attributes = nullptr; unsigned int param_buffer_size; diff --git a/modules/mono/mono_gd/gd_mono_wasm_m2n.h b/modules/mono/mono_gd/gd_mono_wasm_m2n.h index 68299aa984..83e2750e5a 100644 --- a/modules/mono/mono_gd/gd_mono_wasm_m2n.h +++ b/modules/mono/mono_gd/gd_mono_wasm_m2n.h @@ -47,11 +47,11 @@ struct Mono_InterpMethodArguments { size_t ilen; void **iargs; size_t flen; - double *fargs; + double *fargs = nullptr; void **retval; size_t is_float_ret; //#ifdef TARGET_WASM - void *sig; + void *sig = nullptr; //#endif }; } // extern "C" diff --git a/modules/mono/signal_awaiter_utils.h b/modules/mono/signal_awaiter_utils.h index 1a62f36625..532aa3e327 100644 --- a/modules/mono/signal_awaiter_utils.h +++ b/modules/mono/signal_awaiter_utils.h @@ -68,7 +68,7 @@ public: }; class EventSignalCallable : public CallableCustom { - Object *owner; + Object *owner = nullptr; const CSharpScript::EventSignal *event_signal; public: diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.h b/modules/navigation/editor/navigation_mesh_editor_plugin.h index 3c3e804fd2..bc9e4185b7 100644 --- a/modules/navigation/editor/navigation_mesh_editor_plugin.h +++ b/modules/navigation/editor/navigation_mesh_editor_plugin.h @@ -42,14 +42,14 @@ class NavigationMeshEditor : public Control { GDCLASS(NavigationMeshEditor, Control); - AcceptDialog *err_dialog; + AcceptDialog *err_dialog = nullptr; - HBoxContainer *bake_hbox; - Button *button_bake; - Button *button_reset; - Label *bake_info; + HBoxContainer *bake_hbox = nullptr; + Button *button_bake = nullptr; + Button *button_reset = nullptr; + Label *bake_info = nullptr; - NavigationRegion3D *node; + NavigationRegion3D *node = nullptr; void _bake_pressed(); void _clear_pressed(); @@ -68,7 +68,7 @@ public: class NavigationMeshEditorPlugin : public EditorPlugin { GDCLASS(NavigationMeshEditorPlugin, EditorPlugin); - NavigationMeshEditor *navigation_mesh_editor; + NavigationMeshEditor *navigation_mesh_editor = nullptr; public: virtual String get_name() const override { return "NavigationMesh"; } diff --git a/modules/navigation/nav_utils.h b/modules/navigation/nav_utils.h index 0c02885b10..5b6c695ca4 100644 --- a/modules/navigation/nav_utils.h +++ b/modules/navigation/nav_utils.h @@ -89,7 +89,7 @@ struct Edge { }; struct Polygon { - NavRegion *owner; + NavRegion *owner = nullptr; /// The points of this `Polygon` std::vector<Point> points; diff --git a/modules/noise/noise.h b/modules/noise/noise.h index c05bc057da..767aa830e8 100644 --- a/modules/noise/noise.h +++ b/modules/noise/noise.h @@ -39,7 +39,7 @@ class Noise : public Resource { // Helper struct for get_seamless_image(). See comments in .cpp for usage. template <typename T> struct img_buff { - T *img; + T *img = nullptr; int width; // Array dimensions & default modulo for image. int height; int offset_x; // Offset index location on image (wrapped by specified modulo). diff --git a/modules/openxr/editor/openxr_editor_plugin.h b/modules/openxr/editor/openxr_editor_plugin.h index 9d04bc4e45..af8ee7d54c 100644 --- a/modules/openxr/editor/openxr_editor_plugin.h +++ b/modules/openxr/editor/openxr_editor_plugin.h @@ -37,7 +37,7 @@ class OpenXREditorPlugin : public EditorPlugin { GDCLASS(OpenXREditorPlugin, EditorPlugin); - OpenXRActionMapEditor *action_map_editor; + OpenXRActionMapEditor *action_map_editor = nullptr; public: virtual String get_name() const override { return "OpenXRPlugin"; } diff --git a/modules/openxr/extensions/openxr_extension_wrapper.h b/modules/openxr/extensions/openxr_extension_wrapper.h index 5242ee6063..00f81731c2 100644 --- a/modules/openxr/extensions/openxr_extension_wrapper.h +++ b/modules/openxr/extensions/openxr_extension_wrapper.h @@ -43,7 +43,7 @@ class OpenXRAPI; class OpenXRExtensionWrapper { protected: - OpenXRAPI *openxr_api; + OpenXRAPI *openxr_api = nullptr; // Store extension we require. // If bool pointer is a nullptr this means this extension is mandatory and initialisation will fail if it is not available diff --git a/modules/raycast/raycast_occlusion_cull.h b/modules/raycast/raycast_occlusion_cull.h index a22e52dd17..8453c5341d 100644 --- a/modules/raycast/raycast_occlusion_cull.h +++ b/modules/raycast/raycast_occlusion_cull.h @@ -115,7 +115,7 @@ private: struct Scenario { struct RaycastThreadData { - CameraRayTile *rays; + CameraRayTile *rays = nullptr; const uint32_t *masks; }; @@ -124,7 +124,7 @@ private: uint32_t vertex_count; Transform3D xform; const Vector3 *read; - Vector3 *write; + Vector3 *write = nullptr; }; Thread *commit_thread = nullptr; diff --git a/modules/regex/regex.h b/modules/regex/regex.h index a745c50a58..e7221f4070 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -71,7 +71,7 @@ public: class RegEx : public RefCounted { GDCLASS(RegEx, RefCounted); - void *general_ctx; + void *general_ctx = nullptr; void *code = nullptr; String pattern; diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 3bc96908a2..b61412e665 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -112,7 +112,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { RingBuffer<uint8_t> ring_buffer; Vector<uint8_t> read_buffer; bool thread_eof = false; - Semaphore *thread_sem; + Semaphore *thread_sem = nullptr; Thread thread; SafeFlag thread_exit; diff --git a/modules/visual_script/editor/visual_script_property_selector.h b/modules/visual_script/editor/visual_script_property_selector.h index 6b5112f1af..faf39a14e4 100644 --- a/modules/visual_script/editor/visual_script_property_selector.h +++ b/modules/visual_script/editor/visual_script_property_selector.h @@ -62,23 +62,23 @@ class VisualScriptPropertySelector : public ConfirmationDialog { SCOPE_ALL = SCOPE_BASE | SCOPE_INHERITERS | SCOPE_UNRELATED }; - LineEdit *search_box; + LineEdit *search_box = nullptr; - Button *case_sensitive_button; - Button *hierarchy_button; + Button *case_sensitive_button = nullptr; + Button *hierarchy_button = nullptr; - Button *search_visual_script_nodes; - Button *search_classes; - Button *search_operators; + Button *search_visual_script_nodes = nullptr; + Button *search_classes = nullptr; + Button *search_operators = nullptr; - Button *search_methods; - Button *search_signals; - Button *search_constants; - Button *search_properties; - Button *search_theme_items; + Button *search_methods = nullptr; + Button *search_signals = nullptr; + Button *search_constants = nullptr; + Button *search_properties = nullptr; + Button *search_theme_items = nullptr; - OptionButton *scope_combo; - Tree *results_tree; + OptionButton *scope_combo = nullptr; + Tree *results_tree = nullptr; class SearchRunner; Ref<SearchRunner> search_runner; @@ -94,7 +94,7 @@ class VisualScriptPropertySelector : public ConfirmationDialog { void _item_selected(); void _hide_requested(); - EditorHelpBit *help_bit; + EditorHelpBit *help_bit = nullptr; bool properties = false; bool visual_script_generic = false; @@ -104,9 +104,9 @@ class VisualScriptPropertySelector : public ConfirmationDialog { String base_type; String base_script; ObjectID script; - Object *instance; + Object *instance = nullptr; bool virtuals_only = false; - VBoxContainer *vbox; + VBoxContainer *vbox = nullptr; protected: void _notification(int p_what); @@ -159,9 +159,9 @@ class VisualScriptPropertySelector::SearchRunner : public RefCounted { } }; - VisualScriptPropertySelector *selector_ui; - Control *ui_service; - Tree *results_tree; + VisualScriptPropertySelector *selector_ui = nullptr; + Control *ui_service = nullptr; + Tree *results_tree = nullptr; String term; int search_flags; int scope_flags; diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index d72bdf9128..6b27af15f6 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -495,7 +495,7 @@ class VisualScriptLanguage : public ScriptLanguage { String _debug_error; int _debug_call_stack_pos = 0; int _debug_max_call_stack; - CallLevel *_call_stack; + CallLevel *_call_stack = nullptr; public: StringName notification = "_notification"; diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 48239b3f84..a40e17dc2c 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -52,7 +52,7 @@ private: #endif #if defined(VULKAN_ENABLED) - ANativeWindow *native_window; + ANativeWindow *native_window = nullptr; #endif mutable String data_dir_cache; @@ -60,10 +60,10 @@ private: AudioDriverOpenSL audio_driver_android; - MainLoop *main_loop; + MainLoop *main_loop = nullptr; - GodotJavaWrapper *godot_java; - GodotIOJavaWrapper *godot_io_java; + GodotJavaWrapper *godot_java = nullptr; + GodotIOJavaWrapper *godot_io_java = nullptr; public: static const char *ANDROID_EXEC_PATH; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 3281ff0cdb..6a61f3a910 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -52,11 +52,11 @@ private: AudioDriverCoreAudio audio_driver; - iOS *ios; + iOS *ios = nullptr; - JoypadIPhone *joypad_iphone; + JoypadIPhone *joypad_iphone = nullptr; - MainLoop *main_loop; + MainLoop *main_loop = nullptr; virtual void initialize_core() override; virtual void initialize() override; diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index 0f44aa4b11..cd673d94d9 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -108,7 +108,7 @@ class DisplayServerX11 : public DisplayServer { #endif #if defined(DBUS_ENABLED) - FreeDesktopScreenSaver *screensaver; + FreeDesktopScreenSaver *screensaver = nullptr; bool keep_screen_on = false; #endif @@ -168,7 +168,7 @@ class DisplayServerX11 : public DisplayServer { String internal_clipboard_primary; Window xdnd_source_window; ::Display *x11_display; - char *xmbstring; + char *xmbstring = nullptr; int xmblen; unsigned long last_timestamp; ::Time last_keyrelease_time; @@ -249,7 +249,7 @@ class DisplayServerX11 : public DisplayServer { typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors); xrr_get_monitors_t xrr_get_monitors; xrr_free_monitors_t xrr_free_monitors; - void *xrandr_handle; + void *xrandr_handle = nullptr; Bool xrandr_ext_ok; struct Property { diff --git a/platform/linuxbsd/gl_manager_x11.h b/platform/linuxbsd/gl_manager_x11.h index 0bb0a446ab..e89caf3b30 100644 --- a/platform/linuxbsd/gl_manager_x11.h +++ b/platform/linuxbsd/gl_manager_x11.h @@ -66,7 +66,7 @@ private: struct GLDisplay { GLDisplay() { context = nullptr; } ~GLDisplay(); - GLManager_X11_Private *context; + GLManager_X11_Private *context = nullptr; ::Display *x11_display; XVisualInfo x_vi; XSetWindowAttributes x_swa; @@ -82,7 +82,7 @@ private: LocalVector<GLWindow> _windows; LocalVector<GLDisplay> _displays; - GLWindow *_current_window; + GLWindow *_current_window = nullptr; void _internal_set_current_window(GLWindow *p_win); diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h index d3857e85f8..7b912ddee3 100644 --- a/platform/linuxbsd/os_linuxbsd.h +++ b/platform/linuxbsd/os_linuxbsd.h @@ -63,7 +63,7 @@ class OS_LinuxBSD : public OS_Unix { CrashHandler crash_handler; - MainLoop *main_loop; + MainLoop *main_loop = nullptr; protected: virtual void initialize() override; diff --git a/platform/osx/joypad_osx.h b/platform/osx/joypad_osx.h index 4ca7fb1698..b09d5ce34a 100644 --- a/platform/osx/joypad_osx.h +++ b/platform/osx/joypad_osx.h @@ -94,7 +94,7 @@ class JoypadOSX { }; private: - Input *input; + Input *input = nullptr; IOHIDManagerRef hid_manager; Vector<joypad> device_list; diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h index 29f5109056..0869f1961d 100644 --- a/platform/uwp/joypad_uwp.h +++ b/platform/uwp/joypad_uwp.h @@ -68,7 +68,7 @@ private: ControllerDevice controllers[MAX_CONTROLLERS]; - InputDefault *input; + InputDefault *input = nullptr; void OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value); void OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 573d86af7c..f955be1da9 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -74,7 +74,7 @@ private: KEY_EVENT_BUFFER_SIZE = 512 }; - FILE *stdo; + FILE *stdo = nullptr; KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE]; int key_event_pos; @@ -87,16 +87,16 @@ private: bool outside; int old_x, old_y; Point2i center; - RenderingServer *rendering_server; + RenderingServer *rendering_server = nullptr; int pressrc; - ContextEGL_UWP *gl_context; + ContextEGL_UWP *gl_context = nullptr; Windows::UI::Core::CoreWindow ^ window; VideoMode video_mode; int video_driver_index; - MainLoop *main_loop; + MainLoop *main_loop = nullptr; AudioDriverXAudio2 audio_driver; @@ -111,7 +111,7 @@ private: CursorShape cursor_shape; - InputDefault *input; + InputDefault *input = nullptr; JoypadUWP ^ joypad; diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 71fedf2bca..fcf4b5a728 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -392,7 +392,7 @@ class DisplayServerWindows : public DisplayServer { Rect2i parent_safe_rect; }; - JoypadWindows *joypad; + JoypadWindows *joypad = nullptr; HHOOK mouse_monitor = nullptr; List<WindowID> popup_list; uint64_t time_since_popup = 0; diff --git a/platform/windows/gl_manager_windows.h b/platform/windows/gl_manager_windows.h index 6423c54855..f789cba327 100644 --- a/platform/windows/gl_manager_windows.h +++ b/platform/windows/gl_manager_windows.h @@ -75,7 +75,7 @@ private: LocalVector<GLWindow> _windows; LocalVector<GLDisplay> _displays; - GLWindow *_current_window; + GLWindow *_current_window = nullptr; PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT; diff --git a/platform/windows/joypad_windows.h b/platform/windows/joypad_windows.h index 4f15bcf080..d239471a5c 100644 --- a/platform/windows/joypad_windows.h +++ b/platform/windows/joypad_windows.h @@ -105,10 +105,10 @@ private: typedef DWORD(WINAPI *XInputGetState_t)(DWORD dwUserIndex, XINPUT_STATE *pState); typedef DWORD(WINAPI *XInputSetState_t)(DWORD dwUserIndex, XINPUT_VIBRATION *pVibration); - HWND *hWnd; + HWND *hWnd = nullptr; HANDLE xinput_dll; LPDIRECTINPUT8 dinput; - Input *input; + Input *input = nullptr; int id_to_change; int slider_count; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 5bfd24327e..adeecf37c5 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -60,14 +60,14 @@ class JoypadWindows; class OS_Windows : public OS { #ifdef STDOUT_FILE - FILE *stdo; + FILE *stdo = nullptr; #endif uint64_t ticks_start; uint64_t ticks_per_second; HINSTANCE hInstance; - MainLoop *main_loop; + MainLoop *main_loop = nullptr; #ifdef WASAPI_ENABLED AudioDriverWASAPI driver_wasapi; diff --git a/scene/2d/physical_bone_2d.h b/scene/2d/physical_bone_2d.h index 9f31c22031..22d329c320 100644 --- a/scene/2d/physical_bone_2d.h +++ b/scene/2d/physical_bone_2d.h @@ -49,7 +49,7 @@ private: NodePath bone2d_nodepath; bool follow_bone_when_simulating = false; - Joint2D *child_joint; + Joint2D *child_joint = nullptr; bool auto_configure_joint = true; bool simulate_physics = false; diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h index 80ff2a1f79..279c3e49a2 100644 --- a/scene/3d/skeleton_3d.h +++ b/scene/3d/skeleton_3d.h @@ -44,13 +44,13 @@ class SkinReference : public RefCounted { GDCLASS(SkinReference, RefCounted) friend class Skeleton3D; - Skeleton3D *skeleton_node; + Skeleton3D *skeleton_node = nullptr; RID skeleton; Ref<Skin> skin; uint32_t bind_count = 0; uint64_t skeleton_version = 0; Vector<uint32_t> skin_bone_indices; - uint32_t *skin_bone_indices_ptrs; + uint32_t *skin_bone_indices_ptrs = nullptr; void _skin_changed(); protected: diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 11c701b0d5..41fd9c0a10 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -45,10 +45,10 @@ class AcceptDialog : public Window { GDCLASS(AcceptDialog, Window); Window *parent_visible = nullptr; - Panel *bg; - HBoxContainer *hbc; - Label *label; - Button *ok; + Panel *bg = nullptr; + HBoxContainer *hbc = nullptr; + Label *label = nullptr; + Button *ok = nullptr; bool hide_on_ok = true; bool close_on_escape = true; @@ -103,7 +103,7 @@ public: class ConfirmationDialog : public AcceptDialog { GDCLASS(ConfirmationDialog, AcceptDialog); - Button *cancel; + Button *cancel = nullptr; protected: static void _bind_methods(); diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 7a50efe40f..9bba93bb89 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -65,34 +65,34 @@ public: static RegisterFunc unregister_func; private: - ConfirmationDialog *makedialog; - LineEdit *makedirname; + ConfirmationDialog *makedialog = nullptr; + LineEdit *makedirname = nullptr; - Button *makedir; + Button *makedir = nullptr; Access access = ACCESS_RESOURCES; - VBoxContainer *vbox; + VBoxContainer *vbox = nullptr; FileMode mode; - LineEdit *dir; - HBoxContainer *drives_container; - HBoxContainer *shortcuts_container; - OptionButton *drives; - Tree *tree; - HBoxContainer *file_box; - LineEdit *file; - OptionButton *filter; - AcceptDialog *mkdirerr; - AcceptDialog *exterr; - DirAccess *dir_access; - ConfirmationDialog *confirm_save; - - Label *message; - - Button *dir_prev; - Button *dir_next; - Button *dir_up; - - Button *refresh; - Button *show_hidden; + LineEdit *dir = nullptr; + HBoxContainer *drives_container = nullptr; + HBoxContainer *shortcuts_container = nullptr; + OptionButton *drives = nullptr; + Tree *tree = nullptr; + HBoxContainer *file_box = nullptr; + LineEdit *file = nullptr; + OptionButton *filter = nullptr; + AcceptDialog *mkdirerr = nullptr; + AcceptDialog *exterr = nullptr; + DirAccess *dir_access = nullptr; + ConfirmationDialog *confirm_save = nullptr; + + Label *message = nullptr; + + Button *dir_prev = nullptr; + Button *dir_next = nullptr; + Button *dir_up = nullptr; + + Button *refresh = nullptr; + Button *show_hidden = nullptr; Vector<String> filters; diff --git a/scene/gui/gradient_edit.h b/scene/gui/gradient_edit.h index 67531d4f4a..4e3c6525f9 100644 --- a/scene/gui/gradient_edit.h +++ b/scene/gui/gradient_edit.h @@ -38,8 +38,8 @@ class GradientEdit : public Control { GDCLASS(GradientEdit, Control); - PopupPanel *popup; - ColorPicker *picker; + PopupPanel *popup = nullptr; + ColorPicker *picker = nullptr; bool grabbing = false; int grabbed = -1; diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index b0d1944d6e..18b9eeebd4 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -46,7 +46,7 @@ class GraphEditFilter : public Control { friend class GraphEdit; friend class GraphEditMinimap; - GraphEdit *ge; + GraphEdit *ge = nullptr; virtual bool has_point(const Point2 &p_point) const override; public: @@ -58,7 +58,7 @@ class GraphEditMinimap : public Control { friend class GraphEdit; friend class GraphEditFilter; - GraphEdit *ge; + GraphEdit *ge = nullptr; protected: public: @@ -109,20 +109,20 @@ public: }; private: - Label *zoom_label; - Button *zoom_minus; - Button *zoom_reset; - Button *zoom_plus; + Label *zoom_label = nullptr; + Button *zoom_minus = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_plus = nullptr; - Button *snap_button; - SpinBox *snap_amount; + Button *snap_button = nullptr; + SpinBox *snap_amount = nullptr; - Button *minimap_button; + Button *minimap_button = nullptr; - Button *layout_button; + Button *layout_button = nullptr; - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; float port_grab_distance_horizontal = 0.0; float port_grab_distance_vertical; @@ -190,9 +190,9 @@ private: void _scroll_moved(double); virtual void gui_input(const Ref<InputEvent> &p_ev) override; - Control *connections_layer; - GraphEditFilter *top_layer; - GraphEditMinimap *minimap; + Control *connections_layer = nullptr; + GraphEditFilter *top_layer = nullptr; + GraphEditMinimap *minimap = nullptr; void _top_layer_input(const Ref<InputEvent> &p_ev); bool is_in_input_hotzone(GraphNode *p_graph_node, int p_slot_index, const Vector2 &p_mouse_pos, const Vector2i &p_port_size); @@ -236,7 +236,7 @@ private: void _set_drag_comment_enclosed_nodes(GraphNode *p_node, HashMap<StringName, Vector<GraphNode *>> &p_comment_enclosed_nodes, bool p_drag); void _set_position_of_comment_enclosed_nodes(GraphNode *p_node, HashMap<StringName, Vector<GraphNode *>> &p_comment_enclosed_nodes, Vector2 p_pos); - HBoxContainer *zoom_hb; + HBoxContainer *zoom_hb = nullptr; friend class GraphEditFilter; bool _filter_input(const Point2 &p_point); diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index 96735678c1..ffbe7d055a 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -98,7 +98,7 @@ private: SelectMode select_mode = SELECT_SINGLE; IconMode icon_mode = ICON_MODE_LEFT; - VScrollBar *scroll_bar; + VScrollBar *scroll_bar = nullptr; TextParagraph::OverrunBehavior text_overrun_behavior = TextParagraph::OVERRUN_TRIM_ELLIPSIS; uint64_t search_time_msec = 0; diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 9cfb780255..e3ead9c291 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -40,7 +40,7 @@ class MenuButton : public Button { bool clicked = false; bool switch_on_hover = false; bool disable_shortcuts = false; - PopupMenu *popup; + PopupMenu *popup = nullptr; Vector2i mouse_pos_adjusted; diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 732730e0f4..921b76c52a 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -37,7 +37,7 @@ class OptionButton : public Button { GDCLASS(OptionButton, Button); - PopupMenu *popup; + PopupMenu *popup = nullptr; int current = -1; void _focused(int p_which); diff --git a/scene/gui/popup.h b/scene/gui/popup.h index c45f4ddc24..6211af4d20 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -65,7 +65,7 @@ public: class PopupPanel : public Popup { GDCLASS(PopupPanel, Popup); - Panel *panel; + Panel *panel = nullptr; protected: void _update_child_rects(); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 5ce55209d4..518ba14dae 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -89,7 +89,7 @@ class PopupMenu : public Popup { bool close_allowed = false; Timer *minimum_lifetime_timer = nullptr; - Timer *submenu_timer; + Timer *submenu_timer = nullptr; List<Rect2> autohide_areas; Vector<Item> items; MouseButton initial_button_mask = MouseButton::NONE; @@ -125,9 +125,9 @@ class PopupMenu : public Popup { uint64_t search_time_msec = 0; String search_string = ""; - MarginContainer *margin_container; - ScrollContainer *scroll_container; - Control *control; + MarginContainer *margin_container = nullptr; + ScrollContainer *scroll_container = nullptr; + Control *control = nullptr; void _draw_items(); void _draw_background(); diff --git a/scene/gui/range.h b/scene/gui/range.h index 597c50ca26..46b0d39202 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -50,7 +50,7 @@ class Range : public Control { void emit_changed(const char *p_what = ""); }; - Shared *shared; + Shared *shared = nullptr; void _ref_shared(Shared *p_shared); void _unref_shared(); diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index c00df87b18..b9fcf64db6 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -47,8 +47,8 @@ public: }; private: - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; Size2 child_max_size; diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index a15e3fe5f5..d118b28334 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -38,11 +38,11 @@ class SpinBox : public Range { GDCLASS(SpinBox, Range); - LineEdit *line_edit; + LineEdit *line_edit = nullptr; int last_w = 0; bool update_on_text_changed = false; - Timer *range_click_timer; + Timer *range_click_timer = nullptr; void _range_click_timeout(); void _release_mouse(); diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 225c24c25e..9adaa0d844 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -38,7 +38,7 @@ class TabContainer : public Container { GDCLASS(TabContainer, Container); - TabBar *tab_bar; + TabBar *tab_bar = nullptr; bool tabs_visible = true; bool all_tabs_in_front = false; bool menu_hovered = false; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 6deaf76e5e..7d36051a37 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -325,7 +325,7 @@ private: List<TextOperation> undo_stack; List<TextOperation>::Element *undo_stack_pos = nullptr; - Timer *idle_detect; + Timer *idle_detect = nullptr; uint32_t version = 0; uint32_t saved_version = 0; @@ -380,7 +380,7 @@ private: bool draw_caret = true; bool caret_blink_enabled = false; - Timer *caret_blink_timer; + Timer *caret_blink_timer = nullptr; bool move_caret_on_right_click = true; @@ -426,7 +426,7 @@ private: bool dragging_selection = false; - Timer *click_select_held; + Timer *click_select_held = nullptr; uint64_t last_dblclk = 0; Vector2 last_dblclk_pos; void _click_selection_held(); @@ -449,8 +449,8 @@ private: void _update_caret_wrap_offset(); /* Viewport. */ - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; bool scroll_past_end_of_file_enabled = false; diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 04d4b9b935..74ad4f94b8 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -134,7 +134,7 @@ private: Vector<TreeItem *> children_cache; bool is_root = false; // for tree root - Tree *tree; // tree (for reference) + Tree *tree = nullptr; // tree (for reference) TreeItem(Tree *p_tree); @@ -428,18 +428,18 @@ private: bool show_column_titles = false; - VBoxContainer *popup_editor_vb; + VBoxContainer *popup_editor_vb = nullptr; - Popup *popup_editor; + Popup *popup_editor = nullptr; LineEdit *text_editor = nullptr; - HSlider *value_editor; + HSlider *value_editor = nullptr; bool updating_value_editor = false; uint64_t focus_in_id = 0; PopupMenu *popup_menu = nullptr; Vector<ColumnInfo> columns; - Timer *range_click_timer; + Timer *range_click_timer = nullptr; TreeItem *range_item_last = nullptr; bool range_up_last = false; void _range_click_timeout(); @@ -553,8 +553,8 @@ private: int _get_title_button_height() const; void _scroll_moved(float p_value); - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; bool h_scroll_enabled = true; bool v_scroll_enabled = true; diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 26d648458f..8b3441f7d7 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -144,7 +144,7 @@ public: void set_max_redirects(int p_max); int get_max_redirects() const; - Timer *timer; + Timer *timer = nullptr; void set_timeout(double p_timeout); double get_timeout(); diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 10839ca425..0f8cbedb41 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -115,7 +115,7 @@ private: int node_count = 0; #ifdef TOOLS_ENABLED - Node *edited_scene_root; + Node *edited_scene_root = nullptr; #endif struct UGCall { StringName group; @@ -138,7 +138,7 @@ private: Array _get_nodes_in_group(const StringName &p_group); - Node *current_scene; + Node *current_scene = nullptr; Color debug_collisions_color; Color debug_collision_contact_color; diff --git a/scene/multiplayer/scene_cache_interface.h b/scene/multiplayer/scene_cache_interface.h index c709d26b51..d53cf387fb 100644 --- a/scene/multiplayer/scene_cache_interface.h +++ b/scene/multiplayer/scene_cache_interface.h @@ -37,7 +37,7 @@ class SceneCacheInterface : public MultiplayerCacheInterface { GDCLASS(SceneCacheInterface, MultiplayerCacheInterface); private: - MultiplayerAPI *multiplayer; + MultiplayerAPI *multiplayer = nullptr; //path sent caches struct PathSentCache { diff --git a/scene/multiplayer/scene_replication_interface.h b/scene/multiplayer/scene_replication_interface.h index 855878d029..60ac95c93c 100644 --- a/scene/multiplayer/scene_replication_interface.h +++ b/scene/multiplayer/scene_replication_interface.h @@ -47,7 +47,7 @@ private: void _free_remotes(int p_peer); Ref<SceneReplicationState> rep_state; - MultiplayerAPI *multiplayer; + MultiplayerAPI *multiplayer = nullptr; PackedByteArray packet_cache; int sync_mtu = 1350; // Highly dependent on underlying protocol. diff --git a/scene/resources/skeleton_modification_2d.h b/scene/resources/skeleton_modification_2d.h index d49f9e7f51..3b9235ffd8 100644 --- a/scene/resources/skeleton_modification_2d.h +++ b/scene/resources/skeleton_modification_2d.h @@ -49,7 +49,7 @@ class SkeletonModification2D : public Resource { protected: static void _bind_methods(); - SkeletonModificationStack2D *stack; + SkeletonModificationStack2D *stack = nullptr; int execution_mode = 0; // 0 = process bool enabled = true; diff --git a/scene/resources/skeleton_modification_3d.h b/scene/resources/skeleton_modification_3d.h index a81c0c38bd..ab736fcbd2 100644 --- a/scene/resources/skeleton_modification_3d.h +++ b/scene/resources/skeleton_modification_3d.h @@ -44,7 +44,7 @@ class SkeletonModification3D : public Resource { protected: static void _bind_methods(); - SkeletonModificationStack3D *stack; + SkeletonModificationStack3D *stack = nullptr; int execution_mode = 0; // 0 = process bool enabled = true; diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h index 6324e2f5d3..68b523e086 100644 --- a/servers/audio/audio_driver_dummy.h +++ b/servers/audio/audio_driver_dummy.h @@ -40,7 +40,7 @@ class AudioDriverDummy : public AudioDriver { Thread thread; Mutex mutex; - int32_t *samples_in; + int32_t *samples_in = nullptr; static void thread_func(void *p_udata); diff --git a/servers/audio/audio_filter_sw.h b/servers/audio/audio_filter_sw.h index 9e55662d0a..1ec1abd4d5 100644 --- a/servers/audio/audio_filter_sw.h +++ b/servers/audio/audio_filter_sw.h @@ -57,7 +57,7 @@ public: class Processor { // simple filter processor - AudioFilterSW *filter; + AudioFilterSW *filter = nullptr; Coeffs coeffs; float ha1, ha2, hb1, hb2; //history Coeffs incr_coeffs; diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h index 3fbe684c3e..81ac6332e2 100644 --- a/servers/audio/audio_rb_resampler.h +++ b/servers/audio/audio_rb_resampler.h @@ -55,8 +55,8 @@ struct AudioRBResampler { MIX_FRAC_MASK = MIX_FRAC_LEN - 1, }; - float *read_buf; - float *rb; + float *read_buf = nullptr; + float *rb = nullptr; template <int C> uint32_t _resample(AudioFrame *p_dest, int p_todo, int32_t p_increment); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.h b/servers/audio/effects/audio_effect_stereo_enhance.h index 8b8b7b47a0..1f93d1cf9f 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.h +++ b/servers/audio/effects/audio_effect_stereo_enhance.h @@ -44,7 +44,7 @@ class AudioEffectStereoEnhanceInstance : public AudioEffectInstance { MAX_DELAY_MS = 50 }; - float *delay_ringbuff; + float *delay_ringbuff = nullptr; unsigned int ringbuff_pos; unsigned int ringbuff_mask; diff --git a/servers/audio/effects/audio_stream_generator.h b/servers/audio/effects/audio_stream_generator.h index 51288262b3..2ce4b95fcf 100644 --- a/servers/audio/effects/audio_stream_generator.h +++ b/servers/audio/effects/audio_stream_generator.h @@ -65,7 +65,7 @@ class AudioStreamGeneratorPlayback : public AudioStreamPlaybackResampled { int skips; bool active; float mixed; - AudioStreamGenerator *generator; + AudioStreamGenerator *generator = nullptr; protected: virtual int _mix_internal(AudioFrame *p_buffer, int p_frames) override; diff --git a/servers/audio/effects/reverb.h b/servers/audio/effects/reverb.h index ff59ab8d82..de25e8c52b 100644 --- a/servers/audio/effects/reverb.h +++ b/servers/audio/effects/reverb.h @@ -75,7 +75,7 @@ private: Comb comb[MAX_COMBS]; AllPass allpass[MAX_ALLPASS]; - float *input_buffer; + float *input_buffer = nullptr; float *echo_buffer = nullptr; int echo_buffer_size; int echo_buffer_pos; diff --git a/servers/audio_server.h b/servers/audio_server.h index 0c150427f2..5563d60e4a 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -284,7 +284,7 @@ private: struct CallbackItem { AudioCallback callback; - void *userdata; + void *userdata = nullptr; }; SafeList<CallbackItem *> update_callback_list; diff --git a/servers/extensions/physics_server_3d_extension.h b/servers/extensions/physics_server_3d_extension.h index 77e867a05a..ce6bed41c9 100644 --- a/servers/extensions/physics_server_3d_extension.h +++ b/servers/extensions/physics_server_3d_extension.h @@ -193,7 +193,7 @@ typedef PhysicsServer3D::MotionCollision PhysicsServer3DExtensionMotionCollision typedef PhysicsServer3D::MotionResult PhysicsServer3DExtensionMotionResult; struct PhysicsServer3DExtensionStateCallback { - void *instance; + void *instance = nullptr; void (*callback)(void *p_instance, PhysicsDirectBodyState3D *p_state); }; diff --git a/servers/physics_3d/godot_area_pair_3d.h b/servers/physics_3d/godot_area_pair_3d.h index c416477204..64b43a3b51 100644 --- a/servers/physics_3d/godot_area_pair_3d.h +++ b/servers/physics_3d/godot_area_pair_3d.h @@ -37,8 +37,8 @@ #include "godot_soft_body_3d.h" class GodotAreaPair3D : public GodotConstraint3D { - GodotBody3D *body; - GodotArea3D *area; + GodotBody3D *body = nullptr; + GodotArea3D *area = nullptr; int body_shape; int area_shape; bool colliding = false; @@ -55,8 +55,8 @@ public: }; class GodotArea2Pair3D : public GodotConstraint3D { - GodotArea3D *area_a; - GodotArea3D *area_b; + GodotArea3D *area_a = nullptr; + GodotArea3D *area_b = nullptr; int shape_a; int shape_b; bool colliding_a = false; @@ -76,8 +76,8 @@ public: }; class GodotAreaSoftBodyPair3D : public GodotConstraint3D { - GodotSoftBody3D *soft_body; - GodotArea3D *area; + GodotSoftBody3D *soft_body = nullptr; + GodotArea3D *area = nullptr; int soft_body_shape; int area_shape; bool colliding = false; diff --git a/servers/physics_3d/godot_physics_server_3d.h b/servers/physics_3d/godot_physics_server_3d.h index 00ed763e01..d2078a912c 100644 --- a/servers/physics_3d/godot_physics_server_3d.h +++ b/servers/physics_3d/godot_physics_server_3d.h @@ -74,7 +74,7 @@ public: struct CollCbkData { int max; int amount; - Vector3 *ptr; + Vector3 *ptr = nullptr; }; static void _shape_col_cbk(const Vector3 &p_point_A, int p_index_A, const Vector3 &p_point_B, int p_index_B, void *p_userdata); diff --git a/servers/physics_3d/godot_space_3d.h b/servers/physics_3d/godot_space_3d.h index ac54c8bf69..6308ede9a9 100644 --- a/servers/physics_3d/godot_space_3d.h +++ b/servers/physics_3d/godot_space_3d.h @@ -47,7 +47,7 @@ class GodotPhysicsDirectSpaceState3D : public PhysicsDirectSpaceState3D { GDCLASS(GodotPhysicsDirectSpaceState3D, PhysicsDirectSpaceState3D); public: - GodotSpace3D *space; + GodotSpace3D *space = nullptr; virtual int intersect_point(const PointParameters &p_parameters, ShapeResult *r_results, int p_result_max) override; virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override; diff --git a/servers/rendering/renderer_canvas_cull.h b/servers/rendering/renderer_canvas_cull.h index fc53ce2327..94bae30ae0 100644 --- a/servers/rendering/renderer_canvas_cull.h +++ b/servers/rendering/renderer_canvas_cull.h @@ -124,7 +124,7 @@ public: Set<RID> viewports; struct ChildItem { Point2 mirror; - Item *item; + Item *item = nullptr; bool operator<(const ChildItem &p_item) const { return item->index < p_item.item->index; } diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index 956795f414..46ca3b0da8 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -83,10 +83,10 @@ public: Transform2D light_shader_xform; //Vector2 light_shader_pos; - Light *shadows_next_ptr; - Light *filter_next_ptr; - Light *next_ptr; - Light *directional_next_ptr; + Light *shadows_next_ptr = nullptr; + Light *filter_next_ptr = nullptr; + Light *next_ptr = nullptr; + Light *directional_next_ptr = nullptr; RID light_internal; uint64_t version; @@ -168,7 +168,7 @@ public: MAX_SIZE = 4096 }; uint32_t usage; - uint8_t *memory; + uint8_t *memory = nullptr; }; struct Command { @@ -185,7 +185,7 @@ public: TYPE_ANIMATION_SLICE, }; - Command *next; + Command *next = nullptr; Type type; virtual ~Command() {} }; @@ -305,8 +305,8 @@ public: }; struct ViewportRender { - RenderingServer *owner; - void *udata; + RenderingServer *owner = nullptr; + void *udata = nullptr; Rect2 rect; }; @@ -334,22 +334,22 @@ public: RID material; RID skeleton; - Item *next; + Item *next = nullptr; struct CopyBackBuffer { Rect2 rect; Rect2 screen_rect; bool full; }; - CopyBackBuffer *copy_back_buffer; + CopyBackBuffer *copy_back_buffer = nullptr; Color final_modulate; Transform2D final_transform; Rect2 final_clip_rect; - Item *final_clip_owner; - Item *material_owner; - Item *canvas_group_owner; - ViewportRender *vp_render; + Item *final_clip_owner = nullptr; + Item *material_owner = nullptr; + Item *canvas_group_owner = nullptr; + ViewportRender *vp_render = nullptr; bool distance_field; bool light_masked; @@ -453,14 +453,14 @@ public: return rect; } - Command *commands; - Command *last_command; + Command *commands = nullptr; + Command *last_command = nullptr; Vector<CommandBlock> blocks; uint32_t current_block; template <class T> T *alloc_command() { - T *command; + T *command = nullptr; if (commands == nullptr) { // As the most common use case of canvas items is to // use only one command, the first is done with it's @@ -590,7 +590,7 @@ public: bool sdf_collision; RS::CanvasOccluderPolygonCullMode cull_cache; - LightOccluderInstance *next; + LightOccluderInstance *next = nullptr; LightOccluderInstance() { enabled = true; diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h index 11016968ed..37366d3e14 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h @@ -332,7 +332,7 @@ class RenderForwardClustered : public RendererSceneRenderRD { uint32_t instance_buffer_size[RENDER_LIST_MAX] = { 0, 0, 0 }; LocalVector<InstanceData> instance_data[RENDER_LIST_MAX]; - LightmapCaptureData *lightmap_captures; + LightmapCaptureData *lightmap_captures = nullptr; uint32_t max_lightmap_captures; RID lightmap_capture_buffer; diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h index c3039e2f7f..1b7709bedb 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h @@ -42,7 +42,7 @@ private: static SceneShaderForwardClustered *singleton; public: - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; enum ShaderVersion { SHADER_VERSION_DEPTH_PASS, @@ -199,7 +199,7 @@ public: } struct MaterialData : public RendererRD::MaterialData { - ShaderData *shader_data; + ShaderData *shader_data = nullptr; RID uniform_set; uint64_t last_pass = 0; uint32_t index = 0; diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index 6162ca55af..0ddfe89eea 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -328,7 +328,7 @@ protected: uint32_t max_lightmaps; RID lightmap_buffer; - LightmapCaptureData *lightmap_captures; + LightmapCaptureData *lightmap_captures = nullptr; uint32_t max_lightmap_captures; RID lightmap_capture_buffer; diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h index 0f5017dba1..b89fe908d3 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h @@ -40,7 +40,7 @@ namespace RendererSceneRenderImplementation { class SceneShaderForwardMobile { private: static SceneShaderForwardMobile *singleton; - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; public: enum ShaderVersion { @@ -163,7 +163,7 @@ public: } struct MaterialData : public RendererRD::MaterialData { - ShaderData *shader_data; + ShaderData *shader_data = nullptr; RID uniform_set; uint64_t last_pass = 0; uint32_t index = 0; diff --git a/servers/rendering/renderer_rd/pipeline_cache_rd.h b/servers/rendering/renderer_rd/pipeline_cache_rd.h index 8d82480b38..1e80381d88 100644 --- a/servers/rendering/renderer_rd/pipeline_cache_rd.h +++ b/servers/rendering/renderer_rd/pipeline_cache_rd.h @@ -57,7 +57,7 @@ class PipelineCacheRD { RID pipeline; }; - Version *versions; + Version *versions = nullptr; uint32_t version_count; RID _generate_version(RD::VertexFormatID p_vertex_format_id, RD::FramebufferFormatID p_framebuffer_format_id, bool p_wireframe, uint32_t p_render_pass, uint32_t p_bool_specializations = 0); diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h index b33ee3fbfe..6448e1a664 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h @@ -41,7 +41,7 @@ #include "servers/rendering/shader_compiler.h" class RendererCanvasRenderRD : public RendererCanvasRender { - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; enum { BASE_UNIFORM_SET = 0, @@ -200,7 +200,7 @@ class RendererCanvasRenderRD : public RendererCanvasRender { } struct CanvasMaterialData : public RendererRD::MaterialData { - CanvasShaderData *shader_data; + CanvasShaderData *shader_data = nullptr; RID uniform_set; virtual void set_render_priority(int p_priority) {} @@ -361,7 +361,7 @@ class RendererCanvasRenderRD : public RendererCanvasRender { uint32_t pad2; }; - LightUniform *light_uniforms; + LightUniform *light_uniforms = nullptr; RID lights_uniform_buffer; RID canvas_state_buffer; diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.h b/servers/rendering/renderer_rd/renderer_compositor_rd.h index f8bcd81fd7..542cff0159 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.h +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.h @@ -48,15 +48,15 @@ class RendererCompositorRD : public RendererCompositor { protected: - UniformSetCacheRD *uniform_set_cache; - RendererCanvasRenderRD *canvas; + UniformSetCacheRD *uniform_set_cache = nullptr; + RendererCanvasRenderRD *canvas = nullptr; RendererRD::CanvasTextureStorage *canvas_texture_storage; RendererRD::MaterialStorage *material_storage; RendererRD::MeshStorage *mesh_storage; RendererRD::TextureStorage *texture_storage; RendererRD::DecalAtlasStorage *decal_atlas_storage; - RendererStorageRD *storage; - RendererSceneRenderRD *scene; + RendererStorageRD *storage = nullptr; + RendererSceneRenderRD *scene = nullptr; enum BlitMode { BLIT_MODE_NORMAL, diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h index d51b1bf691..ed60bc4362 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h @@ -55,7 +55,7 @@ class RendererSceneRenderRD; class RendererSceneGIRD { private: - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; /* VOXEL_GI INSTANCE */ @@ -331,8 +331,8 @@ public: struct VoxelGIInstance { // access to our containers - RendererStorageRD *storage; - RendererSceneGIRD *gi; + RendererStorageRD *storage = nullptr; + RendererSceneGIRD *gi = nullptr; RID probe; RID texture; @@ -455,8 +455,8 @@ public: }; // access to our containers - RendererStorageRD *storage; - RendererSceneGIRD *gi; + RendererStorageRD *storage = nullptr; + RendererSceneGIRD *gi = nullptr; // used for rendering (voxelization) RID render_albedo; diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h index 77c0437e83..b2c8daffb1 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -92,7 +92,7 @@ class RendererSceneRenderRD : public RendererSceneRender { friend RendererSceneGIRD; protected: - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; double time; double time_step = 0; @@ -314,10 +314,10 @@ private: float shadows_quality_radius = 1.0; float directional_shadow_quality_radius = 1.0; - float *directional_penumbra_shadow_kernel; - float *directional_soft_shadow_kernel; - float *penumbra_shadow_kernel; - float *soft_shadow_kernel; + float *directional_penumbra_shadow_kernel = nullptr; + float *directional_soft_shadow_kernel = nullptr; + float *penumbra_shadow_kernel = nullptr; + float *soft_shadow_kernel = nullptr; int directional_penumbra_shadow_samples = 0; int directional_soft_shadow_samples = 0; int penumbra_shadow_samples = 0; @@ -705,27 +705,27 @@ private: template <class T> struct InstanceSort { float depth; - T *instance; + T *instance = nullptr; bool operator<(const InstanceSort &p_sort) const { return depth < p_sort.depth; } }; - ReflectionData *reflections; + ReflectionData *reflections = nullptr; InstanceSort<ReflectionProbeInstance> *reflection_sort; uint32_t max_reflections; RID reflection_buffer; uint32_t max_reflection_probes_per_instance; uint32_t reflection_count = 0; - DecalData *decals; + DecalData *decals = nullptr; InstanceSort<DecalInstance> *decal_sort; uint32_t max_decals; RID decal_buffer; uint32_t decal_count; - LightData *omni_lights; - LightData *spot_lights; + LightData *omni_lights = nullptr; + LightData *spot_lights = nullptr; InstanceSort<LightInstance> *omni_light_sort; InstanceSort<LightInstance> *spot_light_sort; @@ -735,7 +735,7 @@ private: uint32_t omni_light_count = 0; uint32_t spot_light_count = 0; - DirectionalLightData *directional_lights; + DirectionalLightData *directional_lights = nullptr; uint32_t max_directional_lights; RID directional_light_buffer; @@ -938,7 +938,7 @@ private: }; struct FogMaterialData : public RendererRD::MaterialData { - FogShaderData *shader_data; + FogShaderData *shader_data = nullptr; RID uniform_set; bool uniform_set_updated; diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.h b/servers/rendering/renderer_rd/renderer_scene_sky_rd.h index 7a3e545add..010e2178a9 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.h @@ -63,7 +63,7 @@ public: }; private: - RendererStorageRD *storage; + RendererStorageRD *storage = nullptr; RD::DataFormat texture_format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT; RID index_buffer; @@ -162,8 +162,8 @@ public: UBO ubo; - SkyDirectionalLightData *directional_lights; - SkyDirectionalLightData *last_frame_directional_lights; + SkyDirectionalLightData *directional_lights = nullptr; + SkyDirectionalLightData *last_frame_directional_lights = nullptr; uint32_t max_directional_lights; uint32_t last_frame_directional_light_count; RID directional_light_buffer; @@ -228,7 +228,7 @@ public: } sky_shader; struct SkyMaterialData : public RendererRD::MaterialData { - SkyShaderData *shader_data; + SkyShaderData *shader_data = nullptr; RID uniform_set; bool uniform_set_updated; @@ -262,7 +262,7 @@ public: Sky *dirty_list = nullptr; //State to track when radiance cubemap needs updating - SkyMaterialData *prev_material; + SkyMaterialData *prev_material = nullptr; Vector3 prev_position; float prev_time; diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.h b/servers/rendering/renderer_rd/storage_rd/material_storage.h index 69b7b702b0..270d9f0982 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.h @@ -73,7 +73,7 @@ typedef ShaderData *(*ShaderDataRequestFunction)(); struct Material; struct Shader { - ShaderData *data; + ShaderData *data = nullptr; String code; ShaderType type; Map<StringName, Map<int, RID>> default_texture_parameter; @@ -177,9 +177,9 @@ struct GlobalVariables { List<RID> materials_using_texture; RID buffer; - Value *buffer_values; - ValueUsage *buffer_usage; - bool *buffer_dirty_regions; + Value *buffer_values = nullptr; + ValueUsage *buffer_usage = nullptr; + bool *buffer_dirty_regions = nullptr; uint32_t buffer_dirty_region_count = 0; uint32_t buffer_size; diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index 8806a2a358..e8da8ad563 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -149,7 +149,7 @@ struct Mesh { /* Mesh Instance */ struct MeshInstance { - Mesh *mesh; + Mesh *mesh = nullptr; RID skeleton; struct Surface { RID vertex_buffer; diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index 2112118673..5f71250ced 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -47,7 +47,7 @@ class RendererSceneCull : public RendererScene { public: - RendererSceneRender *scene_render; + RendererSceneRender *scene_render = nullptr; enum { SDFGI_MAX_CASCADES = 8, @@ -115,7 +115,7 @@ public: /* VISIBILITY NOTIFIER API */ - RendererSceneOcclusionCull *dummy_occlusion_culling; + RendererSceneOcclusionCull *dummy_occlusion_culling = nullptr; /* SCENARIO API */ @@ -273,7 +273,7 @@ public: union { uint64_t instance_data_rid; RendererSceneRender::GeometryInstance *instance_geometry; - InstanceVisibilityNotifierData *visibility_notifier; + InstanceVisibilityNotifierData *visibility_notifier = nullptr; }; Instance *instance = nullptr; int32_t parent_array_index = -1; @@ -365,8 +365,8 @@ public: /* INSTANCING API */ struct InstancePair { - Instance *a; - Instance *b; + Instance *a = nullptr; + Instance *b = nullptr; SelfList<InstancePair> list_a; SelfList<InstancePair> list_b; InstancePair() : @@ -409,7 +409,7 @@ public: bool dynamic_gi : 2; //same above for dynamic objects bool redraw_if_visible : 4; - Instance *lightmap; + Instance *lightmap = nullptr; Rect2 lightmap_uv_scale; int lightmap_slice_index; uint32_t lightmap_cull_index; @@ -455,7 +455,7 @@ public: SelfList<Instance> update_item; - AABB *custom_aabb; // <Zylann> would using aabb directly with a bool be better? + AABB *custom_aabb = nullptr; // <Zylann> would using aabb directly with a bool be better? float extra_margin; ObjectID object_id; @@ -465,7 +465,7 @@ public: uint64_t version; // changes to this, and changes to base increase version - InstanceBaseData *base_data; + InstanceBaseData *base_data = nullptr; SelfList<InstancePair>::List pairs; uint64_t pair_check; @@ -597,7 +597,7 @@ public: }; struct InstanceReflectionProbeData : public InstanceBaseData { - Instance *owner; + Instance *owner = nullptr; Set<Instance *> geometries; @@ -613,7 +613,7 @@ public: }; struct InstanceDecalData : public InstanceBaseData { - Instance *owner; + Instance *owner = nullptr; RID instance; Set<Instance *> geometries; @@ -656,7 +656,7 @@ public: Set<Instance *> geometries; - Instance *baked_light; + Instance *baked_light = nullptr; RS::LightBakeMode bake_mode; uint32_t max_sdfgi_cascade = 2; @@ -671,7 +671,7 @@ public: }; struct InstanceVoxelGIData : public InstanceBaseData { - Instance *owner; + Instance *owner = nullptr; Set<Instance *> geometries; Set<Instance *> dynamic_geometries; @@ -1023,7 +1023,7 @@ public: struct VisibilityCullData { uint64_t viewport_mask; - Scenario *scenario; + Scenario *scenario = nullptr; Vector3 camera_position; uint32_t cull_offset; uint32_t cull_count; @@ -1035,12 +1035,12 @@ public: _FORCE_INLINE_ int _visibility_range_check(InstanceVisibilityData &r_vis_data, const Vector3 &p_camera_pos, uint64_t p_viewport_mask); struct CullData { - Cull *cull; - Scenario *scenario; + Cull *cull = nullptr; + Scenario *scenario = nullptr; RID shadow_atlas; Transform3D cam_transform; uint32_t visible_layers; - Instance *render_reflection_probe; + Instance *render_reflection_probe = nullptr; const RendererSceneOcclusionCull::HZBuffer *occlusion_buffer; const CameraMatrix *camera_matrix; uint64_t visibility_viewport_mask; diff --git a/servers/rendering/renderer_scene_render.h b/servers/rendering/renderer_scene_render.h index 5f9c4bb816..0b8734e68c 100644 --- a/servers/rendering/renderer_scene_render.h +++ b/servers/rendering/renderer_scene_render.h @@ -223,7 +223,7 @@ public: struct RenderSDFGIUpdateData { bool update_static = false; uint32_t static_cascade_count; - uint32_t *static_cascade_indices; + uint32_t *static_cascade_indices = nullptr; PagedArray<RID> *static_positional_lights; const Vector<RID> *directional_lights; diff --git a/servers/rendering/renderer_viewport.h b/servers/rendering/renderer_viewport.h index 2245d9a216..b6e44e8436 100644 --- a/servers/rendering/renderer_viewport.h +++ b/servers/rendering/renderer_viewport.h @@ -129,7 +129,7 @@ public: }; struct CanvasData { - CanvasBase *canvas; + CanvasBase *canvas = nullptr; Transform2D transform; int layer; int sublayer; diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index e5ac14a7db..25ec8760af 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -386,7 +386,7 @@ public: return node; } - Node *nodes; + Node *nodes = nullptr; struct OperatorNode : public Node { DataType return_cache = TYPE_VOID; @@ -615,20 +615,20 @@ public: DataType type; StringName type_str; DataPrecision precision; - ConstantNode *initializer; + ConstantNode *initializer = nullptr; int array_size; }; struct Function { StringName name; - FunctionNode *function; + FunctionNode *function = nullptr; Set<StringName> uses_function; bool callable; }; struct Struct { StringName name; - StructNode *shader_struct; + StructNode *shader_struct = nullptr; }; struct Varying { @@ -715,7 +715,7 @@ public: bool is_op; union { Operator op; - Node *node; + Node *node = nullptr; }; }; @@ -973,7 +973,7 @@ private: Token _make_token(TokenType p_type, const StringName &p_text = StringName()); Token _get_token(); - ShaderNode *shader; + ShaderNode *shader = nullptr; enum IdentifierType { IDENTIFIER_FUNCTION, @@ -1021,7 +1021,7 @@ private: CompletionType completion_type; int completion_line; - BlockNode *completion_block; + BlockNode *completion_block = nullptr; DataType completion_base; bool completion_base_array; SubClassTag completion_class; diff --git a/tests/core/math/test_geometry_3d.h b/tests/core/math/test_geometry_3d.h index 1b8d2eee34..99a4ef2d46 100644 --- a/tests/core/math/test_geometry_3d.h +++ b/tests/core/math/test_geometry_3d.h @@ -288,7 +288,7 @@ TEST_CASE("[Geometry3D] Is Point in Projected Triangle") { TEST_CASE("[Geometry3D] Does Ray Intersect Triangle") { struct Case { Vector3 from, direction, v_1, v_2, v_3; - Vector3 *result; + Vector3 *result = nullptr; bool want; Case(){}; Case(Vector3 p_from, Vector3 p_direction, Vector3 p_v_1, Vector3 p_v_2, Vector3 p_v_3, bool p_want) : @@ -390,7 +390,7 @@ TEST_CASE("[Geometry3D] Triangle and Box Overlap") { struct Case { Vector3 box_centre; Vector3 box_half_size; - Vector3 *tri_verts; + Vector3 *tri_verts = nullptr; bool want; Case(){}; Case(Vector3 p_centre, Vector3 p_half_size, Vector3 *p_verts, bool p_want) : |