From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Tue, 25 Sep 2007 18:52:03 +0000 (+0000)
Subject: use bigger prime numbers in calculating vertex hash indices to improve
X-Git-Tag: xonotic-v0.1.0preview~2891
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f465d006a235214974ad19d9864007e7af6fa56f;p=xonotic%2Fdarkplaces.git

use bigger prime numbers in calculating vertex hash indices to improve
loading performance


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7586 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/model_shared.c b/model_shared.c
index b5276236..16bc5022 100644
--- a/model_shared.c
+++ b/model_shared.c
@@ -818,7 +818,7 @@ int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, float *vertex14f)
 	int hashindex, vnum;
 	shadowmeshvertexhash_t *hash;
 	// this uses prime numbers intentionally
-	hashindex = (unsigned int) (vertex14f[0] * 3 + vertex14f[1] * 5 + vertex14f[2] * 7) % SHADOWMESHVERTEXHASH;
+	hashindex = (unsigned int) (vertex14f[0] * 29 + vertex14f[1] * 71 + vertex14f[2] * 113) % SHADOWMESHVERTEXHASH;
 	for (hash = mesh->vertexhashtable[hashindex];hash;hash = hash->next)
 	{
 		vnum = (hash - mesh->vertexhashentries);