diff options
| author | 2014-12-19 19:04:13 +0100 | |
|---|---|---|
| committer | 2014-12-20 18:06:55 +0100 | |
| commit | e4e9710d1863a1c503ad4274eb8e64fbfdaa2d76 (patch) | |
| tree | 7c75bbf4c95fc30ee173d085ba71cba404c7860e /src/video_core/rasterizer.cpp | |
| parent | Pica/DebugUtils: Make a number of variables static. (diff) | |
| download | yuzu-e4e9710d1863a1c503ad4274eb8e64fbfdaa2d76.tar.gz yuzu-e4e9710d1863a1c503ad4274eb8e64fbfdaa2d76.tar.xz yuzu-e4e9710d1863a1c503ad4274eb8e64fbfdaa2d76.zip | |
Pica/Rasterizer: Get rid of C-style casts.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index bd79e4413..bf9c36661 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -18,7 +18,7 @@ namespace Pica { | |||
| 18 | namespace Rasterizer { | 18 | namespace Rasterizer { |
| 19 | 19 | ||
| 20 | static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { | 20 | static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { |
| 21 | u32* color_buffer = (u32*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress())); | 21 | u32* color_buffer = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress()))); |
| 22 | u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b(); | 22 | u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b(); |
| 23 | 23 | ||
| 24 | // Assuming RGBA8 format until actual framebuffer format handling is implemented | 24 | // Assuming RGBA8 format until actual framebuffer format handling is implemented |
| @@ -26,14 +26,14 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static u32 GetDepth(int x, int y) { | 28 | static u32 GetDepth(int x, int y) { |
| 29 | u16* depth_buffer = (u16*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress())); | 29 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()))); |
| 30 | 30 | ||
| 31 | // Assuming 16-bit depth buffer format until actual format handling is implemented | 31 | // Assuming 16-bit depth buffer format until actual format handling is implemented |
| 32 | return *(depth_buffer + x + y * registers.framebuffer.GetWidth()); | 32 | return *(depth_buffer + x + y * registers.framebuffer.GetWidth()); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | static void SetDepth(int x, int y, u16 value) { | 35 | static void SetDepth(int x, int y, u16 value) { |
| 36 | u16* depth_buffer = (u16*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress())); | 36 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()))); |
| 37 | 37 | ||
| 38 | // Assuming 16-bit depth buffer format until actual format handling is implemented | 38 | // Assuming 16-bit depth buffer format until actual format handling is implemented |
| 39 | *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value; | 39 | *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value; |
| @@ -208,7 +208,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, | |||
| 208 | auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); | 208 | auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); |
| 209 | 209 | ||
| 210 | texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info); | 210 | texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info); |
| 211 | DebugUtils::DumpTexture(texture.config, (u8*)texture_data); | 211 | DebugUtils::DumpTexture(texture.config, texture_data); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | // Texture environment - consists of 6 stages of color and alpha combining. | 214 | // Texture environment - consists of 6 stages of color and alpha combining. |