diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2017-08-15 23:33:19 +0200 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2017-08-15 23:41:23 +0200 |
commit | 3bb5abbc35b6690768f32db7becf874febc25713 (patch) | |
tree | 0fbf0454b22009291426a829e709759cc2f2a7bb /scene/2d/tile_map.h | |
parent | a4f9c95169579d650d6189d5034fb417bcc518af (diff) |
Let TileMap apply its material
So when a material is set, every tile will be rendered with that. Quadrants will not be recreated, so a `CanvasItem` will exist per material per quadrant regardless a global material is set.
This makes also __Use parent material__ work for `TileMap`s.
Closes #9996.
Diffstat (limited to 'scene/2d/tile_map.h')
-rw-r--r-- | scene/2d/tile_map.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 082e9d1018..f96c14cd9e 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -183,6 +183,9 @@ private: void _update_quadrant_transform(); void _recompute_rect_cache(); + void _update_all_items_material_state(); + _FORCE_INLINE_ void _update_item_material_state(const RID &p_canvas_item); + _FORCE_INLINE_ int _get_quadrant_size() const; void _set_tile_data(const PoolVector<int> &p_data); @@ -278,6 +281,10 @@ public: virtual void set_light_mask(int p_light_mask); + virtual void set_material(const Ref<Material> &p_material); + + virtual void set_use_parent_material(bool p_use_parent_material); + void clear(); TileMap(); |