Quake II RTX doxygen  1.0 dev
polyset.c File Reference
#include "sw.h"
#include "adivtab.h"

Go to the source code of this file.

Classes

struct  spanpackage_t
 
struct  edgetable_t
 
struct  adivtab_t
 

Macros

#define DPS_MAXSPANS   MAXHEIGHT+1
 

Functions

void R_PolysetDrawSpansConstant8_Blended (spanpackage_t *pspanpackage)
 
void R_PolysetDrawSpans8_Blended (spanpackage_t *pspanpackage)
 
void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage)
 
static void R_PolysetSetEdgeTable (void)
 
static void R_RasterizeAliasPolySmooth (void)
 
void R_DrawTriangle (void)
 
static void R_PolysetScanLeftEdge (int height)
 
static void FloorDivMod (float numer, float denom, int *quotient, int *rem)
 
static void R_PolysetSetUpForLineScan (fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
 
static void R_PolysetCalcGradients (int skinwidth)
 
static void R_PolysetSetUpAndScanLeftEdge (int *plefttop, int *pleftbottom)
 

Variables

aliastriangleparms_t aliastriangleparms
 
static int r_p0 [6]
 
static int r_p1 [6]
 
static int r_p2 [6]
 
static int d_xdenom
 
static const edgetable_tpedgetable
 
static const edgetable_t edgetables [12]
 
static int a_sstepxfrac
 
static int a_tstepxfrac
 
static int r_lstepx
 
static int a_ststepxwhole
 
static int r_sstepx
 
static int r_tstepx
 
static int r_lstepy
 
static int r_sstepy
 
static int r_tstepy
 
static int r_zistepx
 
static int r_zistepy
 
static int d_aspancount
 
static int d_countextrastep
 
static int ubasestep
 
static int errorterm
 
static int erroradjustup
 
static int erroradjustdown
 
static spanpackage_ta_spans
 
static spanpackage_td_pedgespanpackage
 
static byte * d_pdest
 
static byte * d_ptex
 
static short * d_pz
 
static int d_sfrac
 
static int d_tfrac
 
static int d_light
 
static int d_zi
 
static int d_ptexextrastep
 
static int d_sfracextrastep
 
static int d_tfracextrastep
 
static int d_lightextrastep
 
static int d_pdestextrastep
 
static int d_lightbasestep
 
static int d_pdestbasestep
 
static int d_ptexbasestep
 
static int d_sfracbasestep
 
static int d_tfracbasestep
 
static int d_ziextrastep
 
static int d_zibasestep
 
static int d_pzextrastep
 
static int d_pzbasestep
 
static const adivtab_t adivtab [32 *32]
 
void(* d_pdrawspans )(spanpackage_t *pspanpackage)
 

Macro Definition Documentation

◆ DPS_MAXSPANS

#define DPS_MAXSPANS   MAXHEIGHT+1

Definition at line 24 of file polyset.c.

Function Documentation

◆ FloorDivMod()

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

Definition at line 232 of file polyset.c.

233 {
234  int q, r;
235  float x;
236 
237  if (numer >= 0.0) {
238  x = floor(numer / denom);
239  q = (int)x;
240  r = (int)floor(numer - (x * denom));
241  } else {
242  //
243  // perform operations with positive values, and fix mod to make floor-based
244  //
245  x = floor(-numer / denom);
246  q = -(int)x;
247  r = (int)floor(-numer - (x * denom));
248  if (r != 0) {
249  q--;
250  r = (int)denom - r;
251  }
252  }
253 
254  *quotient = q;
255  *rem = r;
256 }

Referenced by R_PolysetSetUpForLineScan().

◆ R_DrawTriangle()

void R_DrawTriangle ( void  )

Definition at line 113 of file polyset.c.

114 {
116  int dv1_ab, dv0_ac;
117  int dv0_ab, dv1_ac;
118 
121 
122  if (!(dv0_ab | dv1_ab))
123  return;
124 
127 
128  if (!(dv0_ac | dv1_ac))
129  return;
130 
131  d_xdenom = (dv0_ac * dv1_ab) - (dv0_ab * dv1_ac);
132 
133  if (d_xdenom < 0) {
134  a_spans = spans;
135 
136  r_p0[0] = aliastriangleparms.a->u; // u
137  r_p0[1] = aliastriangleparms.a->v; // v
138  r_p0[2] = aliastriangleparms.a->s; // s
139  r_p0[3] = aliastriangleparms.a->t; // t
140  r_p0[4] = aliastriangleparms.a->l; // light
141  r_p0[5] = aliastriangleparms.a->zi; // iz
142 
143  r_p1[0] = aliastriangleparms.b->u;
144  r_p1[1] = aliastriangleparms.b->v;
145  r_p1[2] = aliastriangleparms.b->s;
146  r_p1[3] = aliastriangleparms.b->t;
147  r_p1[4] = aliastriangleparms.b->l;
148  r_p1[5] = aliastriangleparms.b->zi;
149 
150  r_p2[0] = aliastriangleparms.c->u;
151  r_p2[1] = aliastriangleparms.c->v;
152  r_p2[2] = aliastriangleparms.c->s;
153  r_p2[3] = aliastriangleparms.c->t;
154  r_p2[4] = aliastriangleparms.c->l;
155  r_p2[5] = aliastriangleparms.c->zi;
156 
159  }
160 }

Referenced by R_AliasClipTriangle(), and R_AliasPreparePoints().

◆ R_PolysetCalcGradients()

static void R_PolysetCalcGradients ( int  skinwidth)
static

Definition at line 297 of file polyset.c.

298 {
299  float xstepdenominv, ystepdenominv, t0, t1;
300  float p01_minus_p21, p11_minus_p21, p00_minus_p20, p10_minus_p20;
301 
302  p00_minus_p20 = r_p0[0] - r_p2[0];
303  p01_minus_p21 = r_p0[1] - r_p2[1];
304  p10_minus_p20 = r_p1[0] - r_p2[0];
305  p11_minus_p21 = r_p1[1] - r_p2[1];
306 
307  xstepdenominv = 1.0 / (float)d_xdenom;
308 
309  ystepdenominv = -xstepdenominv;
310 
311 // ceil () for light so positive steps are exaggerated, negative steps
312 // diminished, pushing us away from underflow toward overflow. Underflow is
313 // very visible, overflow is very unlikely, because of ambient lighting
314  t0 = r_p0[4] - r_p2[4];
315  t1 = r_p1[4] - r_p2[4];
316  r_lstepx = (int)
317  ceil((t1 * p01_minus_p21 - t0 * p11_minus_p21) * xstepdenominv);
318  r_lstepy = (int)
319  ceil((t1 * p00_minus_p20 - t0 * p10_minus_p20) * ystepdenominv);
320 
321  t0 = r_p0[2] - r_p2[2];
322  t1 = r_p1[2] - r_p2[2];
323  r_sstepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
324  xstepdenominv);
325  r_sstepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
326  ystepdenominv);
327 
328  t0 = r_p0[3] - r_p2[3];
329  t1 = r_p1[3] - r_p2[3];
330  r_tstepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
331  xstepdenominv);
332  r_tstepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
333  ystepdenominv);
334 
335  t0 = r_p0[5] - r_p2[5];
336  t1 = r_p1[5] - r_p2[5];
337  r_zistepx = (int)((t1 * p01_minus_p21 - t0 * p11_minus_p21) *
338  xstepdenominv);
339  r_zistepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
340  ystepdenominv);
341 
342  a_sstepxfrac = r_sstepx & 0xFFFF;
343  a_tstepxfrac = r_tstepx & 0xFFFF;
344 
345  a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16) * TEX_BYTES;
346 }

