Drop GLcontext typedef and use struct gl_context instead
[mesa.git] / src / mesa / tnl / t_vb_rendertmp.h
index f0da0cdf0deac90875e99382f0a2ffc248fa56e2..4ed485a7bfdf7b89a5c23efc2355af58e480c121 100644 (file)
@@ -57,7 +57,7 @@
 #define RENDER_TAB_QUALIFIER static
 #endif
 
-static void TAG(render_points)( GLcontext *ctx,
+static void TAG(render_points)( struct gl_context *ctx,
                                GLuint start,
                                GLuint count,
                                GLuint flags )
@@ -70,7 +70,7 @@ static void TAG(render_points)( GLcontext *ctx,
    POSTFIX;
 }
 
-static void TAG(render_lines)( GLcontext *ctx,
+static void TAG(render_lines)( struct gl_context *ctx,
                               GLuint start,
                               GLuint count,
                               GLuint flags )
@@ -91,7 +91,7 @@ static void TAG(render_lines)( GLcontext *ctx,
 }
 
 
-static void TAG(render_line_strip)( GLcontext *ctx,
+static void TAG(render_line_strip)( struct gl_context *ctx,
                                    GLuint start,
                                    GLuint count,
                                    GLuint flags )
@@ -116,7 +116,7 @@ static void TAG(render_line_strip)( GLcontext *ctx,
 }
 
 
-static void TAG(render_line_loop)( GLcontext *ctx,
+static void TAG(render_line_loop)( struct gl_context *ctx,
                                   GLuint start,
                                   GLuint count,
                                   GLuint flags )
@@ -148,7 +148,7 @@ static void TAG(render_line_loop)( GLcontext *ctx,
          if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION_EXT)
             RENDER_LINE( ELT(count-1), ELT(start) );
          else
-            RENDER_LINE( ELT(count), ELT(start-1) ); /* XXX check this one */
+            RENDER_LINE( ELT(start), ELT(count-1) );
       }
    }
 
@@ -156,7 +156,7 @@ static void TAG(render_line_loop)( GLcontext *ctx,
 }
 
 
-static void TAG(render_triangles)( GLcontext *ctx,
+static void TAG(render_triangles)( struct gl_context *ctx,
                                   GLuint start,
                                   GLuint count,
                                   GLuint flags )
@@ -174,7 +174,7 @@ static void TAG(render_triangles)( GLcontext *ctx,
          if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION_EXT)
             RENDER_TRI( ELT(j-2), ELT(j-1), ELT(j) );
          else
-            RENDER_TRI( ELT(j), ELT(j-2), ELT(j-1) );
+            RENDER_TRI( ELT(j-1), ELT(j), ELT(j-2) );
       }
    } else {
       for (j=start+2; j<count; j+=3) {
@@ -189,7 +189,7 @@ static void TAG(render_triangles)( GLcontext *ctx,
 
 
 
-static void TAG(render_tri_strip)( GLcontext *ctx,
+static void TAG(render_tri_strip)( struct gl_context *ctx,
                                   GLuint start,
                                   GLuint count,
                                   GLuint flags )
@@ -201,22 +201,28 @@ static void TAG(render_tri_strip)( GLcontext *ctx,
    INIT(GL_TRIANGLE_STRIP);
    if (NEED_EDGEFLAG_SETUP) {
       for (j=start+2;j<count;j++,parity^=1) {
-        GLuint ej2 = ELT(j-2+parity);
-        GLuint ej1 = ELT(j-1-parity);
-        GLuint ej = ELT(j);
-        GLboolean ef2 = EDGEFLAG_GET( ej2 );
-        GLboolean ef1 = EDGEFLAG_GET( ej1 );
-        GLboolean ef = EDGEFLAG_GET( ej );
+         GLuint ej2, ej1, ej;
+         GLboolean ef2, ef1, ef;
+         if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION_EXT) {
+            ej2 = ELT(j-2+parity);
+            ej1 = ELT(j-1-parity);
+            ej = ELT(j);
+         }
+         else {
+            ej2 = ELT(j-1+parity);
+            ej1 = ELT(j-parity);
+            ej = ELT(j-2);
+         }
+        ef2 = EDGEFLAG_GET( ej2 );
+        ef1 = EDGEFLAG_GET( ej1 );
+        ef = EDGEFLAG_GET( ej );
         if (TEST_PRIM_BEGIN(flags)) {
            RESET_STIPPLE;
         }
         EDGEFLAG_SET( ej2, GL_TRUE );
         EDGEFLAG_SET( ej1, GL_TRUE );
         EDGEFLAG_SET( ej, GL_TRUE );
-         if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION_EXT)
-            RENDER_TRI( ej2, ej1, ej );
-         else
-            RENDER_TRI( ej, ej2, ej1 );
+         RENDER_TRI( ej2, ej1, ej );
         EDGEFLAG_SET( ej2, ef2 );
         EDGEFLAG_SET( ej1, ef1 );
         EDGEFLAG_SET( ej, ef );
@@ -226,14 +232,14 @@ static void TAG(render_tri_strip)( GLcontext *ctx,
          if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION_EXT)
             RENDER_TRI( ELT(j-2+parity), ELT(j-1-parity), ELT(j) );
          else
-            RENDER_TRI( ELT(j), ELT(j-2+parity), ELT(j-1-parity) );
+            RENDER_TRI( ELT(j-1+parity), ELT(j-parity), ELT(j-2) );
       }
    }
    POSTFIX;
 }
 
 
-static void TAG(render_tri_fan)( GLcontext *ctx,
+static void TAG(render_tri_fan)( struct gl_context *ctx,
                                 GLuint start,
                                 GLuint count,
                                 GLuint flags )
@@ -280,7 +286,7 @@ static void TAG(render_tri_fan)( GLcontext *ctx,
 }
 
 
-static void TAG(render_poly)( GLcontext *ctx,
+static void TAG(render_poly)( struct gl_context *ctx,
                              GLuint start,
                              GLuint count,
                              GLuint flags )
@@ -349,7 +355,7 @@ static void TAG(render_poly)( GLcontext *ctx,
    POSTFIX;
 }
 
-static void TAG(render_quads)( GLcontext *ctx,
+static void TAG(render_quads)( struct gl_context *ctx,
                               GLuint start,
                               GLuint count,
                               GLuint flags )
@@ -382,7 +388,7 @@ static void TAG(render_quads)( GLcontext *ctx,
    POSTFIX;
 }
 
-static void TAG(render_quad_strip)( GLcontext *ctx,
+static void TAG(render_quad_strip)( struct gl_context *ctx,
                                    GLuint start,
                                    GLuint count,
                                    GLuint flags )
@@ -430,7 +436,7 @@ static void TAG(render_quad_strip)( GLcontext *ctx,
    POSTFIX;
 }
 
-static void TAG(render_noop)( GLcontext *ctx,
+static void TAG(render_noop)( struct gl_context *ctx,
                              GLuint start,
                              GLuint count,
                              GLuint flags )
@@ -438,7 +444,7 @@ static void TAG(render_noop)( GLcontext *ctx,
    (void)(ctx && start && count && flags);
 }
 
-RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(GLcontext *,
+RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(struct gl_context *,
                                                           GLuint,
                                                           GLuint,
                                                           GLuint) =