icculus quake2 doxygen  1.0 dev
r_polyse.c File Reference
#include "r_local.h"
#include "rand1k.h"
#include "adivtab.h"

Go to the source code of this file.

Classes

struct  spanpackage_t
 
struct  edgetable
 
struct  adivtab_t
 

Macros

#define MASK_1K   0x3FF
 
#define DPS_MAXSPANS   MAXHEIGHT+1
 

Functions

void R_PolysetDrawSpans8_33 (spanpackage_t *pspanpackage)
 
void R_PolysetDrawSpans8_66 (spanpackage_t *pspanpackage)
 
void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage)
 
void R_PolysetDrawThreshSpans8 (spanpackage_t *pspanpackage)
 
void R_PolysetCalcGradients (int skinwidth)
 
void R_DrawNonSubdiv (void)
 
void R_PolysetSetEdgeTable (void)
 
void R_RasterizeAliasPolySmooth (void)
 
void R_PolysetScanLeftEdge (int height)
 
void R_PolysetScanLeftEdge_C (int height)
 
void R_PolysetUpdateTables (void)
 
void R_DrawTriangle (void)
 
void FloorDivMod (float numer, float denom, int *quotient, int *rem)
 
void R_PolysetSetUpForLineScan (fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
 
void R_PolysetDrawSpansConstant8_33 (spanpackage_t *pspanpackage)
 
void R_PolysetDrawSpansConstant8_66 (spanpackage_t *pspanpackage)
 
void R_PolysetFillSpans8 (spanpackage_t *pspanpackage)
 

Variables

int rand1k []
 
int rand1k_index = 0
 
aliastriangleparms_t aliastriangleparms
 
int r_p0 [6]
 
int r_p1 [6]
 
int r_p2 [6]
 
byted_pcolormap
 
int d_aflatcolor
 
int d_xdenom
 
edgetablepedgetable
 
edgetable edgetables [12]
 
int a_sstepxfrac
 
int a_tstepxfrac
 
int r_lstepx
 
int a_ststepxwhole
 
int r_sstepx
 
int r_tstepx
 
int r_lstepy
 
int r_sstepy
 
int r_tstepy
 
int r_zistepx
 
int r_zistepy
 
int d_aspancount
 
int d_countextrastep
 
spanpackage_ta_spans
 
spanpackage_td_pedgespanpackage
 
static int ystart
 
byted_pdest
 
byted_ptex
 
short * d_pz
 
int d_sfrac
 
int d_tfrac
 
int d_light
 
int d_zi
 
int d_ptexextrastep
 
int d_sfracextrastep
 
int d_tfracextrastep
 
int d_lightextrastep
 
int d_pdestextrastep
 
int d_lightbasestep
 
int d_pdestbasestep
 
int d_ptexbasestep
 
int d_sfracbasestep
 
int d_tfracbasestep
 
int d_ziextrastep
 
int d_zibasestep
 
int d_pzextrastep
 
int d_pzbasestep
 
static adivtab_t adivtab [32 *32]
 
byteskintable [MAX_LBM_HEIGHT]
 
int skinwidth
 
byteskinstart
 
void(* d_pdrawspans )(spanpackage_t *pspanpackage)
 
byte iractive = 0
 
byte irtable [256]
 

Macro Definition Documentation

◆ DPS_MAXSPANS

#define DPS_MAXSPANS   MAXHEIGHT+1

Definition at line 35 of file r_polyse.c.

◆ MASK_1K

#define MASK_1K   0x3FF

Definition at line 29 of file r_polyse.c.

Function Documentation

◆ FloorDivMod()

void FloorDivMod ( float  numer,
float  denom,
int quotient,
int rem 
)

Definition at line 336 of file r_polyse.c.

338 {
339  int q, r;
340  float x;
341 
342  if (numer >= 0.0)
343  {
344 
345  x = floor(numer / denom);
346  q = (int)x;
347  r = (int)floor(numer - (x * denom));
348  }
349  else
350  {
351  //
352  // perform operations with positive values, and fix mod to make floor-based
353  //
354  x = floor(-numer / denom);
355  q = -(int)x;
356  r = (int)floor(-numer - (x * denom));
357  if (r != 0)
358  {
359  q--;
360  r = (int)denom - r;
361  }
362  }
363 
364  *quotient = q;
365  *rem = r;
366 }

Referenced by R_PolysetSetUpForLineScan().

◆ R_DrawNonSubdiv()

void R_DrawNonSubdiv ( void  )

◆ R_DrawTriangle()

void R_DrawTriangle ( void  )

Definition at line 204 of file r_polyse.c.

205 {
207 
208  int dv1_ab, dv0_ac;
209  int dv0_ab, dv1_ac;
210 
211  /*
212  d_xdenom = ( aliastriangleparms.a->v[1] - aliastriangleparms.b->v[1] ) * ( aliastriangleparms.a->v[0] - aliastriangleparms.c->v[0] ) -
213  ( aliastriangleparms.a->v[0] - aliastriangleparms.b->v[0] ) * ( aliastriangleparms.a->v[1] - aliastriangleparms.c->v[1] );
214  */
215 
218 
219  if ( !( dv0_ab | dv1_ab ) )
220  return;
221 
224 
225  if ( !( dv0_ac | dv1_ac ) )
226  return;
227 
228  d_xdenom = ( dv0_ac * dv1_ab ) - ( dv0_ab * dv1_ac );
229 
230  if ( d_xdenom < 0 )
231  {
232  a_spans = spans;
233 
234  r_p0[0] = aliastriangleparms.a->u; // u
235  r_p0[1] = aliastriangleparms.a->v; // v
236  r_p0[2] = aliastriangleparms.a->s; // s
237  r_p0[3] = aliastriangleparms.a->t; // t
238  r_p0[4] = aliastriangleparms.a->l; // light
239  r_p0[5] = aliastriangleparms.a->zi; // iz
240 
241  r_p1[0] = aliastriangleparms.b->u;
242  r_p1[1] = aliastriangleparms.b->v;
243  r_p1[2] = aliastriangleparms.b->s;
244  r_p1[3] = aliastriangleparms.b->t;
245  r_p1[4] = aliastriangleparms.b->l;
246  r_p1[5] = aliastriangleparms.b->zi;
247 
248  r_p2[0] = aliastriangleparms.c->u;
249  r_p2[1] = aliastriangleparms.c->v;
250  r_p2[2] = aliastriangleparms.c->s;
251  r_p2[3] = aliastriangleparms.c->t;
252  r_p2[4] = aliastriangleparms.c->l;
253  r_p2[5] = aliastriangleparms.c->zi;
254 
257  }
258 }

Referenced by R_AliasClipTriangle(), and R_AliasPreparePoints().

◆ R_PolysetCalcGradients()

void R_PolysetCalcGradients ( int  skinwidth)

Definition at line 673 of file r_polyse.c.

674 {
675  float xstepdenominv, ystepdenominv, t0, t1;
676  float p01_minus_p21, p11_minus_p21, p00_minus_p20, p10_minus_p20;
677 
678  p00_minus_p20 = r_p0[0] - r_p2[0];
679  p01_minus_p21 = r_p0[1] - r_p2[1];
680  p10_minus_p20 = r_p1[0] - r_p2[0];
681  p11_minus_p21 = r_p1[1] - r_p2[1];
682 
683  xstepdenominv = 1.0 / (float)d_xdenom;
684 
685  ystepdenominv = -xstepdenominv;
686 
687 // ceil () for light so positive steps are exaggerated, negative steps
688 // diminished, pushing us away from underflow toward overflow. Underflow is
689 // very visible, overflow is very unlikely, because of ambient lighting
690  t0 = r_p0[4] - r_p2[4];
691  t1 = r_p1[4] - r_p2[4];
692  r_lstepx = (int)
693  ceil((t1 * p01_minus_p21 - t0 * p11_minus_p21) * xstepdenominv);
694  r_lstepy = (int)
695  ceil((t1 * p00_minus_p20 - t0 * p10_minus_p20) * ystepdenominv);
696 
697  t0 = r_p0[2] - r_p2[2];
698  t1 = r_p1[2] - r_p2[2];
699  r_sstepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
700  xstepdenominv);
701  r_sstepy = (int)((t1 * p00_minus_p20 - t0* p10_minus_p20) *
702  ystepdenominv);
703 
704  t0 = r_p0[3] - r_p2[3];
705  t1 = r_p1[3] - r_p2[3];
706  r_tstepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
707  xstepdenominv);
708  r_tstepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
709  ystepdenominv);
710 
711  t0 = r_p0[5] - r_p2[5];
712  t1 = r_p1[5] - r_p2[5];
713  r_zistepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
714  xstepdenominv);
715  r_zistepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
716  ystepdenominv);
717 
718 //#if id386ALIAS
719 #if id386
721  {
722  a_sstepxfrac = r_sstepx << 16;
723  a_tstepxfrac = r_tstepx << 16;
724  }
725  else
726 #endif
727  {
728 //#else
729  a_sstepxfrac = r_sstepx & 0xFFFF;
730  a_tstepxfrac = r_tstepx & 0xFFFF;
731  }
732 //#endif
733 
734  a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16);
735 }