Referenced by R_RasterizeAliasPolySmooth().

◆ R_PolysetDrawSpans8_Blended()

void R_PolysetDrawSpans8_Blended ( spanpackage_t pspanpackage)

Definition at line 348 of file polyset.c.

349 {
350  int lcount;
351  byte *lpdest;
352  byte *lptex;
353  int lsfrac, ltfrac;
354  int llight;
355  int lzi;
356  short *lpz;
357  int tmp[3];
358 
359  do {
360  lcount = d_aspancount - pspanpackage->count;
361 
363  if (errorterm >= 0) {
366  } else {
368  }
369 
370  if (lcount) {
371  lpdest = pspanpackage->pdest;
372  lptex = pspanpackage->ptex;
373  lpz = pspanpackage->pz;
374  lsfrac = pspanpackage->sfrac;
375  ltfrac = pspanpackage->tfrac;
376  llight = pspanpackage->light;
377  lzi = pspanpackage->zi;
378 
379  do {
380  if ((lzi >> 16) >= *lpz) {
381  tmp[0] = (r_aliasblendcolor[0] * llight) >> 15;
382  tmp[1] = (r_aliasblendcolor[1] * llight) >> 15;
383  tmp[2] = (r_aliasblendcolor[2] * llight) >> 15;
384  if (tmp[0] > 255) tmp[0] = 255;
385  if (tmp[1] > 255) tmp[1] = 255;
386  if (tmp[2] > 255) tmp[2] = 255;
387  tmp[0] = (lptex[0] * tmp[0]) >> 8;
388  tmp[1] = (lptex[1] * tmp[1]) >> 8;
389  tmp[2] = (lptex[2] * tmp[2]) >> 8;
390  lpdest[0] = (lpdest[0] * r_alias_one_minus_alpha + tmp[2] * r_alias_alpha) >> 8;
391  lpdest[1] = (lpdest[1] * r_alias_one_minus_alpha + tmp[1] * r_alias_alpha) >> 8;
392  lpdest[2] = (lpdest[2] * r_alias_one_minus_alpha + tmp[0] * r_alias_alpha) >> 8;
393  *lpz = lzi >> 16;
394  }
395  lpdest += VID_BYTES;
396  lzi += r_zistepx;
397  lpz++;
398  llight += r_lstepx;
399  lptex += a_ststepxwhole;
400  lsfrac += a_sstepxfrac;
401  lptex += (lsfrac >> 16) * TEX_BYTES;
402  lsfrac &= 0xFFFF;
403  ltfrac += a_tstepxfrac;
404  if (ltfrac & 0x10000) {
405  lptex += r_affinetridesc.skinwidth;
406  ltfrac &= 0xFFFF;
407  }
408  } while (--lcount);
409  }
410 
411  pspanpackage++;
412  } while (pspanpackage->count != -999999);
413 }

