float color changes
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 1 May 2001 19:17:15 +0000 (19:17 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 1 May 2001 19:17:15 +0000 (19:17 +0000)
src/mesa/drivers/glide/fxtris.c
src/mesa/drivers/glide/fxvbtmp.h

index ca3848df9dafc99610dbc521cde992f4f132b4b1..5adb11e1f3f5c6f665fc8389a78e2e172b417ceb 100644 (file)
@@ -116,10 +116,10 @@ fx_draw_tri(GLcontext * ctx, const fxVertex * v0, const fxVertex * v1,
 
 #define FX_COLOR(vert, c) {                            \
   GLubyte *col = c;                                    \
-  vert->v.r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]);    \
-  vert->v.g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]);    \
-  vert->v.b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]);    \
-  vert->v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]);    \
+  vert->v.r = col[0] * 255;    \
+  vert->v.g = col[1] * 255;    \
+  vert->v.b = col[2] * 255;    \
+  vert->v.a = col[3] * 255;    \
 }
 
 #define FX_COPY_COLOR( dst, src ) {            \
index 8d7649c6bb0f23637128d276f19b6b0b8873e000..39c69adf2d9f794b885689469d434da73a548aa4 100644 (file)
@@ -35,10 +35,10 @@ NAME(GLcontext * ctx, GLuint start, GLuint end)
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
    GLuint tmu0_source = fxMesa->tmu_source[0];
    GLuint tmu1_source = fxMesa->tmu_source[1];
-   GLfloat(*tmu0_data)[4];
-   GLfloat(*tmu1_data)[4];
-   GLubyte(*color)[4];
-   GLfloat(*proj)[4] = VB->ProjectedClipPtr->data;
+   GLfloat (*tmu0_data)[4];
+   GLfloat (*tmu1_data)[4];
+   GLfloat (*color)[4];
+   GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
    fxVertex *v = &verts[start];
    GLfloat sscale0 = fxMesa->s0scale;
    GLfloat tscale0 = fxMesa->t0scale;
@@ -54,8 +54,8 @@ NAME(GLcontext * ctx, GLuint start, GLuint end)
    if (IND & SETUP_TMU1)
       tmu1_data = VB->TexCoordPtr[tmu1_source]->data;
 
-   if (IND & SETUP_RGBA)
-      color = VB->ColorPtr[0]->data;
+   if (IND & SETUP_RGBA) 
+      color = VB->ColorPtr[0]->Ptr;
 
    if (VB->ClipOrMask) {
       for (i = start; i < end; i++, v++) {
@@ -80,10 +80,10 @@ NAME(GLcontext * ctx, GLuint start, GLuint end)
               }
            }
            if (IND & SETUP_RGBA) {
-              UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.r, color[i][0]);
-              UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.g, color[i][1]);
-              UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.b, color[i][2]);
-              UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.a, color[i][3]);
+              v->v.r = color[i][0] * 255.0;
+              v->v.g = color[i][1] * 255.0;
+              v->v.b = color[i][2] * 255.0;
+              v->v.a = color[i][3] * 255.0;
            }
            if (IND & SETUP_TMU0) {
               v->v.tmuvtx[0].sow = sscale0 * tmu0_data[i][0] * v->v.oow;
@@ -118,10 +118,10 @@ NAME(GLcontext * ctx, GLuint start, GLuint end)
            }
         }
         if (IND & SETUP_RGBA) {
-           UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.r, color[i][0]);
-           UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.g, color[i][1]);
-           UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.b, color[i][2]);
-           UBYTE_COLOR_TO_FLOAT_255_COLOR2(v->v.a, color[i][3]);
+           v->v.r = color[i][0] * 255.0;
+           v->v.g = color[i][1] * 255.0;
+           v->v.b = color[i][2] * 255.0;
+           v->v.a = color[i][3] * 255.0;
         }
         if (IND & SETUP_TMU0) {
            v->v.tmuvtx[0].sow = sscale0 * tmu0_data[i][0] * v->v.oow;