vkQuake2 doxygen  1.0 dev
r_poly.c File Reference
#include <assert.h>
#include "r_local.h"
#include "r_dither.h"

Go to the source code of this file.

Classes

struct  spanletvars_t
 

Macros

#define AFFINE_SPANLET_SIZE   16
 
#define AFFINE_SPANLET_SIZE_BITS   4
 

Functions

static void R_DrawPoly (int iswater)
 
void R_DrawSpanletOpaque (void)
 
void R_DrawSpanletTurbulentStipple33 (void)
 
void R_DrawSpanletTurbulentStipple66 (void)
 
void R_DrawSpanletTurbulentBlended66 (void)
 
void R_DrawSpanletTurbulentBlended33 (void)
 
void R_DrawSpanlet33 (void)
 
void R_DrawSpanletConstant33 (void)
 
void R_DrawSpanlet66 (void)
 
void R_DrawSpanlet33Stipple (void)
 
void R_DrawSpanlet66Stipple (void)
 
int R_ClipPolyFace (int nump, clipplane_t *pclipplane)
 
void R_PolygonDrawSpans (espan_t *pspan, int iswater)
 
void R_PolygonScanLeftEdge (void)
 
void R_PolygonScanRightEdge (void)
 
void R_ClipAndDrawPoly (float alpha, int isturbulent, qboolean textured)
 
void R_BuildPolygonFromSurface (msurface_t *fa)
 
void R_PolygonCalculateGradients (void)
 
void R_DrawAlphaSurfaces (void)
 