Referenced by R_AliasSetupBlend().

◆ R_PolysetDrawSpans8_Opaque()

void R_PolysetDrawSpans8_Opaque ( spanpackage_t pspanpackage)

Definition at line 454 of file polyset.c.

455 {
456  int lcount;
457 
458  do {
459  lcount = d_aspancount - pspanpackage->count;
460 
462  if (errorterm >= 0) {
465  } else {
467  }
468 
469  if (lcount) {
470  int lsfrac, ltfrac;
471  byte *lpdest;
472  byte *lptex;
473  int llight;
474  int lzi;
475  short *lpz;
476  int tmp[3];
477 
478  lpdest = pspanpackage->pdest;
479  lptex = pspanpackage->ptex;
480  lpz = pspanpackage->pz;
481  lsfrac = pspanpackage->sfrac;
482  ltfrac = pspanpackage->tfrac;
483  llight = pspanpackage->light;
484  lzi = pspanpackage->zi;
485 
486  do {
487  if ((lzi >> 16) >= *lpz) {
488  tmp[0] = (r_aliasblendcolor[0] * llight) >> 15;
489  tmp[1] = (r_aliasblendcolor[1] * llight) >> 15;
490  tmp[2] = (r_aliasblendcolor[2] * llight) >> 15;
491  if (tmp[0] > 255) tmp[0] = 255;
492  if (tmp[1] > 255) tmp[1] = 255;
493  if (tmp[2] > 255) tmp[2] = 255;
494  lpdest[0] = (lptex[2] * tmp[2]) >> 8;
495  lpdest[1] = (lptex[1] * tmp[1]) >> 8;
496  lpdest[2] = (lptex[0] * tmp[0]) >> 8;
497  *lpz = lzi >> 16;
498  }
499  lpdest += VID_BYTES;
500  lzi += r_zistepx;
501  lpz++;
502  llight += r_lstepx;
503  lptex += a_ststepxwhole;
504  lsfrac += a_sstepxfrac;
505  lptex += (lsfrac >> 16) * TEX_BYTES;
506  lsfrac &= 0xFFFF;
507  ltfrac += a_tstepxfrac;
508  if (ltfrac & 0x10000) {
509  lptex += r_affinetridesc.skinwidth;
510  ltfrac &= 0xFFFF;
511  }
512  } while (--lcount);
513  }
514 
515  pspanpackage++;
516  } while (pspanpackage->count != -999999);
517 }

