From c25e563d13ab819bec67330c9e9e78b30740b594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 26 Dec 2022 18:16:54 +0100 Subject: [PATCH] Fix rendering of lines with the same x/y but different z. Also enabled centered lines in WebFest homebrew. --- GPU/Common/SoftwareTransformCommon.cpp | 5 +++-- assets/compat.ini | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index 28cdef056e..25eb64acaf 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -768,8 +768,9 @@ void SoftwareTransform::ExpandLines(int vertexCount, int &maxIndex, u16 *&inds, const TransformedVertex &transVtx2 = transformed[indsIn[i + 1]]; // Okay, let's calculate the perpendicular. - float horizontal = transVtx2.x - transVtx1.x; - float vertical = transVtx2.y - transVtx1.y; + float horizontal = transVtx2.x * transVtx2.pos_w - transVtx1.x * transVtx1.pos_w; + float vertical = transVtx2.y * transVtx2.pos_w - transVtx1.y * transVtx1.pos_w; + Vec2f addWidth = Vec2f(-vertical, horizontal).Normalized(); float xoff = addWidth.x * dx; diff --git a/assets/compat.ini b/assets/compat.ini index 022e578ab3..4d05a720ae 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -1124,6 +1124,9 @@ UCAS40197 = true NPEG00006 = true NPUG80135 = true +# Webfest homebrew game (wireframe 3D rendering) looks substantially better with this. +WEBF00752 = true + [ZZT3SelectHack] # Bypass softlock on Zettai Zetsumei Toshi 3 character select screen #4901 # This problem affects the game also on PS3