From ea3317d12ee81b078dc5b02c5096c7f75807243f Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 11 Mar 2024 20:53:45 +0100 Subject: [PATCH] Make use of the new randomize_start_time parameter of RenderingServer::canvas_item_add_texture_rect_animation() in LayeredTileMap. --- modules/layered_tile_map/layered_tile_map.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/layered_tile_map/layered_tile_map.cpp b/modules/layered_tile_map/layered_tile_map.cpp index 0d640d30a..765752af0 100644 --- a/modules/layered_tile_map/layered_tile_map.cpp +++ b/modules/layered_tile_map/layered_tile_map.cpp @@ -220,7 +220,9 @@ void LayeredTileMap::draw_tile(RID p_canvas_item, const Vector2 &p_position, con anim_data.push_back(d); } - RenderingServer::get_singleton()->canvas_item_add_texture_rect_animation(p_canvas_item, anim_data); + bool random_start_time = atlas_source->get_tile_animation_mode(p_atlas_coords) == LayeredTileSetAtlasSource::TILE_ANIMATION_MODE_RANDOM_START_TIMES; + + RenderingServer::get_singleton()->canvas_item_add_texture_rect_animation(p_canvas_item, anim_data, random_start_time); } } }