void R_IMFlatShadedQuad (vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
 

Variables

spanletvars_t s_spanletvars
 
static int r_polyblendcolor
 
static unsigned btemp
 
static espan_ts_polygon_spans
 
polydesc_t r_polydesc
 
msurface_tr_alpha_surfaces
 
intr_turb_turb
 
static int clip_current
 
vec5_t r_clip_verts [2][MAXWORKINGVERTS+2]
 
static int s_minindex
 
static int s_maxindex
 

Macro Definition Documentation

◆ AFFINE_SPANLET_SIZE

#define AFFINE_SPANLET_SIZE   16

Definition at line 24 of file r_poly.c.

◆ AFFINE_SPANLET_SIZE_BITS

#define AFFINE_SPANLET_SIZE_BITS   4

Definition at line 25 of file r_poly.c.

Function Documentation

◆ R_BuildPolygonFromSurface()

void R_BuildPolygonFromSurface ( msurface_t fa)

Definition at line 1160 of file r_poly.c.

1161 {
1162  int i, lindex, lnumverts;
1163  medge_t *pedges, *r_pedge;
1164  int vertpage;
1165  float *vec;
1166  vec5_t *pverts;
1167  float tmins[2] = { 0, 0 };
1168 
1169  r_polydesc.nump = 0;
1170 
1171  // reconstruct the polygon
1172  pedges = currentmodel->edges;
1173  lnumverts = fa->numedges;
1174  vertpage = 0;
1175 
1176  pverts = r_clip_verts[0];
1177 
1178  for (i = 0; i<lnumverts; i++)
1179  {
1180  lindex = currentmodel->surfedges[fa->firstedge + i];
1181 
1182  if (lindex > 0)
1183  {
1184  r_pedge = &pedges[lindex];
1185  vec = currentmodel->vertexes[r_pedge->v[0]].position;
1186  }
1187  else
1188  {
1189  r_pedge = &pedges[-lindex];
1190  vec = currentmodel->vertexes[r_pedge->v[1]].position;
1191  }
1192 
1193  VectorCopy(vec, pverts[i]);
1194  }
1195 
1197  VectorCopy(fa->texinfo->vecs[1], r_polydesc.vup);
1200 
1201  if (fa->flags & SURF_PLANEBACK)
1202  {
1204  }
1205 
1206  // PGM 09/16/98
1207  if (fa->texinfo->flags & (SURF_WARP | SURF_FLOWING))
1208  {
1209  r_polydesc.pixels = fa->texinfo->image->pixels[0];
1212  }
1213  // PGM 09/16/98
1214  else
1215  {
1216  surfcache_t *scache;
1217 
1218  scache = D_CacheSurface(fa, 0);
1219 
1220  r_polydesc.pixels = scache->data;
1221  r_polydesc.pixel_width = scache->width;
1222  r_polydesc.pixel_height = scache->height;
1223 
1224  tmins[0] = fa->texturemins[0];
1225  tmins[1] = fa->texturemins[1];
1226  }
1227 
1228  r_polydesc.dist = DotProduct(r_polydesc.vpn, pverts[0]);
1229 
1230  r_polydesc.s_offset = fa->texinfo->vecs[0][3] - tmins[0];
1231  r_polydesc.t_offset = fa->texinfo->vecs[1][3] - tmins[1];
1232 
1233  // scrolling texture addition
1234  if (fa->texinfo->flags & SURF_FLOWING)
1235  {
1236  r_polydesc.s_offset += -128 * ((r_newrefdef.time*0.25) - (int)(r_newrefdef.time*0.25));
1237  }
1238 
1239  r_polydesc.nump = lnumverts;
1240 }

Referenced by R_DrawAlphaSurfaces().

◆ R_ClipAndDrawPoly()

void R_ClipAndDrawPoly ( float  alpha,
int  isturbulent,
qboolean  textured 
)

Definition at line 1048 of file r_poly.c.

1049 {
1050  emitpoint_t outverts[MAXWORKINGVERTS + 3], *pout;
1051  float *pv;
1052  int i, nump;
1053  float scale;
1055 
1056  if (!textured)
1057  {
1059  }
1060  else
1061  {
1062 
1063  /*
1064  ** choose the correct spanlet routine based on alpha
1065  */
1066  if (alpha == 1)
1067  {
1068  // isturbulent is ignored because we know that turbulent surfaces
1069  // can't be opaque
1071  }
1072  else
1073  {
1074  if (sw_stipplealpha->value)
1075  {
1076  if (isturbulent)
1077  {
1078  if (alpha > 0.33)
1080  else
1082  }
1083  else
1084  {
1085  if (alpha > 0.33)
1087  else
1089  }
1090  }
1091  else
1092  {
1093  if (isturbulent)
1094  {
1095  if (alpha > 0.33)
1097  else
1099  }
1100  else
1101  {
1102  if (alpha > 0.33)
1104  else
1106  }
1107  }
1108  }
1109  }
1110 
1111  // clip to the frustum in worldspace
1112  nump = r_polydesc.nump;
1113  clip_current = 0;
1114 
1115  for (i = 0; i < 4; i++)
1116  {
1117  nump = R_ClipPolyFace(nump, &view_clipplanes[i]);
1118  if (nump < 3)
1119  return;
1120  if (nump > MAXWORKINGVERTS)
1121  ri.Sys_Error(ERR_DROP, "R_ClipAndDrawPoly: too many points: %d", nump);
1122  }
1123 
1124  // transform vertices into viewspace and project
1125  pv = &r_clip_verts[clip_current][0][0];
1126 
1127  for (i = 0; i < nump; i++)
1128  {
1131 
1132  if (transformed[2] < NEAR_CLIP)
1133  transformed[2] = NEAR_CLIP;
1134 
1135  pout = &outverts[i];
1136  pout->zi = 1.0 / transformed[2];
1137 
1138  pout->s = pv[3];
1139  pout->t = pv[4];
1140 
1141  scale = xscale * pout->zi;
1142  pout->u = (xcenter + scale * transformed[0]);
1143 
1144  scale = yscale * pout->zi;
1145  pout->v = (ycenter - scale * transformed[1]);
1146 
1147  pv += sizeof (vec5_t) / sizeof (pv[0]);
1148  }
1149 
1150  // draw it
1151  r_polydesc.nump = nump;
1152  r_polydesc.pverts = outverts;
1153 
1154  R_DrawPoly(isturbulent);
1155 }

Referenced by R_DrawAlphaSurfaces(), and R_IMFlatShadedQuad().

◆ R_ClipPolyFace()

int R_ClipPolyFace ( int  nump,
clipplane_t pclipplane 
)

Definition at line 661 of file r_poly.c.

662 {
663  int i, outcount;
664  float dists[MAXWORKINGVERTS + 3];
665  float frac, clipdist, *pclipnormal;
666  float *in, *instep, *outstep, *vert2;
667 
668  clipdist = pclipplane->dist;
669  pclipnormal = pclipplane->normal;
670 
671  // calc dists
672  if (clip_current)
673  {
674  in = r_clip_verts[1][0];
675  outstep = r_clip_verts[0][0];
676  clip_current = 0;
677  }
678  else
679  {
680  in = r_clip_verts[0][0];
681  outstep = r_clip_verts[1][0];
682  clip_current = 1;
683  }
684 
685  instep = in;
686  for (i = 0; i < nump; i++, instep += sizeof (vec5_t) / sizeof (float))
687  {
688  dists[i] = DotProduct(instep, pclipnormal) - clipdist;
689  }
690 
691  // handle wraparound case
692  dists[nump] = dists[0];
693  memcpy(instep, in, sizeof (vec5_t));
694 
695 
696  // clip the winding
697  instep = in;
698  outcount = 0;
699 
700  for (i = 0; i < nump; i++, instep += sizeof (vec5_t) / sizeof (float))
701  {
702  if (dists[i] >= 0)
703  {
704  memcpy(outstep, instep, sizeof (vec5_t));
705  outstep += sizeof (vec5_t) / sizeof (float);
706  outcount++;
707  }
708 
709  if (dists[i] == 0 || dists[i + 1] == 0)
710  continue;
711 
712  if ((dists[i] > 0) == (dists[i + 1] > 0))
713  continue;
714 
715  // split it into a new vertex
716  frac = dists[i] / (dists[i] - dists[i + 1]);
717 
718  vert2 = instep + sizeof (vec5_t) / sizeof (float);
719 
720  outstep[0] = instep[0] + frac*(vert2[0] - instep[0]);
721  outstep[1] = instep[1] + frac*(vert2[1] - instep[1]);
722  outstep[2] = instep[2] + frac*(vert2[2] - instep[2]);
723  outstep[3] = instep[3] + frac*(vert2[3] - instep[3]);
724  outstep[4] = instep[4] + frac*(vert2[4] - instep[4]);
725 
726  outstep += sizeof (vec5_t) / sizeof (float);
727  outcount++;
728  }
729 
730  return outcount;
731 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawAlphaSurfaces()

void R_DrawAlphaSurfaces ( void  )

Definition at line 1342 of file r_poly.c.

1343 {
1345 
1347 
1348  modelorg[0] = -r_origin[0];
1349  modelorg[1] = -r_origin[1];
1350  modelorg[2] = -r_origin[2];
1351 
1352  while (s)
1353  {
1355 
1356  //=======
1357  //PGM
1358  // if (s->texinfo->flags & SURF_TRANS66)
1359  // R_ClipAndDrawPoly( 0.60f, ( s->texinfo->flags & SURF_WARP) != 0, true );
1360  // else
1361  // R_ClipAndDrawPoly( 0.30f, ( s->texinfo->flags & SURF_WARP) != 0, true );
1362 
1363  // PGM - pass down all the texinfo flags, not just SURF_WARP.
1364  if (s->texinfo->flags & SURF_TRANS66)
1365  R_ClipAndDrawPoly(0.60f, (s->texinfo->flags & (SURF_WARP | SURF_FLOWING)), true);
1366  else
1367  R_ClipAndDrawPoly(0.30f, (s->texinfo->flags & (SURF_WARP | SURF_FLOWING)), true);
1368 
1369  //PGM
1370  //=======
1371 
1372  s = s->nextalphasurface;
1373  }
1374 
1376 }

◆ R_DrawPoly()

static void R_DrawPoly ( int  iswater)
static

Definition at line 1285 of file r_poly.c.

1286 {
1287  int i, nump;
1288  float ymin, ymax;
1289  emitpoint_t *pverts;
1290  espan_t spans[MAXHEIGHT + 1];
1291 
1292  s_polygon_spans = spans;
1293 
1294  // find the top and bottom vertices, and make sure there's at least one scan to
1295  // draw
1296  ymin = 999999.9;
1297  ymax = -999999.9;
1298  pverts = r_polydesc.pverts;
1299 
1300  for (i = 0; i < r_polydesc.nump; i++)
1301  {
1302  if (pverts->v < ymin)
1303  {
1304  ymin = pverts->v;
1305  s_minindex = i;
1306  }
1307 
1308  if (pverts->v > ymax)
1309  {
1310  ymax = pverts->v;
1311  s_maxindex = i;
1312  }
1313 
1314  pverts++;
1315  }
1316 
1317  ymin = ceil(ymin);
1318  ymax = ceil(ymax);
1319 
1320  if (ymin >= ymax)
1321  return; // doesn't cross any scans at all
1322 
1325 
1326  // copy the first vertex to the last vertex, so we don't have to deal with
1327  // wrapping
1328  nump = r_polydesc.nump;
1329  pverts = r_polydesc.pverts;
1330  pverts[nump] = pverts[0];
1331 
1335 
1337 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanlet33()

void R_DrawSpanlet33 ( void  )

Definition at line 368 of file r_poly.c.

369 {
370  do
371  {
372  unsigned ts, tt;
373 
374  if (sw_transmooth->value)
375  {
376  ts = s_spanletvars.s;
377  tt = s_spanletvars.t;
378 
380 
381  ts = (ts >> 16);
382  //ts = ts ? ts - 1 : ts;
383 
384  tt = (tt >> 16);
385  //tt = tt ? tt - 1 : tt;
386  }
387  else
388  {
389  ts = s_spanletvars.s >> 16;
390  tt = s_spanletvars.t >> 16;
391  }
392 
393  btemp = *(s_spanletvars.pbase + (ts)+(tt)* cachewidth);
394 
395  if (btemp != 255)
396  {
397  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
398  {
400  }
401  }
402 
405  s_spanletvars.pz++;
408  } while (--s_spanletvars.spancount > 0);
409 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanlet33Stipple()

void R_DrawSpanlet33Stipple ( void  )

Definition at line 473 of file r_poly.c.

474 {
475  byte *pdest = s_spanletvars.pdest;
476  short *pz = s_spanletvars.pz;
477  int izi = s_spanletvars.izi;
478 
480  {
483 
486  else
488 
490  {
494 
495  pdest++;
496  pz++;
498  }
499 
500  s_spanletvars.sstep *= 2;
501  s_spanletvars.tstep *= 2;
502 
503  while (s_spanletvars.spancount > 0)
504  {
505  unsigned s, t;
506  if (sw_transmooth->value)
507  {
508  s = s_spanletvars.s;
509  t = s_spanletvars.t;
510 
512 
513  s = (s >> 16);
514  t = (t >> 16);
515  /*s = s ? s - 1 : s;
516  t = t ? t - 1 : t;*/
517 
518  }
519  else
520  {
521  s = s_spanletvars.s >> 16;
522  t = s_spanletvars.t >> 16;
523  }
524 
525  btemp = *(s_spanletvars.pbase + (s)+(t * cachewidth));
526 
527  if (btemp != 255)
528  {
529  if (*pz <= (izi >> 16))
530  *pdest = btemp;
531  }
532 
536 
537  pdest += 2;
538  pz += 2;
539 
541  }
542  }
543 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanlet66()

void R_DrawSpanlet66 ( void  )

Definition at line 429 of file r_poly.c.

430 {
431 
432  do
433  {
434  unsigned ts, tt;
435 
436  if (sw_transmooth->value)
437  {
438  ts = s_spanletvars.s;
439  tt = s_spanletvars.t;
440 
442 
443  ts = (ts >> 16);
444  tt = (tt >> 16);
445  }
446  else
447  {
448  ts = s_spanletvars.s >> 16;
449  tt = s_spanletvars.t >> 16;
450  }
451 
452  btemp = *(s_spanletvars.pbase + (ts)+(tt)* cachewidth);
453 
454  if (btemp != 255)
455  {
456  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
457  {
459  }
460  }
461 
464  s_spanletvars.pz++;
467  } while (--s_spanletvars.spancount > 0);
468 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanlet66Stipple()

void R_DrawSpanlet66Stipple ( void  )

Definition at line 548 of file r_poly.c.

549 {
550  byte *pdest = s_spanletvars.pdest;
551  short *pz = s_spanletvars.pz;
552  int izi = s_spanletvars.izi;
553 unsigned s, t;
554 
557 
560  else
562 
564  {
566  {
570 
571  pdest++;
572  pz++;
574  }
575 
576  s_spanletvars.sstep *= 2;
577  s_spanletvars.tstep *= 2;
578 
579  while (s_spanletvars.spancount > 0)
580  {
581  if (sw_transmooth->value)
582  {
583  s = s_spanletvars.s;
584  t = s_spanletvars.t;
585 
587 
588  s = (s >> 16);
589  t = (t >> 16);
590  }
591  else
592  {
593  s = s_spanletvars.s >> 16;
594  t = s_spanletvars.t >> 16;
595  }
596 
597  btemp = *(s_spanletvars.pbase + (s)+(t * cachewidth));
598 
599  if (btemp != 255)
600  {
601  if (*pz <= (izi >> 16))
602  *pdest = btemp;
603  }
604 
608 
609  pdest += 2;
610  pz += 2;
611 
613  }
614  }
615  else
616  {
617  while (s_spanletvars.spancount > 0)
618  {
619  if (sw_transmooth->value)
620  {
621  s = s_spanletvars.s;
622  t = s_spanletvars.t;
623 
625 
626  s = (s >> 16);
627  t = (t >> 16);
628  }
629  else
630  {
631  s = s_spanletvars.s >> 16;
632  t = s_spanletvars.t >> 16;
633  }
634 
635  btemp = *(s_spanletvars.pbase + (s)+(t * cachewidth));
636 
637  if (btemp != 255)
638  {
639  if (*pz <= (izi >> 16))
640  *pdest = btemp;
641  }
642 
646 
647  pdest++;
648  pz++;
649 
651  }
652  }
653 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletConstant33()

void R_DrawSpanletConstant33 ( void  )

Definition at line 411 of file r_poly.c.

412 {
413  do
414  {
415  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
416  {
418  }
419 
422  s_spanletvars.pz++;
423  } while (--s_spanletvars.spancount > 0);
424 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletOpaque()

void R_DrawSpanletOpaque ( void  )

Definition at line 61 of file r_poly.c.

62 {
63  do
64  {
65  unsigned ts, tt;
66 
67  if (sw_transmooth->value)
68  {
69  ts = s_spanletvars.s;
70  tt = s_spanletvars.t;
71 
73 
74  ts = (ts >> 16);
75  tt = (tt >> 16);
76  }
77  else
78  {
79  ts = s_spanletvars.s >> 16;
80  tt = s_spanletvars.t >> 16;
81  }
82 
83  btemp = *(s_spanletvars.pbase + (ts)+(tt)* cachewidth);
84  if (btemp != 255)
85  {
86  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
87  {
90  }
91  }
92 
95  s_spanletvars.pz++;
98  } while (--s_spanletvars.spancount > 0);
99 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletTurbulentBlended33()

void R_DrawSpanletTurbulentBlended33 ( void  )

Definition at line 328 of file r_poly.c.

329 {
330  int sturb, tturb;
331 
332  do
333  {
334  if (sw_transmooth->value)
335  {
336  sturb = s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)];
337  tturb = s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)];
338 
340 
341  tturb = (tturb >> 16) & 63;
342  sturb = (sturb >> 16) & 63;
343  }
344  else
345  {
346  sturb = ((s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)]) >> 16) & 63;
347  tturb = ((s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)]) >> 16) & 63;
348  }
349 
350  btemp = *(s_spanletvars.pbase + (sturb)+(tturb << 6));
351  if (btemp != 255)
352  {
353  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
355  }
358  s_spanletvars.pz++;
361 
362  } while (--s_spanletvars.spancount > 0);
363 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletTurbulentBlended66()

void R_DrawSpanletTurbulentBlended66 ( void  )

Definition at line 289 of file r_poly.c.

290 {
291  int sturb, tturb;
292 
293  do
294  {
295  if (sw_transmooth->value)
296  {
297  sturb = s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)];
298  tturb = s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)];
299 
301 
302  tturb = (tturb >> 16) & 63;
303  sturb = (sturb >> 16) & 63;
304  }
305  else
306  {
307  sturb = ((s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)]) >> 16) & 63;
308  tturb = ((s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)]) >> 16) & 63;
309  }
310 
311  btemp = *(s_spanletvars.pbase + (sturb)+(tturb << 6));
312 
313  if (btemp != 255)
314  {
315  if (*s_spanletvars.pz <= (s_spanletvars.izi >> 16))
317  }
318 
321  s_spanletvars.pz++;
324 
325  } while (--s_spanletvars.spancount > 0);
326 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletTurbulentStipple33()