Referenced by R_RasterizeAliasPolySmooth().

◆ R_PolysetDrawSpans8_33()

void R_PolysetDrawSpans8_33 ( spanpackage_t pspanpackage)

Definition at line 820 of file r_polyse.c.

821 {
822  int lcount;
823  byte *lpdest;
824  byte *lptex;
825  int lsfrac, ltfrac;
826  int llight;
827  int lzi;
828  short *lpz;
829 
830  do
831  {
832  lcount = d_aspancount - pspanpackage->count;
833 
835  if (errorterm >= 0)
836  {
839  }
840  else
841  {
843  }
844 
845  if (lcount)
846  {
847  lpdest = pspanpackage->pdest;
848  lptex = pspanpackage->ptex;
849  lpz = pspanpackage->pz;
850  lsfrac = pspanpackage->sfrac;
851  ltfrac = pspanpackage->tfrac;
852  llight = pspanpackage->light;
853  lzi = pspanpackage->zi;
854 
855  do
856  {
857  if ((lzi >> 16) >= *lpz)
858  {
859  int temp = vid.colormap[*lptex + ( llight & 0xFF00 )];
860 
861  *lpdest = vid.alphamap[temp+ *lpdest*256];
862  }
863  lpdest++;
864  lzi += r_zistepx;
865  lpz++;
866  llight += r_lstepx;
867  lptex += a_ststepxwhole;
868  lsfrac += a_sstepxfrac;
869  lptex += lsfrac >> 16;
870  lsfrac &= 0xFFFF;
871  ltfrac += a_tstepxfrac;
872  if (ltfrac & 0x10000)
873  {
874  lptex += r_affinetridesc.skinwidth;
875  ltfrac &= 0xFFFF;
876  }
877  } while (--lcount);
878  }
879 
880  pspanpackage++;
881  } while (pspanpackage->count != -999999);
882 }

Referenced by R_AliasDrawModel().

◆ R_PolysetDrawSpans8_66()

void R_PolysetDrawSpans8_66 ( spanpackage_t pspanpackage)

Definition at line 928 of file r_polyse.c.

929 {
930  int lcount;
931  byte *lpdest;
932  byte *lptex;
933  int lsfrac, ltfrac;
934  int llight;
935  int lzi;
936  short *lpz;
937 
938  do
939  {
940  lcount = d_aspancount - pspanpackage->count;
941 
943  if (errorterm >= 0)
944  {
947  }
948  else
949  {
951  }
952 
953  if (lcount)
954  {
955  lpdest = pspanpackage->pdest;
956  lptex = pspanpackage->ptex;
957  lpz = pspanpackage->pz;
958  lsfrac = pspanpackage->sfrac;
959  ltfrac = pspanpackage->tfrac;
960  llight = pspanpackage->light;
961  lzi = pspanpackage->zi;
962 
963  do
964  {
965  if ((lzi >> 16) >= *lpz)
966  {
967  int temp = vid.colormap[*lptex + ( llight & 0xFF00 )];
968 
969  *lpdest = vid.alphamap[temp*256 + *lpdest];
970  *lpz = lzi >> 16;
971  }
972  lpdest++;
973  lzi += r_zistepx;
974  lpz++;
975  llight += r_lstepx;
976  lptex += a_ststepxwhole;
977  lsfrac += a_sstepxfrac;
978  lptex += lsfrac >> 16;
979  lsfrac &= 0xFFFF;
980  ltfrac += a_tstepxfrac;
981  if (ltfrac & 0x10000)
982  {
983  lptex += r_affinetridesc.skinwidth;
984  ltfrac &= 0xFFFF;
985  }
986  } while (--lcount);
987  }
988 
989  pspanpackage++;
990  } while (pspanpackage->count != -999999);
991 }

