summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/BPFunctions.cpp')
-rw-r--r--Source/Core/VideoCommon/BPFunctions.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp
index 9ae6c27730..0e4551da09 100644
--- a/Source/Core/VideoCommon/BPFunctions.cpp
+++ b/Source/Core/VideoCommon/BPFunctions.cpp
@@ -49,24 +49,12 @@ void SetScissor()
const int xoff = bpmem.scissorOffset.x * 2;
const int yoff = bpmem.scissorOffset.y * 2;
- EFBRectangle rc(bpmem.scissorTL.x - xoff, bpmem.scissorTL.y - yoff, bpmem.scissorBR.x - xoff + 1,
- bpmem.scissorBR.y - yoff + 1);
-
- if (rc.left < 0)
- rc.left = 0;
- if (rc.top < 0)
- rc.top = 0;
- if (rc.right > EFB_WIDTH)
- rc.right = EFB_WIDTH;
- if (rc.bottom > EFB_HEIGHT)
- rc.bottom = EFB_HEIGHT;
-
- if (rc.left > rc.right)
- rc.right = rc.left;
- if (rc.top > rc.bottom)
- rc.bottom = rc.top;
-
- g_renderer->SetScissorRect(rc);
+ EFBRectangle native_rc(bpmem.scissorTL.x - xoff, bpmem.scissorTL.y - yoff,
+ bpmem.scissorBR.x - xoff + 1, bpmem.scissorBR.y - yoff + 1);
+ native_rc.ClampUL(0, 0, EFB_WIDTH, EFB_HEIGHT);
+
+ TargetRectangle target_rc = g_renderer->ConvertEFBRectangle(native_rc);
+ g_renderer->SetScissorRect(target_rc);
}
void SetViewport()