summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/math/m_norm_tmp.h
diff options
context:
space:
mode:
authoralanh <alanh>2003-03-25 12:39:27 +0000
committeralanh <alanh>2003-03-25 12:39:27 +0000
commit82f30d01497980daf1d339ba6f5031a0de0e46d1 (patch)
tree667cfda64da3e25369f65161a6144818f094388e /xc/extras/Mesa/src/math/m_norm_tmp.h
parent881785ab41b1901f9d745358896bb603d023598a (diff)
merge current Mesa 5.1
Diffstat (limited to 'xc/extras/Mesa/src/math/m_norm_tmp.h')
-rw-r--r--xc/extras/Mesa/src/math/m_norm_tmp.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/xc/extras/Mesa/src/math/m_norm_tmp.h b/xc/extras/Mesa/src/math/m_norm_tmp.h
index 90ca38093..c12afe5d1 100644
--- a/xc/extras/Mesa/src/math/m_norm_tmp.h
+++ b/xc/extras/Mesa/src/math/m_norm_tmp.h
@@ -1,9 +1,10 @@
+/* $Id: m_norm_tmp.h,v 1.6 2003/03/25 12:41:07 alanh Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -68,10 +69,10 @@ TAG(transform_normalize_normals)( const GLmatrix *mat,
{
GLdouble len = tx*tx + ty*ty + tz*tz;
if (len > 1e-20) {
- GLdouble scale = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (tx * scale);
- out[i][1] = (GLfloat) (ty * scale);
- out[i][2] = (GLfloat) (tz * scale);
+ GLfloat scale = INV_SQRTF(len);
+ out[i][0] = tx * scale;
+ out[i][1] = ty * scale;
+ out[i][2] = tz * scale;
}
else {
out[i][0] = out[i][1] = out[i][2] = 0;
@@ -135,10 +136,10 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
{
GLdouble len = tx*tx + ty*ty + tz*tz;
if (len > 1e-20) {
- GLdouble scale = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (tx * scale);
- out[i][1] = (GLfloat) (ty * scale);
- out[i][2] = (GLfloat) (tz * scale);
+ GLfloat scale = INV_SQRTF(len);
+ out[i][0] = tx * scale;
+ out[i][1] = ty * scale;
+ out[i][2] = tz * scale;
}
else {
out[i][0] = out[i][1] = out[i][2] = 0;
@@ -322,10 +323,10 @@ TAG(normalize_normals)( const GLmatrix *mat,
const GLfloat x = from[0], y = from[1], z = from[2];
GLdouble len = x * x + y * y + z * z;
if (len > 1e-50) {
- len = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (x * len);
- out[i][1] = (GLfloat) (y * len);
- out[i][2] = (GLfloat) (z * len);
+ len = INV_SQRTF(len);
+ out[i][0] = x * len;
+ out[i][1] = y * len;
+ out[i][2] = z * len;
}
else {
out[i][0] = x;