summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-23 19:44:19 +0200
committerGitHub <noreply@github.com>2021-09-23 19:44:19 +0200
commit01f692c173b9926ae764a4a4c9a54c266a21272b (patch)
tree96323b3b6cd43dbbec3a74a9c09762c911e9dc32 /scene/2d
parent2ec1152b0fda21f2050b30e49630659697a5e68b (diff)
parentcc51b045da4bf40722d347c6306b2764a1c9d813 (diff)
Merge pull request #52790 from AnilBK/dont-construct
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/cpu_particles_2d.cpp2
-rw-r--r--scene/2d/tile_map.cpp3
2 files changed, 2 insertions, 3 deletions
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<Vector2> 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<Vector2> uvs;
AtlasTexture *atlas_texure = Object::cast_to<AtlasTexture>(*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<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);