mirror of
https://github.com/libretro/pcsx2.git
synced 2024-12-25 19:25:43 +00:00
GSDX: Calculate dimensions of rectangle after merge
* Properly display rectangle size after passing through merge circuit on GS Dumps and GS Frame titlebar.
This commit is contained in:
parent
58b43dbb6c
commit
2166980f91
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user