summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorPJB3005 <pieterjan.briers@gmail.com>2017-12-08 20:14:06 +0100
committerPJB3005 <pieterjan.briers@gmail.com>2017-12-08 20:14:06 +0100
commitcea5078ebe9b54ff3514fdae1cbeb1a17c808bae (patch)
tree67b58a63a2c6599bf3c3ffc8b9511a0af8d6810f /scene/2d
parent146bdf031d053d2af771622aa15f70ad04b0720a (diff)
Fixes TileMap occluder offsets.
This is NOT related to #14388! This fixes a graphical bug where the light occluders used by tilemaps weren't getting offset anymore, this they'd be positioned incorrectly. I tried on all 3 tilemap positioning modes and it seemed to work on every one.
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/tile_map.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index c0d0a6e011..609419cd44 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -513,16 +513,13 @@ void TileMap::_update_dirty_quadrants() {
}
Ref<OccluderPolygon2D> occluder;
- Vector2 occluder_ofs;
if (tile_set->tile_get_is_autotile(c.id)) {
occluder = tile_set->autotile_get_light_occluder(c.id, Vector2(c.autotile_coord_x, c.autotile_coord_y));
- occluder_ofs = tile_set->tile_get_occluder_offset(c.id);
} else {
occluder = tile_set->tile_get_light_occluder(c.id);
- occluder_ofs = Vector2();
}
if (occluder.is_valid()) {
-
+ Vector2 occluder_ofs = tile_set->tile_get_occluder_offset(c.id);
Transform2D xform;
xform.set_origin(offset.floor() + q.pos);
_fix_cell_transform(xform, c, occluder_ofs + center_ofs, s);