Referenced by R_AliasDrawModel().

◆ R_PolysetDrawSpans8_Opaque()

void R_PolysetDrawSpans8_Opaque ( spanpackage_t pspanpackage)

Definition at line 1038 of file r_polyse.c.

1039 {
1040  int lcount;
1041 
1042  do
1043  {
1044  lcount = d_aspancount - pspanpackage->count;
1045 
1047  if (errorterm >= 0)
1048  {
1051  }
1052  else
1053  {
1055  }
1056 
1057  if (lcount)
1058  {
1059  int lsfrac, ltfrac;
1060  byte *lpdest;
1061  byte *lptex;
1062  int llight;
1063  int lzi;
1064  short *lpz;
1065 
1066  lpdest = pspanpackage->pdest;
1067  lptex = pspanpackage->ptex;
1068  lpz = pspanpackage->pz;
1069  lsfrac = pspanpackage->sfrac;
1070  ltfrac = pspanpackage->tfrac;
1071  llight = pspanpackage->light;
1072  lzi = pspanpackage->zi;
1073 
1074  do
1075  {
1076  if ((lzi >> 16) >= *lpz)
1077  {
1078 //PGM
1080  *lpdest = ((byte *)vid.colormap)[irtable[*lptex]];
1081  else
1082  *lpdest = ((byte *)vid.colormap)[*lptex + (llight & 0xFF00)];
1083 //PGM
1084  *lpz = lzi >> 16;
1085  }
1086  lpdest++;
1087  lzi += r_zistepx;
1088  lpz++;
1089  llight += r_lstepx;
1090  lptex += a_ststepxwhole;
1091  lsfrac += a_sstepxfrac;
1092  lptex += lsfrac >> 16;
1093  lsfrac &= 0xFFFF;
1094  ltfrac += a_tstepxfrac;
1095  if (ltfrac & 0x10000)
1096  {
1097  lptex += r_affinetridesc.skinwidth;
1098  ltfrac &= 0xFFFF;
1099  }
1100  } while (--lcount);
1101  }
1102 
1103  pspanpackage++;
1104  } while (pspanpackage->count != -999999);
1105 }

Referenced by R_AliasDrawModel(), R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ R_PolysetDrawSpansConstant8_33()

void R_PolysetDrawSpansConstant8_33 ( spanpackage_t pspanpackage)

Definition at line 884 of file r_polyse.c.

885 {
886  int lcount;
887  byte *lpdest;
888  int lzi;
889  short *lpz;
890 
891  do
892  {
893  lcount = d_aspancount - pspanpackage->count;
894 
896  if (errorterm >= 0)
897  {
900  }
901  else
902  {
904  }
905 
906  if (lcount)
907  {
908  lpdest = pspanpackage->pdest;
909  lpz = pspanpackage->pz;
910  lzi = pspanpackage->zi;
911 
912  do
913  {
914  if ((lzi >> 16) >= *lpz)
915  {
916  *lpdest = vid.alphamap[r_aliasblendcolor + *lpdest*256];
917  }
918  lpdest++;
919  lzi += r_zistepx;
920  lpz++;
921  } while (--lcount);
922  }
923 
924  pspanpackage++;
925  } while (pspanpackage->count != -999999);
926 }

Referenced by R_AliasDrawModel().

◆ R_PolysetDrawSpansConstant8_66()

void R_PolysetDrawSpansConstant8_66 ( spanpackage_t pspanpackage)

Definition at line 993 of file r_polyse.c.

994 {
995  int lcount;
996  byte *lpdest;
997  int lzi;
998  short *lpz;
999 
1000  do
1001  {
1002  lcount = d_aspancount - pspanpackage->count;
1003 
1005  if (errorterm >= 0)
1006  {
1009  }
1010  else
1011  {
1013  }
1014 
1015  if (lcount)
1016  {
1017  lpdest = pspanpackage->pdest;
1018  lpz = pspanpackage->pz;
1019  lzi = pspanpackage->zi;
1020 
1021  do
1022  {
1023  if ((lzi >> 16) >= *lpz)
1024  {
1025  *lpdest = vid.alphamap[r_aliasblendcolor*256 + *lpdest];
1026  }
1027  lpdest++;
1028  lzi += r_zistepx;
1029  lpz++;
1030  } while (--lcount);
1031  }
1032 
1033  pspanpackage++;
1034  } while (pspanpackage->count != -999999);
1035 }

Referenced by R_AliasDrawModel().

◆ R_PolysetDrawThreshSpans8()

void R_PolysetDrawThreshSpans8 ( spanpackage_t pspanpackage)

Definition at line 745 of file r_polyse.c.

