summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Rasterizer.cpp
diff options
context:
space:
mode:
authorezio1900 <yd86128@163.com>2021-04-19 20:20:37 +0800
committerezio1900 <yd86128@163.com>2021-04-24 08:46:21 +0800
commit97ea3a603ef4df32945dfd33300cedcb04ffa67a (patch)
treeb30a2566b5964f66bb427f202dc810e0a931833e /Source/Core/VideoBackends/Software/Rasterizer.cpp
parent34348fad1d64a49420b223d5c79b01010bbc9d56 (diff)
VideoCommon: Fix scissorOffset, handle negative value correctly
VideoCommon: Change the type of BPMemory.scissorOffset to 10bit signed: S32X10Y10 VideoBackends: Fix Software Clipper.PerspectiveDivide function, use BPMemory.scissorOffset instead of hard code 342
Diffstat (limited to 'Source/Core/VideoBackends/Software/Rasterizer.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp
index e987817c8c..cf5374342b 100644
--- a/Source/Core/VideoBackends/Software/Rasterizer.cpp
+++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp
@@ -306,22 +306,22 @@ void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v
s32 maxy = (std::max(std::max(Y1, Y2), Y3) + 0xF) >> 4;
// scissor
- int xoff = bpmem.scissorOffset.x * 2 - 342;
- int yoff = bpmem.scissorOffset.y * 2 - 342;
+ s32 xoff = bpmem.scissorOffset.x * 2;
+ s32 yoff = bpmem.scissorOffset.y * 2;
- s32 scissorLeft = bpmem.scissorTL.x - xoff - 342;
+ s32 scissorLeft = bpmem.scissorTL.x - xoff;
if (scissorLeft < 0)
scissorLeft = 0;
- s32 scissorTop = bpmem.scissorTL.y - yoff - 342;
+ s32 scissorTop = bpmem.scissorTL.y - yoff;
if (scissorTop < 0)
scissorTop = 0;
- s32 scissorRight = bpmem.scissorBR.x - xoff - 341;
+ s32 scissorRight = bpmem.scissorBR.x - xoff + 1;
if (scissorRight > s32(EFB_WIDTH))
scissorRight = EFB_WIDTH;
- s32 scissorBottom = bpmem.scissorBR.y - yoff - 341;
+ s32 scissorBottom = bpmem.scissorBR.y - yoff + 1;
if (scissorBottom > s32(EFB_HEIGHT))
scissorBottom = EFB_HEIGHT;