From cc51b045da4bf40722d347c6306b2764a1c9d813 Mon Sep 17 00:00:00 2001 From: Anilforextra Date: Thu, 23 Sep 2021 20:43:43 +0545 Subject: Construct values only when necessary. --- scene/2d/cpu_particles_2d.cpp | 2 +- scene/2d/tile_map.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scene/2d') diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index b836497627..cf2632f380 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -155,7 +155,7 @@ void CPUParticles2D::_update_mesh_texture() { Vector vertices; vertices.push_back(-tex_size * 0.5); vertices.push_back(-tex_size * 0.5 + Vector2(tex_size.x, 0)); - vertices.push_back(-tex_size * 0.5 + Vector2(tex_size.x, tex_size.y)); + vertices.push_back(-tex_size * 0.5 + tex_size); vertices.push_back(-tex_size * 0.5 + Vector2(0, tex_size.y)); Vector uvs; AtlasTexture *atlas_texure = Object::cast_to(*texture); 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(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); -- cgit v1.2.3