vkQuake2 doxygen  1.0 dev
r_main.c File Reference
#include "r_local.h"

Go to the source code of this file.

Macros

#define STRINGER(x)   "x"
 
#define NUM_BEAM_SEGS   6
 

Functions

void R_MarkLeaves (void)
 
void R_InitTextures (void)
 
void R_InitTurb (void)
 
void R_ImageList_f (void)
 
void R_Register (void)
 
void R_UnRegister (void)
 
qboolean R_Init (void *hInstance, void *wndProc)
 
void R_Shutdown (void)
 
void R_NewMap (void)
 
void R_DrawNullModel (void)
 
void R_DrawEntitiesOnList (void)
 
int R_BmodelCheckBBox (float *minmaxs)
 
mnode_tR_FindTopnode (vec3_t mins, vec3_t maxs)
 
void RotatedBBox (vec3_t mins, vec3_t maxs, vec3_t angles, vec3_t tmins, vec3_t tmaxs)
 
void R_DrawBEntitiesOnList (void)
 
void R_EdgeDrawing (void)
 
void R_CalcPalette (void)
 
void R_SetLightLevel (void)
 
void R_RenderFrame (refdef_t *fd)
 
void R_InitGraphics (int width, int height)
 
void R_BeginFrame (float camera_separation)
 
void R_EndWorldRenderpass (void)
 
void R_GammaCorrectAndSetPalette (const unsigned char *palette)
 
void R_CinematicSetPalette (const unsigned char *palette)
 
void Draw_BuildGammaTable (void)
 
void R_DrawBeam (entity_t *e)
 
void R_SetSky (char *name, float rotate, vec3_t axis)
 
void Draw_GetPalette (void)
 
struct image_sR_RegisterSkin (char *name)
 
refexport_t GetRefAPI (refimport_t rimp)
 
void Sys_Error (char *error,...)
 
void Com_Printf (char *fmt,...)
 

Variables

viddef_t vid
 
refimport_t ri
 
unsigned d_8to24table [256]
 
unsigned d_8to24tabble [256]
 
entity_t r_worldentity
 
char skyname [MAX_QPATH]
 
bytethepalette
 
float skyrotate
 
vec3_t skyaxis
 
image_tsky_images [6]
 
refdef_t r_newrefdef
 
model_tcurrentmodel
 
model_tr_worldmodel
 
byter_warpbuffer
 
int r_warpwidth
 
int r_warpheight
 
swstate_t sw_state
 
voidcolormap
 
vec3_t viewlightvec
 
alight_t r_viewlighting = { 128, 192, viewlightvec }
 
float r_time1
 
int r_numallocatededges
 
float r_aliasuvscale = 1.0
 
int r_outofsurfaces
 
int r_outofedges
 
qboolean r_dowarp
 
mvertex_tr_pcurrentvertbase
 
int c_surf
 
int r_maxsurfsseen
 
int r_maxedgesseen
 
int r_cnumsurfs
 
qboolean r_surfsonstack
 
int r_clipflags
 
vec3_t vup
 
vec3_t base_vup
 
vec3_t vpn
 
vec3_t base_vpn
 
vec3_t vright
 
vec3_t base_vright
 
vec3_t r_origin
 
oldrefdef_t r_refdef
 
float xcenter
 
float ycenter
 
float xscale
 
float yscale
 
float xscaleinv
 
float yscaleinv
 
float xscaleshrink
 
float yscaleshrink
 
float aliasxscale
 
float aliasyscale
 
float aliasxcenter
 
float aliasycenter
 
int r_screenwidth
 
float verticalFieldOfView
 
float xOrigin
 
float yOrigin
 
mplane_t screenedge [4]
 
int r_framecount = 1
 
int r_visframecount
 
int d_spanpixcount
 
int r_polycount
 
int r_drawnpolycount
 
int r_wholepolycount
 
intpfrustum_indexes [4]
 
int r_frustum_indexes [4 *6]
 
mleaf_tr_viewleaf
 
int r_viewcluster
 
int r_oldviewcluster
 
image_tr_notexture_mip
 
float da_time1
 
float da_time2
 
float dp_time1
 
float dp_time2
 
float db_time1
 
float db_time2
 
float rw_time1
 
float rw_time2
 
float se_time1
 
float se_time2
 
float de_time1
 
float de_time2
 
cvar_tr_lefthand
 
cvar_tsw_aliasstats
 
cvar_tsw_allow_modex
 
cvar_tsw_clearcolor
 
cvar_tsw_drawflat
 
cvar_tsw_draworder
 
cvar_tsw_maxedges
 
cvar_tsw_maxsurfs
 
cvar_tsw_mode
 
cvar_tsw_reportedgeout
 
cvar_tsw_reportsurfout
 
cvar_tsw_stipplealpha
 
cvar_tsw_surfcacheoverride
 
cvar_tsw_waterwarp
 
cvar_tsw_transmooth
 
cvar_tr_drawworld
 
cvar_tr_drawentities
 
cvar_tr_dspeeds
 
cvar_tr_fullbright
 
cvar_tr_lerpmodels
 
cvar_tr_novis
 
cvar_tr_speeds
 
cvar_tr_lightlevel
 
cvar_tvid_fullscreen
 
cvar_tvid_gamma
 
cvar_tsw_lockpvs
 
cvar_tr_customwidth
 
cvar_tr_customheight
 
cvar_tr_coloredlights
 
cvar_tr_lightsaturation
 
int coloredlights
 
float d_sdivzstepu
 
float d_tdivzstepu
 
float d_zistepu
 
float d_sdivzstepv
 
float d_tdivzstepv
 
float d_zistepv
 
float d_sdivzorigin
 
float d_tdivzorigin
 
float d_ziorigin
 
fixed16_t sadjust
 
fixed16_t tadjust
 
fixed16_t bbextents
 
fixed16_t bbextentt
 
pixel_tcacheblock
 
int cachewidth
 
pixel_td_viewbuffer
 
short * d_pzbuffer
 
unsigned int d_zrowbytes
 
unsigned int d_zwidth
 
byte r_notexture_buffer [1024]
 
char * suf [6] = { "rt", "bk", "lf", "ft", "up", "dn" }
 
int r_skysideimage [6] = { 5, 2, 4, 1, 0, 3 }
 
mtexinfo_t r_skytexinfo [6]
 

Macro Definition Documentation

◆ NUM_BEAM_SEGS

#define NUM_BEAM_SEGS   6

◆ STRINGER

#define STRINGER (   x)    "x"

Definition at line 158 of file r_main.c.

Function Documentation

◆ Com_Printf()

void Com_Printf ( char *  fmt,
  ... 
)

Definition at line 1511 of file r_main.c.

1512 {
1513  va_list argptr;
1514  char text[1024];
1515 
1516  va_start(argptr, fmt);
1517  vsnprintf (text, 1024, fmt, argptr);
1518  va_end(argptr);
1519 
1520  ri.Con_Printf(PRINT_ALL, "%s", text);
1521 }

◆ Draw_BuildGammaTable()

void Draw_BuildGammaTable ( void  )

Definition at line 1314 of file r_main.c.

1315 {
1316  int i, inf;
1317  float g;
1318 
1319  g = vid_gamma->value;
1320 
1321  if (g == 1.0)
1322  {
1323  for (i = 0; i < 256; i++)
1324  sw_state.gammatable[i] = i;
1325  return;
1326  }
1327 
1328  for (i = 0; i < 256; i++)
1329  {
1330  inf = 255 * pow((i + 0.5) / 255.5, g) + 0.5;
1331  if (inf < 0)
1332  inf = 0;
1333  if (inf > 255)
1334  inf = 255;
1335  sw_state.gammatable[i] = inf;
1336  }
1337 }

Referenced by R_BeginFrame().

◆ Draw_GetPalette()

void Draw_GetPalette ( void  )

Definition at line 1423 of file r_main.c.

1424 {
1425  byte *out;
1426  int i;
1427  int r, g, b;
1428 
1429  // get the palette and colormap
1430  LoadPCX("pics/colormap.pcx", &vid.colormap, &thepalette, NULL, NULL);
1431  if (!vid.colormap)
1432  ri.Sys_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
1433  vid.alphamap = vid.colormap + 64 * 256;
1434  out = (byte *)d_8to24table;
1435  for (i=0 ; i<256 ; i++, out+=4)
1436  {
1437  r = thepalette[i*3+0];
1438  g = thepalette[i*3+1];
1439  b = thepalette[i*3+2];
1440 
1441  out[0] = r;
1442  out[1] = g;
1443  out[2] = b;
1444  }
1445 }

Referenced by R_Init().

◆ GetRefAPI()

refexport_t GetRefAPI ( refimport_t  rimp)

Definition at line 1456 of file r_main.c.

1457 {
1458  refexport_t re;
1459 
1460  ri = rimp;
1461 
1463 
1468  re.SetSky = R_SetSky;
1471 
1473  re.DrawPic = Draw_Pic;
1475  re.DrawChar = Draw_Char;
1477  re.DrawFill = Draw_Fill;
1479 
1481 
1482  re.Init = R_Init;
1484 
1489 
1491 
1492  Swap_Init();
1493 
1494  return re;
1495 }

Referenced by VID_LoadRefresh().

◆ R_BeginFrame()

void R_BeginFrame ( float  camera_separation)

Definition at line 1177 of file r_main.c.

1178 {
1179  extern void Draw_BuildGammaTable(void);
1180 #ifdef REDBLUE
1181  SetStereoBuffer((camera_separation <= 0.0) ? 0 : 1);
1182 #endif
1183  /*
1184  ** rebuild the gamma correction palette if necessary
1185  */
1186  if (vid_gamma->modified)
1187  {
1189  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
1190 
1191  vid_gamma->modified = false;
1192  }
1193 
1195  {
1196  rserr_t err;
1197 
1198  /* a bit hackish approach to enable custom resolutions:
1199  * SWimp_SetMode needs these values set for mode -1 */
1202 
1203  /*
1204  ** if this returns rserr_invalid_fullscreen then it set the mode but not as a
1205  ** fullscreen mode, e.g. 320x200 on a system that doesn't support that res
1206  */
1208  {
1210 
1211  if (sw_mode->value == -1)
1212  {
1213  sw_state.prev_mode = 4; /* safe default for custom mode */
1214  }
1215  else
1216  {
1218  }
1219 
1220  vid_fullscreen->modified = false;
1221  sw_mode->modified = false;
1222  }
1223  else
1224  {
1225  if (err == rserr_invalid_mode)
1226  {
1227  ri.Cvar_SetValue("sw_mode", sw_state.prev_mode);
1228  ri.Con_Printf(PRINT_ALL, "ref_soft::R_BeginFrame() - could not set mode\n");
1229  }
1230  else if (err == rserr_invalid_fullscreen)
1231  {
1233  ri.Con_Printf(PRINT_ALL, "ref_soft::R_BeginFrame() - fullscreen unavailable in this mode\n");
1235  // vid_fullscreen->modified = false;
1236  // sw_mode->modified = false;
1237  }
1238  else
1239  {
1240  ri.Sys_Error(ERR_FATAL, "ref_soft::R_BeginFrame() - catastrophic mode change failure\n");
1241  }
1242  }
1243  }
1244 }

