From 2d133b6910316e282cf9d131669c1258b2600c0f Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 11 Jun 2022 11:54:01 +0200 Subject: [PATCH] Made hashing faster in MapPolygonMesh::GetGeometryCRC() --- neo/idlib/MapFile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neo/idlib/MapFile.cpp b/neo/idlib/MapFile.cpp index e6cdcac7..2c13c141 100644 --- a/neo/idlib/MapFile.cpp +++ b/neo/idlib/MapFile.cpp @@ -2776,7 +2776,13 @@ unsigned int MapPolygonMesh::GetGeometryCRC() const unsigned int crc = 0; for( i = 0; i < verts.Num(); i++ ) { +#if 0 crc ^= StringCRC( ( verts[i].xyz * ( i + 1 ) ).ToString() ); +#else + crc ^= FloatCRC( verts[i].xyz.x * ( i + 1 ) ); + crc ^= FloatCRC( verts[i].xyz.y * ( i + 1 ) ); + crc ^= FloatCRC( verts[i].xyz.z * ( i + 1 ) ); +#endif } for( i = 0; i < polygons.Num(); i++ )