diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2011-09-08 02:14:18 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2011-09-08 02:14:18 +0200 |
| commit | 349a3ae91df42d02f2e07485c1a55805535fef03 (patch) | |
| tree | 36570325f882c2dadb29d6cec5860188575e0505 /Source/Core/VideoCommon/Src/BPFunctions.cpp | |
| parent | 6c7bda6851b39d358f9b951739156e07345ccfa4 (diff) | |
| parent | 8b8e60c2767d2d21b3aeea7e938bdd64e3a2a61b (diff) | |
Merge remote-tracking branch 'remotes/origin/master' into new-shadercache-uids
Diffstat (limited to 'Source/Core/VideoCommon/Src/BPFunctions.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPFunctions.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/BPFunctions.cpp b/Source/Core/VideoCommon/Src/BPFunctions.cpp index f323f03142..4f7315e832 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.cpp +++ b/Source/Core/VideoCommon/Src/BPFunctions.cpp @@ -44,9 +44,24 @@ void SetGenerationMode(const BPCmd &bp) g_renderer->SetGenerationMode(); } -void SetScissor(const BPCmd &bp) +void SetScissor() { - g_renderer->SetScissorRect(); + const int xoff = bpmem.scissorOffset.x * 2 - 342; + const int yoff = bpmem.scissorOffset.y * 2 - 342; + + EFBRectangle rc (bpmem.scissorTL.x - xoff - 342, bpmem.scissorTL.y - yoff - 342, + bpmem.scissorBR.x - xoff - 341, bpmem.scissorBR.y - yoff - 341); + + 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; + + TargetRectangle trc = g_renderer->ConvertEFBRectangle(rc); + g_renderer->SetScissorRect(trc); } void SetLineWidth(const BPCmd &bp) |
