From e780b45696469cdfa5e1d33d977895a17ee1ad6d Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 27 Aug 2021 17:13:26 +0300 Subject: [PATCH] enfasten -meta for nonplanar by doing cheap check 1st --- tools/quake3/q3map2/surface_meta.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/quake3/q3map2/surface_meta.cpp b/tools/quake3/q3map2/surface_meta.cpp index fa0724c2..dc40d55b 100644 --- a/tools/quake3/q3map2/surface_meta.cpp +++ b/tools/quake3/q3map2/surface_meta.cpp @@ -1336,10 +1336,10 @@ static int AddMetaTriangleToSurface( mapDrawSurface_t *ds, metaTriangle_t *tri, /* planar surfaces will only merge with triangles in the same plane */ if ( npDegrees == 0.0f && !ds->shaderInfo->nonplanar && ds->planeNum >= 0 ) { - if ( !VectorCompare( mapplanes[ ds->planeNum ].normal(), tri->plane.normal() ) || mapplanes[ ds->planeNum ].dist() != tri->plane.dist() ) { + if ( tri->planeNum >= 0 && tri->planeNum != ds->planeNum ) { return 0; } - if ( tri->planeNum >= 0 && tri->planeNum != ds->planeNum ) { + if ( !VectorCompare( mapplanes[ ds->planeNum ].normal(), tri->plane.normal() ) || mapplanes[ ds->planeNum ].dist() != tri->plane.dist() ) { return 0; } }