746 {
747  int lcount;
748  byte *lpdest;
749  byte *lptex;
750  int lsfrac, ltfrac;
751  int llight;
752  int lzi;
753  short *lpz;
754 
755  do
756  {
757  lcount = d_aspancount - pspanpackage->count;
758 
760  if (errorterm >= 0)
761  {
764  }
765  else
766  {
768  }
769 
770  if (lcount)
771  {
772  lpdest = pspanpackage->pdest;
773  lptex = pspanpackage->ptex;
774  lpz = pspanpackage->pz;
775  lsfrac = pspanpackage->sfrac;
776  ltfrac = pspanpackage->tfrac;
777  llight = pspanpackage->light;
778  lzi = pspanpackage->zi;
779 
780  do
781  {
782  if ((lzi >> 16) >= *lpz)
783  {
785 
787  {
788  *lpdest = ((byte *)vid.colormap)[*lptex + (llight & 0xFF00)];
789  *lpz = lzi >> 16;
790  }
791  }
792 
793  lpdest++;
794  lzi += r_zistepx;
795  lpz++;
796  llight += r_lstepx;
797  lptex += a_ststepxwhole;
798  lsfrac += a_sstepxfrac;
799  lptex += lsfrac >> 16;
800  lsfrac &= 0xFFFF;
801  ltfrac += a_tstepxfrac;
802  if (ltfrac & 0x10000)
803  {
804  lptex += r_affinetridesc.skinwidth;
805  ltfrac &= 0xFFFF;
806  }
807  } while (--lcount);
808  }
809 
810  pspanpackage++;
811  } while (pspanpackage->count != -999999);
812 }

◆ R_PolysetFillSpans8()

void R_PolysetFillSpans8 ( spanpackage_t pspanpackage)

Definition at line 1114 of file r_polyse.c.

1115 {
1116  int color;
1117 
1118 // FIXME: do z buffering
1119 
1120  color = d_aflatcolor++;
1121 
1122  while (1)
1123  {
1124  int lcount;
1125  byte *lpdest;
1126 
1127  lcount = pspanpackage->count;
1128 
1129  if (lcount == -1)
1130  return;
1131 
1132  if (lcount)
1133  {
1134  lpdest = pspanpackage->pdest;
1135 
1136  do
1137  {
1138  *lpdest++ = color;
1139  } while (--lcount);
1140  }
1141 
1142  pspanpackage++;
1143  }
1144 }

◆ R_PolysetScanLeftEdge()

void R_PolysetScanLeftEdge ( int  height)

◆ R_PolysetScanLeftEdge_C()

void R_PolysetScanLeftEdge_C ( int  height)

Definition at line 266 of file r_polyse.c.

267 {
268  do
269  {
274 
277 
278  // FIXME: need to clamp l, s, t, at both ends?
281 
283 
285  if (errorterm >= 0)
286  {
288  d_pz += d_pzextrastep;
292  d_ptex += d_sfrac >> 16;
293 
294  d_sfrac &= 0xFFFF;
296  if (d_tfrac & 0x10000)
297  {
299  d_tfrac &= 0xFFFF;
300  }
302  d_zi += d_ziextrastep;
304  }
305  else
306  {
308  d_pz += d_pzbasestep;
312  d_ptex += d_sfrac >> 16;
313  d_sfrac &= 0xFFFF;
315  if (d_tfrac & 0x10000)
316  {
318  d_tfrac &= 0xFFFF;
319  }
321  d_zi += d_zibasestep;
322  }
323  } while (--height);
324 }

Referenced by R_RasterizeAliasPolySmooth().

◆ R_PolysetSetEdgeTable()

void R_PolysetSetEdgeTable ( void  )

Definition at line 1483 of file r_polyse.c.

1484 {
1485  int edgetableindex;
1486 
1487  edgetableindex = 0; // assume the vertices are already in
1488  // top to bottom order
1489 
1490 //
1491 // determine which edges are right & left, and the order in which
1492 // to rasterize them
1493 //
1494  if (r_p0[1] >= r_p1[1])
1495  {
1496  if (r_p0[1] == r_p1[1])
1497  {
1498  if (r_p0[1] < r_p2[1])
1499  pedgetable = &edgetables[2];
1500  else
1501  pedgetable = &edgetables[5];
1502 
1503  return;
1504  }
1505  else
1506  {
1507  edgetableindex = 1;
1508  }
1509  }
1510 
1511  if (r_p0[1] == r_p2[1])
1512  {
1513  if (edgetableindex)
1514  pedgetable = &edgetables[8];
1515  else
1516  pedgetable = &edgetables[9];
1517 
1518  return;
1519  }
1520  else if (r_p1[1] == r_p2[1])
1521  {
1522  if (edgetableindex)
1523  pedgetable = &edgetables[10];
1524  else
1525  pedgetable = &edgetables[11];
1526 
1527  return;
1528  }
1529 
1530  if (r_p0[1] > r_p2[1])
1531  edgetableindex += 2;
1532 
1533  if (r_p1[1] > r_p2[1])
1534  edgetableindex += 4;
1535 
1536  pedgetable = &edgetables[edgetableindex];
1537 }

Referenced by R_DrawTriangle().

◆ R_PolysetSetUpForLineScan()

void R_PolysetSetUpForLineScan ( fixed8_t  startvertu,
fixed8_t  startvertv,
fixed8_t  endvertu,
fixed8_t  endvertv 
)

Definition at line 374 of file r_polyse.c.

376 {
377  float dm, dn;
378  int tm, tn;
379  adivtab_t *ptemp;
380 
381 // TODO: implement x86 version
382 
383  errorterm = -1;
384 
385  tm = endvertu - startvertu;
386  tn = endvertv - startvertv;
387 
388  if (((tm <= 16) && (tm >= -15)) &&
389  ((tn <= 16) && (tn >= -15)))
390  {
391  ptemp = &adivtab[((tm+15) << 5) + (tn+15)];
392  ubasestep = ptemp->quotient;
393  erroradjustup = ptemp->remainder;
394  erroradjustdown = tn;
395  }
396  else
397  {
398  dm = tm;
399  dn = tn;
400 
401  FloorDivMod (dm, dn, &ubasestep, &erroradjustup);
402 
403  erroradjustdown = dn;
404  }
405 }

Referenced by R_RasterizeAliasPolySmooth().

◆ R_PolysetUpdateTables()

void R_PolysetUpdateTables ( void  )

Definition at line 182 of file r_polyse.c.

183 {
184  int i;
185  byte *s;
186 
189  {
192  s = skinstart;
193  for (i=0 ; i<MAX_LBM_HEIGHT ; i++, s+=skinwidth)
194  skintable[i] = s;
195  }
196 }

