diff options
author | Anilforextra <anilforextra@gmail.com> | 2021-09-23 20:43:43 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2021-09-23 22:26:07 +0545 |
commit | cc51b045da4bf40722d347c6306b2764a1c9d813 (patch) | |
tree | 96323b3b6cd43dbbec3a74a9c09762c911e9dc32 /scene/2d/tile_map.cpp | |
parent | 2ec1152b0fda21f2050b30e49630659697a5e68b (diff) | |
download | redot-engine-cc51b045da4bf40722d347c6306b2764a1c9d813.tar.gz |
Construct values only when necessary.
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r-- | scene/2d/tile_map.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 40a3214967..03db9c0d32 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1037,8 +1037,7 @@ void TileMap::draw_tile(RID p_canvas_item, Vector2i p_position, const Ref<TileSe TileData *tile_data = Object::cast_to<TileData>(atlas_source->get_tile_data(p_atlas_coords, p_alternative_tile)); // Get the tile modulation. - Color modulate = tile_data->get_modulate(); - modulate = Color(modulate.r * p_modulation.r, modulate.g * p_modulation.g, modulate.b * p_modulation.b, modulate.a * p_modulation.a); + Color modulate = tile_data->get_modulate() * p_modulation; // Compute the offset. Vector2i tile_offset = atlas_source->get_tile_effective_texture_offset(p_atlas_coords, p_alternative_tile); |