diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 22:24:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 22:24:58 +0100 |
commit | 8107fc98b6ceae749b3c10e6f0432e904961867b (patch) | |
tree | 6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /core/variant_op.cpp | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) | |
parent | 8d51618949d5ea8a94e0f504401e8f852a393968 (diff) |
Merge pull request #25853 from marxin/fix-25316-wshadow-local
Add -Wshadow=local to warnings and fix reported issues (#25316).
Diffstat (limited to 'core/variant_op.cpp')
-rw-r--r-- | core/variant_op.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 93654d3389..26851e4c23 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3496,15 +3496,15 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst) case COLOR: { const Color *ca = reinterpret_cast<const Color *>(a._data._mem); const Color *cb = reinterpret_cast<const Color *>(b._data._mem); - float r = ca->r + cb->r * c; - float g = ca->g + cb->g * c; - float b = ca->b + cb->b * c; - float a = ca->a + cb->a * c; - r = r > 1.0 ? 1.0 : r; - g = g > 1.0 ? 1.0 : g; - b = b > 1.0 ? 1.0 : b; - a = a > 1.0 ? 1.0 : a; - r_dst = Color(r, g, b, a); + float new_r = ca->r + cb->r * c; + float new_g = ca->g + cb->g * c; + float new_b = ca->b + cb->b * c; + float new_a = ca->a + cb->a * c; + new_r = new_r > 1.0 ? 1.0 : new_r; + new_g = new_g > 1.0 ? 1.0 : new_g; + new_b = new_b > 1.0 ? 1.0 : new_b; + new_a = new_a > 1.0 ? 1.0 : new_a; + r_dst = Color(new_r, new_g, new_b, new_a); } return; default: { |