Referenced by R_AliasSetupBlend().

◆ R_PolysetDrawSpansConstant8_Blended()

void R_PolysetDrawSpansConstant8_Blended ( spanpackage_t pspanpackage)

Definition at line 415 of file polyset.c.

416 {
417  int lcount;
418  byte *lpdest;
419  int lzi;
420  short *lpz;
421 
422  do {
423  lcount = d_aspancount - pspanpackage->count;
424 
426  if (errorterm >= 0) {
429  } else {
431  }
432 
433  if (lcount) {
434  lpdest = pspanpackage->pdest;
435  lpz = pspanpackage->pz;
436  lzi = pspanpackage->zi;
437 
438  do {
439  if ((lzi >> 16) >= *lpz) {
440  lpdest[0] = (lpdest[0] * r_alias_one_minus_alpha + r_aliasblendcolor[2]) >> 8;
441  lpdest[1] = (lpdest[1] * r_alias_one_minus_alpha + r_aliasblendcolor[1]) >> 8;
442  lpdest[2] = (lpdest[2] * r_alias_one_minus_alpha + r_aliasblendcolor[0]) >> 8;
443  }
444  lpdest += VID_BYTES;
445  lzi += r_zistepx;
446  lpz++;
447  } while (--lcount);
448  }
449 
450  pspanpackage++;
451  } while (pspanpackage->count != -999999);
452 }

Referenced by R_AliasSetupBlend().

◆ R_PolysetScanLeftEdge()

static void R_PolysetScanLeftEdge ( int  height)
static

Definition at line 168 of file polyset.c.

169 {
170  do {
175 
178 
179  // FIXME: need to clamp l, s, t, at both ends?
182 
184 
186  if (errorterm >= 0) {
188  d_pz += d_pzextrastep;
192  d_ptex += (d_sfrac >> 16) * TEX_BYTES;
193 
194  d_sfrac &= 0xFFFF;
196  if (d_tfrac & 0x10000) {
198  d_tfrac &= 0xFFFF;
199  }
201  d_zi += d_ziextrastep;
203  } else {
205  d_pz += d_pzbasestep;
209  d_ptex += (d_sfrac >> 16) * TEX_BYTES;
210  d_sfrac &= 0xFFFF;
212  if (d_tfrac & 0x10000) {
214  d_tfrac &= 0xFFFF;
215  }
217  d_zi += d_zibasestep;
218  }
219  } while (--height);
220 }

Referenced by R_PolysetSetUpAndScanLeftEdge().

◆ R_PolysetSetEdgeTable()

static void R_PolysetSetEdgeTable ( void  )
static

Definition at line 683 of file polyset.c.

684 {
685  int edgetableindex;
686 
687  edgetableindex = 0; // assume the vertices are already in
688  // top to bottom order
689 
690 //
691 // determine which edges are right & left, and the order in which
692 // to rasterize them
693 //
694  if (r_p0[1] >= r_p1[1]) {
695  if (r_p0[1] == r_p1[1]) {
696  if (r_p0[1] < r_p2[1])
697  pedgetable = &edgetables[2];
698  else
699  pedgetable = &edgetables[5];
700 
701  return;
702  } else {
703  edgetableindex = 1;
704  }
705  }
706 
707  if (r_p0[1] == r_p2[1]) {
708  if (edgetableindex)
709  pedgetable = &edgetables[8];
710  else
711  pedgetable = &edgetables[9];
712 
713  return;
714  } else if (r_p1[1] == r_p2[1]) {
715  if (edgetableindex)
716  pedgetable = &edgetables[10];
717  else
718  pedgetable = &edgetables[11];
719 
720  return;
721  }
722 
723  if (r_p0[1] > r_p2[1])
724  edgetableindex += 2;
725 
726  if (r_p1[1] > r_p2[1])
727  edgetableindex += 4;
728 
729  pedgetable = &edgetables[edgetableindex];
730 }

Referenced by R_DrawTriangle().

◆ R_PolysetSetUpAndScanLeftEdge()

static void R_PolysetSetUpAndScanLeftEdge ( int plefttop,
int pleftbottom 
)
static

Definition at line 519 of file polyset.c.