void R_DrawSpanletTurbulentStipple33 ( void  )

Definition at line 104 of file r_poly.c.

105 {
106  int sturb, tturb;
107  byte *pdest = s_spanletvars.pdest;
108  short *pz = s_spanletvars.pz;
109  int izi = s_spanletvars.izi;
110 
111  if (s_spanletvars.v & 1)
112  {
115 
118  else
120 
121  if (s_spanletvars.u & 1)
122  {
126 
127  pdest++;
128  pz++;
130  }
131 
132  s_spanletvars.sstep *= 2;
133  s_spanletvars.tstep *= 2;
134 
135  while (s_spanletvars.spancount > 0)
136  {
137  if (sw_transmooth->value)
138  {
139  sturb = s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)];
140  tturb = s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)];
141 
143 
144  tturb = (tturb >> 16) & 63;
145  sturb = (sturb >> 16) & 63;
146  }
147  else
148  {
149  sturb = ((s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)]) >> 16) & 63;
150  tturb = ((s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)]) >> 16) & 63;
151  }
152 
153  btemp = *(s_spanletvars.pbase + (sturb)+(tturb << 6));
154  if (btemp != 255)
155  {
156  if (*pz <= (izi >> 16))
157  *pdest = btemp;
158  }
162 
163  pdest += 2;
164  pz += 2;
165 
167  }
168  }
169 }

