From 97ea3a603ef4df32945dfd33300cedcb04ffa67a Mon Sep 17 00:00:00 2001 From: ezio1900 Date: Mon, 19 Apr 2021 20:20:37 +0800 Subject: 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 --- Source/Core/VideoBackends/Software/Clipper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoBackends/Software/Clipper.cpp') 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 -- cgit v1.2.3