fix a bunch of pointer type warnings introduced by the change to const parameters...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 May 2002 03:17:50 +0000 (03:17 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 May 2002 03:17:50 +0000 (03:17 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1865 d7cf8633-e32d-0410-b094-e92efae38249

gl_models.c
mathlib.c
mathlib.h
r_sprites.c

index 6f435a0..f8ca764 100644 (file)
@@ -568,7 +568,7 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
        m.m[2][1] = 0;
        m.m[2][2] = 1;
        m.m[2][3] = 0;
-       R_ConcatTransforms(&softwaretransform_matrix[0], &m.m[0], &rootmatrix.m[0]);
+       R_ConcatTransforms(&softwaretransform_matrix[0], &m.m[0][0], &rootmatrix.m[0][0]);
        */
 
        // LordHavoc: combine transform from zym coordinate space to quake coordinate space with model to world transform matrix
@@ -616,9 +616,9 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
                                        m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2 + bone3->m[2][2] * lerp3 + bone4->m[2][2] * lerp4;
                                        m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2 + bone3->m[2][3] * lerp3 + bone4->m[2][3] * lerp4;
                                        if (bone->parent >= 0)
-                                               R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+                                               R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
                                        else
-                                               R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+                                               R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
                                        bone1++;
                                        bone2++;
                                        bone3++;
@@ -645,9 +645,9 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
                                        m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2 + bone3->m[2][2] * lerp3;
                                        m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2 + bone3->m[2][3] * lerp3;
                                        if (bone->parent >= 0)
-                                               R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+                                               R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
                                        else
-                                               R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+                                               R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
                                        bone1++;
                                        bone2++;
                                        bone3++;
@@ -674,9 +674,9 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
                                m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2;
                                m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2;
                                if (bone->parent >= 0)
-                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
                                else
-                                       R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+                                       R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
                                bone1++;
                                bone2++;
                                bone++;
@@ -705,9 +705,9 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
                                m.m[2][2] = bone1->m[2][2] * lerp1;
                                m.m[2][3] = bone1->m[2][3] * lerp1;
                                if (bone->parent >= 0)
-                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
                                else
-                                       R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+                                       R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
                                bone1++;
                                bone++;
                        }
@@ -718,9 +718,9 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
                        for (i = 0, out = zymbonepose;i < count;i++, out++)
                        {
                                if (bone->parent >= 0)
-                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &bone1->m[0], &out->m[0]);
+                                       R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &bone1->m[0][0], &out->m[0][0]);
                                else
-                                       R_ConcatTransforms(&rootmatrix.m[0], &bone1->m[0], &out->m[0]);
+                                       R_ConcatTransforms(&rootmatrix.m[0][0], &bone1->m[0][0], &out->m[0][0]);
                                bone1++;
                                bone++;
                        }
index 19d6a9c..fa5b853 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -746,17 +746,17 @@ float VectorNormalizeLength2 (vec3_t v, vec3_t dest) // LordHavoc: added to allo
 R_ConcatRotations
 ================
 */
-void R_ConcatRotations (const float in1[3][3], const float in2[3][3], float out[3][3])
+void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3])
 {
-       out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];
-       out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];
-       out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];
-       out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];
-       out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];
-       out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];
-       out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];
-       out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];
-       out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];
+       out[0*3+ 0] = in1[0*3+ 0] * in2[0*3+ 0] + in1[0*3+ 1] * in2[1*3+ 0] + in1[0*3+ 2] * in2[2*3+ 0];
+       out[0*3+ 1] = in1[0*3+ 0] * in2[0*3+ 1] + in1[0*3+ 1] * in2[1*3+ 1] + in1[0*3+ 2] * in2[2*3+ 1];
+       out[0*3+ 2] = in1[0*3+ 0] * in2[0*3+ 2] + in1[0*3+ 1] * in2[1*3+ 2] + in1[0*3+ 2] * in2[2*3+ 2];
+       out[1*3+ 0] = in1[1*3+ 0] * in2[0*3+ 0] + in1[1*3+ 1] * in2[1*3+ 0] + in1[1*3+ 2] * in2[2*3+ 0];
+       out[1*3+ 1] = in1[1*3+ 0] * in2[0*3+ 1] + in1[1*3+ 1] * in2[1*3+ 1] + in1[1*3+ 2] * in2[2*3+ 1];
+       out[1*3+ 2] = in1[1*3+ 0] * in2[0*3+ 2] + in1[1*3+ 1] * in2[1*3+ 2] + in1[1*3+ 2] * in2[2*3+ 2];
+       out[2*3+ 0] = in1[2*3+ 0] * in2[0*3+ 0] + in1[2*3+ 1] * in2[1*3+ 0] + in1[2*3+ 2] * in2[2*3+ 0];
+       out[2*3+ 1] = in1[2*3+ 0] * in2[0*3+ 1] + in1[2*3+ 1] * in2[1*3+ 1] + in1[2*3+ 2] * in2[2*3+ 1];
+       out[2*3+ 2] = in1[2*3+ 0] * in2[0*3+ 2] + in1[2*3+ 1] * in2[1*3+ 2] + in1[2*3+ 2] * in2[2*3+ 2];
 }
 
 
