From d8402627399e65f8a5ecf6cac7ddac02b5510967 Mon Sep 17 00:00:00 2001 From: Guilherme Felipe Date: Mon, 17 Dec 2018 10:03:50 -0200 Subject: [PATCH] Add z-index to ATLAS_TILE --- scene/2d/tile_map.cpp | 3 ++- scene/resources/tile_set.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 641cb161cae..ee76a900198 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -327,7 +327,8 @@ void TileMap::update_dirty_quadrants() { Ref mat = tile_set->tile_get_material(c.id); int z_index = tile_set->tile_get_z_index(c.id); - if (tile_set->tile_get_tile_mode(c.id) == TileSet::AUTO_TILE) { + if (tile_set->tile_get_tile_mode(c.id) == TileSet::AUTO_TILE || + tile_set->tile_get_tile_mode(c.id) == TileSet::ATLAS_TILE) { z_index += tile_set->autotile_get_z_index(c.id, Vector2(c.autotile_coord_x, c.autotile_coord_y)); } diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index c2c2c0ff328..8a24d4bab14 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -314,6 +314,7 @@ void TileSet::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile/spacing", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/occluder_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/navpoly_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "occluder_offset")); p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D"));