summaryrefslogtreecommitdiff
path: root/modules/noise
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-09-29 12:53:28 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-10-07 11:32:33 +0300
commit0103af1ddda6a2aa31227965141dd7d3a513e081 (patch)
treeb0965bb65919bc1495ee02204a91e5ed3a9b56a7 /modules/noise
parent5b7f62af55b7f322192f95258d825b163cbf9dc1 (diff)
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4.
Diffstat (limited to 'modules/noise')
-rw-r--r--modules/noise/noise_texture_2d.cpp18
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;
}