diff options
| author | Linktothepast <kostamarino@gmail.com> | 2015-09-28 16:50:35 +0300 |
|---|---|---|
| committer | Linktothepast <kostamarino@gmail.com> | 2015-09-28 16:50:35 +0300 |
| commit | 748be565b8df535ef558e74b38cd0f4d615f8a21 (patch) | |
| tree | b151efee0a87e99125f2401325a9bddecf84fc73 /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | cf17fccdd3093a1b8476b10183b1c4bde36da74d (diff) | |
| parent | ce493b897d6d3735c930a8465cc0c26bbe5feb86 (diff) | |
Merge remote-tracking branch 'dolphin-emu/master' into gameinis
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index c72fd0f8f0..edfd3d8852 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -336,12 +336,9 @@ void TransformColor(const InputVertexData *src, OutputVertexData *dst) LightColor(dst->mvPosition, dst->normal[0], i, colorchan, lightCol); } - int light_x = int(lightCol.x); - int light_y = int(lightCol.y); - int light_z = int(lightCol.z); - MathUtil::Clamp(&light_x, 0, 255); - MathUtil::Clamp(&light_y, 0, 255); - MathUtil::Clamp(&light_z, 0, 255); + int light_x = MathUtil::Clamp(static_cast<int>(lightCol.x), 0, 255); + int light_y = MathUtil::Clamp(static_cast<int>(lightCol.y), 0, 255); + int light_z = MathUtil::Clamp(static_cast<int>(lightCol.z), 0, 255); chancolor[1] = (matcolor[1] * (light_x + (light_x >> 7))) >> 8; chancolor[2] = (matcolor[2] * (light_y + (light_y >> 7))) >> 8; chancolor[3] = (matcolor[3] * (light_z + (light_z >> 7))) >> 8; @@ -373,8 +370,7 @@ void TransformColor(const InputVertexData *src, OutputVertexData *dst) LightAlpha(dst->mvPosition, dst->normal[0], i, alphachan, lightCol); } - int light_a = int(lightCol); - MathUtil::Clamp(&light_a, 0, 255); + int light_a = MathUtil::Clamp(static_cast<int>(lightCol), 0, 255); chancolor[0] = (matcolor[0] * (light_a + (light_a >> 7))) >> 8; } else |
