From: molivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Tue, 3 Dec 2002 10:16:37 +0000 (+0000)
Subject: Removed some warnings in MSVC6
X-Git-Tag: RELEASE_0_2_0_RC1~31
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=761080f3cc6ee2f9e7005db7155f503b8744ff06;p=xonotic%2Fdarkplaces.git

Removed some warnings in MSVC6


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2677 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/matrixlib.c b/matrixlib.c
index 6edcf8a4..4672861e 100644
--- a/matrixlib.c
+++ b/matrixlib.c
@@ -126,15 +126,15 @@ void Matrix4x4_Invert_Simple (matrix4x4_t *out, const matrix4x4_t *in1)
 
 	// invert the rotation by transposing and multiplying by the squared
 	// recipricol of the input matrix scale as described above
-	out->m[0][0] = in1->m[0][0] * scale;
-	out->m[0][1] = in1->m[1][0] * scale;
-	out->m[0][2] = in1->m[2][0] * scale;
-	out->m[1][0] = in1->m[0][1] * scale;
-	out->m[1][1] = in1->m[1][1] * scale;
-	out->m[1][2] = in1->m[2][1] * scale;
-	out->m[2][0] = in1->m[0][2] * scale;
-	out->m[2][1] = in1->m[1][2] * scale;
-	out->m[2][2] = in1->m[2][2] * scale;
+	out->m[0][0] = (float)(in1->m[0][0] * scale);
+	out->m[0][1] = (float)(in1->m[1][0] * scale);
+	out->m[0][2] = (float)(in1->m[2][0] * scale);
+	out->m[1][0] = (float)(in1->m[0][1] * scale);
+	out->m[1][1] = (float)(in1->m[1][1] * scale);
+	out->m[1][2] = (float)(in1->m[2][1] * scale);
+	out->m[2][0] = (float)(in1->m[0][2] * scale);
+	out->m[2][1] = (float)(in1->m[1][2] * scale);
+	out->m[2][2] = (float)(in1->m[2][2] * scale);
 
 	// invert the translate
 	out->m[0][3] = -(in1->m[0][3] * out->m[0][0] + in1->m[1][3] * out->m[0][1] + in1->m[2][3] * out->m[0][2]);
@@ -194,14 +194,14 @@ void Matrix4x4_CreateRotate (matrix4x4_t *out, float angle, float x, float y, fl
 
 	len = x*x+y*y+z*z;
 	if (len != 0.0f)
-		len = 1.0f / sqrt(len);
+		len = 1.0f / (float)sqrt(len);
 	x *= len;
 	y *= len;
 	z *= len;
 
-	angle *= -M_PI / 180.0;
-	c = cos(angle);
-	s = sin(angle);
+	angle *= (float)(-M_PI / 180.0);
+	c = (float)cos(angle);
+	s = (float)sin(angle);
 
 	out->m[0][0]=x * x + c * (1 - x * x);
 	out->m[0][1]=x * y * (1 - c) + z * s;
@@ -274,17 +274,17 @@ void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, float x, float y, float z
 	angle = roll * (M_PI*2 / 360);
 	sr = sin(angle);
 	cr = cos(angle);
-	out->m[0][0] = (cp*cy) * scale;
-	out->m[0][1] = (sr*sp*cy+cr*-sy) * scale;
-	out->m[0][2] = (cr*sp*cy+-sr*-sy) * scale;
+	out->m[0][0] = (float)((cp*cy) * scale);
+	out->m[0][1] = (float)((sr*sp*cy+cr*-sy) * scale);
+	out->m[0][2] = (float)((cr*sp*cy+-sr*-sy) * scale);
 	out->m[0][3] = x;
-	out->m[1][0] = (cp*sy) * scale;
-	out->m[1][1] = (sr*sp*sy+cr*cy) * scale;
-	out->m[1][2] = (cr*sp*sy+-sr*cy) * scale;
+	out->m[1][0] = (float)((cp*sy) * scale);
+	out->m[1][1] = (float)((sr*sp*sy+cr*cy) * scale);
+	out->m[1][2] = (float)((cr*sp*sy+-sr*cy) * scale);
 	out->m[1][3] = y;
-	out->m[2][0] = (-sp) * scale;
-	out->m[2][1] = (sr*cp) * scale;
-	out->m[2][2] = (cr*cp) * scale;
+	out->m[2][0] = (float)((-sp) * scale);
+	out->m[2][1] = (float)((sr*cp) * scale);
+	out->m[2][2] = (float)((cr*cp) * scale);
 	out->m[2][3] = z;
 	out->m[3][0] = 0;
 	out->m[3][1] = 0;