vbo: minor optimisation in vbo_exec_DrawRangeElements
[mesa.git] / src / mesa / vbo / vbo_save_loopback.c
index f2cef698fbedaab9938cfde6f0109b2029960f53..51e598e7e614a9ddc0f60135f70753ad3022cf22 100644 (file)
  * 
  **************************************************************************/
 
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/swrast.h"
-#include "tnl/tnl.h"
 #include "main/context.h"
 #include "main/glheader.h"
 #include "main/enums.h"
 #include "main/imports.h"
-#include "main/macros.h"
+#include "main/mfeatures.h"
 #include "main/mtypes.h"
-#include "glapi/dispatch.h"
+#include "main/dispatch.h"
 #include "glapi/glapi.h"
 
 #include "vbo_context.h"
 
 
+#if FEATURE_dlist
 
-typedef void (*attr_func)( GLcontext *ctx, GLint target, const GLfloat * );
+
+typedef void (*attr_func)( struct gl_context *ctx, GLint target, const GLfloat * );
 
 
 /* This file makes heavy use of the aliasing of NV vertex attributes
  * with the legacy attributes, and also with ARB and Material
  * attributes as currently implemented.
  */
-static void VertexAttrib1fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
+static void VertexAttrib1fvNV(struct gl_context *ctx, GLint target, const GLfloat *v)
 {
    CALL_VertexAttrib1fvNV(ctx->Exec, (target, v));
 }
 
-static void VertexAttrib2fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
+static void VertexAttrib2fvNV(struct gl_context *ctx, GLint target, const GLfloat *v)
 {
    CALL_VertexAttrib2fvNV(ctx->Exec, (target, v));
 }
 
-static void VertexAttrib3fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
+static void VertexAttrib3fvNV(struct gl_context *ctx, GLint target, const GLfloat *v)
 {
    CALL_VertexAttrib3fvNV(ctx->Exec, (target, v));
 }
 
-static void VertexAttrib4fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
+static void VertexAttrib4fvNV(struct gl_context *ctx, GLint target, const GLfloat *v)
 {
    CALL_VertexAttrib4fvNV(ctx->Exec, (target, v));
 }
@@ -82,10 +81,10 @@ struct loopback_attr {
 };
 
 /* Don't emit ends and begins on wrapped primitives.  Don't replay
- * wrapped vertices.  If we get here, it's probably because the the
+ * wrapped vertices.  If we get here, it's probably because the
  * precalculated wrapping is wrong.
  */
-static void loopback_prim( GLcontext *ctx,
+static void loopback_prim( struct gl_context *ctx,
                           const GLfloat *buffer,
                           const struct _mesa_prim *prim,
                           GLuint wrap_count,
@@ -99,12 +98,12 @@ static void loopback_prim( GLcontext *ctx,
    GLuint k;
 
    if (0)
-      _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n",
-                  _mesa_lookup_enum_by_nr(prim->mode),
-                  prim->begin ? "begin" : "..",
-                  prim->end ? "end" : "..",
-                  start, 
-                  end);
+      printf("loopback prim %s(%s,%s) verts %d..%d\n",
+            _mesa_lookup_prim_by_nr(prim->mode),
+            prim->begin ? "begin" : "..",
+            prim->end ? "end" : "..",
+            start, 
+            end);
 
    if (prim->begin) {
       CALL_Begin(GET_DISPATCH(), ( prim->mode ));
@@ -140,7 +139,7 @@ static void loopback_prim( GLcontext *ctx,
  * normally, otherwise need to track and discard the generated
  * primitives.
  */
-static void loopback_weak_prim( GLcontext *ctx,
+static void loopback_weak_prim( struct gl_context *ctx,
                                const struct _mesa_prim *prim )
 {
    /* Use the prim_weak flag to ensure that if this primitive
@@ -157,7 +156,7 @@ static void loopback_weak_prim( GLcontext *ctx,
 }
 
 
-void vbo_loopback_vertex_list( GLcontext *ctx,
+void vbo_loopback_vertex_list( struct gl_context *ctx,
                               const GLfloat *buffer,
                               const GLubyte *attrsz,
                               const struct _mesa_prim *prim,
@@ -192,3 +191,6 @@ void vbo_loopback_vertex_list( GLcontext *ctx,
       }
    }
 }
+
+
+#endif /* FEATURE_dlist */