diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 78309b2d40..7165dd3743 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -69,7 +69,7 @@ public: virtual bool CanUpscale() {return false;} virtual int GetUpscaleMultiplier() {return 1;} virtual GSVector2i GetInternalResolution() { - return GSVector2i(GetDisplayRect().width(), GetDisplayRect().height()); + return GetOutputRect(); } void SetAspectRatio(int aspect) {m_aspectratio = aspect;} void SetVSync(bool enabled); diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index f960c5c9ab..29637b97fa 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -116,7 +116,7 @@ int GSRendererHW::GetUpscaleMultiplier() } GSVector2i GSRendererHW::GetInternalResolution() { - GSVector2i dr(GetDisplayRect().width(), GetDisplayRect().height()); + GSVector2i dr = GetOutputRect(); if (m_upscale_multiplier) return GSVector2i(dr.x * m_upscale_multiplier, dr.y * m_upscale_multiplier); diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 8d318b72a3..63f10fa306 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -467,6 +467,28 @@ GSVector2i GSState::GetDeviceSize(int i) return DeviceSize; } +GSVector2i GSState::GetOutputRect() +{ + GSVector2i Merged_Rectangle(GetDisplayRect().width(), GetDisplayRect().height()); + GSVector4i Rectangle[2] = { GetDisplayRect(0) , GetDisplayRect(1) }; + int width[2] = { Rectangle[0].width() , Rectangle[1].width() }; + int height[2] = { Rectangle[0].height() , Rectangle[1].height() }; + int x_offset[2] = { Rectangle[0].left , Rectangle[1].left }; + int y_offset[2] = { Rectangle[0].top , Rectangle[1].top }; + + if (!(IsEnabled(0) && IsEnabled(1))) + return Merged_Rectangle; + + if (width[0] == width[1] && width[0] == std::max(x_offset[0], x_offset[1]) - std::min(x_offset[0], x_offset[1])) + Merged_Rectangle.x <<= 1; + + if (height[0] == height[1] && height[0] == std::max(y_offset[0], y_offset[1]) - std::min(y_offset[0], y_offset[1])) + Merged_Rectangle.y <<= 1; + + return Merged_Rectangle; + +} + bool GSState::IsEnabled(int i) { ASSERT(i >= 0 && i < 2); diff --git a/plugins/GSdx/GSState.h b/plugins/GSdx/GSState.h index c2078a0062..e50970af69 100644 --- a/plugins/GSdx/GSState.h +++ b/plugins/GSdx/GSState.h @@ -239,6 +239,7 @@ public: GSVector4i GetDisplayRect(int i = -1); GSVector4i GetFrameRect(int i = -1); GSVector2i GetDeviceSize(int i = -1); + GSVector2i GetOutputRect(); //Final Output rectangle after passing through merge circuit. GSVideoMode GetVideoMode(); bool IsEnabled(int i);