diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-08 09:31:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 09:31:08 +0100 |
commit | cea42faa77d72cdbea8ab7c38936e7c8722900d0 (patch) | |
tree | 3c7f54d3b3e6d355a2ffb14933e0b5461478b224 /scene/2d/skeleton_2d.h | |
parent | 57e2822a05c29db3980ad243c37a34acf6c4d14b (diff) | |
parent | 003bb8e1a8c9bb81e3cb0733b3f0d569b1518881 (diff) |
Merge pull request #44630 from qarmin/cppcheck_scene_1
Initialize class variables with default values in scene/ [1/2]
Diffstat (limited to 'scene/2d/skeleton_2d.h')
-rw-r--r-- | scene/2d/skeleton_2d.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/2d/skeleton_2d.h b/scene/2d/skeleton_2d.h index 36b9e1b339..80ca8c80ac 100644 --- a/scene/2d/skeleton_2d.h +++ b/scene/2d/skeleton_2d.h @@ -43,12 +43,12 @@ class Bone2D : public Node2D { friend class AnimatedValuesBackup; #endif - Bone2D *parent_bone; - Skeleton2D *skeleton; + Bone2D *parent_bone = nullptr; + Skeleton2D *skeleton = nullptr; Transform2D rest; - float default_length; + float default_length = 16.0; - int skeleton_index; + int skeleton_index = -1; protected: void _notification(int p_what); @@ -82,19 +82,19 @@ class Skeleton2D : public Node2D { bool operator<(const Bone &p_bone) const { return p_bone.bone->is_greater_than(bone); } - Bone2D *bone; - int parent_index; + Bone2D *bone = nullptr; + int parent_index = 0; Transform2D accum_transform; Transform2D rest_inverse; }; Vector<Bone> bones; - bool bone_setup_dirty; + bool bone_setup_dirty = true; void _make_bone_setup_dirty(); void _update_bone_setup(); - bool transform_dirty; + bool transform_dirty = true; void _make_transform_dirty(); void _update_transform(); |