dos3d
diff src/mingl.c @ 17:1e9f0b3616fa
fixed the matrix multiplication order
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 30 Nov 2011 00:04:16 +0200 |
parents | 7b574ba5758e |
children | 00d84ab1ef26 |
line diff
1.1 --- a/src/mingl.c Tue Nov 29 07:23:57 2011 +0200 1.2 +++ b/src/mingl.c Wed Nov 30 00:04:16 2011 +0200 1.3 @@ -19,6 +19,7 @@ 1.4 #include <stdlib.h> 1.5 #include <string.h> 1.6 #include <math.h> 1.7 +#include <limits.h> 1.8 #include <assert.h> 1.9 #include "mingl.h" 1.10 #include "mglimpl.h" 1.11 @@ -412,7 +413,7 @@ 1.12 memcpy(dest, mat, 16 * sizeof *dest); 1.13 } 1.14 1.15 -#define M(i,j) (((j) << 2) + (i)) 1.16 +#define M(i,j) (((i) << 2) + (j)) 1.17 void mgl_mult_matrix(float *m2) 1.18 { 1.19 int i, j; 1.20 @@ -557,7 +558,7 @@ 1.21 for(i=0; i<MAX_SHIFT; i++) { 1.22 if((val >> i) == 1) { 1.23 *shiftp = i; 1.24 - *maskp = ~(0xffff << i); 1.25 + *maskp = ~(UINT_MAX << i); 1.26 return 0; 1.27 } 1.28 }