for( ; ylen--; y++)
{
	BYTE *_screen;
#if defined(ZBUFFER)
	int *_zbuffer;
#endif
	if( x1 < x2)
	{
		x = (x1 >> 16), xf = (x2 >> 16);
#if defined(ZBUFFER)
		z = z1, zf = z2;
#endif
#if defined(GOURADE)
		l = l1, lf = l2;
#endif
	}
	else
	{
		x = (x2 >> 16), xf = (x1 >> 16);
#if defined(ZBUFFER)
		z = z2, zf = z1;
#endif
#if defined(GOURADE)
		l = l2, lf = l1;
#endif
	}

	xlen = (x2 >> 16) - (x1 >> 16);
	if( xlen)
	{
#if defined(ZBUFFER)
		zadd = (z2 - z1) / xlen;
#endif
#if defined(GOURADE)
		ladd = (l2 - l1) / xlen;
#endif
	}
	else
	{
#if defined(ZBUFFER)
		zadd = 0;
#endif
#if defined(GOURADE)
		ladd = 0;
#endif
	}
	xlen = abs(xlen);


	if( x < buff->minx)
	{
#if defined(ZBUFFER)
		z += zadd * (buff->minx - x);
#endif
#if defined(GOURADE)
		l += ladd * (buff->minx - x);
#endif
		xlen -= buff->minx - x, x = buff->minx;
	}
	if( (x + xlen) > buff->maxx)
		xlen -= (x + xlen) - buff->maxx;

#if defined(ZBUFFER)
	z += (zadd * yc) >> 16;
#endif
#if defined(GOURADE)
	l += (ladd * yc) >> 16;
#endif


	if( xlen > 0)
	{
		_screen = screen + x;
#if defined(ZBUFFER)
		_zbuffer = zbuffer + x;
#endif
		for( ; xlen--; x++)
		{
#if defined(ZBUFFER)
			if( z > *_zbuffer)
			{
				*_zbuffer = z;
#endif
#if defined(GOURADE)
				*_screen = lighttab[ ((l >> 8) & ~0xff)];
#else
				*_screen = col;
#endif
#if defined(ZBUFFER)
			}
			z += zadd;
			_zbuffer++;
#endif
#if defined(GOURADE)
			l += ladd;
#endif
			_screen++;
		}
		if( x < xf)
		{
#if defined(ZBUFFER)
      if( zf < *_zbuffer)
			{
				*_zbuffer = zf;
#endif
#if defined(GOURADE)
				*_screen = lighttab[ ((lf >> 8) & ~0xff)];
#else
				*_screen = col;
#endif
#if defined(ZBUFFER)
			}
#endif
		}
	}
	x1 += x1add, x2 += x2add;
#if defined(ZBUFFER)
	z1 += z1add, z2 += z2add;
	zbuffer += buff->width;
#endif
#if defined(GOURADE)
	l1 += l1add, l2 += l2add;
#endif
	screen += buff->width;
}
