diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-09-29 12:53:28 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-10-07 11:32:33 +0300 |
commit | 0103af1ddda6a2aa31227965141dd7d3a513e081 (patch) | |
tree | b0965bb65919bc1495ee02204a91e5ed3a9b56a7 /modules/gltf/extensions | |
parent | 5b7f62af55b7f322192f95258d825b163cbf9dc1 (diff) |
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4.
Diffstat (limited to 'modules/gltf/extensions')
-rw-r--r-- | modules/gltf/extensions/gltf_light.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/gltf/extensions/gltf_light.cpp b/modules/gltf/extensions/gltf_light.cpp index 6923c765cb..d00bead61c 100644 --- a/modules/gltf/extensions/gltf_light.cpp +++ b/modules/gltf/extensions/gltf_light.cpp @@ -142,18 +142,17 @@ Light3D *GLTFLight::to_node() const { light->set_color(color); return light; } - const float range = CLAMP(this->range, 0, 4096); if (light_type == "point") { OmniLight3D *light = memnew(OmniLight3D); light->set_param(OmniLight3D::PARAM_ENERGY, intensity); - light->set_param(OmniLight3D::PARAM_RANGE, range); + light->set_param(OmniLight3D::PARAM_RANGE, CLAMP(range, 0, 4096)); light->set_color(color); return light; } if (light_type == "spot") { SpotLight3D *light = memnew(SpotLight3D); light->set_param(SpotLight3D::PARAM_ENERGY, intensity); - light->set_param(SpotLight3D::PARAM_RANGE, range); + light->set_param(SpotLight3D::PARAM_RANGE, CLAMP(range, 0, 4096)); light->set_param(SpotLight3D::PARAM_SPOT_ANGLE, Math::rad_to_deg(outer_cone_angle)); light->set_color(color); // Line of best fit derived from guessing, see https://www.desmos.com/calculator/biiflubp8b |