diff options
| author | 2014-12-31 15:04:39 +0100 | |
|---|---|---|
| committer | 2014-12-31 16:32:55 +0100 | |
| commit | 195d73a385c9dd88150ed9b875e313c186e7d96e (patch) | |
| tree | 3e0d63c7e2d8721a1e5c6add465b0a0c0836bce9 /src/video_core/rasterizer.cpp | |
| parent | Pica/VertexShader: Coding style fixes. (diff) | |
| download | yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.gz yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.xz yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.zip | |
Pica/Rasterizer: Clean up long code lines.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 9148745dc..9822b36a6 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -18,7 +18,8 @@ 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 = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress()))); | 21 | const PAddr addr = registers.framebuffer.GetColorBufferPhysicalAddress(); |
| 22 | u32* color_buffer = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(addr))); | ||
| 22 | u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b(); | 23 | u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b(); |
| 23 | 24 | ||
| 24 | // Assuming RGBA8 format until actual framebuffer format handling is implemented | 25 | // Assuming RGBA8 format until actual framebuffer format handling is implemented |
| @@ -26,7 +27,8 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { | |||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | static const Math::Vec4<u8> GetPixel(int x, int y) { | 29 | static const Math::Vec4<u8> GetPixel(int x, int y) { |
| 29 | u32* color_buffer_u32 = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress()))); | 30 | const PAddr addr = registers.framebuffer.GetColorBufferPhysicalAddress(); |
| 31 | u32* color_buffer_u32 = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(addr))); | ||
| 30 | 32 | ||
| 31 | u32 value = *(color_buffer_u32 + x + y * registers.framebuffer.GetWidth()); | 33 | u32 value = *(color_buffer_u32 + x + y * registers.framebuffer.GetWidth()); |
| 32 | Math::Vec4<u8> ret; | 34 | Math::Vec4<u8> ret; |
| @@ -38,14 +40,16 @@ static const Math::Vec4<u8> GetPixel(int x, int y) { | |||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | static u32 GetDepth(int x, int y) { | 42 | static u32 GetDepth(int x, int y) { |
| 41 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()))); | 43 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); |
| 44 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(addr))); | ||
| 42 | 45 | ||
| 43 | // Assuming 16-bit depth buffer format until actual format handling is implemented | 46 | // Assuming 16-bit depth buffer format until actual format handling is implemented |
| 44 | return *(depth_buffer + x + y * registers.framebuffer.GetWidth()); | 47 | return *(depth_buffer + x + y * registers.framebuffer.GetWidth()); |
| 45 | } | 48 | } |
| 46 | 49 | ||
| 47 | static void SetDepth(int x, int y, u16 value) { | 50 | static void SetDepth(int x, int y, u16 value) { |
| 48 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()))); | 51 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); |
| 52 | u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(addr))); | ||
| 49 | 53 | ||
| 50 | // Assuming 16-bit depth buffer format until actual format handling is implemented | 54 | // Assuming 16-bit depth buffer format until actual format handling is implemented |
| 51 | *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value; | 55 | *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value; |