Referenced by R_ClipAndDrawPoly().

◆ R_DrawSpanletTurbulentStipple66()

void R_DrawSpanletTurbulentStipple66 ( void  )

Definition at line 174 of file r_poly.c.

175 {
176  int sturb, tturb;
177  byte *pdest = s_spanletvars.pdest;
178  short *pz = s_spanletvars.pz;
179  int izi = s_spanletvars.izi;
180 
181  if (!(s_spanletvars.v & 1))
182  {
185 
188  else
190 
191  if (s_spanletvars.u & 1)
192  {
196 
197  pdest++;
198  pz++;
200  }
201 
202  s_spanletvars.sstep *= 2;
203  s_spanletvars.tstep *= 2;
204 
205  while (s_spanletvars.spancount > 0)
206  {
207  if (sw_transmooth->value)
208  {
209  sturb = s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)];
210  tturb = s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)];
211 
213 
214  tturb = (tturb >> 16) & 63;
215  sturb = (sturb >> 16) & 63;
216  }
217  else
218  {
219  sturb = ((s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)]) >> 16) & 63;
220  tturb = ((s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)]) >> 16) & 63;
221  }
222 
223  btemp = *(s_spanletvars.pbase + (sturb)+(tturb << 6));
224  if (btemp != 255)
225  {
226  if (*pz <= (izi >> 16))
227  *pdest = btemp;
228  }
232 
233  pdest += 2;
234  pz += 2;
235 
237  }
238  }
239  else
240  {
243 
246  else
248 
249  while (s_spanletvars.spancount > 0)
250  {
251  if (sw_transmooth->value)
252  {
253  sturb = s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)];
254  tturb = s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)];
255 
257 
258  tturb = (tturb >> 16) & 63;
259  sturb = (sturb >> 16) & 63;
260  }
261  else
262  {
263  sturb = ((s_spanletvars.s + r_turb_turb[(s_spanletvars.t >> 16)&(CYCLE - 1)]) >> 16) & 63;
264  tturb = ((s_spanletvars.t + r_turb_turb[(s_spanletvars.s >> 16)&(CYCLE - 1)]) >> 16) & 63;
265  }
266 
267  btemp = *(s_spanletvars.pbase + (sturb)+(tturb << 6));
268 
269  if (btemp != 255) //qb: add alphatest to drawspanturbulent funcs. Easy-peasy!
270  {
271  if (*pz <= (izi >> 16))
272  *pdest = btemp;
273  }
277 
278  pdest++;
279  pz++;
280 
282  }
283  }
284 }

Referenced by R_ClipAndDrawPoly().

◆ R_IMFlatShadedQuad()

void R_IMFlatShadedQuad ( vec3_t  a,
vec3_t  b,
vec3_t  c,
vec3_t  d,
int  color,
float  alpha 
)

Definition at line 1381 of file r_poly.c.

1382 {
1383  vec3_t s0, s1;
1384 
1385  r_polydesc.nump = 4;
1387 
1388  VectorCopy(a, r_clip_verts[0][0]);
1389  VectorCopy(b, r_clip_verts[0][1]);
1390  VectorCopy(c, r_clip_verts[0][2]);
1391  VectorCopy(d, r_clip_verts[0][3]);
1392 
1393  r_clip_verts[0][0][3] = 0;
1394  r_clip_verts[0][1][3] = 0;
1395  r_clip_verts[0][2][3] = 0;
1396  r_clip_verts[0][3][3] = 0;
1397 
1398  r_clip_verts[0][0][4] = 0;
1399  r_clip_verts[0][1][4] = 0;
1400  r_clip_verts[0][2][4] = 0;
1401  r_clip_verts[0][3][4] = 0;
1402 
1403  VectorSubtract(d, c, s0);
1404  VectorSubtract(c, b, s1);
1405  CrossProduct(s0, s1, r_polydesc.vpn);
1407 
1409 
1410  r_polyblendcolor = color;
1411 
1412  R_ClipAndDrawPoly(alpha, false, false);
1413 }

