diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-10-07 11:34:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 11:34:11 +0200 |
commit | 58ca3031419cacb35c530cebe68e87a4c27dde06 (patch) | |
tree | b0965bb65919bc1495ee02204a91e5ed3a9b56a7 /modules/noise/noise_texture_2d.cpp | |
parent | 5b7f62af55b7f322192f95258d825b163cbf9dc1 (diff) | |
parent | 0103af1ddda6a2aa31227965141dd7d3a513e081 (diff) |
Merge pull request #66808 from bruvzg/msvc_warn
Diffstat (limited to 'modules/noise/noise_texture_2d.cpp')
-rw-r--r-- | modules/noise/noise_texture_2d.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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<Image> NoiseTexture2D::_generate_texture() { return Ref<Image>(); } - Ref<Image> image; + Ref<Image> 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<Image> NoiseTexture2D::_modulate_with_gradient(Ref<Image> p_image, Ref<Gradient> p_gradient) { @@ -206,8 +206,8 @@ void NoiseTexture2D::_update_texture() { } } else { - Ref<Image> image = _generate_texture(); - _set_texture_image(image); + Ref<Image> new_image = _generate_texture(); + _set_texture_image(new_image); } update_queued = false; } |