From 7e2fbe6217b98b0056029aae4a4df7dc5eaa1307 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Nov 2024 18:33:17 +0100 Subject: [PATCH 1/2] fix "fade_end" comparison in comparePolygon for ogl batching effectively the comparison for the "fade_end" polygon property was directly discarded and unused --- src/hardware/hw_batching.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_batching.c b/src/hardware/hw_batching.c index 25595e512..cdcb2cdcb 100644 --- a/src/hardware/hw_batching.c +++ b/src/hardware/hw_batching.c @@ -203,9 +203,9 @@ static int comparePolygons(const void *p1, const void *p2) diff = poly1->surf.LightInfo.fade_start - poly2->surf.LightInfo.fade_start; if (diff != 0) return diff; diff = poly1->surf.LightInfo.fade_end - poly2->surf.LightInfo.fade_end; + if (diff != 0) return diff; diff = poly1->surf.LightInfo.directional - poly2->surf.LightInfo.directional; - if (diff != 0) return diff; return diff; } From a362e3e23d5531e87c0e91da90a8719df73e2203 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Nov 2024 18:40:57 +0100 Subject: [PATCH 2/2] reflect sorting order when filling polygon array functionally the same, but keeps consistency --- src/hardware/hw_batching.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_batching.c b/src/hardware/hw_batching.c index cdcb2cdcb..63c314c9f 100644 --- a/src/hardware/hw_batching.c +++ b/src/hardware/hw_batching.c @@ -130,8 +130,8 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt polygonArray[polygonArraySize].vertsIndex = unsortedVertexArraySize; polygonArray[polygonArraySize].numVerts = iNumPts; polygonArray[polygonArraySize].polyFlags = PolyFlags; - polygonArray[polygonArraySize].texture = current_texture; polygonArray[polygonArraySize].brightmap = current_brightmap; + polygonArray[polygonArraySize].texture = current_texture; polygonArray[polygonArraySize].shader = shader; polygonArray[polygonArraySize].horizonSpecial = horizonSpecial; polygonArraySize++;