Referenced by R_AliasSetupSkin().

◆ R_RasterizeAliasPolySmooth()

void R_RasterizeAliasPolySmooth ( void  )

Definition at line 1151 of file r_polyse.c.

1152 {
1153  int initialleftheight, initialrightheight;
1154  int *plefttop, *prighttop, *pleftbottom, *prightbottom;
1155  int working_lstepx, originalcount;
1156 
1157  plefttop = pedgetable->pleftedgevert0;
1158  prighttop = pedgetable->prightedgevert0;
1159 
1160  pleftbottom = pedgetable->pleftedgevert1;
1161  prightbottom = pedgetable->prightedgevert1;
1162 
1163  initialleftheight = pleftbottom[1] - plefttop[1];
1164  initialrightheight = prightbottom[1] - prighttop[1];
1165 
1166 //
1167 // set the s, t, and light gradients, which are consistent across the triangle
1168 // because being a triangle, things are affine
1169 //
1171 //
1172 // rasterize the polygon
1173 //
1174 
1175 //
1176 // scan out the top (and possibly only) part of the left edge
1177 //
1179 
1180  ystart = plefttop[1];
1181  d_aspancount = plefttop[0] - prighttop[0];
1182 
1183  d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
1184  (plefttop[3] >> 16) * r_affinetridesc.skinwidth;
1185 //#if id386ALIAS
1186 #if id386
1188  {
1189  d_sfrac = (plefttop[2] & 0xFFFF) << 16;
1190  d_tfrac = (plefttop[3] & 0xFFFF) << 16;
1191  }
1192 //#else
1193  else
1194 #endif
1195  {
1196  d_sfrac = plefttop[2] & 0xFFFF;
1197  d_tfrac = plefttop[3] & 0xFFFF;
1198  }
1199 //#endif
1200  d_light = plefttop[4];
1201  d_zi = plefttop[5];
1202 
1203  d_pdest = (byte *)d_viewbuffer +
1204  ystart * r_screenwidth + plefttop[0];
1205  d_pz = d_pzbuffer + ystart * d_zwidth + plefttop[0];
1206 
1207  if (initialleftheight == 1)
1208  {
1213 
1216 
1217  // FIXME: need to clamp l, s, t, at both ends?
1220 
1222  }
1223  else
1224  {
1225  R_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
1226  pleftbottom[0], pleftbottom[1]);
1227 
1228 //#if id386ALIAS
1229 #if id386
1231  {
1232  d_pzbasestep = (d_zwidth + ubasestep) << 1;
1234  }
1235 //#else
1236  else
1237 #endif
1238  {
1241  }
1242 //#endif
1243 
1246 
1247  // TODO: can reuse partial expressions here
1248 
1249  // for negative steps in x along left edge, bias toward overflow rather than
1250  // underflow (sort of turning the floor () we did in the gradient calcs into
1251  // ceil (), but plus a little bit)
1252  if (ubasestep < 0)
1253  working_lstepx = r_lstepx - 1;
1254  else
1255  working_lstepx = r_lstepx;
1256 
1258  d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
1259  ((r_tstepy + r_tstepx * ubasestep) >> 16) *
1261 //#if id386ALIAS
1262 #if id386
1264  {
1267  }
1268  else
1269 #endif
1270  {
1271 //#else
1272  d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) & 0xFFFF;
1273  d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) & 0xFFFF;
1274  }
1275 //#endif
1276  d_lightbasestep = r_lstepy + working_lstepx * ubasestep;
1278 
1280  ((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
1282 //#if id386ALIAS
1283 #if id386
1285  {
1288  }
1289  else
1290 #endif
1291  {
1292 //#else
1295  }
1296 //#endif
1297  d_lightextrastep = d_lightbasestep + working_lstepx;
1299 
1300 #if id386
1302  {
1303  R_PolysetScanLeftEdge (initialleftheight);
1304  }
1305  else
1306 #endif
1307  {
1308  R_PolysetScanLeftEdge_C(initialleftheight);
1309  }
1310  }
1311 
1312 //
1313 // scan out the bottom part of the left edge, if it exists
1314 //
1315  if (pedgetable->numleftedges == 2)
1316  {
1317  int height;
1318 
1319  plefttop = pleftbottom;
1320  pleftbottom = pedgetable->pleftedgevert2;
1321 
1322  height = pleftbottom[1] - plefttop[1];
1323 
1324 // TODO: make this a function; modularize this function in general
1325 
1326  ystart = plefttop[1];
1327  d_aspancount = plefttop[0] - prighttop[0];
1328  d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
1329  (plefttop[3] >> 16) * r_affinetridesc.skinwidth;
1330  d_sfrac = 0;
1331  d_tfrac = 0;
1332  d_light = plefttop[4];
1333  d_zi = plefttop[5];
1334 
1335  d_pdest = (byte *)d_viewbuffer + ystart * r_screenwidth + plefttop[0];
1336  d_pz = d_pzbuffer + ystart * d_zwidth + plefttop[0];
1337 
1338  if (height == 1)
1339  {
1344 
1347 
1348  // FIXME: need to clamp l, s, t, at both ends?
1351 
1353  }
1354  else
1355  {
1356  R_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
1357  pleftbottom[0], pleftbottom[1]);
1358 
1361 
1362 //#if id386ALIAS
1363 #if id386
1365  {
1366  d_pzbasestep = (d_zwidth + ubasestep) << 1;
1368  }
1369 //#else
1370  else
1371 #endif
1372  {
1375  }
1376 //#endif
1377 
1378  if (ubasestep < 0)
1379  working_lstepx = r_lstepx - 1;
1380  else
1381  working_lstepx = r_lstepx;
1382 
1384  d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
1385  ((r_tstepy + r_tstepx * ubasestep) >> 16) *
1387 //#if id386ALIAS
1388 #if id386
1390  {
1393  }
1394 //#else
1395  else
1396 #endif
1397  {
1398  d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) & 0xFFFF;
1399  d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) & 0xFFFF;
1400  }
1401 //#endif
1402  d_lightbasestep = r_lstepy + working_lstepx * ubasestep;
1404 
1406  ((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
1408 //#if id386ALIAS
1409 #if id386
1411  {
1414  }
1415  else
1416 #endif
1417 //#endif
1418  {
1421  }
1422 //#endif
1423  d_lightextrastep = d_lightbasestep + working_lstepx;
1425 
1426 #if id386
1428  {
1430  }
1431  else
1432 #endif
1433  {
1435  }
1436  }
1437  }
1438 
1439 // scan out the top (and possibly only) part of the right edge, updating the
1440 // count field
1442 
1443  R_PolysetSetUpForLineScan(prighttop[0], prighttop[1],
1444  prightbottom[0], prightbottom[1]);
1445  d_aspancount = 0;
1447  originalcount = a_spans[initialrightheight].count;
1448  a_spans[initialrightheight].count = -999999; // mark end of the spanpackages
1449  (*d_pdrawspans) (a_spans);
1450 
1451 // scan out the bottom part of the right edge, if it exists
1452  if (pedgetable->numrightedges == 2)
1453  {
1454  int height;
1455  spanpackage_t *pstart;
1456 
1457  pstart = a_spans + initialrightheight;
1458  pstart->count = originalcount;
1459 
1460  d_aspancount = prightbottom[0] - prighttop[0];
1461 
1462  prighttop = prightbottom;
1463  prightbottom = pedgetable->prightedgevert2;
1464 
1465  height = prightbottom[1] - prighttop[1];
1466 
1467  R_PolysetSetUpForLineScan(prighttop[0], prighttop[1],
1468  prightbottom[0], prightbottom[1]);
1469 
1471  a_spans[initialrightheight + height].count = -999999;
1472  // mark end of the spanpackages
1473  (*d_pdrawspans) (pstart);
1474  }
1475 }