520 {
521  int height, ystart;
522  int working_lstepx;
523 
524  height = pleftbottom[1] - plefttop[1];
525  ystart = plefttop[1];
526 
527  d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) * TEX_BYTES +
528  (plefttop[3] >> 16) * r_affinetridesc.skinwidth;
529  d_sfrac = plefttop[2] & 0xFFFF;
530  d_tfrac = plefttop[3] & 0xFFFF;
531  d_light = plefttop[4];
532  d_zi = plefttop[5];
533 
534  d_pdest = d_spantable[ystart] + plefttop[0] * VID_BYTES;
535  d_pz = d_zspantable[ystart] + plefttop[0];
536 
537  if (height == 1) {
542 
545 
546  // FIXME: need to clamp l, s, t, at both ends?
549 
551  } else {
552  R_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
553  pleftbottom[0], pleftbottom[1]);
554 
557 
560 
561  // for negative steps in x along left edge, bias toward overflow rather than
562  // underflow (sort of turning the floor () we did in the gradient calcs into
563  // ceil (), but plus a little bit)
564  if (ubasestep < 0)
565  working_lstepx = r_lstepx - 1;
566  else
567  working_lstepx = r_lstepx;
568 
571  ((r_tstepy + r_tstepx * ubasestep) >> 16) *
573  d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) & 0xFFFF;
574  d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) & 0xFFFF;
575  d_lightbasestep = r_lstepy + working_lstepx * ubasestep;
577 
579  ((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
583  d_lightextrastep = d_lightbasestep + working_lstepx;
585 
587  }
588 }

Referenced by R_RasterizeAliasPolySmooth().

◆ R_PolysetSetUpForLineScan()

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

Definition at line 264 of file polyset.c.

266 {
267  float dm, dn;
268  int tm, tn;
269  const adivtab_t *ptemp;
270 
271  errorterm = -1;
272 
273  tm = endvertu - startvertu;
274  tn = endvertv - startvertv;
275 
276  if (((tm <= 16) && (tm >= -15)) &&
277  ((tn <= 16) && (tn >= -15))) {
278  ptemp = &adivtab[((tm + 15) << 5) + (tn + 15)];
279  ubasestep = ptemp->quotient;
280  erroradjustup = ptemp->remainder;
281  erroradjustdown = tn;
282  } else {
283  dm = tm;
284  dn = tn;
285 
286  FloorDivMod(dm, dn, &ubasestep, &erroradjustup);
287 
288  erroradjustdown = dn;
289  }
290 }

Referenced by R_PolysetSetUpAndScanLeftEdge(), and R_RasterizeAliasPolySmooth().

◆ R_RasterizeAliasPolySmooth()

static void R_RasterizeAliasPolySmooth ( void  )
static

Definition at line 595 of file polyset.c.

596 {
597  int /*initialleftheight,*/ initialrightheight;
598  int *plefttop, *prighttop, *pleftbottom, *prightbottom;
599  int originalcount;
600 
601  plefttop = pedgetable->pleftedgevert0;
602  prighttop = pedgetable->prightedgevert0;
603 
604  pleftbottom = pedgetable->pleftedgevert1;
605  prightbottom = pedgetable->prightedgevert1;
606 
607  /*initialleftheight = pleftbottom[1] - plefttop[1];*/
608  initialrightheight = prightbottom[1] - prighttop[1];
609 
610 //
611 // set the s, t, and light gradients, which are consistent across the triangle
612 // because being a triangle, things are affine
613 //
615 
616 //
617 // rasterize the polygon
618 //
619 
620 //
621 // scan out the top (and possibly only) part of the left edge
622 //
624 
625  d_aspancount = plefttop[0] - prighttop[0];
626 
627  R_PolysetSetUpAndScanLeftEdge(plefttop, pleftbottom);
628 
629 //
630 // scan out the bottom part of the left edge, if it exists
631 //
632  if (pedgetable->numleftedges == 2) {
633  plefttop = pleftbottom;
634  pleftbottom = pedgetable->pleftedgevert2;
635 
636  d_aspancount = plefttop[0] - prighttop[0];
637 
638  R_PolysetSetUpAndScanLeftEdge(plefttop, pleftbottom);
639  }
640 
641 // scan out the top (and possibly only) part of the right edge, updating the
642 // count field
644 
645  R_PolysetSetUpForLineScan(prighttop[0], prighttop[1],
646  prightbottom[0], prightbottom[1]);
647  d_aspancount = 0;
649  originalcount = a_spans[initialrightheight].count;
650  a_spans[initialrightheight].count = -999999; // mark end of the spanpackages
651  (*d_pdrawspans)(a_spans);
652 
653 // scan out the bottom part of the right edge, if it exists
654  if (pedgetable->numrightedges == 2) {
655  int height;
656  spanpackage_t *pstart;
657 
658  pstart = a_spans + initialrightheight;
659  pstart->count = originalcount;
660 
661  d_aspancount = prightbottom[0] - prighttop[0];
662 
663  prighttop = prightbottom;
664  prightbottom = pedgetable->prightedgevert2;
665 
666  height = prightbottom[1] - prighttop[1];
667 
668  R_PolysetSetUpForLineScan(prighttop[0], prighttop[1],
669  prightbottom[0], prightbottom[1]);
670 
672  a_spans[initialrightheight + height].count = -999999; // mark end of the spanpackages
673  (*d_pdrawspans)(pstart);
674  }
675 }

