summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Clipper.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/Clipper.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/Clipper.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Clipper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp
index 417bc63fa3..15cd650b79 100644
--- a/Source/Core/VideoBackends/Software/Clipper.cpp
+++ b/Source/Core/VideoBackends/Software/Clipper.cpp
@@ -513,8 +513,10 @@ void PerspectiveDivide(OutputVertexData* vertex)
Vec3& screen = vertex->screenPosition;
float wInverse = 1.0f / projected.w;
- screen.x = projected.x * wInverse * xfmem.viewport.wd + xfmem.viewport.xOrig - 342;
- screen.y = projected.y * wInverse * xfmem.viewport.ht + xfmem.viewport.yOrig - 342;
+ screen.x =
+ projected.x * wInverse * xfmem.viewport.wd + xfmem.viewport.xOrig - bpmem.scissorOffset.x * 2;
+ screen.y =
+ projected.y * wInverse * xfmem.viewport.ht + xfmem.viewport.yOrig - bpmem.scissorOffset.y * 2;
screen.z = projected.z * wInverse * xfmem.viewport.zRange + xfmem.viewport.farZ;
}
} // namespace Clipper