diff options
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/mga/mgatris.c')
-rw-r--r-- | xc/lib/GL/mesa/src/drv/mga/mgatris.c | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.c b/xc/lib/GL/mesa/src/drv/mga/mgatris.c index 4344003af..cd10daddd 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatris.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.c @@ -23,7 +23,7 @@ * * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.6 2001/01/08 01:07:19 martin Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -38,25 +38,6 @@ #include "mgavb.h" -static void mga_null_quad( GLcontext *ctx, GLuint v0, - GLuint v1, GLuint v2, GLuint v3, GLuint pv ) -{ -} - -static void mga_null_triangle( GLcontext *ctx, GLuint v0, - GLuint v1, GLuint v2, GLuint pv ) -{ -} - -static void mga_null_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ) -{ -} - -static void mga_null_points( GLcontext *ctx, GLuint first, GLuint last ) -{ -} - - #define MGA_COLOR(to, from) { \ (to)[0] = (from)[2]; \ (to)[1] = (from)[1]; \ @@ -64,6 +45,12 @@ static void mga_null_points( GLcontext *ctx, GLuint first, GLuint last ) (to)[3] = (from)[3]; \ } +#define MGA_COLOR3(to, from) { \ + (to)[0] = (from)[2]; \ + (to)[1] = (from)[1]; \ + (to)[2] = (from)[0]; \ +} + static triangle_func tri_tab[0x10]; @@ -106,9 +93,6 @@ static points_func points_tab[0x10]; void mgaDDTrifuncInit() { - int i; - - init(); init_flat(); init_offset(); @@ -117,14 +101,6 @@ void mgaDDTrifuncInit() init_twoside_flat(); init_twoside_offset(); init_twoside_offset_flat(); - - for (i = 0 ; i < 0x20 ; i++) - if (i & MGA_NODRAW_BIT) { - quad_tab[i] = mga_null_quad; - tri_tab[i] = mga_null_triangle; - line_tab[i] = mga_null_line; - points_tab[i] = mga_null_points; - } } @@ -134,7 +110,7 @@ void mgaDDTrifuncInit() #define LINE_FALLBACK (ALL_FALLBACK | DD_LINE_SMOOTH | DD_LINE_STIPPLE) #define TRI_FALLBACK (ALL_FALLBACK | DD_TRI_SMOOTH | DD_TRI_UNFILLED) #define ANY_FALLBACK (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|DD_TRI_STIPPLE) -#define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_Z_NEVER) +#define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET) /* Setup the Point, Line, Triangle and Quad functions based on the current rendering state. Wherever possible, use the hardware to @@ -147,6 +123,9 @@ void mgaDDChooseRenderState(GLcontext *ctx) if (mmesa->Fallback) { mmesa->renderindex = MGA_FALLBACK_BIT; + if (flags & DD_TRI_LIGHT_TWOSIDE) { + mmesa->IndirectTriangles = DD_TRI_LIGHT_TWOSIDE; + } return; } @@ -154,7 +133,6 @@ void mgaDDChooseRenderState(GLcontext *ctx) if (flags & DD_FLATSHADE) index |= MGA_FLAT_BIT; if (flags & DD_TRI_LIGHT_TWOSIDE) index |= MGA_TWOSIDE_BIT; if (flags & DD_TRI_OFFSET) index |= MGA_OFFSET_BIT; - if (flags & DD_Z_NEVER) index |= MGA_NODRAW_BIT; } mmesa->PointsFunc = points_tab[index]; @@ -194,6 +172,9 @@ void mgaDDChooseRenderState(GLcontext *ctx) mmesa->QuadFunc = 0; mmesa->IndirectTriangles |= (DD_TRI_SW_RASTERIZE | DD_QUAD_SW_RASTERIZE); + if (flags & DD_TRI_LIGHT_TWOSIDE) { + mmesa->IndirectTriangles |= DD_TRI_LIGHT_TWOSIDE; + } } } } |