Referenced by R_DrawTriangle().

Variable Documentation

◆ a_spans

spanpackage_t* a_spans

Definition at line 91 of file r_polyse.c.

Referenced by R_DrawTriangle(), and R_RasterizeAliasPolySmooth().

◆ a_sstepxfrac

◆ a_ststepxwhole

◆ a_tstepxfrac

◆ adivtab

adivtab_t adivtab[32 *32]
static
Initial value:
= {
}

Definition at line 109 of file r_polyse.c.

Referenced by R_PolysetSetUpForLineScan().

◆ aliastriangleparms

aliastriangleparms_t aliastriangleparms

Definition at line 59 of file r_polyse.c.

Referenced by R_AliasClipTriangle(), R_AliasPreparePoints(), and R_DrawTriangle().

◆ d_aflatcolor

int d_aflatcolor

Definition at line 65 of file r_polyse.c.

Referenced by R_PolysetFillSpans8(), and R_SetupFrame().

◆ d_aspancount

◆ d_countextrastep

◆ d_light

int d_light

Definition at line 96 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_lightbasestep

int d_lightbasestep

Definition at line 99 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_lightextrastep

int d_lightextrastep

Definition at line 98 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pcolormap

byte* d_pcolormap

Definition at line 63 of file r_polyse.c.

◆ d_pdest

byte* d_pdest

Definition at line 94 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pdestbasestep

int d_pdestbasestep

Definition at line 99 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pdestextrastep

int d_pdestextrastep

Definition at line 98 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pdrawspans

void(* d_pdrawspans) (spanpackage_t *pspanpackage)

◆ d_pedgespanpackage

spanpackage_t* d_pedgespanpackage

Definition at line 92 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_ptex

byte * d_ptex

Definition at line 94 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_ptexbasestep

int d_ptexbasestep

Definition at line 99 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_ptexextrastep

int d_ptexextrastep

Definition at line 97 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pz

short* d_pz

Definition at line 95 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pzbasestep

int d_pzbasestep

Definition at line 102 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_pzextrastep

int d_pzextrastep

Definition at line 102 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_sfrac

int d_sfrac

Definition at line 96 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_sfracbasestep

int d_sfracbasestep

Definition at line 100 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_sfracextrastep

int d_sfracextrastep

Definition at line 97 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_tfrac

int d_tfrac

Definition at line 96 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_tfracbasestep

int d_tfracbasestep

Definition at line 100 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_tfracextrastep

int d_tfracextrastep

Definition at line 98 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_xdenom

int d_xdenom

Definition at line 66 of file r_polyse.c.

Referenced by R_DrawTriangle(), and R_PolysetCalcGradients().

◆ d_zi

int d_zi

Definition at line 96 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_zibasestep

int d_zibasestep

Definition at line 101 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ d_ziextrastep

int d_ziextrastep

Definition at line 101 of file r_polyse.c.

Referenced by R_PolysetScanLeftEdge_C(), and R_RasterizeAliasPolySmooth().

◆ edgetables

edgetable edgetables[12]
Initial value:
= {
{0, 1, r_p0, r_p2, NULL, 2, r_p0, r_p1, r_p2 },
{0, 2, r_p1, r_p0, r_p2, 1, r_p1, r_p2, NULL},
{1, 1, r_p0, r_p2, NULL, 1, r_p1, r_p2, NULL},
{0, 1, r_p1, r_p0, NULL, 2, r_p1, r_p2, r_p0 },
{0, 2, r_p0, r_p2, r_p1, 1, r_p0, r_p1, NULL},
{0, 1, r_p2, r_p1, NULL, 1, r_p2, r_p0, NULL},
{0, 1, r_p2, r_p1, NULL, 2, r_p2, r_p0, r_p1 },
{0, 2, r_p2, r_p1, r_p0, 1, r_p2, r_p0, NULL},
{0, 1, r_p1, r_p0, NULL, 1, r_p1, r_p2, NULL},
{1, 1, r_p2, r_p1, NULL, 1, r_p0, r_p1, NULL},
{1, 1, r_p1, r_p0, NULL, 1, r_p2, r_p0, NULL},
{0, 1, r_p0, r_p2, NULL, 1, r_p0, r_p1, NULL},
}

Definition at line 70 of file r_polyse.c.

Referenced by R_PolysetSetEdgeTable().

◆ iractive

