int32_t u, v, du, dv, uslope, vslope;
#endif
#ifdef ZBUF
- int z, dz, zslope;
+ int32_t z, dz, zslope;
#endif
int32_t start_idx, end_idx;
#if defined(GOURAUD) || defined(TEXMAP) || defined(ZBUF)
int mid;
int32_t dx, tmp;
-#else
- /* flat version, just pack the color now */
- color = G3D_PACK_RGB(pv[0].r, pv[0].g, pv[0].b);
#endif
#ifdef GOURAUD
int32_t r, g, b, dr, dg, db, rslope, gslope, bslope;
int32_t u, v, du, dv, uslope, vslope;
#endif
#ifdef ZBUF
- int z, dz, zslope;
+ int32_t z, dz, zslope;
+#endif
+
+#if !defined(GOURAUD) && !defined(TEXMAP)
+ /* flat version, just pack the color now */
+ color = G3D_PACK_RGB(pv[0].r, pv[0].g, pv[0].b);
#endif
for(i=1; i<nverts; i++) {
/* go across the scanline interpolating if necessary */
while(x <= right[i].x) {
+ /*if(x == (180 << 8) && i == 174) {
+ asm("int $3");
+ }*/
#if defined(GOURAUD) || defined(TEXMAP) || defined(BLEND_ALPHA) || defined(BLEND_ADD)
int cr, cg, cb;
#endif
#endif
#ifdef ZBUF
- int cz = z;
+ int32_t cz = z;
z += zslope;
if(z <= *zptr) {
- *zptr = z;
+ *zptr++ = z;
} else {
#ifdef GOURAUD
r += rslope;
u += uslope;
v += vslope;
#endif
- goto skip_pixel;
+ /* skip pixel */
+ pixptr++;
+ zptr++;
+ x += 256;
+ continue;
}
- zptr++;
#endif
#ifdef GOURAUD
color = G3D_PACK_RGB(cr, cg, cb);
#endif
-#ifdef ZBUF
-skip_pixel:
-#endif
#ifdef DEBUG_OVERDRAW
*pixptr++ += DEBUG_OVERDRAW;
#else