diff options
| author | Stenzek <stenzek@gmail.com> | 2018-01-21 22:12:32 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-02-20 00:49:32 +1000 |
| commit | c1b39ecc582d5f6e7716f69644fbd54e53be538d (patch) | |
| tree | 14caf3385e509d0ff29c9a9b122179e648f7b781 /Source/Core/VideoCommon/BPFunctions.cpp | |
| parent | 5359396099dd09583a155dbf4c6bd04df0a97582 (diff) | |
BPFunctions: Move upscaling of scissor rect to VideoCommon
Diffstat (limited to 'Source/Core/VideoCommon/BPFunctions.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPFunctions.cpp | 24 |
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() |