Referenced by GetRefAPI(), and R_Init().

◆ R_BmodelCheckBBox()

int R_BmodelCheckBBox ( float *  minmaxs)

Definition at line 654 of file r_main.c.

655 {
656  int i, *pindex, clipflags;
657  vec3_t acceptpt, rejectpt;
658  float d;
659 
660  clipflags = 0;
661 
662  for (i = 0; i < 4; i++)
663  {
664  // generate accept and reject points
665  // FIXME: do with fast look-ups or integer tests based on the sign bit
666  // of the floating point values
667 
668  pindex = pfrustum_indexes[i];
669 
670  rejectpt[0] = minmaxs[pindex[0]];
671  rejectpt[1] = minmaxs[pindex[1]];
672  rejectpt[2] = minmaxs[pindex[2]];
673 
674  d = DotProduct(rejectpt, view_clipplanes[i].normal);
675  d -= view_clipplanes[i].dist;
676 
677  if (d <= 0)
678  return BMODEL_FULLY_CLIPPED;
679 
680  acceptpt[0] = minmaxs[pindex[3 + 0]];
681  acceptpt[1] = minmaxs[pindex[3 + 1]];
682  acceptpt[2] = minmaxs[pindex[3 + 2]];
683 
684  d = DotProduct(acceptpt, view_clipplanes[i].normal);
685  d -= view_clipplanes[i].dist;
686 
687  if (d <= 0)
688  clipflags |= (1 << i);
689  }
690 
691  return clipflags;
692 }

Referenced by R_DrawBEntitiesOnList().

◆ R_CalcPalette()

void R_CalcPalette ( void  )

Definition at line 953 of file r_main.c.

954 {
955  static qboolean modified;
956  byte palette[256][4], *in, *out;
957  int i, j;
958  float alpha, one_minus_alpha;
959  vec3_t premult;
960  int v;
961 
962  alpha = r_newrefdef.blend[3];
963  if (alpha <= 0)
964  {
965  if (modified)
966  { // set back to default
967  modified = false;
968  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
969  return;
970  }
971  return;
972  }
973 
974  modified = true;
975  if (alpha > 1)
976  alpha = 1;
977 
978  premult[0] = r_newrefdef.blend[0] * alpha * 255;
979  premult[1] = r_newrefdef.blend[1] * alpha * 255;
980  premult[2] = r_newrefdef.blend[2] * alpha * 255;
981 
982  one_minus_alpha = (1.0 - alpha);
983 
984  in = (byte *)d_8to24table;
985  out = palette[0];
986  for (i = 0; i < 256; i++, in += 4, out += 4)
987  {
988  for (j = 0; j<3; j++)
989  {
990  v = premult[j] + one_minus_alpha * in[j];
991  if (v > 255)
992  v = 255;
993  out[j] = v;
994  }
995  out[3] = 255;
996  }
997 
998  R_GammaCorrectAndSetPalette((const unsigned char *)palette[0]);
999  // SWimp_SetPalette( palette[0] );
1000 }

Referenced by R_RenderFrame().

◆ R_CinematicSetPalette()

void R_CinematicSetPalette ( const unsigned char *  palette)

Definition at line 1274 of file r_main.c.

1275 {
1276  byte palette32[1024];
1277  int i, j, w;
1278  int *d;
1279 
1280  // clear screen to black to avoid any palette flash
1281  w = abs(vid.rowbytes) >> 2; // stupid negative pitch win32 stuff...
1282  for (i = 0; i < vid.height; i++, d += w)
1283  {
1284  d = (int *)(vid.buffer + i*vid.rowbytes);
1285  for (j = 0; j < w; j++)
1286  d[j] = 0;
1287  }
1288  // flush it to the screen
1289  SWimp_EndFrame();
1290 
1291  if (palette)
1292  {
1293  for (i = 0; i < 256; i++)
1294  {
1295  palette32[i * 4 + 0] = palette[i * 3 + 0];
1296  palette32[i * 4 + 1] = palette[i * 3 + 1];
1297  palette32[i * 4 + 2] = palette[i * 3 + 2];
1298  palette32[i * 4 + 3] = 0xFF;
1299  }
1300 
1301  R_GammaCorrectAndSetPalette(palette32);
1302  }
1303  else
1304  {
1305  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
1306  }
1307 }

Referenced by GetRefAPI().

◆ R_DrawBeam()

void R_DrawBeam ( entity_t e)

Definition at line 1342 of file r_main.c.

1343 {
1344 #define NUM_BEAM_SEGS 6
1345 
1346  int i;
1347 
1348  vec3_t perpvec;
1349  vec3_t direction, normalized_direction;
1350  vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
1351  vec3_t oldorigin, origin;
1352 
1353  oldorigin[0] = e->oldorigin[0];
1354  oldorigin[1] = e->oldorigin[1];
1355  oldorigin[2] = e->oldorigin[2];
1356 
1357  origin[0] = e->origin[0];
1358  origin[1] = e->origin[1];
1359  origin[2] = e->origin[2];
1360 
1361  normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1362  normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1363  normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1364 
1365  if (VectorNormalize(normalized_direction) == 0)
1366  return;
1367 
1368  PerpendicularVector(perpvec, normalized_direction);
1369  VectorScale(perpvec, e->frame / 2, perpvec);
1370 
1371  for (i = 0; i < NUM_BEAM_SEGS; i++)
1372  {
1373  RotatePointAroundVector(start_points[i], normalized_direction, perpvec, (360.0 / NUM_BEAM_SEGS)*i);
1374  VectorAdd(start_points[i], origin, start_points[i]);
1375  VectorAdd(start_points[i], direction, end_points[i]);
1376  }
1377 
1378  for (i = 0; i < NUM_BEAM_SEGS; i++)
1379  {
1380  R_IMFlatShadedQuad(start_points[i],
1381  end_points[i],
1382  end_points[(i + 1) % NUM_BEAM_SEGS],
1383  start_points[(i + 1) % NUM_BEAM_SEGS],
1384  e->skinnum & 0xFF,
1385  e->alpha);
1386  }
1387 }

Referenced by R_DrawEntitiesOnList().

◆ R_DrawBEntitiesOnList()

void R_DrawBEntitiesOnList ( void  )

Definition at line 803 of file r_main.c.

804 {
805  int i, clipflags;
806  vec3_t oldorigin;
807  vec3_t mins, maxs;
808  float minmaxs[6];
809  mnode_t *topnode;
810 
811  if (!r_drawentities->value)
812  return;
813 
814  VectorCopy(modelorg, oldorigin);
815  insubmodel = true;
817 
818  for (i = 0; i < r_newrefdef.num_entities; i++)
819  {
822  if (!currentmodel)
823  continue;
824  if (currentmodel->nummodelsurfaces == 0)
825  continue; // clip brush only
826  if (currententity->flags & RF_BEAM)
827  continue;
828  if (currentmodel->type != mod_brush)
829  continue;
830  // see if the bounding box lets us trivially reject, also sets
831  // trivial accept status
833  currententity->angles, mins, maxs);
834  VectorAdd(mins, currententity->origin, minmaxs);
835  VectorAdd(maxs, currententity->origin, (minmaxs + 3));
836 
837  clipflags = R_BmodelCheckBBox(minmaxs);
838  if (clipflags == BMODEL_FULLY_CLIPPED)
839  continue; // off the edge of the screen
840 
841  topnode = R_FindTopnode(minmaxs, minmaxs + 3);
842  if (!topnode)
843  continue; // no part in a visible leaf
844 
847 
849 
850  // FIXME: stop transforming twice
851  R_RotateBmodel();
852 
853  // calculate dynamic lighting for bmodel
855 
856  if (topnode->contents == CONTENTS_NODE)
857  {
858  // not a leaf; has to be clipped to the world BSP
859  r_clipflags = clipflags;
861  }
862  else
863  {
864  // falls entirely in one leaf, so we just put all the
865  // edges in the edge list and let 1/z sorting handle
866  // drawing order
867  R_DrawSubmodelPolygons(currentmodel, clipflags, topnode);
868  }
869 
870  // put back world rotation and frustum clipping
871  // FIXME: R_RotateBmodel should just work off base_vxx
875  VectorCopy(oldorigin, modelorg);
877  }
878 
879  insubmodel = false;
880 }

Referenced by R_EdgeDrawing().

◆ R_DrawEntitiesOnList()

void R_DrawEntitiesOnList ( void  )

Definition at line 548 of file r_main.c.

549 {
550  int i;
551  qboolean translucent_entities = false;
552 
553  if (!r_drawentities->value)
554  return;
555 
556  // all bmodels have already been drawn by the edge list
557  for (i = 0; i < r_newrefdef.num_entities; i++)
558  {
560 
562  {
563  translucent_entities = true;
564  continue;
565  }
566 
567  if (currententity->flags & RF_BEAM)
568  {
569  modelorg[0] = -r_origin[0];
570  modelorg[1] = -r_origin[1];
571  modelorg[2] = -r_origin[2];
574  }
575  else
576  {
578  if (!currentmodel)
579  {
580  R_DrawNullModel();
581  continue;
582  }
585 
586  switch (currentmodel->type)
587  {
588  case mod_sprite:
589  R_DrawSprite();
590  break;
591 
592  case mod_alias:
594  break;
595 
596  default:
597  break;
598  }
599  }
600  }
601 
602  if (!translucent_entities)
603  return;
604 
605  for (i = 0; i < r_newrefdef.num_entities; i++)
606  {
608 
610  continue;
611 
612  if (currententity->flags & RF_BEAM)
613  {
614  modelorg[0] = -r_origin[0];
615  modelorg[1] = -r_origin[1];
616  modelorg[2] = -r_origin[2];
619  }
620  else
621  {
623  if (!currentmodel)
624  {
625  R_DrawNullModel();
626  continue;
627  }
630 
631  switch (currentmodel->type)
632  {
633  case mod_sprite:
634  R_DrawSprite();
635  break;
636 
637  case mod_alias:
639  break;
640 
641  default:
642  break;
643  }
644  }
645  }
646 }

