From 0103af1ddda6a2aa31227965141dd7d3a513e081 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:53:28 +0300 Subject: Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. --- modules/noise/noise_texture_2d.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/noise') diff --git a/modules/noise/noise_texture_2d.cpp b/modules/noise/noise_texture_2d.cpp index 101a66371b..23d60c4866 100644 --- a/modules/noise/noise_texture_2d.cpp +++ b/modules/noise/noise_texture_2d.cpp @@ -152,24 +152,24 @@ Ref NoiseTexture2D::_generate_texture() { return Ref(); } - Ref image; + Ref new_image; if (seamless) { - image = ref_noise->get_seamless_image(size.x, size.y, invert, in_3d_space, seamless_blend_skirt); + new_image = ref_noise->get_seamless_image(size.x, size.y, invert, in_3d_space, seamless_blend_skirt); } else { - image = ref_noise->get_image(size.x, size.y, invert, in_3d_space); + new_image = ref_noise->get_image(size.x, size.y, invert, in_3d_space); } if (color_ramp.is_valid()) { - image = _modulate_with_gradient(image, color_ramp); + new_image = _modulate_with_gradient(new_image, color_ramp); } if (as_normal_map) { - image->bump_map_to_normal_map(bump_strength); + new_image->bump_map_to_normal_map(bump_strength); } if (generate_mipmaps) { - image->generate_mipmaps(); + new_image->generate_mipmaps(); } - return image; + return new_image; } Ref NoiseTexture2D::_modulate_with_gradient(Ref p_image, Ref p_gradient) { @@ -206,8 +206,8 @@ void NoiseTexture2D::_update_texture() { } } else { - Ref image = _generate_texture(); - _set_texture_image(image); + Ref new_image = _generate_texture(); + _set_texture_image(new_image); } update_queued = false; } -- cgit v1.2.3