Referenced by R_DrawTriangle().

Variable Documentation

◆ a_spans

spanpackage_t* a_spans
static

Definition at line 77 of file polyset.c.

Referenced by R_DrawTriangle(), and R_RasterizeAliasPolySmooth().

◆ a_sstepxfrac

int a_sstepxfrac
static

◆ a_ststepxwhole

int a_ststepxwhole
static

◆ a_tstepxfrac

int a_tstepxfrac
static

◆ adivtab

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

Definition at line 94 of file polyset.c.

Referenced by R_PolysetSetUpForLineScan().

◆ aliastriangleparms

aliastriangleparms_t aliastriangleparms

Definition at line 47 of file polyset.c.

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

◆ d_aspancount

◆ d_countextrastep

◆ d_light

int d_light
static

Definition at line 81 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_lightbasestep

int d_lightbasestep
static

Definition at line 84 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_lightextrastep

int d_lightextrastep
static

Definition at line 83 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pdest

byte* d_pdest
static

Definition at line 79 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pdestbasestep

int d_pdestbasestep
static

Definition at line 84 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pdestextrastep

int d_pdestextrastep
static

Definition at line 83 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pdrawspans

void(* d_pdrawspans) (spanpackage_t *pspanpackage)

Definition at line 98 of file polyset.c.

Referenced by R_AliasSetupBlend().

◆ d_pedgespanpackage

spanpackage_t* d_pedgespanpackage
static

◆ d_ptex

byte * d_ptex
static

Definition at line 79 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_ptexbasestep

int d_ptexbasestep
static

Definition at line 84 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_ptexextrastep

int d_ptexextrastep
static

Definition at line 82 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pz

short* d_pz
static

Definition at line 80 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pzbasestep

int d_pzbasestep
static

Definition at line 87 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_pzextrastep

int d_pzextrastep
static

Definition at line 87 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_sfrac

int d_sfrac
static

Definition at line 81 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_sfracbasestep

int d_sfracbasestep
static

Definition at line 85 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_sfracextrastep

int d_sfracextrastep
static

Definition at line 82 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_tfrac

int d_tfrac
static

Definition at line 81 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_tfracbasestep

int d_tfracbasestep
static

Definition at line 85 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_tfracextrastep

int d_tfracextrastep
static

Definition at line 83 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_xdenom

int d_xdenom
static

Definition at line 51 of file polyset.c.

Referenced by R_DrawTriangle(), and R_PolysetCalcGradients().

◆ d_zi

int d_zi
static

Definition at line 81 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_zibasestep

int d_zibasestep
static

Definition at line 86 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ d_ziextrastep

int d_ziextrastep
static

Definition at line 86 of file polyset.c.

Referenced by R_PolysetScanLeftEdge(), and R_PolysetSetUpAndScanLeftEdge().

◆ edgetables

const edgetable_t edgetables[12]
static
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 55 of file polyset.c.

Referenced by R_PolysetSetEdgeTable().

◆ erroradjustdown

◆ erroradjustup

◆ errorterm

◆ pedgetable

const edgetable_t* pedgetable
static

Definition at line 53 of file polyset.c.

Referenced by R_PolysetSetEdgeTable(), and R_RasterizeAliasPolySmooth().

◆ r_lstepx

◆ r_lstepy

int r_lstepy
static

Definition at line 71 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ r_p0

int r_p0[6]
static

Definition at line 49 of file polyset.c.

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

