fix a variety of warnings/errors
[mesa.git] / src / mesa / swrast_setup / ss_triangle.c
index d106d4c3173d72110b54d3161b30473476dfe0c5..d37bdf71cbc361cd78c6af50d6f3542da7361742 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  6.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  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"),
@@ -42,8 +41,8 @@
 #define SS_UNFILLED_BIT            0x8
 #define SS_MAX_TRIFUNC      0x10
 
-static triangle_func tri_tab[SS_MAX_TRIFUNC];
-static quad_func     quad_tab[SS_MAX_TRIFUNC];
+static tnl_triangle_func tri_tab[SS_MAX_TRIFUNC];
+static tnl_quad_func     quad_tab[SS_MAX_TRIFUNC];
 
 
 static void _swsetup_render_line_tri( GLcontext *ctx,
@@ -59,7 +58,7 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
    SWvertex *v2 = &verts[e2];
    GLchan c[2][4];
    GLchan s[2][4];
-   GLuint i[2];
+   GLfloat i[2];
 
    /* cull testing */
    if (ctx->Polygon.CullFlag) {
@@ -118,7 +117,7 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
    SWvertex *v2 = &verts[e2];
    GLchan c[2][4];
    GLchan s[2][4];
-   GLuint i[2];
+   GLfloat i[2];
 
    /* cull testing */
    if (ctx->Polygon.CullFlag) {
@@ -162,8 +161,8 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
    _swrast_flush(ctx);
 }
 
-#define SS_COLOR(a,b) COPY_CHAN4(a,b)
-#define SS_SPEC(a,b) COPY_3V(a,b)
+#define SS_COLOR(a,b) UNCLAMPED_FLOAT_TO_RGBA_CHAN(a,b)
+#define SS_SPEC(a,b) UNCLAMPED_FLOAT_TO_RGB_CHAN(a,b)
 #define SS_IND(a,b) (a = b)
 
 #define IND (0)
@@ -291,7 +290,8 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
        ctx->Polygon.OffsetFill)
       ind |= SS_OFFSET_BIT;
 
-   if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+   if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
+       (ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled))
       ind |= SS_TWOSIDE_BIT;
 
    /* We piggyback the two-sided stencil front/back determination on the