File melonds_PR2011.patch of Package melonds

From 41a13fa4cbf848e73c656206e14dd211b5ee0280 Mon Sep 17 00:00:00 2001
From: Jaklyy <102590697+Jaklyy@users.noreply.github.com>
Date: Sat, 6 Apr 2024 12:41:28 -0400
Subject: [PATCH] i hate how this works

---
 src/GPU3D.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp
index 47abae2f0c..161e413157 100644
--- a/src/GPU3D.cpp
+++ b/src/GPU3D.cpp
@@ -1013,6 +1013,18 @@ void GPU3D::SubmitPolygon() noexcept
             return;
         }
     }
+    // dot == 0
+    // kinda gross hack to get the "correct" result 
+    // polygons should be treated as facing *neither* direction if the first/second vertex is equal to the third vertex's position,
+    // and as facing *both* directions under any other circumstances (with a dot of 0, ofc)
+    // needs more testing to make sure this actually covers every edge case
+    else if (!((v0->Position[0] == v2->Position[0] && v0->Position[1] == v2->Position[1]) ||
+             (v1->Position[0] == v2->Position[0] && v1->Position[1] == v2->Position[1])) &&
+             !(CurPolygonAttr & (3<<6)))
+    {
+        LastStripPolygon = NULL;
+        return;
+    }
 
     // for strips, check whether we can attach to the previous polygon
     // this requires two original vertices shared with the previous polygon, and that
openSUSE Build Service is sponsored by