]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix warnings.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 12:27:16 +0000 (12:27 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 12:27:16 +0000 (12:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12202 d7cf8633-e32d-0410-b094-e92efae38249

collision.c
collision.h
csprogs.c
model_brush.h
netconn.c

index f440042c7c1613aed97b7be8d62125c4e613fd44..3d148a8bbdebbfcc79c0cc6c8841add3a124ac2b 100644 (file)
@@ -1374,7 +1374,7 @@ static void Collision_TransformBrush(const matrix4x4_t *matrix, colbrushf_t *bru
        // now we can transform the data
        for(i = 0; i < brush->numplanes; ++i)
        {
-               Matrix4x4_TransformPositivePlane(matrix, brush->planes[i].normal[0], brush->planes[i].normal[1], brush->planes[i].normal[2], brush->planes[i].dist, brush->planes[i].normal);
+               Matrix4x4_TransformPositivePlane(matrix, brush->planes[i].normal[0], brush->planes[i].normal[1], brush->planes[i].normal[2], brush->planes[i].dist, brush->planes[i].normal_and_dist);
        }
        for(i = 0; i < brush->numedgedirs; ++i)
        {
@@ -1778,7 +1778,7 @@ void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const fram
 
        // transform plane
        // NOTE: this relies on plane.dist being directly after plane.normal
-       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal);
+       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist);
 }
 
 void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontents, float extend)
@@ -1814,7 +1814,7 @@ void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const
 
        // transform plane
        // NOTE: this relies on plane.dist being directly after plane.normal
-       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal);
+       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist);
 }
 
 void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontents, float extend, qboolean hitsurfaces)
@@ -1849,7 +1849,7 @@ void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const
        VectorCopy(start, trace->endpos);
        // transform plane
        // NOTE: this relies on plane.dist being directly after plane.normal
-       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal);
+       Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist);
 }
 
 void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, int hitsupercontents)
index 70fbd48551bd90cd69a3e54bd1c0fb7dd1d0d677..e0770827d9fa761dda12166d36a5ac2787c119e4 100644 (file)
@@ -9,7 +9,7 @@ typedef union plane_s
                vec3_t  normal;
                vec_t   dist;
        };
-       vec4_t dist_and_normal;
+       vec4_t normal_and_dist;
 }
 plane_t;
 
index 64e21e68a92ed7b66dba2778bfc9da9227b6a7a1..b1598ddadd97a68df5172545aaec41f2dd251e63 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -1242,7 +1242,7 @@ qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clip
                                Matrix4x4_Invert_Full(&mat, viewmatrix);
                                Matrix4x4_FromVectors(viewmatrix, forward, left, up, origin);
                                Matrix4x4_Concat(&matq, viewmatrix, &mat);
-                               Matrix4x4_TransformPositivePlane(&matq, clipplane->normal[0], clipplane->normal[1], clipplane->normal[2], clipplane->dist, &clipplane->normal[0]);
+                               Matrix4x4_TransformPositivePlane(&matq, clipplane->normal[0], clipplane->normal[1], clipplane->normal[2], clipplane->dist, clipplane->normal_and_dist);
                        }
                }
        CSQC_END
index d103f4543fa596a21329d24b8bc2364ebba5f8da..0c07048971f24701598428eb78a678dd7923148e 100644 (file)
@@ -48,8 +48,15 @@ mvertex_t;
 // plane_t structure
 typedef struct mplane_s
 {
-       vec3_t normal;
-       float dist;
+       union
+       {
+               struct
+               {
+                       vec3_t normal;
+                       vec_t dist;
+               };
+               vec4_t normal_and_dist;
+       };
        // for texture axis selection and fast side tests
        int type; // set by PlaneClassify()
        int signbits; // set by PlaneClassify()
index 9db3a473c311baab53a27840c628c8a2712d0d50..9b53ed3f5ea605c457a61257917f38280fa21e25 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1213,7 +1213,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
        if (protocol == PROTOCOL_QUAKEWORLD)
        {
                unsigned int sequence, sequence_ack;
-               int reliable_ack, reliable_message;
+               qboolean reliable_ack, reliable_message;
                int count;
                //int qport;
 
@@ -1234,8 +1234,8 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
                }
 
                conn->packetsReceived++;
-               reliable_message = (sequence >> 31) & 1;
-               reliable_ack = (sequence_ack >> 31) & 1;
+               reliable_message = (sequence >> 31) != 0;
+               reliable_ack = (sequence_ack >> 31) != 0;
                sequence &= ~(1<<31);
                sequence_ack &= ~(1<<31);
                if (sequence <= conn->qw.incoming_sequence)