diff options
Diffstat (limited to 'xc/extras/Mesa/src/swrast/s_linetemp.h')
-rw-r--r-- | xc/extras/Mesa/src/swrast/s_linetemp.h | 96 |
1 files changed, 25 insertions, 71 deletions
diff --git a/xc/extras/Mesa/src/swrast/s_linetemp.h b/xc/extras/Mesa/src/swrast/s_linetemp.h index c5e7984c5..9c7541315 100644 --- a/xc/extras/Mesa/src/swrast/s_linetemp.h +++ b/xc/extras/Mesa/src/swrast/s_linetemp.h @@ -1,8 +1,7 @@ -/* $Id: s_linetemp.h,v 1.1.1.1 2002/10/22 13:06:55 alanh Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0.2 + * Version: 5.0 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -56,11 +55,7 @@ * Optionally, one may provide one-time setup code * SETUP_CODE - code which is to be executed once per line * - * To enable line stippling define STIPPLE = 1 - * To enable wide lines define WIDE = 1 - * - * To actually "plot" each pixel either the PLOT macro or - * (XMAJOR_PLOT and YMAJOR_PLOT macros) must be defined... + * To actually "plot" each pixel the PLOT macro must be defined... * PLOT(X,Y) - code to plot a pixel. Example: * if (Z < *zPtr) { * *zPtr = Z; @@ -140,16 +135,6 @@ PIXEL_TYPE *pixelPtr; GLint pixelXstep, pixelYstep; #endif -#ifdef STIPPLE - SWcontext *swrast = SWRAST_CONTEXT(ctx); -#endif -#ifdef WIDE - /* for wide lines, draw all X in [x+min, x+max] or Y in [y+min, y+max] */ - GLint width, min, max; - width = (GLint) CLAMP( ctx->Line.Width, MIN_LINE_WIDTH, MAX_LINE_WIDTH ); - min = (width-1) / -2; - max = min + width - 1; -#endif #ifdef INTERP_TEX { tex[0] = invw0 * vert0->texcoord[0][0]; @@ -188,6 +173,19 @@ return; } + /* + printf("%s():\n", __FUNCTION__); + printf(" (%f, %f, %f) -> (%f, %f, %f)\n", + vert0->win[0], vert0->win[1], vert0->win[2], + vert1->win[0], vert1->win[1], vert1->win[2]); + printf(" (%d, %d, %d) -> (%d, %d, %d)\n", + vert0->color[0], vert0->color[1], vert0->color[2], + vert1->color[0], vert1->color[1], vert1->color[2]); + printf(" (%d, %d, %d) -> (%d, %d, %d)\n", + vert0->specular[0], vert0->specular[1], vert0->specular[2], + vert1->specular[0], vert1->specular[1], vert1->specular[2]); + */ + /* * Despite being clipped to the view volume, the line's window coordinates * may just lie outside the window bounds. That is, if the legal window @@ -231,8 +229,8 @@ zPtr = (DEPTH_TYPE *) _mesa_zbuffer_address(ctx, x0, y0); # endif if (depthBits <= 16) { - z0 = FloatToFixed(vert0->win[2]); - z1 = FloatToFixed(vert1->win[2]); + z0 = FloatToFixed(vert0->win[2]) + FIXED_HALF; + z1 = FloatToFixed(vert1->win[2]) + FIXED_HALF; } else { z0 = (int) vert0->win[2]; @@ -301,6 +299,9 @@ GLint errorInc = dy+dy; GLint error = errorInc-dx; GLint errorDec = error-dx; +#ifdef SET_XMAJOR + xMajor = GL_TRUE; +#endif #ifdef INTERP_Z dz = (z1-z0) / dx; #endif @@ -348,11 +349,6 @@ #endif for (i=0;i<dx;i++) { -#ifdef STIPPLE - GLushort m; - m = 1 << ((swrast->StippleCounter/ctx->Line.StippleFactor) & 0xf); - if (ctx->Line.StipplePattern & m) { -#endif #ifdef INTERP_Z GLdepth Z = FixedToDepth(z0); #endif @@ -382,26 +378,9 @@ } } #endif -#ifdef WIDE - { - GLint yy; - GLint ymin = y0 + min; - GLint ymax = y0 + max; - for (yy=ymin;yy<=ymax;yy++) { - PLOT( x0, yy ); - } - } -#else -# ifdef XMAJOR_PLOT - XMAJOR_PLOT( x0, y0 ); -# else + PLOT( x0, y0 ); -# endif -#endif /*WIDE*/ -#ifdef STIPPLE - } - swrast->StippleCounter++; -#endif + #ifdef INTERP_XY x0 += xstep; #endif @@ -523,11 +502,6 @@ #endif for (i=0;i<dy;i++) { -#ifdef STIPPLE - GLushort m; - m = 1 << ((swrast->StippleCounter/ctx->Line.StippleFactor) & 0xf); - if (ctx->Line.StipplePattern & m) { -#endif #ifdef INTERP_Z GLdepth Z = FixedToDepth(z0); #endif @@ -557,26 +531,9 @@ } } #endif -#ifdef WIDE - { - GLint xx; - GLint xmin = x0 + min; - GLint xmax = x0 + max; - for (xx=xmin;xx<=xmax;xx++) { - PLOT( xx, y0 ); - } - } -#else -# ifdef YMAJOR_PLOT - YMAJOR_PLOT( x0, y0 ); -# else + PLOT( x0, y0 ); -# endif -#endif /*WIDE*/ -#ifdef STIPPLE - } - swrast->StippleCounter++; -#endif + #ifdef INTERP_XY y0 += ystep; #endif @@ -663,9 +620,6 @@ #undef BYTES_PER_ROW #undef SETUP_CODE #undef PLOT -#undef XMAJOR_PLOT -#undef YMAJOR_PLOT #undef CLIP_HACK -#undef STIPPLE -#undef WIDE #undef FixedToDepth +#undef SET_XMAJOR |