Referenced by R_DrawBeam().

◆ R_PolygonCalculateGradients()

void R_PolygonCalculateGradients ( void  )

Definition at line 1245 of file r_poly.c.

1246 {
1247  vec3_t p_normal, p_saxis, p_taxis;
1248  float distinv;
1249 
1250  TransformVector(r_polydesc.vpn, p_normal);
1251  TransformVector(r_polydesc.vright, p_saxis);
1252  TransformVector(r_polydesc.vup, p_taxis);
1253 
1255 
1256  d_sdivzstepu = p_saxis[0] * xscaleinv;
1257  d_sdivzstepv = -p_saxis[1] * yscaleinv;
1258  d_sdivzorigin = p_saxis[2] - xcenter * d_sdivzstepu - ycenter * d_sdivzstepv;
1259 
1260  d_tdivzstepu = p_taxis[0] * xscaleinv;
1261  d_tdivzstepv = -p_taxis[1] * yscaleinv;
1262  d_tdivzorigin = p_taxis[2] - xcenter * d_tdivzstepu - ycenter * d_tdivzstepv;
1263 
1264  d_zistepu = p_normal[0] * xscaleinv * distinv;
1265  d_zistepv = -p_normal[1] * yscaleinv * distinv;
1266  d_ziorigin = p_normal[2] * distinv - xcenter * d_zistepu - ycenter * d_zistepv;
1267 
1270 
1271  // -1 (-epsilon) so we never wander off the edge of the texture
1272  bbextents = (r_polydesc.pixel_width << 16) - 1;
1273  bbextentt = (r_polydesc.pixel_height << 16) - 1;
1274 }

Referenced by R_DrawPoly().

◆ R_PolygonDrawSpans()

void R_PolygonDrawSpans ( espan_t pspan,
int  iswater 
)

Definition at line 737 of file r_poly.c.

738 {
739  int count;
741  float sdivz, tdivz, zi, z, du, dv, spancountminus1;
742  float sdivzspanletstepu, tdivzspanletstepu, zispanletstepu;
743 
745 
746  //PGM
747  if (iswater & SURF_WARP)
749  else if (iswater & SURF_FLOWING)
751  //PGM
752 
753  sdivzspanletstepu = d_sdivzstepu * AFFINE_SPANLET_SIZE;
754  tdivzspanletstepu = d_tdivzstepu * AFFINE_SPANLET_SIZE;
755  zispanletstepu = d_zistepu * AFFINE_SPANLET_SIZE;
756 
757  // we count on FP exceptions being turned off to avoid range problems
758  s_spanletvars.izistep = (int)(d_zistepu * 0x8000 * 0x10000);
760 
761  s_spanletvars.pz = 0;
762 
763  do
764  {
765  s_spanletvars.pdest = (byte *)d_viewbuffer + (d_scantable[pspan->v] /*r_screenwidth * pspan->v*/) + pspan->u;
766  s_spanletvars.pz = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u;
767  s_spanletvars.u = pspan->u;
768  s_spanletvars.v = pspan->v;
769 
770  count = pspan->count;
771 
772  if (count <= 0)
773  goto NextSpan;
774 
775  // calculate the initial s/z, t/z, 1/z, s, and t and clamp
776  du = (float)pspan->u;
777  dv = (float)pspan->v;
778 
781 
783  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
784  // we count on FP exceptions being turned off to avoid range problems
785  s_spanletvars.izi = (int)(zi * 0x8000 * 0x10000);
786 
787  s_spanletvars.s = (int)(sdivz * z) + sadjust;
788  s_spanletvars.t = (int)(tdivz * z) + tadjust;
789 
790  if (!iswater)
791  {
792  if (s_spanletvars.s > bbextents)
794  else if (s_spanletvars.s < 0)
795  s_spanletvars.s = 0;
796 
797  if (s_spanletvars.t > bbextentt)
799  else if (s_spanletvars.t < 0)
800  s_spanletvars.t = 0;
801  }
802 
803  do
804  {
805  // calculate s and t at the far end of the span
806  if (count >= AFFINE_SPANLET_SIZE)
808  else
810 
812 
813  if (count)
814  {
815  // calculate s/z, t/z, zi->fixed s and t at far end of span,
816  // calculate s and t steps across span by shifting
817  sdivz += sdivzspanletstepu;
818  tdivz += tdivzspanletstepu;
819  zi += zispanletstepu;
820  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
821 
822  snext = (int)(sdivz * z) + sadjust;
823  tnext = (int)(tdivz * z) + tadjust;
824 
825  if (!iswater)
826  {
827  if (snext > bbextents)
828  snext = bbextents;
829  else if (snext < AFFINE_SPANLET_SIZE)
830  snext = AFFINE_SPANLET_SIZE; // prevent round-off error on <0 steps from
831  // from causing overstepping & running off the
832  // edge of the texture
833 
834  if (tnext > bbextentt)
835  tnext = bbextentt;
836  else if (tnext < AFFINE_SPANLET_SIZE)
837  tnext = AFFINE_SPANLET_SIZE; // guard against round-off error on <0 steps
838  }
839 
842  }
843  else
844  {
845  // calculate s/z, t/z, zi->fixed s and t at last pixel in span (so
846  // can't step off polygon), clamp, calculate s and t steps across
847  // span by division, biasing steps low so we don't run off the
848  // texture
849  spancountminus1 = (float)(s_spanletvars.spancount - 1);
853  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
854  snext = (int)(sdivz * z) + sadjust;
855  tnext = (int)(tdivz * z) + tadjust;
856 
857  if (!iswater)
858  {
859  if (snext > bbextents)
860  snext = bbextents;
861  else if (snext < AFFINE_SPANLET_SIZE)
862  snext = AFFINE_SPANLET_SIZE; // prevent round-off error on <0 steps from
863  // from causing overstepping & running off the
864  // edge of the texture
865 
866  if (tnext > bbextentt)
867  tnext = bbextentt;
868  else if (tnext < AFFINE_SPANLET_SIZE)
869  tnext = AFFINE_SPANLET_SIZE; // guard against round-off error on <0 steps
870  }
871 
872  if (s_spanletvars.spancount > 1)
873  {
876  }
877  }
878 
879  if (iswater)
880  {
881  s_spanletvars.s = s_spanletvars.s & ((CYCLE << 16) - 1);
882  s_spanletvars.t = s_spanletvars.t & ((CYCLE << 16) - 1);
883  }
884 
886 
889 
890  } while (count > 0);
891 
892  NextSpan:
893  pspan++;
894 
895  } while (pspan->count != DS_SPAN_LIST_END);
896 }

