Minor fix to border and blend color.
authorAapo Tahkola <aet@rasterburn.org>
Sat, 19 Feb 2005 16:30:56 +0000 (16:30 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Sat, 19 Feb 2005 16:30:56 +0000 (16:30 +0000)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_tex.c

index 18dc9d1..ae9711d 100644 (file)
@@ -716,6 +716,19 @@ struct r300_context {
 
 #define R300_CONTEXT(ctx)              ((r300ContextPtr)(ctx->DriverCtx))
 
+static __inline GLuint r300PackColor( GLuint cpp,
+                                       GLubyte r, GLubyte g,
+                                       GLubyte b, GLubyte a )
+{
+   switch ( cpp ) {
+   case 2:
+      return PACK_COLOR_565( r, g, b );
+   case 4:
+      return PACK_COLOR_8888( r, g, b, a );
+   default:
+      return 0;
+   }
+}
 extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
 extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
                                   __DRIcontextPrivate * driContextPriv,
index a386564..3646507 100644 (file)
@@ -119,7 +119,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4])
        CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
        CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
 
-       rmesa->hw.unk4E10.cmd[1]=radeonPackColor(4, color[0], color[1], color[2], color[3]);
+       rmesa->hw.unk4E10.cmd[1]=r300PackColor(4, color[0], color[1], color[2], color[3]);
        //fprintf(stderr, "%s:%s is not implemented yet. Fixme !\n", __FILE__, __FUNCTION__);
 #if 0
        R200_STATECHANGE(rmesa, ctx);
index 000b7be..c3010d3 100644 (file)
@@ -267,7 +267,7 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf)
 
 static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
 {
-       t->pp_border_color = radeonPackColor(4, c[3], c[2], c[1], c[0]);
+       t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]);
 }
 
 /**