summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-12 08:38:46 +0200
committerGitHub <noreply@github.com>2021-10-12 08:38:46 +0200
commit0fd50ff21777e74258ba5a38e9c32b27cf0784b2 (patch)
treef8796d2d0081664e729762194ea194d64f8ce79c /scene
parent34624068583e472cc69c6864be360821265e764b (diff)
parent7e51e4cb84aeb3c191289752e0e6b92facd8f7f6 (diff)
Merge pull request #52736 from aaronfranke/lgtm-mult
Fix some LGTM errors of "Multiplication result converted to larger type"
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/parallax_layer.cpp4
-rw-r--r--scene/3d/gpu_particles_collision_3d.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 67e35cc7a3..797e2e59cb 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -123,12 +123,12 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, real_t p_s
Point2 new_ofs = (screen_offset + (p_offset - screen_offset) * motion_scale) + motion_offset * p_scale + orig_offset * p_scale;
if (mirroring.x) {
- double den = mirroring.x * p_scale;
+ real_t den = mirroring.x * p_scale;
new_ofs.x -= den * ceil(new_ofs.x / den);
}
if (mirroring.y) {
- double den = mirroring.y * p_scale;
+ real_t den = mirroring.y * p_scale;
new_ofs.y -= den * ceil(new_ofs.y / den);
}
diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp
index 4fa34615bf..9127168c58 100644
--- a/scene/3d/gpu_particles_collision_3d.cpp
+++ b/scene/3d/gpu_particles_collision_3d.cpp
@@ -475,7 +475,7 @@ Ref<Image> GPUParticlesCollisionSDF::bake() {
_create_bvh(bvh, face_pos.ptr(), face_pos.size(), faces.ptr(), th);
Vector<uint8_t> data;
- data.resize(sdf_size.z * sdf_size.y * sdf_size.x * sizeof(float));
+ data.resize(sdf_size.z * sdf_size.y * sdf_size.x * (int)sizeof(float));
if (bake_step_function) {
bake_step_function(0, "Baking SDF");