From c63f1a99976ebfdf1adc48c66ebd59ce01eabb33 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Tue, 19 Sep 2023 16:08:22 +0200 Subject: [PATCH] pvr: background poly vertex order fix Fix background poly vertices coordinates to form a valid triangle strip Fixes lovebery bogus background poly on character selection screen. Issue #1200 --- core/hw/pvr/ta_vtx.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/hw/pvr/ta_vtx.cpp b/core/hw/pvr/ta_vtx.cpp index 41dd5f472..d24653976 100644 --- a/core/hw/pvr/ta_vtx.cpp +++ b/core/hw/pvr/ta_vtx.cpp @@ -1614,23 +1614,25 @@ void FillBGP(TA_context* ctx) } else { + if (cv[2].x == cv[1].x) { + cv[2].x = cv[0].x; + cv[2].u = cv[0].u; + } const float deltaU = (cv[1].u - cv[0].u) * 0.4f; cv[0].x -= 256.f; cv[0].u -= deltaU; cv[1].x += 256.f; cv[1].u += deltaU; - cv[2].x += 256.f; - cv[2].u += deltaU; + cv[2].x -= 256.f; + cv[2].u -= deltaU; cv[0].x *= scale_x; cv[1].x *= scale_x; cv[2].x *= scale_x; cv[3] = cv[2]; - cv[3].x = cv[0].x; - cv[3].u = cv[0].u; - - std::swap(cv[0], cv[1]); + cv[3].x = cv[1].x; + cv[3].u = cv[1].u; } }