byte iractive = 0

Definition at line 134 of file r_polyse.c.

Referenced by R_AliasPreparePoints().

◆ irtable

byte irtable[256]

Definition at line 135 of file r_polyse.c.

Referenced by R_PolysetDrawSpans8_Opaque().

◆ pedgetable

edgetable* pedgetable

Definition at line 68 of file r_polyse.c.

Referenced by R_PolysetSetEdgeTable(), and R_RasterizeAliasPolySmooth().

◆ r_lstepx

◆ r_lstepy

int r_lstepy

Definition at line 87 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ r_p0

int r_p0[6]

Definition at line 61 of file r_polyse.c.

Referenced by R_DrawTriangle(), R_PolysetCalcGradients(), and R_PolysetSetEdgeTable().

◆ r_p1

int r_p1[6]

Definition at line 61 of file r_polyse.c.

Referenced by R_DrawTriangle(), R_PolysetCalcGradients(), and R_PolysetSetEdgeTable().

◆ r_p2

int r_p2[6]

Definition at line 61 of file r_polyse.c.

Referenced by R_DrawTriangle(), R_PolysetCalcGradients(), and R_PolysetSetEdgeTable().

◆ r_sstepx

int r_sstepx

Definition at line 87 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ r_sstepy

int r_sstepy

Definition at line 87 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ r_tstepx

int r_tstepx

Definition at line 87 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ r_tstepy

int r_tstepy

Definition at line 87 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ r_zistepx

◆ r_zistepy

int r_zistepy

Definition at line 88 of file r_polyse.c.

Referenced by R_PolysetCalcGradients(), and R_RasterizeAliasPolySmooth().

◆ rand1k

int rand1k[]
Initial value:
= {
}

Definition at line 25 of file r_polyse.c.

Referenced by R_PolysetDrawThreshSpans8().

◆ rand1k_index

int rand1k_index = 0

Definition at line 31 of file r_polyse.c.

Referenced by R_PolysetDrawThreshSpans8().

◆ skinstart

byte* skinstart

Definition at line 115 of file r_polyse.c.

Referenced by R_PolysetUpdateTables().

◆ skintable

byte* skintable[MAX_LBM_HEIGHT]

Definition at line 113 of file r_polyse.c.

Referenced by R_PolysetUpdateTables().

◆ skinwidth

int skinwidth

Definition at line 114 of file r_polyse.c.

Referenced by R_FloodFillSkin(), R_PolysetCalcGradients(), and R_PolysetUpdateTables().

◆ ystart

int ystart
static

Definition at line 93 of file r_polyse.c.

Referenced by M_Main_Draw(), and R_RasterizeAliasPolySmooth().

