Fix various cases in scissor rect emulation.
Patch by delroth.
This commit is contained in:
parent
95517a9741
commit
6845a1596c
|
@ -652,22 +652,9 @@ bool Renderer::SetScissorRect()
|
|||
if (rc.right > EFB_WIDTH) rc.right = EFB_WIDTH;
|
||||
if (rc.bottom > EFB_HEIGHT) rc.bottom = EFB_HEIGHT;
|
||||
|
||||
if (rc.left > rc.right)
|
||||
{
|
||||
int temp = rc.right;
|
||||
rc.right = rc.left;
|
||||
rc.left = temp;
|
||||
}
|
||||
if (rc.top > rc.bottom)
|
||||
{
|
||||
int temp = rc.bottom;
|
||||
rc.bottom = rc.top;
|
||||
rc.top = temp;
|
||||
}
|
||||
if (rc.left > rc.right) rc.right = rc.left;
|
||||
if (rc.top > rc.bottom) rc.bottom = rc.top;
|
||||
|
||||
// Check that the coordinates are good
|
||||
if (rc.right != rc.left && rc.bottom != rc.top)
|
||||
{
|
||||
glScissor(
|
||||
EFBToScaledX(rc.left), // x = 0 for example
|
||||
EFBToScaledY(EFB_HEIGHT - rc.bottom), // y = 0 for example
|
||||
|
@ -675,17 +662,6 @@ bool Renderer::SetScissorRect()
|
|||
EFBToScaledY(rc.bottom - rc.top)); // height = 480 for example
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
glScissor(
|
||||
0,
|
||||
0,
|
||||
Renderer::GetTargetWidth(),
|
||||
Renderer::GetTargetHeight()
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Renderer::SetColorMask()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue