summaryrefslogtreecommitdiff
path: root/scene/main/canvas_item.h
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2020-12-21 00:24:36 +0100
committerGitHub <noreply@github.com>2020-12-21 00:24:36 +0100
commit153c132a7e7e7cea00c420b93257f3ebd56cf2dc (patch)
treea14a01cd3a431673b819165b47179e82c78b0386 /scene/main/canvas_item.h
parent5f7c88ab4eb7d05e1c83ab1773cc184d376dfcc0 (diff)
parent31cb04fbdda17b1321504faa0f1e2b2c510be7e5 (diff)
Merge pull request #44300 from KoBeWi/🧹🧹
Move initialization of some classes to headers
Diffstat (limited to 'scene/main/canvas_item.h')
-rw-r--r--scene/main/canvas_item.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h
index 3cde6b69c1..34268c1a78 100644
--- a/scene/main/canvas_item.h
+++ b/scene/main/canvas_item.h
@@ -73,7 +73,7 @@ private:
uint32_t invalid_key : 1;
};
- uint32_t key;
+ uint32_t key = 0;
bool operator<(const MaterialKey &p_key) const {
return key < p_key.key;
@@ -114,10 +114,11 @@ private:
_FORCE_INLINE_ void _queue_shader_change();
_FORCE_INLINE_ bool _is_shader_dirty() const;
- BlendMode blend_mode;
- LightMode light_mode;
- bool particles_animation;
+ BlendMode blend_mode = BLEND_MODE_MIX;
+ LightMode light_mode = LIGHT_MODE_NORMAL;
+ bool particles_animation = false;
+ // Initialized in the constructor.
int particles_anim_h_frames;
int particles_anim_v_frames;
bool particles_anim_loop;
@@ -188,39 +189,38 @@ private:
RID canvas_item;
String group;
- CanvasLayer *canvas_layer;
+ CanvasLayer *canvas_layer = nullptr;
- Color modulate;
- Color self_modulate;
+ Color modulate = Color(1, 1, 1, 1);
+ Color self_modulate = Color(1, 1, 1, 1);
List<CanvasItem *> children_items;
- List<CanvasItem *>::Element *C;
-
- int light_mask;
-
- Window *window;
- bool first_draw;
- bool visible;
- bool clip_children;
- bool pending_update;
- bool top_level;
- bool drawing;
- bool block_transform_notify;
- bool behind;
- bool use_parent_material;
- bool notify_local_transform;
- bool notify_transform;
-
- RS::CanvasItemTextureFilter texture_filter_cache;
- RS::CanvasItemTextureRepeat texture_repeat_cache;
-
- TextureFilter texture_filter;
- TextureRepeat texture_repeat;
+ List<CanvasItem *>::Element *C = nullptr;
+
+ int light_mask = 1;
+
+ Window *window = nullptr;
+ bool first_draw = false;
+ bool visible = true;
+ bool clip_children = false;
+ bool pending_update = false;
+ bool top_level = false;
+ bool drawing = false;
+ bool block_transform_notify = false;
+ bool behind = false;
+ bool use_parent_material = false;
+ bool notify_local_transform = false;
+ bool notify_transform = false;
+
+ RS::CanvasItemTextureFilter texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
+ RS::CanvasItemTextureRepeat texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
+ TextureFilter texture_filter = TEXTURE_FILTER_PARENT_NODE;
+ TextureRepeat texture_repeat = TEXTURE_REPEAT_PARENT_NODE;
Ref<Material> material;
mutable Transform2D global_transform;
- mutable bool global_invalid;
+ mutable bool global_invalid = true;
void _top_level_raise_self();