d_xdenom
int d_xdenom
Definition: r_polyse.c:66
r_zistepx
int r_zistepx
Definition: r_polyse.c:88
spanpackage_t::count
int count
Definition: r_polyse.c:42
height
GLsizei height
Definition: qgl_win.c:69
errorterm
int errorterm
Definition: r_edge.c:80
RF_IR_VISIBLE
#define RF_IR_VISIBLE
Definition: q_shared.h:629
d_aflatcolor
int d_aflatcolor
Definition: r_polyse.c:65
d_pzbasestep
int d_pzbasestep
Definition: r_polyse.c:102
r_sstepx
int r_sstepx
Definition: r_polyse.c:87
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
finalvert_s::u
int u
Definition: r_local.h:282
edgetable::pleftedgevert2
int * pleftedgevert2
Definition: r_polyse.c:52
d_zi
int d_zi
Definition: r_polyse.c:96
skinwidth
int skinwidth
Definition: r_polyse.c:114
aliastriangleparms_t::b
finalvert_t * b
Definition: r_local.h:712
R_PolysetSetUpForLineScan
void R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
Definition: r_polyse.c:374
d_ptexbasestep
int d_ptexbasestep
Definition: r_polyse.c:99
d_sfracextrastep
int d_sfracextrastep
Definition: r_polyse.c:97
d_zibasestep
int d_zibasestep
Definition: r_polyse.c:101
x
GLint GLenum GLint x
Definition: qgl_win.c:116
id386
#define id386
Definition: q_shared.h:46
i
int i
Definition: q_shared.c:305
d_viewbuffer
pixel_t * d_viewbuffer
Definition: r_main.c:181
d_ziextrastep
int d_ziextrastep
Definition: r_polyse.c:101
r_lstepy
int r_lstepy
Definition: r_polyse.c:87
q
GLdouble GLdouble GLdouble q
Definition: qgl_win.c:344
irtable
byte irtable[256]
Definition: r_polyse.c:135
d_pdrawspans
void(* d_pdrawspans)(spanpackage_t *pspanpackage)
Definition: r_polyse.c:117
refdef_t::rdflags
int rdflags
Definition: ref.h:128
R_PolysetDrawSpans8_Opaque
void R_PolysetDrawSpans8_Opaque(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1038
finalvert_s::t
int t
Definition: r_local.h:282
entity_s::flags
int flags
Definition: ref.h:76
currententity
entity_t * currententity
Definition: r_bsp.c:28
erroradjustup
int erroradjustup
Definition: r_edge.c:80
d_tfracextrastep
int d_tfracextrastep
Definition: r_polyse.c:98
spanpackage_t::tfrac
int tfrac
Definition: r_polyse.c:44
edgetable::numleftedges
int numleftedges
Definition: r_polyse.c:49
r_tstepy
int r_tstepy
Definition: r_polyse.c:87
finalvert_s::v
int v
Definition: r_local.h:282
r_p1
int r_p1[6]
Definition: r_polyse.c:61
edgetable::prightedgevert1
int * prightedgevert1
Definition: r_polyse.c:55
d_lightextrastep
int d_lightextrastep
Definition: r_polyse.c:98
r
GLdouble GLdouble r
Definition: qgl_win.c:336
r_zistepy
int r_zistepy
Definition: r_polyse.c:88
spanpackage_t::pz
short * pz
Definition: r_polyse.c:41
r_p0
int r_p0[6]
Definition: r_polyse.c:61
MASK_1K
#define MASK_1K
Definition: r_polyse.c:29
d_tfrac
int d_tfrac
Definition: r_polyse.c:96
d_pdestextrastep
int d_pdestextrastep
Definition: r_polyse.c:98
RDF_IRGOGGLES
#define RDF_IRGOGGLES
Definition: q_shared.h:649
R_RasterizeAliasPolySmooth
void R_RasterizeAliasPolySmooth(void)
Definition: r_polyse.c:1151
pedgetable
edgetable * pedgetable
Definition: r_polyse.c:68
d_pzextrastep
int d_pzextrastep
Definition: r_polyse.c:102
r_affinetridesc
affinetridesc_t r_affinetridesc
Definition: r_alias.c:36
r_lstepx
int r_lstepx
Definition: r_polyse.c:86
adivtab_t::remainder
int remainder
Definition: r_polyse.c:106
spanpackage_t::sfrac
int sfrac
Definition: r_polyse.c:44
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:36
adivtab
static adivtab_t adivtab[32 *32]
Definition: r_polyse.c:109
skinstart
byte * skinstart
Definition: r_polyse.c:115
edgetable::numrightedges
int numrightedges
Definition: r_polyse.c:53
NULL
#define NULL
Definition: q_shared.h:60
d_sfracbasestep
int d_sfracbasestep
Definition: r_polyse.c:100
d_ptex
byte * d_ptex
Definition: r_polyse.c:94
finalvert_s::zi
int zi
Definition: r_local.h:284
edgetable::prightedgevert0
int * prightedgevert0
Definition: r_polyse.c:54
r_screenwidth
int r_screenwidth
Definition: r_main.c:81
R_PolysetScanLeftEdge_C
void R_PolysetScanLeftEdge_C(int height)
Definition: r_polyse.c:266
d_pdest
byte * d_pdest
Definition: r_polyse.c:94
d_tfracbasestep
int d_tfracbasestep
Definition: r_polyse.c:100
a_tstepxfrac
int a_tstepxfrac
Definition: r_polyse.c:86
affinetridesc_t::skinwidth
int skinwidth
Definition: r_local.h:307
MAX_LBM_HEIGHT
#define MAX_LBM_HEIGHT
Definition: r_local.h:177
spanpackage_t
Definition: r_polyse.c:39
d_countextrastep
int d_countextrastep
Definition: r_polyse.c:89
a_spans
spanpackage_t * a_spans
Definition: r_polyse.c:91
ystart
static int ystart
Definition: r_polyse.c:93
d_pdestbasestep
int d_pdestbasestep
Definition: r_polyse.c:99
R_PolysetScanLeftEdge
void R_PolysetScanLeftEdge(int height)
d_ptexextrastep
int d_ptexextrastep
Definition: r_polyse.c:97
edgetable::pleftedgevert0
int * pleftedgevert0
Definition: r_polyse.c:50
aliastriangleparms_t::a
finalvert_t * a
Definition: r_local.h:712
r_sstepy
int r_sstepy
Definition: r_polyse.c:87
d_pedgespanpackage
spanpackage_t * d_pedgespanpackage
Definition: r_polyse.c:92
edgetables
edgetable edgetables[12]
Definition: r_polyse.c:70
affinetridesc_t::vis_thresh
int vis_thresh
Definition: r_local.h:315
spanpackage_t::pdest
void * pdest
Definition: r_polyse.c:40
d_lightbasestep
int d_lightbasestep
Definition: r_polyse.c:99
finalvert_s::s
int s
Definition: r_local.h:282
FloorDivMod
void FloorDivMod(float numer, float denom, int *quotient, int *rem)
Definition: r_polyse.c:336
edgetable::pleftedgevert1
int * pleftedgevert1
Definition: r_polyse.c:51
d_zwidth
unsigned int d_zwidth
Definition: r_local.h:502
aliastriangleparms_t::c
finalvert_t * c
Definition: r_local.h:712
adivtab_t
Definition: r_polyse.c:104
d_pz
short * d_pz
Definition: r_polyse.c:95
d_light
int d_light
Definition: r_polyse.c:96
DPS_MAXSPANS
#define DPS_MAXSPANS
Definition: r_polyse.c:35
spanpackage_t::zi
int zi
Definition: r_polyse.c:44
R_PolysetSetEdgeTable
void R_PolysetSetEdgeTable(void)
Definition: r_polyse.c:1483
a_sstepxfrac
int a_sstepxfrac
Definition: r_polyse.c:86
spanpackage_t::ptex
byte * ptex
Definition: r_polyse.c:43
skintable
byte * skintable[MAX_LBM_HEIGHT]
Definition: r_polyse.c:113
d_sfrac
int d_sfrac
Definition: r_polyse.c:96
r_aliasblendcolor
int r_aliasblendcolor
Definition: r_alias.c:43
a_ststepxwhole
int a_ststepxwhole
Definition: r_polyse.c:86
r_tstepx
int r_tstepx
Definition: r_polyse.c:87
adivtab_t::quotient
int quotient
Definition: r_polyse.c:105
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:89
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:182
edgetable::prightedgevert2
int * prightedgevert2
Definition: r_polyse.c:56
d_aspancount
int d_aspancount
Definition: r_polyse.c:89
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:90
spanpackage_t::light
int light
Definition: r_polyse.c:44
r_p2
int r_p2[6]
Definition: r_polyse.c:61
erroradjustdown
int erroradjustdown
Definition: r_edge.c:80
aliastriangleparms
aliastriangleparms_t aliastriangleparms
Definition: r_polyse.c:59
rand1k
int rand1k[]
Definition: r_polyse.c:25
rand1k_index
int rand1k_index
Definition: r_polyse.c:31
finalvert_s::l
int l
Definition: r_local.h:283
ubasestep
int ubasestep
Definition: r_edge.c:80
affinetridesc_t::pskin
void * pskin
Definition: r_local.h:305
R_PolysetCalcGradients
void R_PolysetCalcGradients(int skinwidth)
Definition: r_polyse.c:673
vid
viddef_t vid
Definition: r_main.c:24