diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2017-09-29 00:31:08 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2017-11-17 22:11:32 -0600 |
| commit | 4964fc87ae15600252cea8a07df5799e91c11875 (patch) | |
| tree | dfd067d59541079078dae594dcd2476db854a168 /Source/Core/VideoBackends/Software | |
| parent | a129a53e56cdff93e2fd092fd56f3e0726408a60 (diff) | |
Video Backends: Remove the right of the xfb region for games where the
VI stride does not match the VI width
Diffstat (limited to 'Source/Core/VideoBackends/Software')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWOGLWindow.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWOGLWindow.h | 3 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWRenderer.cpp | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/SWOGLWindow.cpp b/Source/Core/VideoBackends/Software/SWOGLWindow.cpp index bead74872d..8027d3fb68 100644 --- a/Source/Core/VideoBackends/Software/SWOGLWindow.cpp +++ b/Source/Core/VideoBackends/Software/SWOGLWindow.cpp @@ -90,7 +90,7 @@ void SWOGLWindow::PrintText(const std::string& text, int x, int y, u32 color) m_text.push_back({text, x, y, color}); } -void SWOGLWindow::ShowImage(AbstractTexture* image, float aspect) +void SWOGLWindow::ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region) { SW::SWTexture* sw_image = static_cast<SW::SWTexture*>(image); GLInterface->Update(); // just updates the render window position and the backbuffer size @@ -103,6 +103,8 @@ void SWOGLWindow::ShowImage(AbstractTexture* image, float aspect) glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D, m_image_texture); + // TODO: Apply xfb_region + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); // 4-byte pixel alignment glPixelStorei(GL_UNPACK_ROW_LENGTH, sw_image->GetConfig().width); diff --git a/Source/Core/VideoBackends/Software/SWOGLWindow.h b/Source/Core/VideoBackends/Software/SWOGLWindow.h index 68fbcc133e..64ee2414bc 100644 --- a/Source/Core/VideoBackends/Software/SWOGLWindow.h +++ b/Source/Core/VideoBackends/Software/SWOGLWindow.h @@ -9,6 +9,7 @@ #include <vector> #include "Common/CommonTypes.h" +#include "VideoCommon/VideoCommon.h" class AbstractTexture; @@ -23,7 +24,7 @@ public: void PrintText(const std::string& text, int x, int y, u32 color); // Image to show, will be swapped immediately - void ShowImage(AbstractTexture* image, float aspect); + void ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region); int PeekMessages(); diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 97311d0e1f..3c05068606 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -43,13 +43,13 @@ void SWRenderer::RenderText(const std::string& pstr, int left, int top, u32 colo } // Called on the GPU thread -void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& rc, u64 ticks, float Gamma) +void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region, u64 ticks, float Gamma) { OSD::DoCallbacks(OSD::CallbackType::OnFrame); DrawDebugText(); - SWOGLWindow::s_instance->ShowImage(texture, 1.0); + SWOGLWindow::s_instance->ShowImage(texture, xfb_region); UpdateActiveConfig(); } |
