]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
better fix for skeletal no-bones case
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Sep 2011 14:05:06 +0000 (14:05 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Sep 2011 14:05:06 +0000 (14:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11377 d7cf8633-e32d-0410-b094-e92efae38249

mod_skeletal_animatevertices_generic.c
mod_skeletal_animatevertices_sse.c
model_alias.c

index f95277af84079a0fda368d35e1eae445b6ef4d0d..00ab435d9661176aeb80ba1baee7a087ffed448a 100644 (file)
@@ -16,18 +16,6 @@ void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, con
        float m[12];
        const blendweights_t * RESTRICT weights;
 
-       if (!model->surfmesh.num_vertices)
-               return;
-
-       if (!model->num_bones)
-       {
-               if (vertex3f) memcpy(vertex3f, model->surfmesh.data_vertex3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (normal3f) memcpy(normal3f, model->surfmesh.data_normal3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (svector3f) memcpy(svector3f, model->surfmesh.data_svector3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (tvector3f) memcpy(tvector3f, model->surfmesh.data_tvector3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               return;
-       }
-
        //unsigned long long ts = rdtsc();
        bonepose = (float12_t *) Mod_Skeletal_AnimateVertices_AllocBuffers(sizeof(float12_t) * (model->num_bones*2 + model->surfmesh.num_blends));
        boneposerelative = bonepose + model->num_bones;
index 8c41b600c45594020a29e6b736e82278a6c7b593..f575d24522db67e7b2d3f604e639905f8d6706c4 100644 (file)
@@ -20,18 +20,6 @@ void Mod_Skeletal_AnimateVertices_SSE(const dp_model_t * RESTRICT model, const f
        const blendweights_t * RESTRICT weights;
        int num_vertices_minus_one;
 
-       if (!model->surfmesh.num_vertices)
-               return;
-
-       if (!model->num_bones)
-       {
-               if (vertex3f) memcpy(vertex3f, model->surfmesh.data_vertex3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (normal3f) memcpy(normal3f, model->surfmesh.data_normal3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (svector3f) memcpy(svector3f, model->surfmesh.data_svector3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               if (tvector3f) memcpy(tvector3f, model->surfmesh.data_tvector3f, model->surfmesh.num_vertices*sizeof(float[3]));
-               return;
-       }
-
        num_vertices_minus_one = model->surfmesh.num_vertices - 1;
 
        //unsigned long long ts = rdtsc();
index 6982028ec6b8c90be19a44e48d3c9d6a7fa68865..4ddcfc975cfbd8c0c1b1f0d939df658d4e8b5d0b 100644 (file)
@@ -63,6 +63,19 @@ void *Mod_Skeletal_AnimateVertices_AllocBuffers(size_t nbytes)
 
 void Mod_Skeletal_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f)
 {
+
+       if (!model->surfmesh.num_vertices)
+               return;
+
+       if (!model->num_bones)
+       {
+               if (vertex3f) memcpy(vertex3f, model->surfmesh.data_vertex3f, model->surfmesh.num_vertices*sizeof(float[3]));
+               if (normal3f) memcpy(normal3f, model->surfmesh.data_normal3f, model->surfmesh.num_vertices*sizeof(float[3]));
+               if (svector3f) memcpy(svector3f, model->surfmesh.data_svector3f, model->surfmesh.num_vertices*sizeof(float[3]));
+               if (tvector3f) memcpy(tvector3f, model->surfmesh.data_tvector3f, model->surfmesh.num_vertices*sizeof(float[3]));
+               return;
+       }
+
 #ifdef SSE_POSSIBLE
        if(r_skeletal_use_sse_defined)
                if(r_skeletal_use_sse.integer)