diff options
| author | 2019-11-13 02:16:22 -0300 | |
|---|---|---|
| committer | 2019-11-13 02:16:22 -0300 | |
| commit | cf770a68a528cdb7f3a5483f6d17eeb924e37b7e (patch) | |
| tree | 6406933e26e9fbe255a04b4c0810d21b05815494 /src/video_core/textures/texture.h | |
| parent | Update CONTRIBUTING.md (diff) | |
| parent | video_core: Enable sign conversion warnings (diff) | |
| download | yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.gz yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.xz yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.zip | |
Merge pull request #3084 from ReinUsesLisp/cast-warnings
video_core: Treat implicit conversions as errors
Diffstat (limited to 'src/video_core/textures/texture.h')
| -rw-r--r-- | src/video_core/textures/texture.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 27c8ce975..8e82c6748 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -342,13 +342,14 @@ struct TSCEntry { | |||
| 342 | float GetLodBias() const { | 342 | float GetLodBias() const { |
| 343 | // Sign extend the 13-bit value. | 343 | // Sign extend the 13-bit value. |
| 344 | constexpr u32 mask = 1U << (13 - 1); | 344 | constexpr u32 mask = 1U << (13 - 1); |
| 345 | return static_cast<s32>((mip_lod_bias ^ mask) - mask) / 256.0f; | 345 | return static_cast<float>(static_cast<s32>((mip_lod_bias ^ mask) - mask)) / 256.0f; |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | std::array<float, 4> GetBorderColor() const { | 348 | std::array<float, 4> GetBorderColor() const { |
| 349 | if (srgb_conversion) { | 349 | if (srgb_conversion) { |
| 350 | return {srgb_border_color_r / 255.0f, srgb_border_color_g / 255.0f, | 350 | return {static_cast<float>(srgb_border_color_r) / 255.0f, |
| 351 | srgb_border_color_b / 255.0f, border_color[3]}; | 351 | static_cast<float>(srgb_border_color_g) / 255.0f, |
| 352 | static_cast<float>(srgb_border_color_b) / 255.0f, border_color[3]}; | ||
| 352 | } | 353 | } |
| 353 | return border_color; | 354 | return border_color; |
| 354 | } | 355 | } |