diff options
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/mga/mgavb.c')
-rw-r--r-- | xc/lib/GL/mesa/src/drv/mga/mgavb.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.c b/xc/lib/GL/mesa/src/drv/mga/mgavb.c index f5d7e7e40..57e24fa0e 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgavb.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.c @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. * * Authors: - * Keith Whitwell <keithw@valinux.com> + * Keith Whitwell <keith@tungstengraphics.com> */ /* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.13 2002/02/26 23:37:35 tsi Exp $ */ @@ -34,7 +34,7 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" #include "mmath.h" @@ -43,9 +43,6 @@ #include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" -#include <stdio.h> -#include <stdlib.h> - #define MGA_TEX1_BIT 0x1 #define MGA_TEX0_BIT 0x2 @@ -88,11 +85,12 @@ static struct { #define VERTEX mgaVertex +#define VERTEX_COLOR mga_color_t #define LOCALVARS mgaContextPtr mmesa = MGA_CONTEXT(ctx); #define GET_VIEWPORT_MAT() mmesa->hw_viewport #define GET_TEXSOURCE(n) mmesa->tmu_source[n] #define GET_VERTEX_FORMAT() mmesa->vertex_format -#define GET_VERTEX_STORE() (GLubyte *)(mmesa->verts) +#define GET_VERTEX_STORE() mmesa->verts #define GET_VERTEX_STRIDE_SHIFT() mmesa->vertex_stride_shift #define GET_UBYTE_COLOR_STORE() &mmesa->UbyteColor #define GET_UBYTE_SPEC_COLOR_STORE() &mmesa->UbyteSecondaryColor @@ -124,8 +122,8 @@ static struct { #define IMPORT_FLOAT_COLORS mga_import_float_colors #define IMPORT_FLOAT_SPEC_COLORS mga_import_float_spec_colors -#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv +#define INTERP_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].interp +#define COPY_PV_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].copy_pv /*********************************************************************** @@ -362,24 +360,24 @@ void mgaBuildVertices( GLcontext *ctx, if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= MGA_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= MGA_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= MGA_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= MGA_TEX0_BIT|MGA_TEX1_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= MGA_FOG_BIT; if (mmesa->SetupIndex & MGA_PTEX_BIT) @@ -406,15 +404,18 @@ void mgaChooseVertexState( GLcontext *ctx ) if (ctx->Fog.Enabled) ind |= MGA_FOG_BIT; - if (ctx->Texture._ReallyEnabled & 0xf0) { - if (ctx->Texture._ReallyEnabled & 0xf) { + if (ctx->Texture._EnabledUnits & 0x2) { + /* unit 1 enabled */ + if (ctx->Texture._EnabledUnits & 0x1) { + /* unit 0 enabled */ ind |= MGA_TEX1_BIT|MGA_TEX0_BIT; } else { ind |= MGA_TEX0_BIT; } } - else if (ctx->Texture._ReallyEnabled & 0xf) { + else if (ctx->Texture._EnabledUnits & 0x1) { + /* unit 0 enabled */ ind |= MGA_TEX0_BIT; } |