]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authordivverent divverent@d7cf8633-e32d-0410-b094-e92efae38249 <>
Fri, 9 Jul 2010 17:21:51 +0000 (17:21 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:00:48 +0000 (22:00 +0200)
cleanup mempool use when generating a shadow mesh (one instance that used "loadmodel->mempool" that shouldn't)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10276 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::unmerge=a19a4d85d2b64f05334d015c6ccbe5c61166243a

model_shared.c

index 37bae9787e171895cf0cc7a79598e88f7b928280..cd01781cba0aa49c21c5973ae1fcab4346f8a7c4 100644 (file)
@@ -1187,7 +1187,7 @@ shadowmesh_t *Mod_ShadowMesh_Begin(mempool_t *mempool, int maxverts, int maxtria
        return Mod_ShadowMesh_Alloc(mempool, maxverts, maxtriangles, map_diffuse, map_specular, map_normal, light, neighbors, expandable);
 }
 
-static void Mod_ShadowMesh_CreateVBOs(shadowmesh_t *mesh, mempool_t *mempool)
+static void Mod_ShadowMesh_CreateVBOs(shadowmesh_t *mesh)
 {
        if (!mesh->numverts)
                return;
@@ -1199,7 +1199,7 @@ static void Mod_ShadowMesh_CreateVBOs(shadowmesh_t *mesh, mempool_t *mempool)
                int vertexindex;
                int numvertices = mesh->numverts;
                r_vertexmesh_t *vertexmesh;
-               mesh->vertexmesh = vertexmesh = (r_vertexmesh_t*)Mem_Alloc(mempool, numvertices * sizeof(*mesh->vertexmesh));
+               mesh->vertexmesh = vertexmesh = (r_vertexmesh_t*)Mem_Alloc(loadmodel->mempool, numvertices * sizeof(*mesh->vertexmesh));
                for (vertexindex = 0;vertexindex < numvertices;vertexindex++, vertexmesh++)
                {
                        VectorCopy(mesh->vertex3f + 3*vertexindex, vertexmesh->vertex3f);
@@ -1282,7 +1282,7 @@ shadowmesh_t *Mod_ShadowMesh_Finish(mempool_t *mempool, shadowmesh_t *firstmesh,
                                        newmesh->element3s[i] = newmesh->element3i[i];
                        }
                        if (createvbo)
-                               Mod_ShadowMesh_CreateVBOs(newmesh, mempool);
+                               Mod_ShadowMesh_CreateVBOs(newmesh);
                }
                Mem_Free(mesh);
        }