23 #define AFFINE_SPANLET_SIZE 16
24 #define AFFINE_SPANLET_SIZE_BITS 4
130 if ( *pz <= ( izi >> 16 ) )
187 if ( *pz <= ( izi >> 16 ) )
217 if ( *pz <= ( izi >> 16 ) )
405 if ( *pz <= ( izi >> 16 ) )
464 if ( *pz <= ( izi >> 16 ) )
489 if ( *pz <= ( izi >> 16 ) )
515 float frac, clipdist, *pclipnormal;
516 float *in, *instep, *outstep, *vert2;
518 clipdist = pclipplane->
dist;
519 pclipnormal = pclipplane->
normal;
536 for (
i=0 ;
i<nump ;
i++, instep +=
sizeof (
vec5_t) /
sizeof (
float))
538 dists[
i] =
DotProduct (instep, pclipnormal) - clipdist;
542 dists[nump] = dists[0];
543 memcpy (instep, in,
sizeof (
vec5_t));
550 for (
i=0 ;
i<nump ;
i++, instep +=
sizeof (
vec5_t) /
sizeof (
float))
554 memcpy (outstep, instep,
sizeof (
vec5_t));
555 outstep +=
sizeof (
vec5_t) /
sizeof (
float);
559 if (dists[
i] == 0 || dists[
i+1] == 0)
562 if ( (dists[
i] > 0) == (dists[
i+1] > 0) )
566 frac = dists[
i] / (dists[
i] - dists[
i+1]);
568 vert2 = instep +
sizeof (
vec5_t) /
sizeof (
float);
570 outstep[0] = instep[0] + frac*(vert2[0] - instep[0]);
571 outstep[1] = instep[1] + frac*(vert2[1] - instep[1]);
572 outstep[2] = instep[2] + frac*(vert2[2] - instep[2]);
573 outstep[3] = instep[3] + frac*(vert2[3] - instep[3]);
574 outstep[4] = instep[4] + frac*(vert2[4] - instep[4]);
576 outstep +=
sizeof (
vec5_t) /
sizeof (
float);
591 float sdivz, tdivz, zi,
z, du, dv, spancountminus1;
592 float sdivzspanletstepu, tdivzspanletstepu, zispanletstepu;
626 du = (float)pspan->
u;
627 dv = (
float)pspan->
v;
633 z = (float)0x10000 / zi;
667 sdivz += sdivzspanletstepu;
668 tdivz += tdivzspanletstepu;
669 zi += zispanletstepu;
670 z = (float)0x10000 / zi;
703 z = (float)0x10000 / zi;
757 int i,
v, itop, ibottom, lmaxindex;
760 float du, dv, vtop, vbottom, slope;
779 vbottom = ceil (pnext->
v);
783 du = pnext->
u - pvert->
u;
784 dv = pnext->
v - pvert->
v;
787 u_step = (
int)(slope * 0x10000);
789 u = (
int)((pvert->
u + (slope * (vtop - pvert->
v))) * 0x10000) +
792 ibottom = (
int)vbottom;
794 for (
v=itop ;
v<ibottom ;
v++)
809 }
while (
i != lmaxindex);
820 int i,
v, itop, ibottom;
823 float du, dv, vtop, vbottom, slope, uvert, unext, vvert, vnext;
848 vbottom = ceil (vnext);
867 u_step = (
int)(slope * 0x10000);
869 u = (
int)((uvert + (slope * (vtop - vvert))) * 0x10000) +
872 ibottom = (
int)vbottom;
874 for (
v=itop ;
v<ibottom ;
v++)
876 pspan->
count = (u >> 16) - pspan->
u;
904 vec3_t transformed, local;
965 for (
i=0 ;
i<4 ;
i++)
977 for (
i=0 ;
i<nump ;
i++)
986 pout->
zi = 1.0 / transformed[2];
992 pout->
u = (
xcenter + scale * transformed[0]);
995 pout->
v = (
ycenter - scale * transformed[1]);
997 pv +=
sizeof (
vec5_t) /
sizeof (pv);
1012 int i, lindex, lnumverts;
1017 float tmins[2] = { 0, 0 };
1028 for (
i=0 ;
i<lnumverts ;
i++)
1097 vec3_t p_normal, p_saxis, p_taxis;
1152 if (pverts->
v < ymin)
1158 if (pverts->
v > ymax)
1180 pverts[nump] = pverts[0];