diff options
| author | 2014-12-31 15:17:07 +0100 | |
|---|---|---|
| committer | 2014-12-31 16:32:55 +0100 | |
| commit | 47543d62cf9e982598f58438ad24769c2b36ec77 (patch) | |
| tree | 856ccab2a9165d0a50def92f958851566bb93b2b /src/citra_qt/debugger/graphics_framebuffer.cpp | |
| parent | VideoCore: Remove some unused functions. (diff) | |
| download | yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.gz yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.xz yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.zip | |
Pica: Cleanup color conversion.
Diffstat (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 4a45027b8..a9e9de652 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <QPushButton> | 10 | #include <QPushButton> |
| 11 | #include <QSpinBox> | 11 | #include <QSpinBox> |
| 12 | 12 | ||
| 13 | #include "video_core/color.h" | ||
| 13 | #include "video_core/pica.h" | 14 | #include "video_core/pica.h" |
| 14 | 15 | ||
| 15 | #include "graphics_framebuffer.hxx" | 16 | #include "graphics_framebuffer.hxx" |
| @@ -259,14 +260,10 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 259 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 260 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 260 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 261 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 261 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); | 262 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); |
| 262 | u8 r = (value >> 11) & 0x1F; | 263 | u8 r = Color::Convert5To8((value >> 11) & 0x1F); |
| 263 | u8 g = (value >> 6) & 0x1F; | 264 | u8 g = Color::Convert5To8((value >> 6) & 0x1F); |
| 264 | u8 b = (value >> 1) & 0x1F; | 265 | u8 b = Color::Convert5To8((value >> 1) & 0x1F); |
| 265 | u8 a = value & 1; | 266 | u8 a = Color::Convert1To8(value & 1); |
| 266 | r = (r << 3) | (r >> 2); | ||
| 267 | g = (g << 3) | (g >> 2); | ||
| 268 | b = (b << 3) | (b >> 2); | ||
| 269 | a *= 255; | ||
| 270 | 267 | ||
| 271 | decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); | 268 | decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); |
| 272 | } | 269 | } |