Referenced by R_RenderFrame().

◆ R_DrawNullModel()

void R_DrawNullModel ( void  )

Definition at line 539 of file r_main.c.

540 {
541 }

Referenced by R_DrawEntitiesOnList().

◆ R_EdgeDrawing()

void R_EdgeDrawing ( void  )

Definition at line 888 of file r_main.c.

889 {
890  static edge_t ledges[NUMSTACKEDGES +
891  ((CACHE_SIZE - 1) / sizeof(edge_t)) + 1];
892  static surf_t lsurfs[NUMSTACKSURFACES +
893  ((CACHE_SIZE - 1) / sizeof(surf_t)) + 1];
895  return;
896 
897  if (auxedges)
898  {
899  r_edges = auxedges;
900  }
901  else
902  {
903  r_edges = (edge_t *)
904  (((intptr_t)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
905  }
906 
907  if (r_surfsonstack)
908  {
909  surfaces = (surf_t *)
910  (((intptr_t)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
912  // surface 0 doesn't really exist; it's just a dummy because index 0
913  // is used to indicate no edge attached to surface
914  surfaces--;
915  R_SurfacePatch();
916  }
917 
919 
920  if (r_dspeeds->value)
921  {
923  }
924 
925  R_RenderWorld();
926 
927  if (r_dspeeds->value)
928  {
930  db_time1 = rw_time2;
931  }
932 
934 
935  if (r_dspeeds->value)
936  {
938  se_time1 = db_time2;
939  }
940 
941  R_ScanEdges();
942 }

Referenced by R_RenderFrame().

◆ R_EndWorldRenderpass()

void R_EndWorldRenderpass ( void  )

Definition at line 1249 of file r_main.c.

1250 {
1251  // software renderer has only one pass
1252 }

Referenced by GetRefAPI(), and QVk_EndFrame().

◆ R_FindTopnode()

mnode_t* R_FindTopnode ( vec3_t  mins,
vec3_t  maxs 
)

Definition at line 702 of file r_main.c.

703 {
704  mplane_t *splitplane;
705  int sides;
706  mnode_t *node;
707 
708  node = r_worldmodel->nodes;
709 
710  while (1)
711  {
712  if (node->visframe != r_visframecount)
713  return NULL; // not visible at all
714 
715  if (node->contents != CONTENTS_NODE)
716  {
717  if (node->contents != CONTENTS_SOLID)
718  return node; // we've reached a non-solid leaf, so it's
719  // visible and not BSP clipped
720  return NULL; // in solid, so not visible
721  }
722 
723  splitplane = node->plane;
724  sides = BOX_ON_PLANE_SIDE(mins, maxs, (cplane_t *)splitplane);
725 
726  if (sides == 3)
727  return node; // this is the splitter
728 
729  // not split yet; recurse down the contacted side
730  if (sides & 1)
731  node = node->children[0];
732  else
733  node = node->children[1];
734  }
735 }

Referenced by R_DrawBEntitiesOnList().

◆ R_GammaCorrectAndSetPalette()

void R_GammaCorrectAndSetPalette ( const unsigned char *  palette)

Definition at line 1257 of file r_main.c.

1258 {
1259  int i;
1260 
1261  for (i = 0; i < 256; i++)
1262  {
1263  sw_state.currentpalette[i * 4 + 0] = sw_state.gammatable[palette[i * 4 + 0]];
1264  sw_state.currentpalette[i * 4 + 1] = sw_state.gammatable[palette[i * 4 + 1]];
1265  sw_state.currentpalette[i * 4 + 2] = sw_state.gammatable[palette[i * 4 + 2]];
1266  }
1267 
1269 }

Referenced by R_BeginFrame(), R_CalcPalette(), R_CinematicSetPalette(), R_InitGraphics(), and SWimp_SetMode().

◆ R_ImageList_f()

void R_ImageList_f ( void  )

Definition at line 34 of file r_image.c.

35 {
36  int i;
37  image_t *image;
38  int texels;
39 
40  ri.Con_Printf (PRINT_ALL, "------------------\n");
41  texels = 0;
42 
43  for (i=0, image=r_images ; i<numr_images ; i++, image++)
44  {
45  if (image->registration_sequence <= 0)
46  continue;
47  texels += image->width*image->height;
48  switch (image->type)
49  {
50  case it_skin:
51  ri.Con_Printf (PRINT_ALL, "M");
52  break;
53  case it_sprite:
54  ri.Con_Printf (PRINT_ALL, "S");
55  break;
56  case it_wall:
57  ri.Con_Printf (PRINT_ALL, "W");
58  break;
59  case it_pic:
60  ri.Con_Printf (PRINT_ALL, "P");
61  break;
62  default:
63  ri.Con_Printf (PRINT_ALL, " ");
64  break;
65  }
66 
67  ri.Con_Printf (PRINT_ALL, " %3i %3i : %s\n",
68  image->width, image->height, image->name);
69  }
70  ri.Con_Printf (PRINT_ALL, "Total texel count: %i\n", texels);
71 }

Referenced by R_Register().

◆ R_Init()

qboolean R_Init ( void hInstance,
void wndProc 
)

Definition at line 326 of file r_main.c.

327 {
328 
329  R_InitImages();
330  Mod_Init();
331  Draw_InitLocal();
332  R_InitTextures();
333 
334  R_InitTurb();
335 
336  view_clipplanes[0].leftedge = true;
337  view_clipplanes[1].rightedge = true;
339  view_clipplanes[3].leftedge = false;
341  view_clipplanes[3].rightedge = false;
342 
345 
346  // TODO: collect 386-specific code in one place
347 #if id386
349  (long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
350  Sys_SetFPCW(); // get bit masks for FPCW (FIXME: is this id386?)
351 #endif // id386
352 
353  r_aliasuvscale = 1.0;
354 
355  R_Register();
356  Draw_GetPalette();
357  Draw_InitRGBMap(); // leilei - colored lights
358 
359  if (SWimp_Init(hInstance, wndProc) == false)
360  return -1;
361 
362  // create the window
363  R_BeginFrame(0);
364 
365  ri.Con_Printf(PRINT_ALL, "ref_soft version: "REF_VERSION"\n");
366 
367  return true;
368 }

Referenced by GetRefAPI().

◆ R_InitGraphics()

void R_InitGraphics ( int  width,
int  height 
)

Definition at line 1108 of file r_main.c.

1109 {
1110  vid.width = width;
1111  vid.height = height;
1112 
1113  // free z buffer
1114  if (d_pzbuffer)
1115  {
1116  free(d_pzbuffer);
1117  d_pzbuffer = NULL;
1118  }
1119 
1120  // free surface cache
1121  if (sc_base)
1122  {
1123  D_FlushCaches();
1124  free(sc_base);
1125  sc_base = NULL;
1126  }
1127 
1128  r_warpwidth = vid.width;
1130 
1131  // screen warping resolutions wider than 1280 pixels cause major slowdown
1132  //qb: ...OK, if not AROS/MorphOS? if ( r_warpwidth < 1440)
1133  //{
1134  // speed up screen warping 1280 pixel wide resolutions
1135  if (r_warpwidth >= 1280)
1136  {
1137  r_warpwidth >>= 1;
1138  r_warpheight >>= 1;
1139  }
1140 
1141  //ri.Con_Printf(PRINT_ALL,"Warping resolution: %d %d\n", r_warpwidth, r_warpheight);
1142 
1143  if (r_warpbuffer)
1144  {
1145  //ri.Con_Printf(PRINT_ALL, "***realloc\n");
1146  //r_warpbuffer = realloc(r_warpbuffer, vid.width*vid.height);
1148  }
1149  else
1150  {
1151  //ri.Con_Printf(PRINT_ALL, "***malloc\n");
1153  }
1154  /* qb: let it roll }
1155  else
1156  {
1157  if (r_warpbuffer)
1158  {
1159  free(r_warpbuffer);
1160  }
1161  r_warpbuffer = NULL;
1162  } */
1163 
1164  d_pzbuffer = malloc(vid.width*vid.height * 2);
1165 
1166  R_InitCaches();
1167 
1168  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
1169 }

Referenced by R_BeginFrame().

◆ R_InitTextures()

void R_InitTextures ( void  )

Definition at line 211 of file r_main.c.

212 {
213  int x, y, m;
214  byte *dest;
215 
216  // create a simple checkerboard texture for the default
218 
221  r_notexture_mip->pixels[1] = r_notexture_mip->pixels[0] + 16 * 16;
222  r_notexture_mip->pixels[2] = r_notexture_mip->pixels[1] + 8 * 8;
223  r_notexture_mip->pixels[3] = r_notexture_mip->pixels[2] + 4 * 4;
224 
225  for (m = 0; m < 4; m++)
226  {
227  dest = r_notexture_mip->pixels[m];
228  for (y = 0; y < (16 >> m); y++)
229  for (x = 0; x < (16 >> m); x++)
230  {
231  if ((y < (8 >> m)) ^ (x < (8 >> m)))
232 
233  *dest++ = 0;
234  else
235  *dest++ = 0xff;
236  }
237  }
238 }

Referenced by R_Init().

◆ R_InitTurb()

void R_InitTurb ( void  )

Definition at line 246 of file r_main.c.

247 {
248  int i;
249 
250  for (i = 0; i < 4200; i++) //qb: 4k screens
251  {
252  sintable[i] = AMP + sin(i*3.14159 * 2 / CYCLE)*AMP;
253  intsintable[i] = AMP2 + sin(i*3.14159 * 2 / CYCLE)*AMP2; // AMP2, not 20
254  blanktable[i] = 0; //PGM
255  }
256 }

Referenced by R_Init().

◆ R_MarkLeaves()

void R_MarkLeaves ( void  )

Definition at line 467 of file r_main.c.

468 {
469  byte *vis;
470  mnode_t *node;
471  int i;
472  mleaf_t *leaf;
473  int cluster;
474 
476  return;
477 
478  // development aid to let you run around and see exactly where
479  // the pvs ends
480  if (sw_lockpvs->value)
481  return;
482 
483  r_visframecount++;
485 
486  if (r_novis->value || r_viewcluster == -1 || !r_worldmodel->vis)
487  {
488  // mark everything
489  for (i = 0; i < r_worldmodel->numleafs; i++)
491  for (i = 0; i < r_worldmodel->numnodes; i++)
493  return;
494  }
495 
497 
498  for (i = 0, leaf = r_worldmodel->leafs; i < r_worldmodel->numleafs; i++, leaf++)
499  {
500  cluster = leaf->cluster;
501  if (cluster == -1)
502  continue;
503  if (vis[cluster >> 3] & (1 << (cluster & 7)))
504  {
505  node = (mnode_t *)leaf;
506  do
507  {
508  if (node->visframe == r_visframecount)
509  break;
510  node->visframe = r_visframecount;
511  node = node->parent;
512  } while (node);
513  }
514  }
515 
516 #if 0
517  for (i=0 ; i<r_worldmodel->vis->numclusters ; i++)
518  {
519  if (vis[i>>3] & (1<<(i&7)))
520  {
521  node = (mnode_t *)&r_worldmodel->leafs[i]; // FIXME: cluster
522  do
523  {
524  if (node->visframe == r_visframecount)
525  break;
526  node->visframe = r_visframecount;
527  node = node->parent;
528  } while (node);
529  }
530  }
531 #endif
532 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_NewMap()

void R_NewMap ( void  )

Definition at line 415 of file r_main.c.

416 {
417  r_viewcluster = -1;
418 
420 
421  if (r_cnumsurfs <= MINSURFACES)
423 
425  {
426  surfaces = malloc(r_cnumsurfs * sizeof(surf_t));
429  r_surfsonstack = false;
430  // surface 0 doesn't really exist; it's just a dummy because index 0
431  // is used to indicate no edge attached to surface
432  surfaces--;
433  R_SurfacePatch();
434  }
435  else
436  {
437  r_surfsonstack = true;
438  }
439 
440  r_maxedgesseen = 0;
441  r_maxsurfsseen = 0;
442 
444 
447 
449  {
450  auxedges = NULL;
451  }
452  else
453  {
454  auxedges = malloc(r_numallocatededges * sizeof(edge_t));
455  }
456 }

Referenced by R_BeginRegistration().

◆ R_Register()

void R_Register ( void  )

Definition at line 260 of file r_main.c.

261 {
262  sw_aliasstats = ri.Cvar_Get("sw_polymodelstats", "0", 0);
263  sw_allow_modex = ri.Cvar_Get( "sw_allow_modex", "1", CVAR_ARCHIVE );
264  sw_clearcolor = ri.Cvar_Get("sw_clearcolor", "2", 0);
265  sw_drawflat = ri.Cvar_Get("sw_drawflat", "0", 0);
266  sw_draworder = ri.Cvar_Get("sw_draworder", "0", 0);
267  sw_maxedges = ri.Cvar_Get("sw_maxedges", STRINGER(MAXSTACKSURFACES), 0);
268  sw_maxsurfs = ri.Cvar_Get("sw_maxsurfs", "0", 0);
269  sw_mipcap = ri.Cvar_Get("sw_mipcap", "0", 0);
270  sw_mipscale = ri.Cvar_Get("sw_mipscale", "1", 0);
271  sw_reportedgeout = ri.Cvar_Get("sw_reportedgeout", "0", 0);
272  sw_reportsurfout = ri.Cvar_Get("sw_reportsurfout", "0", 0);
273  sw_stipplealpha = ri.Cvar_Get("sw_stipplealpha", "0", CVAR_ARCHIVE);
274  sw_surfcacheoverride = ri.Cvar_Get("sw_surfcacheoverride", "0", 0);
275  sw_waterwarp = ri.Cvar_Get("sw_waterwarp", "1", 0);
276  sw_mode = ri.Cvar_Get("sw_mode", "4", CVAR_ARCHIVE);
277  sw_transmooth = ri.Cvar_Get("sw_transmooth", "0", CVAR_ARCHIVE);
278  //sw_transquality = ri.Cvar_Get("sw_transquality", "1", CVAR_ARCHIVE);
279 
280  r_lefthand = ri.Cvar_Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
281  r_speeds = ri.Cvar_Get("r_speeds", "0", 0);
282  r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0);
283  r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0);
284  r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0);
285  r_dspeeds = ri.Cvar_Get("r_dspeeds", "0", 0);
286  r_lightlevel = ri.Cvar_Get("r_lightlevel", "0", 0);
287  r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0);
288  r_novis = ri.Cvar_Get("r_novis", "0", 0);
289 
290  vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
291  vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", CVAR_ARCHIVE);
292 
293  ri.Cmd_AddCommand("modellist", Mod_Modellist_f);
294  ri.Cmd_AddCommand("screenshot", R_ScreenShot_f);
295  ri.Cmd_AddCommand("imagelist", R_ImageList_f);
296 
297  sw_mode->modified = true; // force us to do mode specific stuff later
298  vid_gamma->modified = true; // force us to rebuild the gamma table later
299 
300  //PGM
301  sw_lockpvs = ri.Cvar_Get("sw_lockpvs", "0", 0);
302  //PGM
303 
304  r_customwidth = ri.Cvar_Get("r_customwidth", "1024", CVAR_ARCHIVE);
305  r_customheight = ri.Cvar_Get("r_customheight", "768", CVAR_ARCHIVE);
306  // leilei - colored lights
307 
308  r_coloredlights = ri.Cvar_Get("r_coloredlights", "2", CVAR_ARCHIVE);
309  r_lightsaturation = ri.Cvar_Get("r_lightsaturation", "1", CVAR_ARCHIVE);
310 
311  // o^_^o
312 }

Referenced by R_Init().

◆ R_RegisterSkin()

struct image_s* R_RegisterSkin ( char *  name)

Definition at line 550 of file r_image.c.

551 {
552  return R_FindImage (name, it_skin);
553 }

Referenced by GetRefAPI().

◆ R_RenderFrame()

void R_RenderFrame ( refdef_t fd)

Definition at line 1033 of file r_main.c.

1034 {
1035  r_newrefdef = *fd;
1036 
1038  ri.Sys_Error(ERR_FATAL, "R_RenderView: NULL worldmodel");
1039 
1042 
1043  if (r_speeds->value || r_dspeeds->value)
1045 
1046  R_SetupFrame();
1047 
1048  R_MarkLeaves(); // done here so we know if we're in water
1049 
1051 
1052  R_EdgeDrawing();
1053 
1054  if (r_dspeeds->value)
1055  {
1057  de_time1 = se_time2;
1058  }
1059 
1061 
1062  if (r_dspeeds->value)
1063  {
1066  }
1067 
1068  R_DrawParticles();
1069 
1070  if (r_dspeeds->value)
1072 
1074 
1075  R_SetLightLevel();
1076 
1077  // if (r_dowarp)
1078  if (r_dowarp && r_warpbuffer)
1079  D_WarpScreen();
1080 
1081  if (r_dspeeds->value)
1083 
1084  if (r_dspeeds->value)
1086 
1087  R_CalcPalette();
1088 
1089  if (sw_aliasstats->value)
1091 
1092  if (r_speeds->value)
1093  R_PrintTimes();
1094 
1095  if (r_dspeeds->value)
1096  R_PrintDSpeeds();
1097 
1099  ri.Con_Printf(PRINT_ALL, "Short %d surfaces\n", r_outofsurfaces);
1100 
1102  ri.Con_Printf(PRINT_ALL, "Short roughly %d edges\n", r_outofedges * 2 / 3);
1103 }

Referenced by GetRefAPI().

◆ R_SetLightLevel()

void R_SetLightLevel ( void  )

Definition at line 1011 of file r_main.c.

1012 {
1013  vec3_t light;
1014 
1016  {
1017  r_lightlevel->value = 150.0;
1018  return;
1019  }
1020 
1021  // save off light value for server to look at (BIG HACK!)
1023  r_lightlevel->value = 150.0 * light[0];
1024 }

Referenced by R_RenderFrame().

◆ R_SetSky()

void R_SetSky ( char *  name,
float  rotate,
vec3_t  axis 
)

Definition at line 1401 of file r_main.c.

1402 {
1403  int i;
1404  char pathname[MAX_QPATH];
1405 
1406  strncpy(skyname, name, sizeof(skyname)-1);
1407  skyrotate = rotate;
1408  VectorCopy(axis, skyaxis);
1409 
1410  for (i = 0; i < 6; i++)
1411  {
1412  Com_sprintf(pathname, sizeof(pathname), "env/%s%s.pcx", skyname, suf[r_skysideimage[i]]);
1413  r_skytexinfo[i].image = R_FindImage(pathname, it_sky);
1414  }
1415 }

Referenced by GetRefAPI().

◆ R_Shutdown()

void R_Shutdown ( void  )

Definition at line 375 of file r_main.c.

376 {
377  // free z buffer
378  if (d_pzbuffer)
379  {
380  free(d_pzbuffer);
381  d_pzbuffer = NULL;
382  }
383  // free surface cache
384  if (sc_base)
385  {
386  D_FlushCaches();
387  free(sc_base);
388  sc_base = NULL;
389  }
390 
391  if (r_warpbuffer)
392  {
393  free(r_warpbuffer);
394  r_warpbuffer = NULL;
395  }
396 
397  // free colormap
398  if (vid.colormap)
399  {
400  free(vid.colormap);
401  vid.colormap = NULL;
402  }
403  R_UnRegister();
404  Mod_FreeAll();
406 
407  SWimp_Shutdown();
408 }

Referenced by GetRefAPI().

◆ R_UnRegister()

void R_UnRegister ( void  )

Definition at line 314 of file r_main.c.

315 {
316  ri.Cmd_RemoveCommand("screenshot");
317  ri.Cmd_RemoveCommand("modellist");
318  ri.Cmd_RemoveCommand("imagelist");
319 }

Referenced by R_Shutdown().

◆ RotatedBBox()

void RotatedBBox ( vec3_t  mins,
vec3_t  maxs,
vec3_t  angles,
vec3_t  tmins,
vec3_t  tmaxs 
)

Definition at line 745 of file r_main.c.

746 {
747  vec3_t tmp, v;
748  int i, j;
750 
751  if (!angles[0] && !angles[1] && !angles[2])
752  {
753  VectorCopy(mins, tmins);
754  VectorCopy(maxs, tmaxs);
755  return;
756  }
757 
758  for (i = 0; i < 3; i++)
759  {
760  tmins[i] = 99999;
761  tmaxs[i] = -99999;
762  }
763 
764  AngleVectors(angles, forward, right, up);
765 
766  for (i = 0; i < 8; i++)
767  {
768  if (i & 1)
769  tmp[0] = mins[0];
770  else
771  tmp[0] = maxs[0];
772 
773  if (i & 2)
774  tmp[1] = mins[1];
775  else
776  tmp[1] = maxs[1];
777 
778  if (i & 4)
779  tmp[2] = mins[2];
780  else
781  tmp[2] = maxs[2];
782 
783 
784  VectorScale(forward, tmp[0], v);
785  VectorMA(v, -tmp[1], right, v);
786  VectorMA(v, tmp[2], up, v);
787 
788  for (j = 0; j < 3; j++)
789  {
790  if (v[j] < tmins[j])
791  tmins[j] = v[j];
792  if (v[j] > tmaxs[j])
793  tmaxs[j] = v[j];
794  }
795  }
796 }

Referenced by R_DrawBEntitiesOnList().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 1499 of file r_main.c.

1500 {
1501  va_list argptr;
1502  char text[1024];
1503 
1504  va_start(argptr, error);
1505  vsnprintf(text, 1024, error, argptr);
1506  va_end(argptr);
1507 
1508  ri.Sys_Error(ERR_FATAL, "%s", text);
1509 }

Variable Documentation

◆ aliasxcenter

float aliasxcenter

Definition at line 85 of file r_main.c.

◆ aliasxscale

float aliasxscale

Definition at line 85 of file r_main.c.

Referenced by R_AliasDrawModel(), R_AliasProjectAndClipTestFinalVert(), and R_ViewChanged().

◆ aliasycenter

float aliasycenter

Definition at line 85 of file r_main.c.

◆ aliasyscale

float aliasyscale

Definition at line 85 of file r_main.c.

◆ base_vpn

vec3_t base_vpn

Definition at line 73 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ base_vright

vec3_t base_vright

Definition at line 74 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ base_vup

vec3_t base_vup

Definition at line 72 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ bbextents

◆ bbextentt

fixed16_t bbextentt

Definition at line 192 of file r_main.c.

◆ c_surf

int c_surf

Definition at line 64 of file r_main.c.

Referenced by D_CacheSurface(), and R_PrintTimes().

◆ cacheblock

◆ cachewidth

◆ coloredlights

◆ colormap

void* colormap

Definition at line 51 of file r_main.c.

Referenced by D_Patch().

◆ currentmodel

model_t* currentmodel

Definition at line 39 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_DrawEntitiesOnList().

◆ d_8to24tabble

unsigned d_8to24tabble[256]

Definition at line 28 of file r_main.c.

Referenced by Draw_8to24().

◆ d_8to24table

unsigned d_8to24table[256]

◆ d_pzbuffer

◆ d_sdivzorigin

float d_sdivzorigin

◆ d_sdivzstepu

float d_sdivzstepu

◆ d_sdivzstepv

float d_sdivzstepv

◆ d_spanpixcount

int d_spanpixcount

Definition at line 99 of file r_main.c.

Referenced by R_SetupFrame().

◆ d_tdivzorigin

float d_tdivzorigin

Definition at line 190 of file r_main.c.

◆ d_tdivzstepu

float d_tdivzstepu

Definition at line 188 of file r_main.c.

◆ d_tdivzstepv

float d_tdivzstepv

Definition at line 189 of file r_main.c.

◆ d_viewbuffer

◆ d_ziorigin

float d_ziorigin

Definition at line 190 of file r_main.c.

◆ d_zistepu

float d_zistepu

Definition at line 188 of file r_main.c.

◆ d_zistepv

float d_zistepv

Definition at line 189 of file r_main.c.

◆ d_zrowbytes

unsigned int d_zrowbytes

Definition at line 198 of file r_main.c.

Referenced by D_ViewChanged().

◆ d_zwidth

unsigned int d_zwidth

Definition at line 199 of file r_main.c.

◆ da_time1

float da_time1

Definition at line 112 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ da_time2

float da_time2

Definition at line 112 of file r_main.c.

Referenced by R_RenderFrame().

◆ db_time1

float db_time1

Definition at line 112 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ db_time2

float db_time2

Definition at line 112 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ de_time1

float de_time1

Definition at line 113 of file r_main.c.

Referenced by R_RenderFrame().

◆ de_time2

float de_time2

Definition at line 113 of file r_main.c.

Referenced by R_RenderFrame().

◆ dp_time1

float dp_time1

Definition at line 112 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ dp_time2

float dp_time2

Definition at line 112 of file r_main.c.

Referenced by R_RenderFrame().

◆ pfrustum_indexes

int* pfrustum_indexes[4]

Definition at line 104 of file r_main.c.

Referenced by R_BmodelCheckBBox(), R_RecursiveWorldNode(), and R_SetUpFrustumIndexes().

◆ r_aliasuvscale

float r_aliasuvscale = 1.0

Definition at line 56 of file r_main.c.

Referenced by R_Init(), and R_ViewChanged().

◆ r_clipflags

int r_clipflags

Definition at line 67 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_RenderBmodelFace().

◆ r_cnumsurfs

int r_cnumsurfs

Definition at line 65 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ r_coloredlights

cvar_t* r_coloredlights

Definition at line 154 of file r_main.c.

Referenced by Mod_LoadBrushModel(), and R_Register().

◆ r_customheight

cvar_t* r_customheight

Definition at line 152 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ r_customwidth

cvar_t* r_customwidth

Definition at line 151 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ r_dowarp

qboolean r_dowarp

Definition at line 60 of file r_main.c.

Referenced by R_RenderFrame(), and R_SetupFrame().

◆ r_drawentities

cvar_t* r_drawentities

Definition at line 135 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), R_DrawEntitiesOnList(), R_Register(), and R_SetLightLevel().

◆ r_drawnpolycount

int r_drawnpolycount

Definition at line 101 of file r_main.c.

Referenced by D_DrawSurfaces(), R_PrintTimes(), and R_SetupFrame().

◆ r_drawworld

cvar_t* r_drawworld

Definition at line 134 of file r_main.c.

Referenced by R_Register().

◆ r_dspeeds

cvar_t* r_dspeeds

Definition at line 136 of file r_main.c.

Referenced by R_EdgeDrawing(), R_Register(), and R_RenderFrame().

◆ r_framecount

int r_framecount = 1

Definition at line 97 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ r_frustum_indexes

int r_frustum_indexes[4 *6]

Definition at line 105 of file r_main.c.

Referenced by R_SetUpFrustumIndexes().

◆ r_fullbright

cvar_t* r_fullbright

Definition at line 137 of file r_main.c.

Referenced by R_Register().

◆ r_lefthand

cvar_t* r_lefthand

Definition at line 117 of file r_main.c.

Referenced by R_Register().

◆ r_lerpmodels

cvar_t* r_lerpmodels

Definition at line 138 of file r_main.c.

Referenced by R_Register().

◆ r_lightlevel

cvar_t* r_lightlevel

Definition at line 142 of file r_main.c.

Referenced by R_Register(), and R_SetLightLevel().

◆ r_lightsaturation

cvar_t* r_lightsaturation

Definition at line 155 of file r_main.c.

Referenced by Draw_InitRGBMap(), and R_Register().

◆ r_maxedgesseen

int r_maxedgesseen

Definition at line 65 of file r_main.c.

Referenced by R_NewMap().

◆ r_maxsurfsseen

int r_maxsurfsseen

Definition at line 65 of file r_main.c.

Referenced by R_NewMap().

◆ r_newrefdef

◆ r_notexture_buffer

byte r_notexture_buffer[1024]

Definition at line 204 of file r_main.c.

Referenced by R_InitTextures().

◆ r_notexture_mip

image_t* r_notexture_mip

Definition at line 110 of file r_main.c.

Referenced by Mod_LoadTexinfo(), R_InitTextures(), and R_LoadWal().

◆ r_novis

cvar_t* r_novis

Definition at line 139 of file r_main.c.

Referenced by R_MarkLeaves(), and R_Register().

◆ r_numallocatededges

int r_numallocatededges

Definition at line 55 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_NewMap().

◆ r_oldviewcluster

int r_oldviewcluster

Definition at line 108 of file r_main.c.

Referenced by R_MarkLeaves().

◆ r_origin

vec3_t r_origin

Definition at line 75 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_DrawEntitiesOnList().

◆ r_outofedges

int r_outofedges

Definition at line 58 of file r_main.c.

Referenced by R_RenderBmodelFace(), R_RenderFace(), R_RenderFrame(), and R_SetupFrame().

◆ r_outofsurfaces

int r_outofsurfaces

Definition at line 57 of file r_main.c.

Referenced by R_RenderBmodelFace(), R_RenderFace(), R_RenderFrame(), and R_SetupFrame().

◆ r_pcurrentvertbase

mvertex_t* r_pcurrentvertbase

◆ r_polycount

int r_polycount

Definition at line 100 of file r_main.c.

Referenced by R_PrintTimes(), R_RenderBmodelFace(), R_RenderFace(), and R_SetupFrame().

◆ r_refdef

◆ r_screenwidth

◆ r_skysideimage

int r_skysideimage[6] = { 5, 2, 4, 1, 0, 3 }

Definition at line 1399 of file r_main.c.

Referenced by R_SetSky().

◆ r_skytexinfo

mtexinfo_t r_skytexinfo[6]

Definition at line 70 of file r_rast.c.

Referenced by R_EmitSkyBox(), R_InitSkyBox(), and R_SetSky().

◆ r_speeds

cvar_t* r_speeds

Definition at line 141 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ r_surfsonstack

qboolean r_surfsonstack

Definition at line 66 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ r_time1

float r_time1

Definition at line 54 of file r_main.c.

Referenced by R_PrintDSpeeds(), R_PrintTimes(), and R_RenderFrame().

◆ r_viewcluster

int r_viewcluster

Definition at line 108 of file r_main.c.

Referenced by R_MarkLeaves(), and R_NewMap().

◆ r_viewleaf

mleaf_t* r_viewleaf

Definition at line 107 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_viewlighting

alight_t r_viewlighting = { 128, 192, viewlightvec }

Definition at line 53 of file r_main.c.

◆ r_visframecount

int r_visframecount

Definition at line 98 of file r_main.c.

Referenced by R_FindTopnode(), and R_MarkLeaves().

◆ r_warpbuffer

byte* r_warpbuffer

Definition at line 45 of file r_main.c.

Referenced by D_WarpScreen(), R_InitGraphics(), R_RenderFrame(), R_SetupFrame(), and R_Shutdown().

◆ r_warpheight

int r_warpheight

Definition at line 47 of file r_main.c.

Referenced by R_InitGraphics(), and R_SetupFrame().

◆ r_warpwidth

int r_warpwidth

Definition at line 46 of file r_main.c.

Referenced by D_WarpScreen(), R_InitGraphics(), and R_SetupFrame().

◆ r_wholepolycount

int r_wholepolycount

Definition at line 102 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_worldentity

entity_t r_worldentity

Definition at line 30 of file r_main.c.

Referenced by D_SolidSurf(), and R_RenderWorld().

◆ r_worldmodel

model_t* r_worldmodel

Definition at line 41 of file r_main.c.

Referenced by R_FindTopnode(), R_MarkLeaves(), and R_RenderFrame().

◆ ri

◆ rw_time1

float rw_time1

Definition at line 112 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ rw_time2

float rw_time2

Definition at line 112 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ sadjust

◆ screenedge

mplane_t screenedge[4]

Definition at line 92 of file r_main.c.

Referenced by R_TransformFrustum(), and R_ViewChanged().

◆ se_time1

float se_time1

Definition at line 113 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_PrintDSpeeds().

◆ se_time2

float se_time2

Definition at line 113 of file r_main.c.

Referenced by R_RenderFrame().

◆ sky_images

image_t* sky_images[6]

Definition at line 36 of file r_main.c.

◆ skyaxis

vec3_t skyaxis

Definition at line 35 of file r_main.c.

Referenced by R_SetSky().

◆ skyname

char skyname[MAX_QPATH]

Definition at line 32 of file r_main.c.

Referenced by R_SetSky().

◆ skyrotate

float skyrotate

Definition at line 34 of file r_main.c.

Referenced by R_SetSky().

◆ suf

char* suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" }

Definition at line 1398 of file r_main.c.

Referenced by R_SetSky().

◆ sw_aliasstats

cvar_t* sw_aliasstats

Definition at line 118 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_allow_modex

cvar_t* sw_allow_modex

Definition at line 119 of file r_main.c.

Referenced by DDRAW_Init(), and R_Register().

◆ sw_clearcolor

cvar_t* sw_clearcolor

Definition at line 120 of file r_main.c.

Referenced by D_BackgroundSurf(), D_ViewChanged(), and R_Register().

◆ sw_drawflat

cvar_t* sw_drawflat

Definition at line 121 of file r_main.c.

Referenced by D_DrawSurfaces(), and R_Register().

◆ sw_draworder

cvar_t* sw_draworder

Definition at line 122 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_Register().

◆ sw_lockpvs

cvar_t* sw_lockpvs

Definition at line 148 of file r_main.c.

Referenced by R_MarkLeaves(), and R_Register().

◆ sw_maxedges

cvar_t* sw_maxedges

Definition at line 123 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_maxsurfs

cvar_t* sw_maxsurfs

Definition at line 124 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_mode

cvar_t* sw_mode

Definition at line 125 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ sw_reportedgeout

cvar_t* sw_reportedgeout

Definition at line 126 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_reportsurfout

cvar_t* sw_reportsurfout

Definition at line 127 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_state

◆ sw_stipplealpha

cvar_t* sw_stipplealpha

Definition at line 128 of file r_main.c.

Referenced by R_Register().

◆ sw_surfcacheoverride

cvar_t* sw_surfcacheoverride

Definition at line 129 of file r_main.c.

Referenced by R_InitCaches(), and R_Register().

◆ sw_transmooth

◆ sw_waterwarp

cvar_t* sw_waterwarp

Definition at line 130 of file r_main.c.

Referenced by R_Register(), and R_SetupFrame().

◆ tadjust

fixed16_t tadjust

Definition at line 192 of file r_main.c.

◆ thepalette

byte* thepalette

Definition at line 33 of file r_main.c.

Referenced by Draw_GetPalette(), and R_ScreenShot_f().

◆ verticalFieldOfView

float verticalFieldOfView

Definition at line 89 of file r_main.c.

Referenced by R_ViewChanged().

◆ vid

◆ vid_fullscreen

cvar_t* vid_fullscreen

Definition at line 144 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ vid_gamma

cvar_t* vid_gamma

Definition at line 145 of file r_main.c.

Referenced by Draw_BuildGammaTable(), R_BeginFrame(), and R_Register().

◆ viewlightvec

vec3_t viewlightvec

Definition at line 52 of file r_main.c.

◆ vpn

vec3_t vpn

Definition at line 73 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ vright

vec3_t vright

Definition at line 74 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ vup

vec3_t vup

Definition at line 72 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ xcenter

◆ xOrigin

float xOrigin

Definition at line 90 of file r_main.c.

Referenced by R_ViewChanged().

◆ xscale

float xscale

Definition at line 82 of file r_main.c.

Referenced by D_ViewChanged(), R_ClipAndDrawPoly(), R_EmitEdge(), and R_ViewChanged().

◆ xscaleinv

float xscaleinv

◆ xscaleshrink

float xscaleshrink

Definition at line 84 of file r_main.c.

Referenced by R_DrawParticles(), and R_ViewChanged().

◆ ycenter

float ycenter

Definition at line 81 of file r_main.c.

◆ yOrigin

float yOrigin

Definition at line 90 of file r_main.c.

◆ yscale

float yscale

Definition at line 82 of file r_main.c.

◆ yscaleinv

float yscaleinv

Definition at line 83 of file r_main.c.

◆ yscaleshrink

float yscaleshrink

Definition at line 84 of file r_main.c.

RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:604
r_pcurrentvertbase
mvertex_t * r_pcurrentvertbase
Definition: r_main.c:62
it_sprite
@ it_sprite
Definition: r_local.h:65
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:159
r_skytexinfo
mtexinfo_t r_skytexinfo[6]
Definition: r_rast.c:70
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:106
refimport_t::Cmd_RemoveCommand
void(* Cmd_RemoveCommand)(char *name)
Definition: ref.h:197
sw_reportedgeout
cvar_t * sw_reportedgeout
Definition: r_main.c:126
rserr_t
rserr_t
Definition: r_local.h:103
height
GLsizei height
Definition: qgl_win.c:69
r_cnumsurfs
int r_cnumsurfs
Definition: r_main.c:65
r_warpheight
int r_warpheight
Definition: r_main.c:47
sw_mipscale
cvar_t * sw_mipscale
Definition: r_misc.c:27
R_BeginEdgeFrame
void R_BeginEdgeFrame(void)
Definition: r_edge.c:109
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
entity_s::origin
float origin[3]
Definition: ref.h:57
R_Register
void R_Register(void)
Definition: r_main.c:260
entity_s::model
struct model_s * model
Definition: ref.h:51
CONTENTS_NODE
#define CONTENTS_NODE
Definition: r_model.h:122
R_InitImages
void R_InitImages(void)
Definition: r_image.c:593
R_DrawBeam
void R_DrawBeam(entity_t *e)
Definition: r_main.c:1342
r_novis
cvar_t * r_novis
Definition: r_main.c:139
model_s::vis
dvis_t * vis
Definition: r_model.h:229
oldrefdef_t::vieworg
vec3_t vieworg
Definition: r_local.h:138
r_visframecount
int r_visframecount
Definition: r_main.c:98
base_vpn
vec3_t base_vpn
Definition: r_main.c:73
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
Sys_SetFPCW
void Sys_SetFPCW(void)
Definition: rw_imp.c:351
R_ShutdownImages
void R_ShutdownImages(void)
Definition: r_image.c:603
CYCLE
#define CYCLE
Definition: asm_draw.h:16
r_maxsurfsseen
int r_maxsurfsseen
Definition: r_main.c:65
R_BeginRegistration
void R_BeginRegistration(char *map)
Definition: r_model.c:1213
R_BmodelCheckBBox
int R_BmodelCheckBBox(float *minmaxs)
Definition: r_main.c:654
Swap_Init
void Swap_Init(void)
Definition: q_shared.c:1011
Draw_Char
#define Draw_Char
Definition: qmenu.c:48
sw_reportsurfout
cvar_t * sw_reportsurfout
Definition: r_main.c:127
da_time1
float da_time1
Definition: r_main.c:112
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:138
Sys_MakeCodeWriteable
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
Definition: rw_imp.c:322
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:94
r_oldviewcluster
int r_oldviewcluster
Definition: r_main.c:108
insubmodel
qboolean insubmodel
Definition: r_bsp.c:27
R_ScreenShot_f
void R_ScreenShot_f(void)
Definition: r_misc.c:627
BOX_ON_PLANE_SIDE
#define BOX_ON_PLANE_SIDE(emins, emaxs, p)
Definition: q_shared.h:197
model_s::nummodelsurfaces
int nummodelsurfaces
Definition: r_model.h:196
skyname
char skyname[MAX_QPATH]
Definition: r_main.c:32
R_PushDlights
void R_PushDlights(model_t *model)
Definition: r_light.c:94
Draw_StretchRaw
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: r_draw.c:423
ri
refimport_t ri
Definition: r_main.c:25
R_SurfacePatch
void R_SurfacePatch(void)
Definition: r_misc.c:532
BMODEL_FULLY_CLIPPED
#define BMODEL_FULLY_CLIPPED
Definition: r_local.h:220
oldrefdef_t::viewangles
vec3_t viewangles
Definition: r_local.h:139
r_customheight
cvar_t * r_customheight
Definition: r_main.c:152
R_SetSky
void R_SetSky(char *name, float rotate, vec3_t axis)
Definition: r_main.c:1401
r_coloredlights
cvar_t * r_coloredlights
Definition: r_main.c:154
refexport_t::DrawStretchRaw
void(* DrawStretchRaw)(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: ref.h:175
vright
vec3_t vright
Definition: r_main.c:74
v
GLdouble v
Definition: qgl_win.c:143
it_wall
@ it_wall
Definition: r_local.h:66
cvar_s::modified
qboolean modified
Definition: q_shared.h:330
R_InitGraphics
void R_InitGraphics(int width, int height)
Definition: r_main.c:1108
r_origin
vec3_t r_origin
Definition: r_main.c:75
R_CalcPalette
void R_CalcPalette(void)
Definition: r_main.c:953
CACHE_SIZE
#define CACHE_SIZE
Definition: d_ifacea.h:22
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
sw_drawflat
cvar_t * sw_drawflat
Definition: r_main.c:121
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:160
r_skysideimage
int r_skysideimage[6]
Definition: r_main.c:1399
refexport_t::DrawFill
void(* DrawFill)(int x, int y, int w, int h, int c)
Definition: ref.h:171
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: r_light.c:226
mnode_s::visframe
int visframe
Definition: r_model.h:127
vid
viddef_t vid
Definition: r_main.c:24
de_time1
float de_time1
Definition: r_main.c:113
refimport_t::Cvar_Get
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
Definition: ref.h:216
sw_draworder
cvar_t * sw_draworder
Definition: r_main.c:122
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: r_main.c:129
R_FindImage
image_t * R_FindImage(char *name, imagetype_t type)
Definition: r_image.c:491
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
oldrefdef_t::xOrigin
float xOrigin
Definition: r_local.h:135
entity_s::skinnum
int skinnum
Definition: ref.h:70
SWimp_AppActivate
void SWimp_AppActivate(qboolean active)
Definition: rw_imp.c:292
i
int i
Definition: q_shared.c:305
surf_max
surf_t * surf_max
Definition: r_edge.c:51
API_VERSION
#define API_VERSION
Definition: ref.h:128
modelorg
vec3_t modelorg
Definition: r_bsp.c:29
skyaxis
vec3_t skyaxis
Definition: r_main.c:35
R_DrawSprite
void R_DrawSprite(void)
Definition: r_sprite.c:40
db_time1
float db_time1
Definition: r_main.c:112
mleaf_s::visframe
int visframe
Definition: r_model.h:147
mnode_s::parent
struct mnode_s * parent
Definition: r_model.h:131
sw_lockpvs
cvar_t * sw_lockpvs
Definition: r_main.c:148
mnode_s
Definition: r_model.h:123
sw_clearcolor
cvar_t * sw_clearcolor
Definition: r_main.c:120
r_aliasuvscale
float r_aliasuvscale
Definition: r_main.c:56
sintable
int sintable[4200]
Definition: r_rast.c:47
refdef_t::rdflags
int rdflags
Definition: ref.h:110
SWimp_Shutdown
void SWimp_Shutdown(void)
Definition: rw_imp.c:274
width
GLint GLsizei width
Definition: qgl_win.c:115
r_notexture_buffer
byte r_notexture_buffer[1024]
Definition: r_main.c:204
mnode_s::children
struct mnode_s * children[2]
Definition: r_model.h:135
CONTENTS_SOLID
#define CONTENTS_SOLID
Definition: qfiles.h:333
r_surfsonstack
qboolean r_surfsonstack
Definition: r_main.c:66
entity_s::flags
int flags
Definition: ref.h:76
R_DrawSolidClippedSubmodelPolygons
void R_DrawSolidClippedSubmodelPolygons(model_t *pmodel, mnode_t *topnode)
Definition: r_bsp.c:336
vid_gamma
cvar_t * vid_gamma
Definition: r_main.c:145
dp_time2
float dp_time2
Definition: r_main.c:112
image_s::registration_sequence
int registration_sequence
Definition: r_local.h:77
refexport_t::AppActivate
void(* AppActivate)(qboolean activate)
Definition: ref.h:185
currententity
entity_t * currententity
Definition: r_bsp.c:28
r_time1
float r_time1
Definition: r_main.c:54
oldrefdef_t::yOrigin
float yOrigin
Definition: r_local.h:136
mod_brush
@ mod_brush
Definition: r_model.h:169
r_notexture_mip
image_t * r_notexture_mip
Definition: r_main.c:110
mleaf_s
Definition: r_model.h:143
intsintable
int intsintable[4200]
Definition: r_rast.c:48
vpn
vec3_t vpn
Definition: r_main.c:73
refexport_t::EndRegistration
void(* EndRegistration)(void)
Definition: ref.h:162
r_drawentities
cvar_t * r_drawentities
Definition: r_main.c:135
R_Init
qboolean R_Init(void *hInstance, void *wndProc)
Definition: r_main.c:326
vup
vec3_t vup
Definition: r_main.c:72
refexport_t::EndFrame
void(* EndFrame)(void)
Definition: ref.h:182
SWimp_SetPalette
void SWimp_SetPalette(const unsigned char *palette)
Definition: rw_imp.c:257
j
GLint j
Definition: qgl_win.c:150
D_WarpScreen
void D_WarpScreen(void)
Definition: r_scan.c:52
Draw_GetPalette
void Draw_GetPalette(void)
Definition: r_main.c:1423
de_time2
float de_time2
Definition: r_main.c:113
r_dspeeds
cvar_t * r_dspeeds
Definition: r_main.c:136
Mod_FreeAll
void Mod_FreeAll(void)
Definition: r_model.c:1324
sw_maxedges
cvar_t * sw_maxedges
Definition: r_main.c:123
image_t
struct image_s image_t
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
R_EdgeDrawing
void R_EdgeDrawing(void)
Definition: r_main.c:888
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
r_numallocatededges
int r_numallocatededges
Definition: r_main.c:55
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:606
Draw_InitRGBMap
void Draw_InitRGBMap(void)
Definition: r_draw.c:174
r_framecount
int r_framecount
Definition: r_main.c:97
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
R_SetLightLevel
void R_SetLightLevel(void)
Definition: r_main.c:1011
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
refexport_t::DrawFadeScreen
void(* DrawFadeScreen)(void)
Definition: ref.h:172
sw_transmooth
cvar_t * sw_transmooth
Definition: r_main.c:131
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:622
Draw_Fill
#define Draw_Fill
Definition: qmenu.c:49
NUM_BEAM_SEGS
#define NUM_BEAM_SEGS
RotatedBBox
void RotatedBBox(vec3_t mins, vec3_t maxs, vec3_t angles, vec3_t tmins, vec3_t tmaxs)
Definition: r_main.c:745
Draw_FadeScreen
void Draw_FadeScreen(void)
Definition: r_draw.c:620
sw_mipcap
cvar_t * sw_mipcap
Definition: r_misc.c:26
R_DrawEntitiesOnList
void R_DrawEntitiesOnList(void)
Definition: r_main.c:548
r_speeds
cvar_t * r_speeds
Definition: r_main.c:141
D_FlushCaches
void D_FlushCaches(void)
Definition: r_surf.c:481
SWimp_EndFrame
void SWimp_EndFrame(void)
Definition: rw_imp.c:163
r_edges
edge_t * r_edges
Definition: r_edge.c:49
auxedges
edge_t * auxedges
Definition: r_edge.c:48
Draw_InitLocal
void Draw_InitLocal(void)
Definition: r_draw.c:222
numleafs
int numleafs
Definition: cmodel.c:77
it_pic
@ it_pic
Definition: r_local.h:67
MINEDGES
#define MINEDGES
Definition: r_local.h:205
entity_s::alpha
float alpha
Definition: ref.h:73
viddef_t::rowbytes
int rowbytes
Definition: r_local.h:97
vid_fullscreen
cvar_t * vid_fullscreen
Definition: r_main.c:144
r
GLdouble GLdouble r
Definition: qgl_win.c:336
dvis_t::numclusters
int numclusters
Definition: qfiles.h:465
rw_time2
float rw_time2
Definition: r_main.c:112
db_time2
float db_time2
Definition: r_main.c:112
r_maxedgesseen
int r_maxedgesseen
Definition: r_main.c:65
image_s::height
int height
Definition: r_local.h:75
viddef_t::width
unsigned width
Definition: vid.h:29
R_InitTextures
void R_InitTextures(void)
Definition: r_main.c:211
model_s::type
modtype_t type
Definition: r_model.h:177
clipplane_s::leftedge
byte leftedge
Definition: r_local.h:383
refimport_t::Cmd_AddCommand
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
Definition: ref.h:196
clipplane_s::rightedge
byte rightedge
Definition: r_local.h:384
skyrotate
float skyrotate
Definition: r_main.c:34
R_PrintTimes
void R_PrintTimes(void)
Definition: r_misc.c:131
R_InitCaches
void R_InitCaches(void)
Definition: r_surf.c:442
forward
static vec3_t forward
Definition: p_view.c:29
r_images
image_t r_images[MAX_RIMAGES]
Definition: r_image.c:25
R_GammaCorrectAndSetPalette
void R_GammaCorrectAndSetPalette(const unsigned char *palette)
Definition: r_main.c:1257
rserr_invalid_mode
@ rserr_invalid_mode
Definition: r_local.h:108
PerpendicularVector
void PerpendicularVector(vec3_t dst, const vec3_t src)
Definition: q_shared.c:152
model_s::leafs
mleaf_t * leafs
Definition: r_model.h:205
R_RotateBmodel
void R_RotateBmodel(void)
Definition: r_bsp.c:75
model_s::nodes
mnode_t * nodes
Definition: r_model.h:215
R_DrawParticles
void R_DrawParticles(void)
Definition: r_part.c:598
model_s::mins
vec3_t mins
Definition: r_model.h:185
mleaf_s::cluster
int cluster
Definition: r_model.h:154
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
se_time1
float se_time1
Definition: r_main.c:113
R_PrintAliasStats
void R_PrintAliasStats(void)
Definition: r_misc.c:175
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
viddef_t::height
unsigned height
Definition: vid.h:29
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
refexport_t
Definition: ref.h:133
AMP
#define AMP
Definition: r_local.h:239
MINSURFACES
#define MINSURFACES
Definition: r_local.h:207
r_clipflags
int r_clipflags
Definition: r_main.c:67
cvar_s::value
float value
Definition: q_shared.h:331
Draw_TileClear
void Draw_TileClear(int x, int y, int w, int h, char *name)
Definition: r_draw.c:537
base_vright
vec3_t base_vright
Definition: r_main.c:74
R_UnRegister
void R_UnRegister(void)
Definition: r_main.c:314
NUMSTACKEDGES
#define NUMSTACKEDGES
Definition: r_local.h:204
XCENTERING
#define XCENTERING
Definition: r_local.h:223
error
static int error(vorb *f, enum STBVorbisError e)
Definition: stb_vorbis.c:865
image_s::type
imagetype_t type
Definition: r_local.h:74
Mod_Init
void Mod_Init(void)
Definition: r_model.c:78
refdef_t::blend
float blend[4]
Definition: ref.h:108
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
refexport_t::DrawGetPicSize
void(* DrawGetPicSize)(int *w, int *h, char *name)
Definition: ref.h:166
NULL
#define NULL
Definition: q_shared.h:67
refexport_t::CinematicSetPalette
void(* CinematicSetPalette)(const unsigned char *palette)
Definition: ref.h:180
r_viewcluster
int r_viewcluster
Definition: r_main.c:108
SWimp_SetMode
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
Definition: rw_imp.c:189
surface_p
surf_t * surface_p
Definition: r_edge.c:51
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
se_time2
float se_time2
Definition: r_main.c:113
image_s::width
int width
Definition: r_local.h:75
R_DrawNullModel
void R_DrawNullModel(void)
Definition: r_main.c:539
thepalette
byte * thepalette
Definition: r_main.c:33
dp_time1
float dp_time1
Definition: r_main.c:112
numr_images
int numr_images
Definition: r_image.c:26
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:167
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
R_CinematicSetPalette
void R_CinematicSetPalette(const unsigned char *palette)
Definition: r_main.c:1274
image_s::name
char name[MAX_QPATH]
Definition: r_local.h:73
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:158
it_skin
@ it_skin
Definition: r_local.h:64
R_EndWorldRenderpass
void R_EndWorldRenderpass(void)
Definition: r_main.c:1249
AMP2
#define AMP2
Definition: r_local.h:240
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:197
r_dowarp
qboolean r_dowarp
Definition: r_main.c:60
name
cvar_t * name
Definition: cl_main.c:79
REF_VERSION
#define REF_VERSION
Definition: r_local.h:36
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
refexport_t::BeginRegistration
void(* BeginRegistration)(char *map)
Definition: ref.h:157
mod_sprite
@ mod_sprite
Definition: r_model.h:169
swstate_s::prev_mode
int prev_mode
Definition: r_local.h:881
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
R_RenderFrame
void R_RenderFrame(refdef_t *fd)
Definition: r_main.c:1033
model_s::maxs
vec3_t maxs
Definition: r_model.h:185
swstate_s::gammatable
byte gammatable[256]
Definition: r_local.h:883
y
GLint y
Definition: qgl_win.c:115
pfrustum_indexes
int * pfrustum_indexes[4]
Definition: r_main.c:104
sw_mode
cvar_t * sw_mode
Definition: r_main.c:125
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1239
re
refexport_t re
Definition: vid_dll.c:32
R_IMFlatShadedQuad
void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
Definition: r_poly.c:1381
R_FindTopnode
mnode_t * R_FindTopnode(vec3_t mins, vec3_t maxs)
Definition: r_main.c:702
entity_s::frame
int frame
Definition: ref.h:58
Draw_BuildGammaTable
void Draw_BuildGammaTable(void)
Definition: r_main.c:1314
refexport_t::BeginFrame
void(* BeginFrame)(float camera_separation)
Definition: ref.h:181
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
R_EdgeCodeStart
void R_EdgeCodeStart(void)
sw_stipplealpha
cvar_t * sw_stipplealpha
Definition: r_main.c:128
refexport_t::EndWorldRenderpass
void(* EndWorldRenderpass)(void)
Definition: ref.h:183
R_InitTurb
void R_InitTurb(void)
Definition: r_main.c:246
sc_base
surfcache_t * sc_base
Definition: r_local.h:813
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
sw_allow_modex
cvar_t * sw_allow_modex
Definition: r_main.c:119
refdef_t::num_entities
int num_entities
Definition: ref.h:116
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
refexport_t::SetSky
void(* SetSky)(char *name, float rotate, vec3_t axis)
Definition: ref.h:161
suf
char * suf[6]
Definition: r_main.c:1398
mnode_s::contents
int contents
Definition: r_model.h:126
up
static vec3_t up
Definition: p_view.c:29
r_warpbuffer
byte * r_warpbuffer
Definition: r_main.c:45
R_EndRegistration
void R_EndRegistration(void)
Definition: r_model.c:1282
rserr_ok
@ rserr_ok
Definition: r_local.h:105
r_lightlevel
cvar_t * r_lightlevel
Definition: r_main.c:142
Draw_GetPicSize
void Draw_GetPicSize(int *w, int *h, char *pic)
Definition: r_draw.c:321
SWimp_Init
int SWimp_Init(void *hInstance, void *wndProc)
Definition: rw_imp.c:118
view_clipplanes
clipplane_t view_clipplanes[4]
Definition: r_rast.c:38
currentmodel
model_t * currentmodel
Definition: r_main.c:39
NUMSTACKSURFACES
#define NUMSTACKSURFACES
Definition: r_local.h:206
mnode_s::plane
mplane_t * plane
Definition: r_model.h:134
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:317
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:117
r_drawworld
cvar_t * r_drawworld
Definition: r_main.c:134
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
mod_alias
@ mod_alias
Definition: r_model.h:169
model_s::numleafs
int numleafs
Definition: r_model.h:204
sw_waterwarp
cvar_t * sw_waterwarp
Definition: r_main.c:130
refexport_t::Shutdown
void(* Shutdown)(void)
Definition: ref.h:142
r_dlightframecount
int r_dlightframecount
Definition: r_light.c:24
refexport_t::DrawStretchPic
void(* DrawStretchPic)(int x, int y, int w, int h, char *name)
Definition: ref.h:168
Draw_Pic
void Draw_Pic(int x, int y, char *name)
Definition: r_draw.c:438
R_ImageList_f
void R_ImageList_f(void)
Definition: r_image.c:34
sw_aliasstats
cvar_t * sw_aliasstats
Definition: r_main.c:118
R_AliasDrawModel
void R_AliasDrawModel(void)
Definition: r_alias.c:1068
R_TransformFrustum
void R_TransformFrustum(void)
Definition: r_misc.c:187
mplane_s
Definition: r_model.h:57
model_s::numnodes
int numnodes
Definition: r_model.h:213
refexport_t::api_version
int api_version
Definition: ref.h:136
R_EdgeCodeEnd
void R_EdgeCodeEnd(void)
sw_maxsurfs
cvar_t * sw_maxsurfs
Definition: r_main.c:124
refexport_t::DrawTileClear
void(* DrawTileClear)(int x, int y, int w, int h, char *name)
Definition: ref.h:170
ri
refimport_t ri
Definition: r_main.c:25
refexport_t::DrawChar
void(* DrawChar)(int x, int y, int c)
Definition: ref.h:169
R_PrintDSpeeds
void R_PrintDSpeeds(void)
Definition: r_misc.c:151
clipplane_s::dist
float dist
Definition: r_local.h:381
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: r_poly.c:1342
Draw_FindPic
image_t * Draw_FindPic(char *name)
Definition: r_draw.c:37
rw_time1
float rw_time1
Definition: r_main.c:112
R_ScanEdges
void R_ScanEdges(void)
Definition: r_edge.c:635
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
R_DrawBEntitiesOnList
void R_DrawBEntitiesOnList(void)
Definition: r_main.c:803
right
GLdouble right
Definition: qgl_win.c:159
r_lightsaturation
cvar_t * r_lightsaturation
Definition: r_main.c:155
R_DrawSubmodelPolygons
void R_DrawSubmodelPolygons(model_t *pmodel, int clipflags, mnode_t *topnode)
Definition: r_bsp.c:415
refimport_t::Cvar_SetValue
void(* Cvar_SetValue)(char *name, float value)
Definition: ref.h:218
image_s
Definition: r_local.h:71
sw_state
swstate_t sw_state
Definition: r_main.c:49
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:107
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
refdef_t::entities
entity_t * entities
Definition: ref.h:117
r_entorigin
vec3_t r_entorigin
Definition: r_bsp.c:31
R_MarkLeaves
void R_MarkLeaves(void)
Definition: r_main.c:467
cplane_s
Definition: q_shared.h:413
YCENTERING
#define YCENTERING
Definition: r_local.h:224
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:95
Draw_StretchPic
void Draw_StretchPic(int x, int y, int w, int h, char *name)
Definition: r_draw.c:405
refexport_t::Init
qboolean(* Init)(void *hinstance, void *wndproc)
Definition: ref.h:139
model_s::vertexes
mvertex_t * vertexes
Definition: r_model.h:208
STRINGER
#define STRINGER(x)
Definition: r_main.c:158
swstate_s::currentpalette
byte currentpalette[1024]
Definition: r_local.h:884
r_outofsurfaces
int r_outofsurfaces
Definition: r_main.c:57
Mod_Modellist_f
void Mod_Modellist_f(void)
Definition: r_model.c:55
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:96
R_BeginFrame
void R_BeginFrame(float camera_separation)
Definition: r_main.c:1177
R_RenderWorld
void R_RenderWorld(void)
Definition: r_bsp.c:616
Mod_ClusterPVS
byte * Mod_ClusterPVS(int cluster, model_t *model)
Definition: r_model.c:268
rserr_invalid_fullscreen
@ rserr_invalid_fullscreen
Definition: r_local.h:107
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
R_RegisterSkin
struct image_s * R_RegisterSkin(char *name)
Definition: r_image.c:550
r_warpwidth
int r_warpwidth
Definition: r_main.c:46
R_SetupFrame
void R_SetupFrame(void)
Definition: r_misc.c:426
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
surf_s
Definition: r_local.h:428
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:164
surfaces
surf_t * surfaces
Definition: r_edge.c:51
r_outofedges
int r_outofedges
Definition: r_main.c:58
entity_s::angles
float angles[3]
Definition: ref.h:52
LoadPCX
void LoadPCX(char *filename, byte **pic, byte **palette, int *width, int *height)
Definition: r_image.c:87
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:137
RotatePointAroundVector
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Definition: q_shared.c:32
blanktable
int blanktable[4200]
Definition: r_rast.c:49
base_vup
vec3_t base_vup
Definition: r_main.c:72
R_Shutdown
void R_Shutdown(void)
Definition: r_main.c:375
da_time2
float da_time2
Definition: r_main.c:112
edge_s
Definition: r_local.h:450
r_customwidth
cvar_t * r_customwidth
Definition: r_main.c:151
it_sky
@ it_sky
Definition: r_local.h:68