Referenced by R_DrawPoly().

◆ R_PolygonScanLeftEdge()

void R_PolygonScanLeftEdge ( void  )

Definition at line 905 of file r_poly.c.

906 {
907  int i, v, itop, ibottom, lmaxindex;
908  emitpoint_t *pvert, *pnext;
909  espan_t *pspan;
910  float du, dv, vtop, vbottom, slope;
911  fixed16_t u, u_step;
912 
913  pspan = s_polygon_spans;
914  i = s_minindex;
915  if (i == 0)
916  i = r_polydesc.nump;
917 
918  lmaxindex = s_maxindex;
919  if (lmaxindex == 0)
920  lmaxindex = r_polydesc.nump;
921 
922  vtop = ceil(r_polydesc.pverts[i].v);
923 
924  do
925  {
926  pvert = &r_polydesc.pverts[i];
927  pnext = pvert - 1;
928 
929  vbottom = ceil(pnext->v);
930 
931  if (vtop < vbottom)
932  {
933  du = pnext->u - pvert->u;
934  dv = pnext->v - pvert->v;
935 
936  slope = du / dv;
937  u_step = (int)(slope * 0x10000);
938  // adjust u to ceil the integer portion
939  u = (int)((pvert->u + (slope * (vtop - pvert->v))) * 0x10000) +
940  (0x10000 - 1);
941  itop = (int)vtop;
942  ibottom = (int)vbottom;
943 
944  for (v = itop; v < ibottom; v++)
945  {
946  pspan->u = u >> 16;
947  pspan->v = v;
948  u += u_step;
949  pspan++;
950  }
951  }
952 
953  vtop = vbottom;
954 
955  i--;
956  if (i == 0)
957  i = r_polydesc.nump;
958 
959  } while (i != lmaxindex);
960 }

Referenced by R_DrawPoly().

◆ R_PolygonScanRightEdge()

void R_PolygonScanRightEdge ( void  )

Definition at line 968 of file r_poly.c.

969 {
970  int i, v, itop, ibottom;
971  emitpoint_t *pvert, *pnext;
972  espan_t *pspan;
973  float du, dv, vtop, vbottom, slope, uvert, unext, vvert, vnext;
974  fixed16_t u, u_step;
975 
976  pspan = s_polygon_spans;
977  i = s_minindex;
978 
979  vvert = r_polydesc.pverts[i].v;
980  if (vvert < r_refdef.fvrecty_adj)
981  vvert = r_refdef.fvrecty_adj;
982  if (vvert > r_refdef.fvrectbottom_adj)
983  vvert = r_refdef.fvrectbottom_adj;
984 
985  vtop = ceil(vvert);
986 
987  do
988  {
989  pvert = &r_polydesc.pverts[i];
990  pnext = pvert + 1;
991 
992  vnext = pnext->v;
993  if (vnext < r_refdef.fvrecty_adj)
994  vnext = r_refdef.fvrecty_adj;
995  if (vnext > r_refdef.fvrectbottom_adj)
996  vnext = r_refdef.fvrectbottom_adj;
997 
998  vbottom = ceil(vnext);
999 
1000  if (vtop < vbottom)
1001  {
1002  uvert = pvert->u;
1003  if (uvert < r_refdef.fvrectx_adj)
1004  uvert = r_refdef.fvrectx_adj;
1005  if (uvert > r_refdef.fvrectright_adj)
1006  uvert = r_refdef.fvrectright_adj;
1007 
1008  unext = pnext->u;
1009  if (unext < r_refdef.fvrectx_adj)
1010  unext = r_refdef.fvrectx_adj;
1011  if (unext > r_refdef.fvrectright_adj)
1012  unext = r_refdef.fvrectright_adj;
1013 
1014  du = unext - uvert;
1015  dv = vnext - vvert;
1016  slope = du / dv;
1017  u_step = (int)(slope * 0x10000);
1018  // adjust u to ceil the integer portion
1019  u = (int)((uvert + (slope * (vtop - vvert))) * 0x10000) +
1020  (0x10000 - 1);
1021  itop = (int)vtop;
1022  ibottom = (int)vbottom;
1023 
1024  for (v = itop; v < ibottom; v++)
1025  {
1026  pspan->count = (u >> 16) - pspan->u;
1027  u += u_step;
1028  pspan++;
1029  }
1030  }
1031 
1032  vtop = vbottom;
1033  vvert = vnext;
1034 
1035  i++;
1036  if (i == r_polydesc.nump)
1037  i = 0;
1038 
1039  } while (i != s_maxindex);
1040 
1041  pspan->count = DS_SPAN_LIST_END; // mark the end of the span list
1042 }

Referenced by R_DrawPoly().

Variable Documentation

◆ btemp

◆ clip_current

int clip_current
static

Definition at line 51 of file r_poly.c.

Referenced by R_ClipAndDrawPoly(), and R_ClipPolyFace().

◆ r_alpha_surfaces

msurface_t* r_alpha_surfaces

Definition at line 47 of file r_poly.c.

Referenced by R_DrawAlphaSurfaces().

◆ r_clip_verts

◆ r_polyblendcolor

int r_polyblendcolor
static

Definition at line 40 of file r_poly.c.

Referenced by R_DrawSpanletConstant33(), and R_IMFlatShadedQuad().

◆ r_polydesc

◆ r_turb_turb

◆ s_maxindex

int s_maxindex
static

Definition at line 54 of file r_poly.c.

Referenced by R_DrawPoly(), R_PolygonScanLeftEdge(), and R_PolygonScanRightEdge().

◆ s_minindex

int s_minindex
static

Definition at line 54 of file r_poly.c.

Referenced by R_DrawPoly(), R_PolygonScanLeftEdge(), and R_PolygonScanRightEdge().

◆ s_polygon_spans

espan_t* s_polygon_spans
static

Definition at line 43 of file r_poly.c.

Referenced by R_DrawPoly(), R_PolygonScanLeftEdge(), and R_PolygonScanRightEdge().

◆ s_spanletvars

