From 6845a1596c04ec37ffb734b4e14b908deb4b3088 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sat, 3 Sep 2011 23:37:05 +0200 Subject: [PATCH 1/3] Fix various cases in scissor rect emulation. Patch by delroth. --- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 0c9d904cad..a54e1dd3f5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -652,39 +652,15 @@ 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 - EFBToScaledX(rc.right - rc.left), // width = 640 for example - EFBToScaledY(rc.bottom - rc.top)); // height = 480 for example - return true; - } - else - { - glScissor( - 0, - 0, - Renderer::GetTargetWidth(), - Renderer::GetTargetHeight() - ); - } - return false; + glScissor( + EFBToScaledX(rc.left), // x = 0 for example + EFBToScaledY(EFB_HEIGHT - rc.bottom), // y = 0 for example + EFBToScaledX(rc.right - rc.left), // width = 640 for example + EFBToScaledY(rc.bottom - rc.top)); // height = 480 for example + return true; } void Renderer::SetColorMask() From b867c21fea6401c0f9886129621bb0dbae962a4a Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Mon, 5 Sep 2011 12:19:11 -0700 Subject: [PATCH 2/3] apply to dx9 and dx11 backends as well --- Source/Core/VideoCommon/Src/RenderBase.h | 2 +- .../Plugins/Plugin_VideoDX11/Src/Render.cpp | 42 +++-------------- Source/Plugins/Plugin_VideoDX11/Src/Render.h | 2 +- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 46 +++---------------- Source/Plugins/Plugin_VideoDX9/Src/Render.h | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 12 ++--- Source/Plugins/Plugin_VideoOGL/Src/Render.h | 2 +- 7 files changed, 20 insertions(+), 88 deletions(-) diff --git a/Source/Core/VideoCommon/Src/RenderBase.h b/Source/Core/VideoCommon/Src/RenderBase.h index 17132ebb8c..7e5c0dc8fe 100644 --- a/Source/Core/VideoCommon/Src/RenderBase.h +++ b/Source/Core/VideoCommon/Src/RenderBase.h @@ -54,7 +54,7 @@ public: virtual void SetColorMask() = 0; virtual void SetBlendMode(bool forceUpdate) = 0; - virtual bool SetScissorRect() = 0; + virtual void SetScissorRect() = 0; virtual void SetGenerationMode() = 0; virtual void SetDepthMode() = 0; virtual void SetLogicOpMode() = 0; diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index d0756bfa98..2c2f3037f6 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -444,51 +444,21 @@ bool Renderer::CheckForResize() return false; } -bool Renderer::SetScissorRect() +void Renderer::SetScissorRect() { - TargetRectangle rc; + EFBRectangle rc; GetScissorRect(rc); if (rc.left < 0) rc.left = 0; - if (rc.right < 0) rc.right = 0; if (rc.top < 0) rc.top = 0; - if (rc.bottom < 0) rc.bottom = 0; - - if (rc.left > EFB_WIDTH) rc.left = EFB_WIDTH; if (rc.right > EFB_WIDTH) rc.right = EFB_WIDTH; - if (rc.top > EFB_HEIGHT) rc.top = EFB_HEIGHT; if (rc.bottom > EFB_HEIGHT) rc.bottom = EFB_HEIGHT; - rc.left = EFBToScaledX(rc.left); - rc.right = EFBToScaledX(rc.right); - rc.top = EFBToScaledY(rc.top); - rc.bottom = EFBToScaledY(rc.bottom); + if (rc.left > rc.right) rc.right = rc.left; + if (rc.top > rc.bottom) rc.bottom = rc.top; - 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.right >= rc.left && rc.bottom >= rc.top) - { - D3D::context->RSSetScissorRects(1, rc.AsRECT()); - return true; - } - else - { - //WARN_LOG(VIDEO, "Bad scissor rectangle: %i %i %i %i", rc.left, rc.top, rc.right, rc.bottom); - *rc.AsRECT() = CD3D11_RECT(0.f, 0.f, s_target_width, s_target_height); - D3D::context->RSSetScissorRects(1, rc.AsRECT()); - return false; - } + TargetRectangle trc = ConvertEFBRectangle(rc); + D3D::context->RSSetScissorRects(1, trc.AsRECT()); } void Renderer::SetColorMask() diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.h b/Source/Plugins/Plugin_VideoDX11/Src/Render.h index 5d1c24bc23..bc6dcba2bd 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - bool SetScissorRect(); + void SetScissorRect(); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index e333cbc168..59af978107 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -426,55 +426,21 @@ bool Renderer::CheckForResize() return false; } -bool Renderer::SetScissorRect() +void Renderer::SetScissorRect() { - TargetRectangle rc; + EFBRectangle rc; GetScissorRect(rc); if (rc.left < 0) rc.left = 0; - if (rc.right < 0) rc.right = 0; if (rc.top < 0) rc.top = 0; - if (rc.bottom < 0) rc.bottom = 0; - - if (rc.left > EFB_WIDTH) rc.left = EFB_WIDTH; if (rc.right > EFB_WIDTH) rc.right = EFB_WIDTH; - if (rc.top > EFB_HEIGHT) rc.top = EFB_HEIGHT; 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; - rc.left = EFBToScaledX(rc.left); - rc.top = EFBToScaledY(rc.top); - rc.right = EFBToScaledX(rc.right); - rc.bottom = EFBToScaledY(rc.bottom); - - // Check that the coordinates are good - if (rc.right != rc.left && rc.bottom != rc.top) - { - D3D::dev->SetScissorRect(rc.AsRECT()); - return true; - } - else - { - //WARN_LOG(VIDEO, "Bad scissor rectangle: %i %i %i %i", rc.left, rc.top, rc.right, rc.bottom); - rc.left = 0; - rc.top = 0; - rc.right = s_target_width; - rc.bottom = s_target_height; - D3D::dev->SetScissorRect(rc.AsRECT()); - } - return false; + TargetRectangle trc = ConvertEFBRectangle(rc); + D3D::dev->SetScissorRect(trc.AsRECT()); } void Renderer::SetColorMask() diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.h b/Source/Plugins/Plugin_VideoDX9/Src/Render.h index b3c89f82f9..6ba40de063 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - bool SetScissorRect(); + void SetScissorRect(); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index a54e1dd3f5..1567c9825b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -642,9 +642,9 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc) // Renderer::GetTargetHeight() = the fixed ini file setting // donkopunchstania - it appears scissorBR is the bottom right pixel inside the scissor box // therefore the width and height are (scissorBR + 1) - scissorTL -bool Renderer::SetScissorRect() +void Renderer::SetScissorRect() { - MathUtil::Rectangle rc; + EFBRectangle rc; GetScissorRect(rc); if (rc.left < 0) rc.left = 0; @@ -655,12 +655,8 @@ bool Renderer::SetScissorRect() if (rc.left > rc.right) rc.right = rc.left; if (rc.top > rc.bottom) rc.bottom = rc.top; - glScissor( - EFBToScaledX(rc.left), // x = 0 for example - EFBToScaledY(EFB_HEIGHT - rc.bottom), // y = 0 for example - EFBToScaledX(rc.right - rc.left), // width = 640 for example - EFBToScaledY(rc.bottom - rc.top)); // height = 480 for example - return true; + TargetRectangle trc = ConvertEFBRectangle(rc); + glScissor(trc.left, trc.bottom, trc.GetWidth(), trc.GetHeight()); } void Renderer::SetColorMask() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.h b/Source/Plugins/Plugin_VideoOGL/Src/Render.h index 5805c524ae..b14617bed6 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - bool SetScissorRect(); + void SetScissorRect(); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode(); From 17fcd406fcf68059ee5c0e940d42e9bcdcd32842 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 5 Sep 2011 22:04:28 +0200 Subject: [PATCH 3/3] Merge some scissor rect related code to VideoCommon. --- Source/Core/VideoCommon/Src/BPFunctions.cpp | 19 +++++++++++++++++-- Source/Core/VideoCommon/Src/BPFunctions.h | 2 +- Source/Core/VideoCommon/Src/BPStructs.cpp | 2 +- Source/Core/VideoCommon/Src/RenderBase.h | 14 +------------- Source/Core/VideoCommon/Src/VideoCommon.h | 3 +-- .../Plugins/Plugin_VideoDX11/Src/Render.cpp | 19 ++++--------------- Source/Plugins/Plugin_VideoDX11/Src/Render.h | 2 +- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 19 ++++--------------- Source/Plugins/Plugin_VideoDX9/Src/Render.h | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 19 ++++--------------- Source/Plugins/Plugin_VideoOGL/Src/Render.h | 2 +- 11 files changed, 36 insertions(+), 67 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) diff --git a/Source/Core/VideoCommon/Src/BPFunctions.h b/Source/Core/VideoCommon/Src/BPFunctions.h index d104b12751..2b86523687 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.h +++ b/Source/Core/VideoCommon/Src/BPFunctions.h @@ -38,7 +38,7 @@ enum void FlushPipeline(); void SetGenerationMode(const BPCmd &bp); -void SetScissor(const BPCmd &bp); +void SetScissor(); void SetLineWidth(const BPCmd &bp); void SetDepthMode(const BPCmd &bp); void SetBlendMode(const BPCmd &bp); diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 42b5b2212a..cee68327f5 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -162,7 +162,7 @@ void BPWritten(const BPCmd& bp) case BPMEM_SCISSORTL: // Scissor Rectable Top, Left case BPMEM_SCISSORBR: // Scissor Rectable Bottom, Right case BPMEM_SCISSOROFFSET: // Scissor Offset - SetScissor(bp); + SetScissor(); break; case BPMEM_LINEPTWIDTH: // Line Width SetLineWidth(bp); diff --git a/Source/Core/VideoCommon/Src/RenderBase.h b/Source/Core/VideoCommon/Src/RenderBase.h index 7e5c0dc8fe..b2c2c7ecfb 100644 --- a/Source/Core/VideoCommon/Src/RenderBase.h +++ b/Source/Core/VideoCommon/Src/RenderBase.h @@ -54,7 +54,7 @@ public: virtual void SetColorMask() = 0; virtual void SetBlendMode(bool forceUpdate) = 0; - virtual void SetScissorRect() = 0; + virtual void SetScissorRect(const TargetRectangle& rc) = 0; virtual void SetGenerationMode() = 0; virtual void SetDepthMode() = 0; virtual void SetLogicOpMode() = 0; @@ -175,16 +175,4 @@ extern Renderer *g_renderer; void UpdateViewport(Matrix44& vpCorrection); -template -void GetScissorRect(MathUtil::Rectangle &rect) -{ - const int xoff = bpmem.scissorOffset.x * 2 - 342; - const int yoff = bpmem.scissorOffset.y * 2 - 342; - - rect.left = (R)(bpmem.scissorTL.x - xoff - 342); - rect.top = (R)(bpmem.scissorTL.y - yoff - 342); - rect.right = (R)(bpmem.scissorBR.x - xoff - 341); - rect.bottom = (R)(bpmem.scissorBR.y - yoff - 341); -} - #endif // _COMMON_RENDERBASE_H_ diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index 030c1f0b32..80c0937884 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -70,8 +70,7 @@ void HandleGLError(); // This structure should only be used to represent a rectangle in EFB // coordinates, where the origin is at the upper left and the frame dimensions // are 640 x 528. -struct EFBRectangle : public MathUtil::Rectangle -{}; +typedef MathUtil::Rectangle EFBRectangle; // This structure should only be used to represent a rectangle in standard target // coordinates, where the origin is at the lower left and the frame dimensions diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index 2c2f3037f6..bbf2a966dd 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -42,6 +42,7 @@ #include "Movie.h" #include "Television.h" #include "Host.h" +#include "BPFunctions.h" namespace DX11 { @@ -444,21 +445,9 @@ bool Renderer::CheckForResize() return false; } -void Renderer::SetScissorRect() +void Renderer::SetScissorRect(const TargetRectangle& rc) { - EFBRectangle rc; - GetScissorRect(rc); - - 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 = ConvertEFBRectangle(rc); - D3D::context->RSSetScissorRects(1, trc.AsRECT()); + D3D::context->RSSetScissorRects(1, rc.AsRECT()); } void Renderer::SetColorMask() @@ -1133,7 +1122,7 @@ void Renderer::RestoreAPIState() D3D::stateman->PopDepthState(); D3D::stateman->PopRasterizerState(); VertexShaderManager::SetViewportChanged(); - SetScissorRect(); + BPFunctions::SetScissor(); } void Renderer::ApplyState(bool bUseDstAlpha) diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.h b/Source/Plugins/Plugin_VideoDX11/Src/Render.h index bc6dcba2bd..8f6c78fae1 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - void SetScissorRect(); + void SetScissorRect(const TargetRectangle& rc); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 59af978107..15b592e800 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -53,6 +53,7 @@ #include "Debugger.h" #include "Core.h" #include "Movie.h" +#include "BPFunctions.h" namespace DX9 { @@ -426,21 +427,9 @@ bool Renderer::CheckForResize() return false; } -void Renderer::SetScissorRect() +void Renderer::SetScissorRect(const TargetRectangle& rc) { - EFBRectangle rc; - GetScissorRect(rc); - - 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 = ConvertEFBRectangle(rc); - D3D::dev->SetScissorRect(trc.AsRECT()); + D3D::dev->SetScissorRect(rc.AsRECT()); } void Renderer::SetColorMask() @@ -1259,7 +1248,7 @@ void Renderer::RestoreAPIState() D3D::SetRenderState(D3DRS_FILLMODE, g_ActiveConfig.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID); D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); VertexShaderManager::SetViewportChanged(); - SetScissorRect(); + BPFunctions::SetScissor(); if (bpmem.zmode.testenable) { D3D::SetRenderState(D3DRS_ZENABLE, TRUE); if (bpmem.zmode.updateenable) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.h b/Source/Plugins/Plugin_VideoDX9/Src/Render.h index 6ba40de063..6e5198b3cd 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - void SetScissorRect(); + void SetScissorRect(const TargetRectangle& rc); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 1567c9825b..ca3280673e 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -60,6 +60,7 @@ #include "Core.h" #include "Movie.h" #include "Host.h" +#include "BPFunctions.h" #include "main.h" // Local #ifdef _WIN32 @@ -642,21 +643,9 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc) // Renderer::GetTargetHeight() = the fixed ini file setting // donkopunchstania - it appears scissorBR is the bottom right pixel inside the scissor box // therefore the width and height are (scissorBR + 1) - scissorTL -void Renderer::SetScissorRect() +void Renderer::SetScissorRect(const TargetRectangle& rc) { - EFBRectangle rc; - GetScissorRect(rc); - - 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 = ConvertEFBRectangle(rc); - glScissor(trc.left, trc.bottom, trc.GetWidth(), trc.GetHeight()); + glScissor(rc.left, rc.bottom, rc.GetWidth(), rc.GetHeight()); } void Renderer::SetColorMask() @@ -1404,7 +1393,7 @@ void Renderer::RestoreAPIState() // Gets us back into a more game-like state. glEnable(GL_SCISSOR_TEST); SetGenerationMode(); - SetScissorRect(); + BPFunctions::SetScissor(); SetColorMask(); SetDepthMode(); SetBlendMode(true); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.h b/Source/Plugins/Plugin_VideoOGL/Src/Render.h index b14617bed6..032a9a222c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.h @@ -15,7 +15,7 @@ public: void SetColorMask(); void SetBlendMode(bool forceUpdate); - void SetScissorRect(); + void SetScissorRect(const TargetRectangle& rc); void SetGenerationMode(); void SetDepthMode(); void SetLogicOpMode();