switch to using driFillInModes fix depthbuffer = 0
[mesa.git] / src / mesa / tnl / t_save_loopback.c
index b496a784c35db9c7f3662b9322b0ab4f60da6440..088b73609a6d1372ea63c8771fdf57affd7c5baa 100644 (file)
@@ -27,6 +27,7 @@
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
+#include "glheader.h"
 #include "context.h"
 #include "enums.h"
 #include "glapi.h"
@@ -168,7 +169,7 @@ static void index_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v)
 
 static void edgeflag_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v)
 {
-   ctx->Exec->EdgeFlag((v[0] == 1.0));
+   ctx->Exec->EdgeFlag((GLboolean)(v[0] == 1.0));
 }
 
 struct loopback_attr {
@@ -182,18 +183,20 @@ struct loopback_attr {
  * precalculated wrapping is wrong.
  */
 static void loopback_prim( GLcontext *ctx,
-                          struct tnl_vertex_list *list, GLuint i,
-                          struct loopback_attr *la, GLuint nr )
+                          const struct tnl_vertex_list *list, GLuint i,
+                          const struct loopback_attr *la, GLuint nr )
 {
    struct tnl_prim *prim = &list->prim[i];
    GLint begin = prim->start;
    GLint end = begin + prim->count;
    GLfloat *data;
-   GLint j, k;
+   GLint j;
+   GLuint k;
 
    if (prim->mode & PRIM_BEGIN) {
       glBegin( prim->mode & PRIM_MODE_MASK );
-   } else {
+   }
+   else {
       assert(i == 0);
       assert(begin == 0);
       begin += list->wrap_count;
@@ -229,8 +232,8 @@ static void loopback_prim( GLcontext *ctx,
  * primitives.
  */
 static void loopback_weak_prim( GLcontext *ctx,
-                               struct tnl_vertex_list *list, GLuint i,
-                               struct loopback_attr *la, GLuint nr )
+                               const struct tnl_vertex_list *list, GLuint i,
+                               const struct loopback_attr *la, GLuint nr )
 {
    if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) 
       loopback_prim( ctx, list, i, la, nr );
@@ -253,7 +256,8 @@ static void loopback_weak_prim( GLcontext *ctx,
 
 
 
-void _tnl_loopback_vertex_list( GLcontext *ctx, struct tnl_vertex_list *list )
+void _tnl_loopback_vertex_list( GLcontext *ctx,
+                                const struct tnl_vertex_list *list )
 {
    struct loopback_attr la[_TNL_ATTRIB_MAX];
    GLuint i, nr = 0;