summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-03-16 18:18:24 -0400
committerGravatar bunnei2015-03-16 18:18:24 -0400
commit968c418fa537b8843bd220379b876cc525b31378 (patch)
tree6583aea801328cfc9ff3a33d58ac72d4c060517e /src
parentMerge pull request #663 from lioncash/ticks (diff)
parentVideoCore: Add static_cast around expressions where the compiler doesn’t de... (diff)
downloadyuzu-968c418fa537b8843bd220379b876cc525b31378.tar.gz
yuzu-968c418fa537b8843bd220379b876cc525b31378.tar.xz
yuzu-968c418fa537b8843bd220379b876cc525b31378.zip
Merge pull request #662 from linkmauve/video_core-warnings
Add static_cast around expressions where the compiler doesn’t deduce the right type
Diffstat (limited to 'src')
-rw-r--r--src/video_core/color.h2
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/color.h b/src/video_core/color.h
index 14ade74f2..43d635e2c 100644
--- a/src/video_core/color.h
+++ b/src/video_core/color.h
@@ -124,7 +124,7 @@ inline u32 DecodeD24(const u8* bytes) {
124 * @return Resulting values stored as a Math::Vec2 124 * @return Resulting values stored as a Math::Vec2
125 */ 125 */
126inline const Math::Vec2<u32> DecodeD24S8(const u8* bytes) { 126inline const Math::Vec2<u32> DecodeD24S8(const u8* bytes) {
127 return { (bytes[2] << 16) | (bytes[1] << 8) | bytes[0], bytes[3] }; 127 return { static_cast<u32>((bytes[2] << 16) | (bytes[1] << 8) | bytes[0]), bytes[3] };
128} 128}
129 129
130/** 130/**
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 745c4f4ed..83982b4f2 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -322,7 +322,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
322 case Regs::TextureFormat::RGBA8: 322 case Regs::TextureFormat::RGBA8:
323 { 323 {
324 auto res = Color::DecodeRGBA8(source + VideoCore::GetMortonOffset(x, y, 4)); 324 auto res = Color::DecodeRGBA8(source + VideoCore::GetMortonOffset(x, y, 4));
325 return { res.r(), res.g(), res.b(), disable_alpha ? 255 : res.a() }; 325 return { res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a()) };
326 } 326 }
327 327
328 case Regs::TextureFormat::RGB8: 328 case Regs::TextureFormat::RGB8:
@@ -334,7 +334,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
334 case Regs::TextureFormat::RGB5A1: 334 case Regs::TextureFormat::RGB5A1:
335 { 335 {
336 auto res = Color::DecodeRGB5A1(source + VideoCore::GetMortonOffset(x, y, 2)); 336 auto res = Color::DecodeRGB5A1(source + VideoCore::GetMortonOffset(x, y, 2));
337 return { res.r(), res.g(), res.b(), disable_alpha ? 255 : res.a() }; 337 return { res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a()) };
338 } 338 }
339 339
340 case Regs::TextureFormat::RGB565: 340 case Regs::TextureFormat::RGB565:
@@ -346,7 +346,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
346 case Regs::TextureFormat::RGBA4: 346 case Regs::TextureFormat::RGBA4:
347 { 347 {
348 auto res = Color::DecodeRGBA4(source + VideoCore::GetMortonOffset(x, y, 2)); 348 auto res = Color::DecodeRGBA4(source + VideoCore::GetMortonOffset(x, y, 2));
349 return { res.r(), res.g(), res.b(), disable_alpha ? 255 : res.a() }; 349 return { res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a()) };
350 } 350 }
351 351
352 case Regs::TextureFormat::IA8: 352 case Regs::TextureFormat::IA8: