fix for ubyte colors

This commit is contained in:
Keith Whitwell
2001-12-13 10:51:41 +00:00
parent 59e5b90452
commit 5246b6c9d1

View File

@@ -1,4 +1,4 @@
/* $Id: t_dd_vb.c,v 1.15 2001/05/14 09:00:52 keithw Exp $ */ /* $Id: t_dd_vb.c,v 1.16 2001/12/13 10:51:41 keithw Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -277,7 +277,7 @@ IMPORT_QUALIFIER void TAG(import_float_spec_colors)( GLcontext *ctx )
#define INTERP_QUALIFIER static #define INTERP_QUALIFIER static
#endif #endif
#define GET_COLOR(ptr, idx) (((GLfloat (*)[4])((ptr)->Ptr))[idx]) #define GET_COLOR(ptr, idx) (((GLchan (*)[4])((ptr)->Ptr))[idx])
INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
@@ -289,13 +289,13 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->ColorPtr[1]) {
INTERP_4F( t, INTERP_4CHAN( t,
GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->ColorPtr[1], out),
GET_COLOR(VB->ColorPtr[1], in) ); GET_COLOR(VB->ColorPtr[1], in) );
if (VB->SecondaryColorPtr[1]) { if (VB->SecondaryColorPtr[1]) {
INTERP_3F( t, INTERP_3CHAN( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->SecondaryColorPtr[1], out),
GET_COLOR(VB->SecondaryColorPtr[1], in) ); GET_COLOR(VB->SecondaryColorPtr[1], in) );
@@ -316,11 +316,11 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->ColorPtr[1]) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), COPY_CHAN4( GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], src) ); GET_COLOR(VB->ColorPtr[1], src) );
if (VB->SecondaryColorPtr[1]) { if (VB->SecondaryColorPtr[1]) {
COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), COPY_CHAN4( GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) ); GET_COLOR(VB->SecondaryColorPtr[1], src) );
} }
} }