]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mod_skeletal_animatevertices_generic.c
Fix engine not starting on Windows if linked against SDL > 2.0.5
[xonotic/darkplaces.git] / mod_skeletal_animatevertices_generic.c
index 5c1045e460a700c611a60381fc36a9787b6b76a4..5a1047d9798bd89c541ed5ca566c15d17c3ab110 100644 (file)
@@ -10,7 +10,7 @@ void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, con
 
        //unsigned long long ts = rdtsc();
        bonepose = (float *) Mod_Skeletal_AnimateVertices_AllocBuffers(sizeof(float[12]) * (model->num_bones*2 + model->surfmesh.num_blends));
-       boneposerelative = bonepose + model->num_bones;
+       boneposerelative = bonepose + model->num_bones * 12;
 
        Mod_Skeletal_BuildTransforms(model, frameblend, skeleton, bonepose, boneposerelative);
 
@@ -66,19 +66,19 @@ void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, con
                        const float * RESTRICT n = model->surfmesh.data_normal3f;
                        if (svector3f && tvector3f)
                        {
-                               const float * RESTRICT sv = model->surfmesh.data_svector3f;
-                               const float * RESTRICT tv = model->surfmesh.data_tvector3f;
+                               const float * RESTRICT svec = model->surfmesh.data_svector3f;
+                               const float * RESTRICT tvec = model->surfmesh.data_tvector3f;
 
                                // Note that for SSE each iteration stores one element past end, so we break one vertex short
                                // and handle that with scalars in that case
-                               for (i = 0; i < model->surfmesh.num_vertices; i++, v += 3, n += 3, sv += 3, tv += 3, b++,
+                               for (i = 0; i < model->surfmesh.num_vertices; i++, v += 3, n += 3, svec += 3, tvec += 3, b++,
                                                vertex3f += 3, normal3f += 3, svector3f += 3, tvector3f += 3)
                                {
                                        LOAD_MATRIX4();
                                        TRANSFORM_POSITION(v, vertex3f);
                                        TRANSFORM_VECTOR(n, normal3f);
-                                       TRANSFORM_VECTOR(sv, svector3f);
-                                       TRANSFORM_VECTOR(tv, tvector3f);
+                                       TRANSFORM_VECTOR(svec, svector3f);
+                                       TRANSFORM_VECTOR(tvec, tvector3f);
                                }
 
                                return;
@@ -114,23 +114,23 @@ void Mod_Skeletal_AnimateVertices_Generic(const dp_model_t * RESTRICT model, con
 
        if (svector3f)
        {
-               const float * RESTRICT sv = model->surfmesh.data_svector3f;
+               const float * RESTRICT svec = model->surfmesh.data_svector3f;
                const unsigned short * RESTRICT b = model->surfmesh.blends;
-               for (i = 0; i < model->surfmesh.num_vertices; i++, sv += 3, b++, svector3f += 3)
+               for (i = 0; i < model->surfmesh.num_vertices; i++, svec += 3, b++, svector3f += 3)
                {
                        LOAD_MATRIX3();
-                       TRANSFORM_VECTOR(sv, svector3f);
+                       TRANSFORM_VECTOR(svec, svector3f);
                }
        }
 
        if (tvector3f)
        {
-               const float * RESTRICT tv = model->surfmesh.data_tvector3f;
+               const float * RESTRICT tvec = model->surfmesh.data_tvector3f;
                const unsigned short * RESTRICT b = model->surfmesh.blends;
-               for (i = 0; i < model->surfmesh.num_vertices; i++, tv += 3, b++, tvector3f += 3)
+               for (i = 0; i < model->surfmesh.num_vertices; i++, tvec += 3, b++, tvector3f += 3)
                {
                        LOAD_MATRIX3();
-                       TRANSFORM_VECTOR(tv, tvector3f);
+                       TRANSFORM_VECTOR(tvec, tvector3f);
                }
        }
 }