@@ -765,20 +765,20 @@ void R_ConcatRotations (const float in1[3][3], const float in2[3][3], float out[
 R_ConcatTransforms
 ================
 */
-void R_ConcatTransforms (const float in1[3][4], const float in2[3][4], float out[3][4])
+void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4])
 {
-       out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];
-       out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];
-       out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];
-       out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] + in1[0][2] * in2[2][3] + in1[0][3];
-       out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];
-       out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];
-       out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];
-       out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] + in1[1][2] * in2[2][3] + in1[1][3];
-       out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];
-       out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];
-       out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];
-       out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] + in1[2][2] * in2[2][3] + in1[2][3];
+       out[0*4+0] = in1[0*4+0] * in2[0*4+0] + in1[0*4+1] * in2[1*4+0] + in1[0*4+2] * in2[2*4+0];
+       out[0*4+1] = in1[0*4+0] * in2[0*4+1] + in1[0*4+1] * in2[1*4+1] + in1[0*4+2] * in2[2*4+1];
+       out[0*4+2] = in1[0*4+0] * in2[0*4+2] + in1[0*4+1] * in2[1*4+2] + in1[0*4+2] * in2[2*4+2];
+       out[0*4+3] = in1[0*4+0] * in2[0*4+3] + in1[0*4+1] * in2[1*4+3] + in1[0*4+2] * in2[2*4+3] + in1[0*4+3];
+       out[1*4+0] = in1[1*4+0] * in2[0*4+0] + in1[1*4+1] * in2[1*4+0] + in1[1*4+2] * in2[2*4+0];
+       out[1*4+1] = in1[1*4+0] * in2[0*4+1] + in1[1*4+1] * in2[1*4+1] + in1[1*4+2] * in2[2*4+1];
+       out[1*4+2] = in1[1*4+0] * in2[0*4+2] + in1[1*4+1] * in2[1*4+2] + in1[1*4+2] * in2[2*4+2];
+       out[1*4+3] = in1[1*4+0] * in2[0*4+3] + in1[1*4+1] * in2[1*4+3] + in1[1*4+2] * in2[2*4+3] + in1[1*4+3];
+       out[2*4+0] = in1[2*4+0] * in2[0*4+0] + in1[2*4+1] * in2[1*4+0] + in1[2*4+2] * in2[2*4+0];
+       out[2*4+1] = in1[2*4+0] * in2[0*4+1] + in1[2*4+1] * in2[1*4+1] + in1[2*4+2] * in2[2*4+1];
+       out[2*4+2] = in1[2*4+0] * in2[0*4+2] + in1[2*4+1] * in2[1*4+2] + in1[2*4+2] * in2[2*4+2];
+       out[2*4+3] = in1[2*4+0] * in2[0*4+3] + in1[2*4+1] * in2[1*4+3] + in1[2*4+2] * in2[2*4+3] + in1[2*4+3];
 }
 
 
index bd20e91..28e4d05 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -134,8 +134,8 @@ extern float m_bytenormals[NUMVERTEXNORMALS][3];
 qbyte NormalToByte(const vec3_t n);
 void ByteToNormal(qbyte num, vec3_t n);
 
-void R_ConcatRotations (const float in1[3][3], const float in2[3][3], float out[3][3]);
-void R_ConcatTransforms (const float in1[3][4], const float in2[3][4], float out[3][4]);
+void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3]);
+void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4]);
 
 void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
 // LordHavoc: proper matrix version of AngleVectors
index b2aa3ab..741a913 100644 (file)
@@ -118,7 +118,7 @@ int R_SpriteSetup (int type, float org[3], float left[3], float up[3])
                VectorCopy(vpn, matrix2[0]);
                VectorNegate(vright, matrix2[1]);
                VectorCopy(vup, matrix2[2]);
-               R_ConcatRotations (matrix1, matrix2, matrix3);
+               R_ConcatRotations (matrix1[0], matrix2[0], matrix3[0]);
                break;
        }