cachewidth
int cachewidth
Definition: r_main.c:195
R_DrawSpanlet66Stipple
void R_DrawSpanlet66Stipple(void)
Definition: r_poly.c:548
R_ClipPolyFace
int R_ClipPolyFace(int nump, clipplane_t *pclipplane)
Definition: r_poly.c:661
R_PolygonCalculateGradients
void R_PolygonCalculateGradients(void)
Definition: r_poly.c:1245
spanletvars_t::pdest
byte * pdest
Definition: r_poly.c:29
espan_s
Definition: r_local.h:404
currentmodel
model_t * currentmodel
Definition: r_main.c:39
msurface_s::plane
mplane_t * plane
Definition: r_model.h:100
oldrefdef_t::fvrectx_adj
float fvrectx_adj
Definition: r_local.h:126
MAXWORKINGVERTS
#define MAXWORKINGVERTS
Definition: r_local.h:167
d_sdivzorigin
float d_sdivzorigin
Definition: r_main.c:190
r_clip_verts
vec5_t r_clip_verts[2][MAXWORKINGVERTS+2]
Definition: r_poly.c:52
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
transformed
static vec3_t transformed
Definition: r_part.c:468
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
surfcache_s
Definition: r_local.h:389
emitpoint_t::u
float u
Definition: r_local.h:257
CYCLE
#define CYCLE
Definition: asm_draw.h:16
ri
refimport_t ri
Definition: r_main.c:25
surfcache_s::height
unsigned height
Definition: r_local.h:397
R_DrawSpanletTurbulentBlended33
void R_DrawSpanletTurbulentBlended33(void)
Definition: r_poly.c:328
v
GLdouble v
Definition: qgl_win.c:143
yscaleinv
float yscaleinv
Definition: r_local.h:576
d_tdivzstepv
float d_tdivzstepv
Definition: r_local.h:518
D_CacheSurface
surfcache_t * D_CacheSurface(msurface_t *surface, int miplevel)
Definition: r_surf.c:638
spanletvars_t::sstep
fixed16_t sstep
Definition: r_poly.c:32
spancountminus1
static float spancountminus1
Definition: r_scan.c:31
MAXHEIGHT
#define MAXHEIGHT
Definition: d_ifacea.h:19
emitpoint_t::s
float s
Definition: r_local.h:258
model_s::edges
medge_t * edges
Definition: r_model.h:211
spanletvars_t::izistep
int izistep
Definition: r_poly.c:33
s_maxindex
static int s_maxindex
Definition: r_poly.c:54
z
GLdouble GLdouble z
Definition: qgl_win.c:283
i
int i
Definition: q_shared.c:305
d_viewbuffer
pixel_t * d_viewbuffer
Definition: r_main.c:196
msurface_s::numedges
int numedges
Definition: r_model.h:104
modelorg
vec3_t modelorg
Definition: r_bsp.c:29
d_tdivzorigin
float d_tdivzorigin
Definition: r_local.h:519
polydesc_t::pixel_width
int pixel_width
Definition: r_local.h:416
polydesc_t::stipple_parity
int stipple_parity
Definition: r_local.h:423
r_origin
vec3_t r_origin
Definition: r_main.c:75
sintable
int sintable[4200]
Definition: r_rast.c:47
oldrefdef_t::fvrectright_adj
float fvrectright_adj
Definition: r_local.h:129
SPEED
#define SPEED
Definition: r_local.h:241
xscaleinv
float xscaleinv
Definition: r_main.c:83
r_alpha_surfaces
msurface_t * r_alpha_surfaces
Definition: r_poly.c:47
s_minindex
static int s_minindex
Definition: r_poly.c:54
SURF_WARP
#define SURF_WARP
Definition: qfiles.h:372
mplane_s::normal
vec3_t normal
Definition: r_model.h:59
polydesc_t::vpn
vec3_t vpn
Definition: r_local.h:418
R_DrawSpanletTurbulentStipple66
void R_DrawSpanletTurbulentStipple66(void)
Definition: r_poly.c:174
polydesc_t::viewer_position
float viewer_position[3]
Definition: r_local.h:421
SURF_TRANS66
#define SURF_TRANS66
Definition: qfiles.h:374
dv
static float dv
Definition: r_scan.c:31
clipplane_s::normal
vec3_t normal
Definition: r_local.h:380
tdivz
static float tdivz
Definition: r_scan.c:31
mvertex_t::position
vec3_t position
Definition: r_model.h:47
espan_s::count
int count
Definition: r_local.h:406
polydesc_t::pixels
byte * pixels
Definition: r_local.h:415
spanletvars_t::u
unsigned u
Definition: r_poly.c:35
spanletvars_t::t
fixed16_t t
Definition: r_poly.c:31
SURF_PLANEBACK
#define SURF_PLANEBACK
Definition: r_model.h:68
snext
static fixed16_t snext
Definition: r_scan.c:30
R_PolygonScanRightEdge
void R_PolygonScanRightEdge(void)
Definition: r_poly.c:968
polydesc_t::t_offset
float t_offset
Definition: r_local.h:420
spanletvars_t::spancount
int spancount
Definition: r_poly.c:34
oldrefdef_t::fvrecty_adj
float fvrecty_adj
Definition: r_local.h:126
u
static int u
Definition: r_part.c:472
btemp
static unsigned btemp
Definition: r_poly.c:41
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
polydesc_t::s_offset
float s_offset
Definition: r_local.h:420
CrossProduct
void CrossProduct(vec3_t v1, vec3_t v2, vec3_t cross)
Definition: q_shared.c:753
d_ziorigin
float d_ziorigin
Definition: r_local.h:519
spanletvars_t::pbase
byte * pbase
Definition: r_poly.c:29
medge_t
Definition: r_model.h:77
R_BuildPolygonFromSurface
void R_BuildPolygonFromSurface(msurface_t *fa)
Definition: r_poly.c:1160
image_s::height
int height
Definition: r_local.h:75
DitherKernel2
#define DitherKernel2(u, v, X, Y)
Definition: r_dither.h:36
bbextentt
fixed16_t bbextentt
Definition: r_local.h:522
espan_s::v
int v
Definition: r_local.h:406
polydesc_t::nump
int nump
Definition: r_local.h:413
AFFINE_SPANLET_SIZE_BITS
#define AFFINE_SPANLET_SIZE_BITS
Definition: r_poly.c:25
msurface_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:112
oldrefdef_t::fvrectbottom_adj
float fvrectbottom_adj
Definition: r_local.h:129
emitpoint_t
Definition: r_local.h:255
t
GLdouble t
Definition: qgl_win.c:328
spanletvars_t::izistep_times_2
int izistep_times_2
Definition: r_poly.c:33
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
spanletvars_t::v
unsigned v
Definition: r_poly.c:35
polydesc_t::dist
float dist
Definition: r_local.h:419
SURF_FLOWING
#define SURF_FLOWING
Definition: qfiles.h:375
sadjust
fixed16_t sadjust
Definition: r_local.h:732
d_tdivzstepu
float d_tdivzstepu
Definition: r_local.h:517
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
tnext
static fixed16_t tnext
Definition: r_scan.c:30
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
pz
static short * pz
Definition: r_part.c:471
cvar_s::value
float value
Definition: q_shared.h:331
xscale
float xscale
Definition: r_main.c:82
s_polygon_spans
static espan_t * s_polygon_spans
Definition: r_poly.c:43
emitpoint_t::v
float v
Definition: r_local.h:257
emitpoint_t::zi
float zi
Definition: r_local.h:259
R_ClipAndDrawPoly
void R_ClipAndDrawPoly(float alpha, int isturbulent, qboolean textured)
Definition: r_poly.c:1048
R_DrawSpanlet66
void R_DrawSpanlet66(void)
Definition: r_poly.c:429
espan_s::u
int u
Definition: r_local.h:406
du
static float du
Definition: r_scan.c:31
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
NULL
#define NULL
Definition: q_shared.h:67
bbextents
fixed16_t bbextents
Definition: r_local.h:733
refdef_t::time
float time
Definition: ref.h:109
d_scantable
int d_scantable[MAXHEIGHT]
Definition: r_misc.c:42
d_zistepv
float d_zistepv
Definition: r_local.h:518
model_s::surfedges
int * surfedges
Definition: r_model.h:224
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
image_s::width
int width
Definition: r_local.h:75
R_DrawSpanletTurbulentStipple33
void R_DrawSpanletTurbulentStipple33(void)
Definition: r_poly.c:104
R_DrawSpanletOpaque
void R_DrawSpanletOpaque(void)
Definition: r_poly.c:61
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
d_zistepu
float d_zistepu
Definition: r_local.h:517
ycenter
float ycenter
Definition: r_local.h:574
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
spanletvars_t::izi
int izi
Definition: r_poly.c:33
msurface_s::flags
int flags
Definition: r_model.h:101
R_PolygonDrawSpans
void R_PolygonDrawSpans(espan_t *pspan, int iswater)
Definition: r_poly.c:737
s
static fixed16_t s
Definition: r_scan.c:30
emitpoint_t::t
float t
Definition: r_local.h:258
sdivz
static float sdivz
Definition: r_scan.c:31
r_pedge
medge_t * r_pedge
Definition: r_rast.c:41
s_spanletvars
spanletvars_t s_spanletvars
Definition: r_poly.c:38
r_polydesc
polydesc_t r_polydesc
Definition: r_poly.c:45
R_DrawSpanletTurbulentBlended66
void R_DrawSpanletTurbulentBlended66(void)
Definition: r_poly.c:289
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
r_turb_turb
int * r_turb_turb
Definition: r_scan.c:40
mtexinfo_s::vecs
float vecs[2][4]
Definition: r_model.h:85
R_DrawSpanlet33Stipple
void R_DrawSpanlet33Stipple(void)
Definition: r_poly.c:473
fixed16_t
int fixed16_t
Definition: q_shared.h:139
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
polydesc_t::drawspanlet
void(* drawspanlet)(void)
Definition: r_local.h:422
DS_SPAN_LIST_END
#define DS_SPAN_LIST_END
Definition: r_local.h:201
pdest
static byte * pdest
Definition: r_part.c:470
polydesc_t::vup
vec3_t vup
Definition: r_local.h:418
view_clipplanes
clipplane_t view_clipplanes[4]
Definition: r_rast.c:38
surfcache_s::data
byte data[4]
Definition: r_local.h:400
medge_t::v
unsigned short v[2]
Definition: r_model.h:79
vec5_t
vec_t vec5_t[5]
Definition: q_shared.h:135
local
static vec3_t local
Definition: r_part.c:468
d_zwidth
unsigned int d_zwidth
Definition: r_local.h:538
NEAR_CLIP
#define NEAR_CLIP
Definition: asm_draw.h:13
msurface_s
Definition: r_model.h:93
R_DrawSpanlet33
void R_DrawSpanlet33(void)
Definition: r_poly.c:368
d_sdivzstepu
float d_sdivzstepu
Definition: r_main.c:188
mtexinfo_s::flags
int flags
Definition: r_model.h:88
msurface_s::texturemins
short texturemins[2]
Definition: r_model.h:109
clipplane_s::dist
float dist
Definition: r_local.h:381
surfcache_s::width
unsigned width
Definition: r_local.h:396
spanletvars_t::pz
short * pz
Definition: r_poly.c:30
sw_stipplealpha
static cvar_t * sw_stipplealpha
Definition: vid_menu.c:53
d_sdivzstepv
float d_sdivzstepv
Definition: r_main.c:189
R_DrawSpanletConstant33
void R_DrawSpanletConstant33(void)
Definition: r_poly.c:411
polydesc_t::pverts
emitpoint_t * pverts
Definition: r_local.h:414
cacheblock
pixel_t * cacheblock
Definition: r_main.c:194
clip_current
static int clip_current
Definition: r_poly.c:51
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:197
r_polyblendcolor
static int r_polyblendcolor
Definition: r_poly.c:40
model_s::vertexes
mvertex_t * vertexes
Definition: r_model.h:208
tadjust
fixed16_t tadjust
Definition: r_local.h:521
sw_transmooth
cvar_t * sw_transmooth
Definition: r_main.c:131
polydesc_t::pixel_height
int pixel_height
Definition: r_local.h:417
xcenter
float xcenter
Definition: r_main.c:81
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:96
AFFINE_SPANLET_SIZE
#define AFFINE_SPANLET_SIZE
Definition: r_poly.c:24
TransformVector
void TransformVector(vec3_t in, vec3_t out)
Definition: r_misc.c:216
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
yscale
float yscale
Definition: r_local.h:575
zi
static float zi
Definition: r_part.c:469
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
count
GLint GLsizei count
Definition: qgl_win.c:128
blanktable
int blanktable[4200]
Definition: r_rast.c:49
polydesc_t::vright
vec3_t vright
Definition: r_local.h:418
msurface_s::firstedge
int firstedge
Definition: r_model.h:103
izi
static int izi
Definition: r_part.c:472
R_DrawPoly
static void R_DrawPoly(int iswater)
Definition: r_poly.c:1285
R_PolygonScanLeftEdge
void R_PolygonScanLeftEdge(void)
Definition: r_poly.c:905
spanletvars_t::tstep
fixed16_t tstep
Definition: r_poly.c:32
vid
viddef_t vid
Definition: r_main.c:24
spanletvars_t::s
fixed16_t s
Definition: r_poly.c:31