diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-01-05 23:11:23 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-02-04 21:31:40 +0100 |
commit | a1c9ac7845395c250a78fc8df93a9ffed29f3d5b (patch) | |
tree | 7e3768df24f82e9e732302318326113419309d33 /src/citra_qt | |
parent | Merge pull request #2496 from mailwl/cfg-mem (diff) | |
download | yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar.gz yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar.bz2 yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar.lz yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar.xz yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.tar.zst yuzu-a1c9ac7845395c250a78fc8df93a9ffed29f3d5b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_cmdlists.cpp | 10 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_surface.cpp | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp index f5a2ec761..ee79f0edf 100644 --- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -20,13 +20,14 @@ #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/texture/texture_decode.h" namespace { -QImage LoadTexture(const u8* src, const Pica::DebugUtils::TextureInfo& info) { +QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) { QImage decoded_image(info.width, info.height, QImage::Format_ARGB32); for (int y = 0; y < info.height; ++y) { for (int x = 0; x < info.width; ++x) { - Math::Vec4<u8> color = Pica::DebugUtils::LookupTexture(src, x, y, info, true); + Math::Vec4<u8> color = Pica::Texture::LookupTexture(src, x, y, info, true); decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a())); } } @@ -36,9 +37,10 @@ QImage LoadTexture(const u8* src, const Pica::DebugUtils::TextureInfo& info) { class TextureInfoWidget : public QWidget { public: - TextureInfoWidget(const u8* src, const Pica::DebugUtils::TextureInfo& info, + TextureInfoWidget(const u8* src, const Pica::Texture::TextureInfo& info, QWidget* parent = nullptr) : QWidget(parent) { + QLabel* image_widget = new QLabel; QPixmap image_pixmap = QPixmap::fromImage(LoadTexture(src, info)); image_pixmap = image_pixmap.scaled(200, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -160,7 +162,7 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) { const auto config = texture.config; const auto format = texture.format; - const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format); + const auto info = Pica::Texture::TextureInfo::FromPicaRegister(config, format); const u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress()); new_info_widget = new TextureInfoWidget(src, info); } diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index 4efd95d3c..c0a72a6ef 100644 --- a/src/citra_qt/debugger/graphics/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp @@ -18,6 +18,7 @@ #include "core/memory.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/texture/texture_decode.h" #include "video_core/utils.h" SurfacePicture::SurfacePicture(QWidget* parent, GraphicsSurfaceWidget* surface_widget_) @@ -512,7 +513,7 @@ void GraphicsSurfaceWidget::OnUpdate() { } const auto texture = Pica::g_state.regs.GetTextures()[texture_index]; - auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); + auto info = Pica::Texture::TextureInfo::FromPicaRegister(texture.config, texture.format); surface_address = info.physical_address; surface_width = info.width; @@ -574,7 +575,7 @@ void GraphicsSurfaceWidget::OnUpdate() { if (surface_format <= Format::MaxTextureFormat) { // Generate a virtual texture - Pica::DebugUtils::TextureInfo info; + Pica::Texture::TextureInfo info; info.physical_address = surface_address; info.width = surface_width; info.height = surface_height; @@ -583,7 +584,7 @@ void GraphicsSurfaceWidget::OnUpdate() { for (unsigned int y = 0; y < surface_height; ++y) { for (unsigned int x = 0; x < surface_width; ++x) { - Math::Vec4<u8> color = Pica::DebugUtils::LookupTexture(buffer, x, y, info, true); + Math::Vec4<u8> color = Pica::Texture::LookupTexture(buffer, x, y, info, true); decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a())); } } |