◆ r_p1

int r_p1[6]
static

Definition at line 49 of file polyset.c.

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

◆ r_p2

int r_p2[6]
static

Definition at line 49 of file polyset.c.

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

◆ r_sstepx

int r_sstepx
static

Definition at line 71 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ r_sstepy

int r_sstepy
static

Definition at line 71 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ r_tstepx

int r_tstepx
static

Definition at line 71 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ r_tstepy

int r_tstepy
static

Definition at line 71 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ r_zistepx

◆ r_zistepy

int r_zistepy
static

Definition at line 72 of file polyset.c.

Referenced by R_PolysetCalcGradients(), and R_PolysetSetUpAndScanLeftEdge().

◆ ubasestep

edgetable_t::pleftedgevert1
int * pleftedgevert1
Definition: polyset.c:39
d_countextrastep
static int d_countextrastep
Definition: polyset.c:73
R_PolysetScanLeftEdge
static void R_PolysetScanLeftEdge(int height)
Definition: polyset.c:168
r_lstepy
static int r_lstepy
Definition: polyset.c:71
d_sfrac
static int d_sfrac
Definition: polyset.c:81
spanpackage_t::count
int count
Definition: polyset.c:30
r_zistepx
static int r_zistepx
Definition: polyset.c:72
edgetable_t::pleftedgevert0
int * pleftedgevert0
Definition: polyset.c:38
d_zi
static int d_zi
Definition: polyset.c:81
finalvert_s::u
int u
Definition: sw.h:163
height
static int height
Definition: physical_sky.c:39
d_sfracextrastep
static int d_sfracextrastep
Definition: polyset.c:82
d_ptexbasestep
static int d_ptexbasestep
Definition: polyset.c:84
r_p2
static int r_p2[6]
Definition: polyset.c:49
aliastriangleparms_t::b
finalvert_t * b
Definition: sw.h:294
edgetable_t::numleftedges
int numleftedges
Definition: polyset.c:37
DPS_MAXSPANS
#define DPS_MAXSPANS
Definition: polyset.c:24
edgetable_t::prightedgevert0
int * prightedgevert0
Definition: polyset.c:42
d_light
static int d_light
Definition: polyset.c:81
R_PolysetSetUpForLineScan
static void R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
Definition: polyset.c:264
d_ziextrastep
static int d_ziextrastep
Definition: polyset.c:86
erroradjustdown
static int erroradjustdown
Definition: polyset.c:75
TEX_BYTES
#define TEX_BYTES
Definition: sw.h:50
r_aliasblendcolor
fixed8_t r_aliasblendcolor[3]
Definition: alias.c:31
R_RasterizeAliasPolySmooth
static void R_RasterizeAliasPolySmooth(void)
Definition: polyset.c:595
pedgetable
static const edgetable_t * pedgetable
Definition: polyset.c:53
d_screenrowbytes
int d_screenrowbytes
Definition: main.c:126
d_zibasestep
static int d_zibasestep
Definition: polyset.c:86
r_lstepx
static int r_lstepx
Definition: polyset.c:70
edgetables
static const edgetable_t edgetables[12]
Definition: polyset.c:55
finalvert_s::t
int t
Definition: sw.h:163
d_lightbasestep
static int d_lightbasestep
Definition: polyset.c:84
a_ststepxwhole
static int a_ststepxwhole
Definition: polyset.c:70
edgetable_t::prightedgevert2
int * prightedgevert2
Definition: polyset.c:44
spanpackage_t::tfrac
int tfrac
Definition: polyset.c:32
r_zistepy
static int r_zistepy
Definition: polyset.c:72
finalvert_s::v
int v
Definition: sw.h:163
d_pdestextrastep
static int d_pdestextrastep
Definition: polyset.c:83
adivtab
static const adivtab_t adivtab[32 *32]
Definition: polyset.c:94
d_pedgespanpackage
static spanpackage_t * d_pedgespanpackage
Definition: polyset.c:78
spanpackage_t::pz
short * pz
Definition: polyset.c:29
d_xdenom
static int d_xdenom
Definition: polyset.c:51
edgetable_t::numrightedges
int numrightedges
Definition: polyset.c:41
r_alias_alpha
int r_alias_alpha
Definition: alias.c:29
R_PolysetSetUpAndScanLeftEdge
static void R_PolysetSetUpAndScanLeftEdge(int *plefttop, int *pleftbottom)
Definition: polyset.c:519
d_aspancount
static int d_aspancount
Definition: polyset.c:73
adivtab_t::remainder
int remainder
Definition: polyset.c:91
spanpackage_t::sfrac
int sfrac
Definition: polyset.c:32
d_spantable
byte * d_spantable[MAXHEIGHT]
Definition: main.c:130
a_spans
static spanpackage_t * a_spans
Definition: polyset.c:77
d_tfracextrastep
static int d_tfracextrastep
Definition: polyset.c:83
d_zwidth
int d_zwidth
Definition: main.c:129
d_zspantable
short * d_zspantable[MAXHEIGHT]
Definition: main.c:131
d_sfracbasestep
static int d_sfracbasestep
Definition: polyset.c:85
finalvert_s::zi
int zi
Definition: sw.h:165
d_ptex
static byte * d_ptex
Definition: polyset.c:79
d_pzbasestep
static int d_pzbasestep
Definition: polyset.c:87
R_PolysetCalcGradients
static void R_PolysetCalcGradients(int skinwidth)
Definition: polyset.c:297
ubasestep
static int ubasestep
Definition: polyset.c:75
errorterm
static int errorterm
Definition: polyset.c:75
affinetridesc_t::skinwidth
int skinwidth
Definition: sw.h:172
spanpackage_t
Definition: polyset.c:27
edgetable_t::pleftedgevert2
int * pleftedgevert2
Definition: polyset.c:40
VID_BYTES
#define VID_BYTES
Definition: sw.h:49
d_lightextrastep
static int d_lightextrastep
Definition: polyset.c:83
aliastriangleparms_t::a
finalvert_t * a
Definition: sw.h:294
edgetable_t::prightedgevert1
int * prightedgevert1
Definition: polyset.c:43
erroradjustup
static int erroradjustup
Definition: polyset.c:75
spanpackage_t::pdest
void * pdest
Definition: polyset.c:28
r_sstepy
static int r_sstepy
Definition: polyset.c:71
finalvert_s::s
int s
Definition: sw.h:163
d_pdestbasestep
static int d_pdestbasestep
Definition: polyset.c:84
d_pzextrastep
static int d_pzextrastep
Definition: polyset.c:87
r_alias_one_minus_alpha
int r_alias_one_minus_alpha
Definition: alias.c:30
r_p1
static int r_p1[6]
Definition: polyset.c:49
aliastriangleparms_t::c
finalvert_t * c
Definition: sw.h:294
d_ptexextrastep
static int d_ptexextrastep
Definition: polyset.c:82
adivtab_t
Definition: polyset.c:89
r_affinetridesc
affinetridesc_t r_affinetridesc
Definition: alias.c:27
spanpackage_t::zi
int zi
Definition: polyset.c:32
spanpackage_t::ptex
byte * ptex
Definition: polyset.c:31
r_p0
static int r_p0[6]
Definition: polyset.c:49
int
CONST PIXELFORMATDESCRIPTOR int
Definition: wgl.c:26
adivtab_t::quotient
int quotient
Definition: polyset.c:90
r_sstepx
static int r_sstepx
Definition: polyset.c:71
d_tfracbasestep
static int d_tfracbasestep
Definition: polyset.c:85
r_tstepx
static int r_tstepx
Definition: polyset.c:71
aliastriangleparms
aliastriangleparms_t aliastriangleparms
Definition: polyset.c:47
r_tstepy
static int r_tstepy
Definition: polyset.c:71
a_tstepxfrac
static int a_tstepxfrac
Definition: polyset.c:70
FloorDivMod
static void FloorDivMod(float numer, float denom, int *quotient, int *rem)
Definition: polyset.c:232
spanpackage_t::light
int light
Definition: polyset.c:32
d_pdest
static byte * d_pdest
Definition: polyset.c:79
finalvert_s::l
int l
Definition: sw.h:164
R_PolysetSetEdgeTable
static void R_PolysetSetEdgeTable(void)
Definition: polyset.c:683
d_pz
static short * d_pz
Definition: polyset.c:80
d_tfrac
static int d_tfrac
Definition: polyset.c:81
affinetridesc_t::pskin
void * pskin
Definition: sw.h:171
a_sstepxfrac
static int a_sstepxfrac
Definition: polyset.c:70