diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2020-12-21 00:24:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 00:24:36 +0100 |
commit | 153c132a7e7e7cea00c420b93257f3ebd56cf2dc (patch) | |
tree | a14a01cd3a431673b819165b47179e82c78b0386 /scene/main/node.h | |
parent | 5f7c88ab4eb7d05e1c83ab1773cc184d376dfcc0 (diff) | |
parent | 31cb04fbdda17b1321504faa0f1e2b2c510be7e5 (diff) |
Merge pull request #44300 from KoBeWi/🧹🧹
Move initialization of some classes to headers
Diffstat (limited to 'scene/main/node.h')
-rw-r--r-- | scene/main/node.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/scene/main/node.h b/scene/main/node.h index 024d036fd3..5c178d401c 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -90,54 +90,54 @@ private: HashMap<NodePath, int> editable_instances; - Node *parent; - Node *owner; - Vector<Node *> children; // list of children - int pos; - int depth; - int blocked; // safeguard that throws an error when attempting to modify the tree in a harmful way while being traversed. + Node *parent = nullptr; + Node *owner = nullptr; + Vector<Node *> children; + int pos = -1; + int depth = -1; + int blocked = 0; // Safeguard that throws an error when attempting to modify the tree in a harmful way while being traversed. StringName name; - SceneTree *tree; - bool inside_tree; - bool ready_notified; //this is a small hack, so if a node is added during _ready() to the tree, it correctly gets the _ready() notification - bool ready_first; + SceneTree *tree = nullptr; + bool inside_tree = false; + bool ready_notified = false; // This is a small hack, so if a node is added during _ready() to the tree, it correctly gets the _ready() notification. + bool ready_first = true; #ifdef TOOLS_ENABLED - NodePath import_path; //path used when imported, used by scene editors to keep tracking + NodePath import_path; // Path used when imported, used by scene editors to keep tracking. #endif - Viewport *viewport; + Viewport *viewport = nullptr; Map<StringName, GroupData> grouped; - List<Node *>::Element *OW; // owned element + List<Node *>::Element *OW = nullptr; // Owned element. List<Node *> owned; - PauseMode pause_mode; - Node *pause_owner; + PauseMode pause_mode = PAUSE_MODE_INHERIT; + Node *pause_owner = nullptr; - int network_master; + int network_master = 1; // Server by default. Vector<NetData> rpc_methods; Vector<NetData> rpc_properties; - // variables used to properly sort the node when processing, ignored otherwise - //should move all the stuff below to bits - bool physics_process; - bool idle_process; - int process_priority; + // Variables used to properly sort the node when processing, ignored otherwise. + // TODO: Should move all the stuff below to bits. + bool physics_process = false; + bool idle_process = false; + int process_priority = 0; - bool physics_process_internal; - bool idle_process_internal; + bool physics_process_internal = false; + bool idle_process_internal = false; - bool input; - bool unhandled_input; - bool unhandled_key_input; + bool input = false; + bool unhandled_input = false; + bool unhandled_key_input = false; - bool parent_owned; - bool in_constructor; - bool use_placeholder; + bool parent_owned = false; + bool in_constructor = true; + bool use_placeholder = false; - bool display_folded; + bool display_folded = false; - mutable NodePath *path_cache; + mutable NodePath *path_cache = nullptr; } data; |