summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>1999-11-04 19:42:28 +0000
committerKeith Whitwell <[email protected]>1999-11-04 19:42:28 +0000
commit30990a65f8e1fd67d394f0b4a73956975a65a215 (patch)
tree26bbc26874a8d1fb0037fd15edab7b295f452fd6 /src/mesa/main/varray.c
parent486e1f982e59010b4ad3d7d04b90f2a909c5bb8b (diff)
Fix for glerror on compilation of list containing gldrawelements calls
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 57564198906..29eb392de8b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1,4 +1,4 @@
-/* $Id: varray.c,v 1.5 1999/10/19 18:37:05 keithw Exp $ */
+/* $Id: varray.c,v 1.6 1999/11/04 19:42:28 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -825,34 +825,49 @@ void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count )
/* KW: Exactly fakes the effects of calling glArrayElement multiple times.
* Compilation is handled via. the IM->maybe_transform_vb() callback.
*/
+#if 1
#define DRAW_ELT(FUNC, TYPE) \
static void FUNC( GLcontext *ctx, GLenum mode, \
TYPE *indices, GLuint count ) \
{ \
GLuint i,j; \
\
- if (count) gl_Begin( ctx, mode ); \
+ gl_Begin( ctx, mode ); \
\
for (j = 0 ; j < count ; ) { \
- GLuint nr = MIN2( VB_MAX, count - j + VB_START ); \
struct immediate *IM = ctx->input; \
- GLuint sf = IM->Flag[VB_START]; \
+ GLuint start = IM->Start; \
+ GLuint nr = MIN2( VB_MAX, count - j + start ); \
+ GLuint sf = IM->Flag[start]; \
IM->FlushElt |= IM->ArrayEltFlush; \
\
- for (i = VB_START ; i < nr ; i++) { \
+ for (i = start ; i < nr ; i++) { \
IM->Elt[i] = (GLuint) *indices++; \
IM->Flag[i] = VERT_ELT; \
} \
\
- if (j == 0) IM->Flag[IM->Start] |= sf; \
+ if (j == 0) IM->Flag[start] |= sf; \
\
IM->Count = nr; \
- j += nr - VB_START; \
+ j += nr - start; \
\
if (j == count) gl_End( ctx ); \
IM->maybe_transform_vb( IM ); \
} \
}
+#else
+#define DRAW_ELT(FUNC, TYPE) \
+static void FUNC( GLcontext *ctx, GLenum mode, \
+ TYPE *indices, GLuint count ) \
+{ \
+ int i; \
+ glBegin(mode); \
+ for (i = 0 ; i < count ; i++) \
+ glArrayElement( indices[i] ); \
+ glEnd(); \
+}
+#endif
+
DRAW_ELT( draw_elt_ubyte, GLubyte )
DRAW_ELT( draw_elt_ushort, GLushort )