-/* $Id: m_trans_tmp.h,v 1.5 2001/03/12 02:02:36 gareth Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 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"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/*
- * New (3.1) transformation code written by Keith Whitwell.
- */
-
-
-/* KW: This file also included by tnl/trans_elt.c to build code
- * specific to the implementation of array-elements in the
- * tnl module.
+/**
+ * \brief Templates for vector conversions.
+ * \author Keith Whitwell.
*/
-
#ifdef DEST_4F
static void DEST_4F( GLfloat (*t)[4],
CONST void *ptr,
if (SZ >= 1) t[i][0] = TRX_4F(f, 0);
if (SZ >= 2) t[i][1] = TRX_4F(f, 1);
if (SZ >= 3) t[i][2] = TRX_4F(f, 2);
- if (SZ == 4) t[i][3] = TRX_4F(f, 3);
+ if (SZ == 4) t[i][3] = TRX_4F(f, 3); else t[i][3] = 1.0;
+ }
+ }
+}
+#endif
+
+
+
+#ifdef DEST_4FN
+static void DEST_4FN( GLfloat (*t)[4],
+ CONST void *ptr,
+ GLuint stride,
+ ARGS )
+{
+ const GLubyte *f = (GLubyte *) ptr + SRC_START * stride;
+ const GLubyte *first = f;
+ GLuint i;
+
+ (void) first;
+ (void) start;
+ for (i = DST_START ; i < n ; i++, NEXT_F) {
+ CHECK {
+ NEXT_F2;
+ if (SZ >= 1) t[i][0] = TRX_4FN(f, 0);
+ if (SZ >= 2) t[i][1] = TRX_4FN(f, 1);
+ if (SZ >= 3) t[i][2] = TRX_4FN(f, 2);
+ if (SZ == 4) t[i][3] = TRX_4FN(f, 3); else t[i][3] = 1.0;
}
}
}
#endif
-#ifdef DEST_3F
-static void DEST_3F( GLfloat (*t)[3],
+#ifdef DEST_3FN
+static void DEST_3FN( GLfloat (*t)[3],
CONST void *ptr,
GLuint stride,
ARGS )
for (i = DST_START ; i < n ; i++, NEXT_F) {
CHECK {
NEXT_F2;
- t[i][0] = TRX_3F(f, 0);
- t[i][1] = TRX_3F(f, 1);
- t[i][2] = TRX_3F(f, 2);
+ t[i][0] = TRX_3FN(f, 0);
+ t[i][1] = TRX_3FN(f, 1);
+ t[i][2] = TRX_3FN(f, 2);
}
}
}
GLuint stride,
ARGS )
{
- const GLushort *f = (GLushort *) ptr + SRC_START * stride;
- const GLushort *first = f;
+ const GLubyte *f = (GLubyte *) ((GLubyte *) ptr + SRC_START * stride);
+ const GLubyte *first = f;
GLuint i;
(void) start;
(void) first;
ASSERT(SZ == 1);
TAB(_1f)[SRC_IDX] = DEST_1F;
#endif
-#ifdef DEST_3F
+#ifdef DEST_3FN
ASSERT(SZ == 3);
- TAB(_3f)[SRC_IDX] = DEST_3F;
+ TAB(_3fn)[SRC_IDX] = DEST_3FN;
#endif
#ifdef DEST_4UB
TAB(_4ub)[SZ][SRC_IDX] = DEST_4UB;
#ifdef DEST_4F
TAB(_4f)[SZ][SRC_IDX] = DEST_4F;
#endif
+#ifdef DEST_4FN
+ TAB(_4fn)[SZ][SRC_IDX] = DEST_4FN;
+#endif
}
+#ifdef INIT
#undef INIT
+#endif
+#ifdef DEST_1UI
#undef DEST_1UI
+#endif
+#ifdef DEST_1UB
#undef DEST_1UB
+#endif
+#ifdef DEST_4UB
#undef DEST_4UB
+#endif
+#ifdef DEST_4US
#undef DEST_4US
-#undef DEST_3F
+#endif
+#ifdef DEST_3FN
+#undef DEST_3FN
+#endif
+#ifdef DEST_4F
#undef DEST_4F
+#endif
+#ifdef DEST_4FN
+#undef DEST_4FN
+#endif
+#ifdef DEST_1F
#undef DEST_1F
+#endif
+#ifdef SZ
#undef SZ
+#endif
+#ifdef TAG
#undef TAG
+#endif
+