summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2016-11-28 15:21:35 +0100
committerGitHub <noreply@github.com>2016-11-28 15:21:35 +0100
commit2cf4c5e173dc80faa4a5447030bf0a01797c411b (patch)
treec3c8e571f3593a959cbdc633eafcc00699021a60 /scene
parent39fede4b17308226f4e18217eee90374bfef226e (diff)
parente07dd9ab324ea376cda3f2a4e6f4b804dbc52042 (diff)
Merge pull request #7170 from Ovnuniarchos/TileMapBlendMode
TileMap now honors blending mode.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/canvas_item.h2
-rw-r--r--scene/2d/tile_map.cpp9
-rw-r--r--scene/2d/tile_map.h2
3 files changed, 12 insertions, 1 deletions
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 7849a66185..58397c1fb0 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -193,7 +193,7 @@ public:
void update();
- void set_blend_mode(BlendMode p_blend_mode);
+ virtual void set_blend_mode(BlendMode p_blend_mode);
BlendMode get_blend_mode() const;
virtual void set_light_mask(int p_light_mask);
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 1a4f88c30e..cc904e4d04 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -352,6 +352,7 @@ void TileMap::_update_dirty_quadrants() {
xform.set_origin( q.pos );
vs->canvas_item_set_transform( canvas_item, xform );
vs->canvas_item_set_light_mask(canvas_item,get_light_mask());
+ vs->canvas_item_set_blend_mode(canvas_item,VS::MaterialBlendMode(get_blend_mode()));
q.canvas_items.push_back(canvas_item);
@@ -1190,6 +1191,14 @@ void TileMap::set_light_mask(int p_light_mask) {
}
}
+void TileMap::set_blend_mode(BlendMode p_blend_mode) {
+
+ CanvasItem::set_blend_mode(p_blend_mode);
+ _recreate_quadrants();
+
+}
+
+
void TileMap::_bind_methods() {
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index b48fdde43f..7501d49aa5 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -255,6 +255,8 @@ public:
void set_occluder_light_mask(int p_mask);
int get_occluder_light_mask() const;
+ void set_blend_mode(BlendMode p_blend_mode);
+
virtual void set_light_mask(int p_light_mask);
void clear();