summaryrefslogtreecommitdiff
path: root/src/mesa/math
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/math')
-rw-r--r--src/mesa/math/m_debug_xform.c3
-rw-r--r--src/mesa/math/m_matrix.h12
-rw-r--r--src/mesa/math/m_xform.c8
-rw-r--r--src/mesa/math/mathmod.h2
4 files changed, 14 insertions, 11 deletions
diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c
index ec22c7052d..df8cc066b6 100644
--- a/src/mesa/math/m_debug_xform.c
+++ b/src/mesa/math/m_debug_xform.c
@@ -206,7 +206,8 @@ static int test_transform_function( transform_func func, int psize,
case VAR:
break;
default:
- abort();
+ ASSERT(0);
+ return 0;
}
}
}
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h
index e8303f3ac5..a8d9000e89 100644
--- a/src/mesa/math/m_matrix.h
+++ b/src/mesa/math/m_matrix.h
@@ -189,6 +189,18 @@ do { \
} while (0)
+/**
+ * Transform a direction by a matrix.
+ */
+#define TRANSFORM_DIRECTION( TO, DIR, MAT ) \
+do { \
+ TO[0] = DIR[0] * MAT[0] + DIR[1] * MAT[4] + DIR[2] * MAT[8]; \
+ TO[1] = DIR[0] * MAT[1] + DIR[1] * MAT[5] + DIR[2] * MAT[9]; \
+ TO[2] = DIR[0] * MAT[2] + DIR[1] * MAT[6] + DIR[2] * MAT[10];\
+} while (0)
+
+
+
/*@}*/
diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c
index 901ae5b416..fdc8abd434 100644
--- a/src/mesa/math/m_xform.c
+++ b/src/mesa/math/m_xform.c
@@ -220,11 +220,3 @@ _math_init_transformation( void )
_mesa_init_all_x86_64_transform_asm();
#endif
}
-
-void
-_math_init( void )
-{
- _math_init_transformation();
- _math_init_translate();
- _math_init_eval();
-}
diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h
index 6fbaaea94b..fb0862b5b1 100644
--- a/src/mesa/math/mathmod.h
+++ b/src/mesa/math/mathmod.h
@@ -36,6 +36,4 @@
#ifndef _MESA_MATH_H_
#define _MESA_MATH_H_
-extern void _math_init( void );
-
#endif