]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authordivverent divverent@d7cf8633-e32d-0410-b094-e92efae38249 <>
Sat, 4 Sep 2010 15:39:43 +0000 (15:39 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:00:20 +0000 (22:00 +0200)
optimize R_AnimCache_UpdateEntityMeshBuffers to use memcpy instead of VectorCopy, Steel Storm 150fps -> 167fps (now only effective in D3D mode, as this path is usually not used any more in OpenGL)

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

gl_rmain.c

index 67f45bb68bd6c64e2d70cb223be35d25bed0bbc4..c30a63854781fd533a9af2b9efa94ea9fbc68244 100644 (file)
@@ -7805,7 +7805,7 @@ void R_AnimCache_UpdateEntityMeshBuffers(entity_render_t *ent, int numvertices)
        {
                /*
                for (i = 0;i < numvertices;i++)
-                       memcpy(ent->animcache_vertexposition[i].vertex3f, ent->animcache_vertex3f + 3*i, sizeof(float[3]));
+                       VectorCopy(ent->animcache_vertex3f + 3*i, ent->animcache_vertexposition[i].vertex3f);
                */
                // TODO: upload vertex buffer?
        }
@@ -7813,16 +7813,16 @@ void R_AnimCache_UpdateEntityMeshBuffers(entity_render_t *ent, int numvertices)
        {
                memcpy(ent->animcache_vertexmesh, ent->model->surfmesh.vertexmesh, sizeof(r_vertexmesh_t)*numvertices);
                for (i = 0;i < numvertices;i++)
-                       memcpy(ent->animcache_vertexmesh[i].vertex3f, ent->animcache_vertex3f + 3*i, sizeof(float[3]));
+                       VectorCopy(ent->animcache_vertex3f + 3*i, ent->animcache_vertexmesh[i].vertex3f);
                if (ent->animcache_svector3f)
                        for (i = 0;i < numvertices;i++)
-                               memcpy(ent->animcache_vertexmesh[i].svector3f, ent->animcache_svector3f + 3*i, sizeof(float[3]));
+                               VectorCopy(ent->animcache_svector3f + 3*i, ent->animcache_vertexmesh[i].svector3f);
                if (ent->animcache_tvector3f)
                        for (i = 0;i < numvertices;i++)
-                               memcpy(ent->animcache_vertexmesh[i].tvector3f, ent->animcache_tvector3f + 3*i, sizeof(float[3]));
+                               VectorCopy(ent->animcache_tvector3f + 3*i, ent->animcache_vertexmesh[i].tvector3f);
                if (ent->animcache_normal3f)
                        for (i = 0;i < numvertices;i++)
-                               memcpy(ent->animcache_vertexmesh[i].normal3f, ent->animcache_normal3f + 3*i, sizeof(float[3]));
+                               VectorCopy(ent->animcache_normal3f + 3*i, ent->animcache_vertexmesh[i].normal3f);
                // TODO: upload vertex buffer?
        }
 }