icculus quake2 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)
 
int 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_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]
 
entity_t r_worldentity
 
char skyname [MAX_QPATH]
 
float skyrotate
 
vec3_t skyaxis
 
image_tsky_images [6]
 
refdef_t r_newrefdef
 
model_tcurrentmodel
 
model_tr_worldmodel
 
byte r_warpbuffer [WARP_WIDTH *WARP_HEIGHT]
 
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_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
 
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 143 of file r_main.c.

Function Documentation

◆ Com_Printf()

void Com_Printf ( char *  fmt,
  ... 
)

Definition at line 1423 of file r_main.c.

1424 {
1425  va_list argptr;
1426  char text[1024];
1427 
1428  va_start (argptr, fmt);
1429  vsprintf (text, fmt, argptr);
1430  va_end (argptr);
1431 
1432  ri.Con_Printf (PRINT_ALL, "%s", text);
1433 }

◆ Draw_BuildGammaTable()

void Draw_BuildGammaTable ( void  )

Definition at line 1217 of file r_main.c.

1218 {
1219  int i, inf;
1220  float g;
1221 
1222  g = vid_gamma->value;
1223 
1224  if (g == 1.0)
1225  {
1226  for (i=0 ; i<256 ; i++)
1227  sw_state.gammatable[i] = i;
1228  return;
1229  }
1230 
1231  for (i=0 ; i<256 ; i++)
1232  {
1233  inf = 255 * pow ( (i+0.5)/255.5 , g ) + 0.5;
1234  if (inf < 0)
1235  inf = 0;
1236  if (inf > 255)
1237  inf = 255;
1238  sw_state.gammatable[i] = inf;
1239  }
1240 }

Referenced by R_BeginFrame().

◆ Draw_GetPalette()

void Draw_GetPalette ( void  )

Definition at line 1326 of file r_main.c.

1327 {
1328  byte *pal, *out;
1329  int i;
1330  int r, g, b;
1331 
1332  // get the palette and colormap
1333  LoadPCX ("pics/colormap.pcx", &vid.colormap, &pal, NULL, NULL);
1334  if (!vid.colormap)
1335  ri.Sys_Error (ERR_FATAL, "Couldn't load pics/colormap.pcx");
1336  vid.alphamap = vid.colormap + 64*256;
1337 
1338  out = (byte *)d_8to24table;
1339  for (i=0 ; i<256 ; i++, out+=4)
1340  {
1341  r = pal[i*3+0];
1342  g = pal[i*3+1];
1343  b = pal[i*3+2];
1344 
1345  out[0] = r;
1346  out[1] = g;
1347  out[2] = b;
1348  }
1349 
1350  free (pal);
1351 }

Referenced by R_Init().

◆ GetRefAPI()

refexport_t GetRefAPI ( refimport_t  rimp)

Definition at line 1361 of file r_main.c.

1362 {
1363  refexport_t re;
1364 
1365  ri = rimp;
1366 
1368 
1373  re.SetSky = R_SetSky;
1375 
1377 
1379 
1380 
1381 #ifdef QMAX
1382  re.DrawScaledPic = Draw_ScaledPic;
1383  re.AddStain = R_AddStain;
1384 #endif
1385 
1386  re.DrawPic = Draw_Pic;
1388  re.DrawChar = Draw_Char;
1390  re.DrawFill = Draw_Fill;
1392 
1394 
1395  re.Init = R_Init;
1397 
1401 
1403 
1404  Swap_Init ();
1405 
1406  return re;
1407 }

Referenced by VID_LoadRefresh().

◆ R_BeginFrame()

void R_BeginFrame ( float  camera_separation)

Definition at line 1099 of file r_main.c.

1100 {
1101  extern void Draw_BuildGammaTable( void );
1102 #ifdef REDBLUE
1103  SetStereoBuffer((camera_separation <= 0.0) ? 0 : 1);
1104 #endif
1105  /*
1106  ** rebuild the gamma correction palette if necessary
1107  */
1108  if ( vid_gamma->modified )
1109  {
1111  R_GammaCorrectAndSetPalette( ( const unsigned char * ) d_8to24table );
1112 
1113  vid_gamma->modified = false;
1114  }
1115 
1116  while ( sw_mode->modified || vid_fullscreen->modified )
1117  {
1118  rserr_t err;
1119 
1120  /*
1121  ** if this returns rserr_invalid_fullscreen then it set the mode but not as a
1122  ** fullscreen mode, e.g. 320x200 on a system that doesn't support that res
1123  */
1124  if ( ( err = SWimp_SetMode( &vid.width, &vid.height, sw_mode->value, vid_fullscreen->value ) ) == rserr_ok )
1125  {
1127 
1129  vid_fullscreen->modified = false;
1130  sw_mode->modified = false;
1131  }
1132  else
1133  {
1134  if ( err == rserr_invalid_mode )
1135  {
1136  ri.Cvar_SetValue( "sw_mode", sw_state.prev_mode );
1137  ri.Con_Printf( PRINT_ALL, "ref_soft::R_BeginFrame() - could not set mode\n" );
1138  }
1139  else if ( err == rserr_invalid_fullscreen )
1140  {
1142 
1143  ri.Cvar_SetValue( "vid_fullscreen", 0);
1144  ri.Con_Printf( PRINT_ALL, "ref_soft::R_BeginFrame() - fullscreen unavailable in this mode\n" );
1146 // vid_fullscreen->modified = false;
1147 // sw_mode->modified = false;
1148  }
1149  else
1150  {
1151  ri.Sys_Error( ERR_FATAL, "ref_soft::R_BeginFrame() - catastrophic mode change failure\n" );
1152  }
1153  }
1154  }
1155 }

Referenced by GetRefAPI(), and R_Init().

◆ R_BmodelCheckBBox()

int R_BmodelCheckBBox ( float *  minmaxs)

Definition at line 619 of file r_main.c.

620 {
621  int i, *pindex, clipflags;
622  vec3_t acceptpt, rejectpt;
623  float d;
624 
625  clipflags = 0;
626 
627  for (i=0 ; i<4 ; i++)
628  {
629  // generate accept and reject points
630  // FIXME: do with fast look-ups or integer tests based on the sign bit
631  // of the floating point values
632 
633  pindex = pfrustum_indexes[i];
634 
635  rejectpt[0] = minmaxs[pindex[0]];
636  rejectpt[1] = minmaxs[pindex[1]];
637  rejectpt[2] = minmaxs[pindex[2]];
638 
639  d = DotProduct (rejectpt, view_clipplanes[i].normal);
640  d -= view_clipplanes[i].dist;
641 
642  if (d <= 0)
643  return BMODEL_FULLY_CLIPPED;
644 
645  acceptpt[0] = minmaxs[pindex[3+0]];
646  acceptpt[1] = minmaxs[pindex[3+1]];
647  acceptpt[2] = minmaxs[pindex[3+2]];
648 
649  d = DotProduct (acceptpt, view_clipplanes[i].normal);
650  d -= view_clipplanes[i].dist;
651 
652  if (d <= 0)
653  clipflags |= (1<<i);
654  }
655 
656  return clipflags;
657 }

Referenced by R_DrawBEntitiesOnList().

◆ R_CalcPalette()

void R_CalcPalette ( void  )

Definition at line 919 of file r_main.c.

920 {
921  static qboolean modified;
922  byte palette[256][4], *in, *out;
923  int i, j;
924  float alpha, one_minus_alpha;
925  vec3_t premult;
926  int v;
927 
928  alpha = r_newrefdef.blend[3];
929  if (alpha <= 0)
930  {
931  if (modified)
932  { // set back to default
933  modified = false;
934  R_GammaCorrectAndSetPalette( ( const unsigned char * ) d_8to24table );
935  return;
936  }
937  return;
938  }
939 
940  modified = true;
941  if (alpha > 1)
942  alpha = 1;
943 
944  premult[0] = r_newrefdef.blend[0]*alpha*255;
945  premult[1] = r_newrefdef.blend[1]*alpha*255;
946  premult[2] = r_newrefdef.blend[2]*alpha*255;
947 
948  one_minus_alpha = (1.0 - alpha);
949 
950  in = (byte *)d_8to24table;
951  out = palette[0];
952  for (i=0 ; i<256 ; i++, in+=4, out+=4)
953  {
954  for (j=0 ; j<3 ; j++)
955  {
956  v = premult[j] + one_minus_alpha * in[j];
957  if (v > 255)
958  v = 255;
959  out[j] = v;
960  }
961  out[3] = 255;
962  }
963 
964  R_GammaCorrectAndSetPalette( ( const unsigned char * ) palette[0] );
965 // SWimp_SetPalette( palette[0] );
966 }

Referenced by R_RenderFrame().

◆ R_CinematicSetPalette()

void R_CinematicSetPalette ( const unsigned char *  palette)

Definition at line 1177 of file r_main.c.

1178 {
1179  byte palette32[1024];
1180  int i, j, w;
1181  int *d;
1182 
1183  // clear screen to black to avoid any palette flash
1184  w = abs(vid.rowbytes)>>2; // stupid negative pitch win32 stuff...
1185  for (i=0 ; i<vid.height ; i++, d+=w)
1186  {
1187  d = (int *)(vid.buffer + i*vid.rowbytes);
1188  for (j=0 ; j<w ; j++)
1189  d[j] = 0;
1190  }
1191  // flush it to the screen
1192  SWimp_EndFrame ();
1193 
1194  if ( palette )
1195  {
1196  for ( i = 0; i < 256; i++ )
1197  {
1198  palette32[i*4+0] = palette[i*3+0];
1199  palette32[i*4+1] = palette[i*3+1];
1200  palette32[i*4+2] = palette[i*3+2];
1201  palette32[i*4+3] = 0xFF;
1202  }
1203 
1204  R_GammaCorrectAndSetPalette( palette32 );
1205  }
1206  else
1207  {
1208  R_GammaCorrectAndSetPalette( ( const unsigned char * ) d_8to24table );
1209  }
1210 }

Referenced by GetRefAPI().

◆ R_DrawBeam()

void R_DrawBeam ( entity_t e)

Definition at line 1245 of file r_main.c.

1246 {
1247 #define NUM_BEAM_SEGS 6
1248 
1249  int i;
1250 
1251  vec3_t perpvec;
1252  vec3_t direction, normalized_direction;
1253  vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
1254  vec3_t oldorigin, origin;
1255 
1256  oldorigin[0] = e->oldorigin[0];
1257  oldorigin[1] = e->oldorigin[1];
1258  oldorigin[2] = e->oldorigin[2];
1259 
1260  origin[0] = e->origin[0];
1261  origin[1] = e->origin[1];
1262  origin[2] = e->origin[2];
1263 
1264  normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1265  normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1266  normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1267 
1268  if ( VectorNormalize( normalized_direction ) == 0 )
1269  return;
1270 
1271  PerpendicularVector( perpvec, normalized_direction );
1272  VectorScale( perpvec, e->frame / 2, perpvec );
1273 
1274  for ( i = 0; i < NUM_BEAM_SEGS; i++ )
1275  {
1276  RotatePointAroundVector( start_points[i], normalized_direction, perpvec, (360.0/NUM_BEAM_SEGS)*i );
1277  VectorAdd( start_points[i], origin, start_points[i] );
1278  VectorAdd( start_points[i], direction, end_points[i] );
1279  }
1280 
1281  for ( i = 0; i < NUM_BEAM_SEGS; i++ )
1282  {
1283  R_IMFlatShadedQuad( start_points[i],
1284  end_points[i],
1285  end_points[(i+1)%NUM_BEAM_SEGS],
1286  start_points[(i+1)%NUM_BEAM_SEGS],
1287  e->skinnum & 0xFF,
1288  e->alpha );
1289  }
1290 }

Referenced by R_DrawEntitiesOnList().

◆ R_DrawBEntitiesOnList()

void R_DrawBEntitiesOnList ( void  )

Definition at line 768 of file r_main.c.

769 {
770  int i, clipflags;
771  vec3_t oldorigin;
772  vec3_t mins, maxs;
773  float minmaxs[6];
774  mnode_t *topnode;
775 
776  if (!r_drawentities->value)
777  return;
778 
779  VectorCopy (modelorg, oldorigin);
780  insubmodel = true;
782 
783  for (i=0 ; i<r_newrefdef.num_entities ; i++)
784  {
787  if (!currentmodel)
788  continue;
789  if (currentmodel->nummodelsurfaces == 0)
790  continue; // clip brush only
791  if ( currententity->flags & RF_BEAM )
792  continue;
793  if (currentmodel->type != mod_brush)
794  continue;
795  // see if the bounding box lets us trivially reject, also sets
796  // trivial accept status
798  currententity->angles, mins, maxs);
799  VectorAdd (mins, currententity->origin, minmaxs);
800  VectorAdd (maxs, currententity->origin, (minmaxs+3));
801 
802  clipflags = R_BmodelCheckBBox (minmaxs);
803  if (clipflags == BMODEL_FULLY_CLIPPED)
804  continue; // off the edge of the screen
805 
806  topnode = R_FindTopnode (minmaxs, minmaxs+3);
807  if (!topnode)
808  continue; // no part in a visible leaf
809 
812 
814 
815  // FIXME: stop transforming twice
816  R_RotateBmodel ();
817 
818  // calculate dynamic lighting for bmodel
820 
821  if (topnode->contents == CONTENTS_NODE)
822  {
823  // not a leaf; has to be clipped to the world BSP
824  r_clipflags = clipflags;
826  }
827  else
828  {
829  // falls entirely in one leaf, so we just put all the
830  // edges in the edge list and let 1/z sorting handle
831  // drawing order
832  R_DrawSubmodelPolygons (currentmodel, clipflags, topnode);
833  }
834 
835  // put back world rotation and frustum clipping
836  // FIXME: R_RotateBmodel should just work off base_vxx
840  VectorCopy (oldorigin, modelorg);
842  }
843 
844  insubmodel = false;
845 }

Referenced by R_EdgeDrawing().

◆ R_DrawEntitiesOnList()

void R_DrawEntitiesOnList ( void  )

Definition at line 513 of file r_main.c.

514 {
515  int i;
516  qboolean translucent_entities = false;
517 
518  if (!r_drawentities->value)
519  return;
520 
521  // all bmodels have already been drawn by the edge list
522  for (i=0 ; i<r_newrefdef.num_entities ; i++)
523  {
525 
527  {
528  translucent_entities = true;
529  continue;
530  }
531 
532  if ( currententity->flags & RF_BEAM )
533  {
534  modelorg[0] = -r_origin[0];
535  modelorg[1] = -r_origin[1];
536  modelorg[2] = -r_origin[2];
539  }
540  else
541  {
543  if (!currentmodel)
544  {
545  R_DrawNullModel();
546  continue;
547  }
550 
551  switch (currentmodel->type)
552  {
553  case mod_sprite:
554  R_DrawSprite ();
555  break;
556 
557  case mod_alias:
558  R_AliasDrawModel ();
559  break;
560 
561  default:
562  break;
563  }
564  }
565  }
566 
567  if ( !translucent_entities )
568  return;
569 
570  for (i=0 ; i<r_newrefdef.num_entities ; i++)
571  {
573 
574  if ( !( currententity->flags & RF_TRANSLUCENT ) )
575  continue;
576 
577  if ( currententity->flags & RF_BEAM )
578  {
579  modelorg[0] = -r_origin[0];
580  modelorg[1] = -r_origin[1];
581  modelorg[2] = -r_origin[2];
584  }
585  else
586  {
588  if (!currentmodel)
589  {
590  R_DrawNullModel();
591  continue;
592  }
595 
596  switch (currentmodel->type)
597  {
598  case mod_sprite:
599  R_DrawSprite ();
600  break;
601 
602  case mod_alias:
603  R_AliasDrawModel ();
604  break;
605 
606  default:
607  break;
608  }
609  }
610  }
611 }

Referenced by R_RenderFrame().

◆ R_DrawNullModel()

void R_DrawNullModel ( void  )

Definition at line 504 of file r_main.c.

505 {
506 }

Referenced by R_DrawEntitiesOnList().

◆ R_EdgeDrawing()

void R_EdgeDrawing ( void  )

Definition at line 853 of file r_main.c.

854 {
855  edge_t ledges[NUMSTACKEDGES +
856  ((CACHE_SIZE - 1) / sizeof(edge_t)) + 1];
857  surf_t lsurfs[NUMSTACKSURFACES +
858  ((CACHE_SIZE - 1) / sizeof(surf_t)) + 1];
859 
861  return;
862 
863  if (auxedges)
864  {
865  r_edges = auxedges;
866  }
867  else
868  {
869  r_edges = (edge_t *)
870  (((long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
871  }
872 
873  if (r_surfsonstack)
874  {
875  surfaces = (surf_t *)
876  (((long)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
878  // surface 0 doesn't really exist; it's just a dummy because index 0
879  // is used to indicate no edge attached to surface
880  surfaces--;
881  R_SurfacePatch ();
882  }
883 
884  R_BeginEdgeFrame ();
885 
886  if (r_dspeeds->value)
887  {
889  }
890 
891  R_RenderWorld ();
892 
893  if (r_dspeeds->value)
894  {
896  db_time1 = rw_time2;
897  }
898 
900 
901  if (r_dspeeds->value)
902  {
904  se_time1 = db_time2;
905  }
906 
907  R_ScanEdges ();
908 }

Referenced by R_RenderFrame().

◆ R_FindTopnode()

mnode_t* R_FindTopnode ( vec3_t  mins,
vec3_t  maxs 
)

Definition at line 667 of file r_main.c.

668 {
669  mplane_t *splitplane;
670  int sides;
671  mnode_t *node;
672 
673  node = r_worldmodel->nodes;
674 
675  while (1)
676  {
677  if (node->visframe != r_visframecount)
678  return NULL; // not visible at all
679 
680  if (node->contents != CONTENTS_NODE)
681  {
682  if (node->contents != CONTENTS_SOLID)
683  return node; // we've reached a non-solid leaf, so it's
684  // visible and not BSP clipped
685  return NULL; // in solid, so not visible
686  }
687 
688  splitplane = node->plane;
689  sides = BOX_ON_PLANE_SIDE(mins, maxs, (cplane_t *)splitplane);
690 
691  if (sides == 3)
692  return node; // this is the splitter
693 
694  // not split yet; recurse down the contacted side
695  if (sides & 1)
696  node = node->children[0];
697  else
698  node = node->children[1];
699  }
700 }

Referenced by R_DrawBEntitiesOnList().

◆ R_GammaCorrectAndSetPalette()

void R_GammaCorrectAndSetPalette ( const unsigned char *  palette)

Definition at line 1160 of file r_main.c.

1161 {
1162  int i;
1163 
1164  for ( i = 0; i < 256; i++ )
1165  {
1166  sw_state.currentpalette[i*4+0] = sw_state.gammatable[palette[i*4+0]];
1167  sw_state.currentpalette[i*4+1] = sw_state.gammatable[palette[i*4+1]];
1168  sw_state.currentpalette[i*4+2] = sw_state.gammatable[palette[i*4+2]];
1169  }
1170 
1172 }

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()

int R_Init ( void hInstance,
void wndProc 
)

Definition at line 300 of file r_main.c.

301 {
302  R_InitImages ();
303  Mod_Init ();
304  Draw_InitLocal ();
305  R_InitTextures ();
306 
307  R_InitTurb ();
308 
309  view_clipplanes[0].leftedge = true;
310  view_clipplanes[1].rightedge = true;
312  view_clipplanes[3].leftedge = false;
314  view_clipplanes[3].rightedge = false;
315 
318 
319 // TODO: collect 386-specific code in one place
320 #if id386
322  (long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
323  Sys_SetFPCW (); // get bit masks for FPCW (FIXME: is this id386?)
324 #endif // id386
325 
326  r_aliasuvscale = 1.0;
327 
328  R_Register ();
329  Draw_GetPalette ();
330  if (SWimp_Init( hInstance, wndProc ) == false)
331  return -1;
332 
333  // create the window
334  R_BeginFrame( 0 );
335 
336  ri.Con_Printf (PRINT_ALL, "ref_soft version: "REF_VERSION"\n");
337 
338  return true;
339 }

Referenced by GetRefAPI().

◆ R_InitGraphics()

void R_InitGraphics ( int  width,
int  height 
)

Definition at line 1066 of file r_main.c.

1067 {
1068  vid.width = width;
1069  vid.height = height;
1070 
1071  // free z buffer
1072  if ( d_pzbuffer )
1073  {
1074  free( d_pzbuffer );
1075  d_pzbuffer = NULL;
1076  }
1077 
1078  // free surface cache
1079  if ( sc_base )
1080  {
1081  D_FlushCaches ();
1082  free( sc_base );
1083  sc_base = NULL;
1084  }
1085 
1086  d_pzbuffer = malloc(vid.width*vid.height*2);
1087 
1088  R_InitCaches ();
1089 
1090  R_GammaCorrectAndSetPalette( ( const unsigned char *) d_8to24table );
1091 }

Referenced by R_BeginFrame().

◆ R_InitTextures()

void R_InitTextures ( void  )

Definition at line 196 of file r_main.c.

197 {
198  int x,y, m;
199  byte *dest;
200 
201 // create a simple checkerboard texture for the default
203 
206  r_notexture_mip->pixels[1] = r_notexture_mip->pixels[0] + 16*16;
209 
210  for (m=0 ; m<4 ; m++)
211  {
212  dest = r_notexture_mip->pixels[m];
213  for (y=0 ; y< (16>>m) ; y++)
214  for (x=0 ; x< (16>>m) ; x++)
215  {
216  if ( (y< (8>>m) ) ^ (x< (8>>m) ) )
217 
218  *dest++ = 0;
219  else
220  *dest++ = 0xff;
221  }
222  }
223 }

Referenced by R_Init().

◆ R_InitTurb()

void R_InitTurb ( void  )

Definition at line 231 of file r_main.c.

232 {
233  int i;
234 
235  for (i=0 ; i<1280 ; i++)
236  {
237  sintable[i] = AMP + sin(i*3.14159*2/CYCLE)*AMP;
238  intsintable[i] = AMP2 + sin(i*3.14159*2/CYCLE)*AMP2; // AMP2, not 20
239  blanktable[i] = 0; //PGM
240  }
241 }

Referenced by R_Init().

◆ R_MarkLeaves()

void R_MarkLeaves ( void  )

Definition at line 432 of file r_main.c.

433 {
434  byte *vis;
435  mnode_t *node;
436  int i;
437  mleaf_t *leaf;
438  int cluster;
439 
441  return;
442 
443  // development aid to let you run around and see exactly where
444  // the pvs ends
445  if (sw_lockpvs->value)
446  return;
447 
448  r_visframecount++;
450 
451  if (r_novis->value || r_viewcluster == -1 || !r_worldmodel->vis)
452  {
453  // mark everything
454  for (i=0 ; i<r_worldmodel->numleafs ; i++)
456  for (i=0 ; i<r_worldmodel->numnodes ; i++)
458  return;
459  }
460 
462 
463  for (i=0,leaf=r_worldmodel->leafs ; i<r_worldmodel->numleafs ; i++, leaf++)
464  {
465  cluster = leaf->cluster;
466  if (cluster == -1)
467  continue;
468  if (vis[cluster>>3] & (1<<(cluster&7)))
469  {
470  node = (mnode_t *)leaf;
471  do
472  {
473  if (node->visframe == r_visframecount)
474  break;
475  node->visframe = r_visframecount;
476  node = node->parent;
477  } while (node);
478  }
479  }
480 
481 #if 0
482  for (i=0 ; i<r_worldmodel->vis->numclusters ; i++)
483  {
484  if (vis[i>>3] & (1<<(i&7)))
485  {
486  node = (mnode_t *)&r_worldmodel->leafs[i]; // FIXME: cluster
487  do
488  {
489  if (node->visframe == r_visframecount)
490  break;
491  node->visframe = r_visframecount;
492  node = node->parent;
493  } while (node);
494  }
495  }
496 #endif
497 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_NewMap()

void R_NewMap ( void  )

Definition at line 380 of file r_main.c.

381 {
382  r_viewcluster = -1;
383 
385 
386  if (r_cnumsurfs <= MINSURFACES)
388 
390  {
391  surfaces = malloc (r_cnumsurfs * sizeof(surf_t));
394  r_surfsonstack = false;
395  // surface 0 doesn't really exist; it's just a dummy because index 0
396  // is used to indicate no edge attached to surface
397  surfaces--;
398  R_SurfacePatch ();
399  }
400  else
401  {
402  r_surfsonstack = true;
403  }
404 
405  r_maxedgesseen = 0;
406  r_maxsurfsseen = 0;
407 
409 
412 
414  {
415  auxedges = NULL;
416  }
417  else
418  {
419  auxedges = malloc (r_numallocatededges * sizeof(edge_t));
420  }
421 }

Referenced by R_BeginRegistration().

◆ R_Register()

void R_Register ( void  )

Definition at line 245 of file r_main.c.

246 {
247  sw_aliasstats = ri.Cvar_Get ("sw_polymodelstats", "0", 0);
248  sw_allow_modex = ri.Cvar_Get( "sw_allow_modex", "1", CVAR_ARCHIVE );
249  sw_clearcolor = ri.Cvar_Get ("sw_clearcolor", "2", 0);
250  sw_drawflat = ri.Cvar_Get ("sw_drawflat", "0", 0);
251  sw_draworder = ri.Cvar_Get ("sw_draworder", "0", 0);
252  sw_maxedges = ri.Cvar_Get ("sw_maxedges", STRINGER(MAXSTACKSURFACES), 0);
253  sw_maxsurfs = ri.Cvar_Get ("sw_maxsurfs", "0", 0);
254  sw_mipcap = ri.Cvar_Get ("sw_mipcap", "0", 0);
255  sw_mipscale = ri.Cvar_Get ("sw_mipscale", "1", 0);
256  sw_reportedgeout = ri.Cvar_Get ("sw_reportedgeout", "0", 0);
257  sw_reportsurfout = ri.Cvar_Get ("sw_reportsurfout", "0", 0);
258  sw_stipplealpha = ri.Cvar_Get( "sw_stipplealpha", "0", CVAR_ARCHIVE );
259  sw_surfcacheoverride = ri.Cvar_Get ("sw_surfcacheoverride", "0", 0);
260  sw_waterwarp = ri.Cvar_Get ("sw_waterwarp", "1", 0);
261  sw_mode = ri.Cvar_Get( "sw_mode", "0", CVAR_ARCHIVE );
262 
263  r_lefthand = ri.Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );
264  r_speeds = ri.Cvar_Get ("r_speeds", "0", 0);
265  r_fullbright = ri.Cvar_Get ("r_fullbright", "0", 0);
266  r_drawentities = ri.Cvar_Get ("r_drawentities", "1", 0);
267  r_drawworld = ri.Cvar_Get ("r_drawworld", "1", 0);
268  r_dspeeds = ri.Cvar_Get ("r_dspeeds", "0", 0);
269  r_lightlevel = ri.Cvar_Get ("r_lightlevel", "0", 0);
270  r_lerpmodels = ri.Cvar_Get( "r_lerpmodels", "1", 0 );
271  r_novis = ri.Cvar_Get( "r_novis", "0", 0 );
272 
273  vid_fullscreen = ri.Cvar_Get( "vid_fullscreen", "0", CVAR_ARCHIVE );
274  vid_gamma = ri.Cvar_Get( "vid_gamma", "1.0", CVAR_ARCHIVE );
275 
276  ri.Cmd_AddCommand ("modellist", Mod_Modellist_f);
277  ri.Cmd_AddCommand( "screenshot", R_ScreenShot_f );
278  ri.Cmd_AddCommand( "imagelist", R_ImageList_f );
279 
280  sw_mode->modified = true; // force us to do mode specific stuff later
281  vid_gamma->modified = true; // force us to rebuild the gamma table later
282 
283 //PGM
284  sw_lockpvs = ri.Cvar_Get ("sw_lockpvs", "0", 0);
285 //PGM
286 }

Referenced by R_Init().

◆ R_RegisterSkin()

struct image_s* R_RegisterSkin ( char *  name)

Definition at line 564 of file r_image.c.

565 {
566  return R_FindImage (name, it_skin);
567 }

Referenced by GetRefAPI().

◆ R_RenderFrame()

void R_RenderFrame ( refdef_t fd)

Definition at line 992 of file r_main.c.

993 {
994  r_newrefdef = *fd;
995 
997  ri.Sys_Error (ERR_FATAL,"R_RenderView: NULL worldmodel");
998 
1001 
1002  if (r_speeds->value || r_dspeeds->value)
1004 
1005  R_SetupFrame ();
1006 
1007  R_MarkLeaves (); // done here so we know if we're in water
1008 
1010 
1011  R_EdgeDrawing ();
1012 
1013  if (r_dspeeds->value)
1014  {
1016  de_time1 = se_time2;
1017  }
1018 
1020 
1021  if (r_dspeeds->value)
1022  {
1025  }
1026 
1027  R_DrawParticles ();
1028 
1029  if (r_dspeeds->value)
1031 
1033 
1034  R_SetLightLevel ();
1035 
1036  if (r_dowarp)
1037  D_WarpScreen ();
1038 
1039  if (r_dspeeds->value)
1041 
1042  if (r_dspeeds->value)
1044 
1045  R_CalcPalette ();
1046 
1047  if (sw_aliasstats->value)
1048  R_PrintAliasStats ();
1049 
1050  if (r_speeds->value)
1051  R_PrintTimes ();
1052 
1053  if (r_dspeeds->value)
1054  R_PrintDSpeeds ();
1055 
1057  ri.Con_Printf (PRINT_ALL,"Short %d surfaces\n", r_outofsurfaces);
1058 
1060  ri.Con_Printf (PRINT_ALL,"Short roughly %d edges\n", r_outofedges * 2 / 3);
1061 }

Referenced by GetRefAPI().

◆ R_SetLightLevel()

void R_SetLightLevel ( void  )

Definition at line 970 of file r_main.c.

971 {
972  vec3_t light;
973 
975  {
976  r_lightlevel->value = 150.0;
977  return;
978  }
979 
980  // save off light value for server to look at (BIG HACK!)
982  r_lightlevel->value = 150.0 * light[0];
983 }

Referenced by R_RenderFrame().

◆ R_SetSky()

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

Definition at line 1304 of file r_main.c.

1305 {
1306  int i;
1307  char pathname[MAX_QPATH];
1308 
1309  strncpy (skyname, name, sizeof(skyname)-1);
1310  skyrotate = rotate;
1311  VectorCopy (axis, skyaxis);
1312 
1313  for (i=0 ; i<6 ; i++)
1314  {
1315  Com_sprintf (pathname, sizeof(pathname), "env/%s%s.pcx", skyname, suf[r_skysideimage[i]]);
1316  r_skytexinfo[i].image = R_FindImage (pathname, it_sky);
1317  }
1318 }

Referenced by GetRefAPI().

◆ R_Shutdown()

void R_Shutdown ( void  )

Definition at line 346 of file r_main.c.

347 {
348  // free z buffer
349  if (d_pzbuffer)
350  {
351  free (d_pzbuffer);
352  d_pzbuffer = NULL;
353  }
354  // free surface cache
355  if (sc_base)
356  {
357  D_FlushCaches ();
358  free (sc_base);
359  sc_base = NULL;
360  }
361 
362  // free colormap
363  if (vid.colormap)
364  {
365  free (vid.colormap);
366  vid.colormap = NULL;
367  }
368  R_UnRegister ();
369  Mod_FreeAll ();
370  R_ShutdownImages ();
371 
372  SWimp_Shutdown();
373 }

Referenced by GetRefAPI().

◆ R_UnRegister()

void R_UnRegister ( void  )

Definition at line 288 of file r_main.c.

289 {
290  ri.Cmd_RemoveCommand( "screenshot" );
291  ri.Cmd_RemoveCommand ("modellist");
292  ri.Cmd_RemoveCommand( "imagelist" );
293 }

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 710 of file r_main.c.

711 {
712  vec3_t tmp, v;
713  int i, j;
715 
716  if (!angles[0] && !angles[1] && !angles[2])
717  {
718  VectorCopy (mins, tmins);
719  VectorCopy (maxs, tmaxs);
720  return;
721  }
722 
723  for (i=0 ; i<3 ; i++)
724  {
725  tmins[i] = 99999;
726  tmaxs[i] = -99999;
727  }
728 
729  AngleVectors (angles, forward, right, up);
730 
731  for ( i = 0; i < 8; i++ )
732  {
733  if ( i & 1 )
734  tmp[0] = mins[0];
735  else
736  tmp[0] = maxs[0];
737 
738  if ( i & 2 )
739  tmp[1] = mins[1];
740  else
741  tmp[1] = maxs[1];
742 
743  if ( i & 4 )
744  tmp[2] = mins[2];
745  else
746  tmp[2] = maxs[2];
747 
748 
749  VectorScale (forward, tmp[0], v);
750  VectorMA (v, -tmp[1], right, v);
751  VectorMA (v, tmp[2], up, v);
752 
753  for (j=0 ; j<3 ; j++)
754  {
755  if (v[j] < tmins[j])
756  tmins[j] = v[j];
757  if (v[j] > tmaxs[j])
758  tmaxs[j] = v[j];
759  }
760  }
761 }

Referenced by R_DrawBEntitiesOnList().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 1411 of file r_main.c.

1412 {
1413  va_list argptr;
1414  char text[1024];
1415 
1416  va_start (argptr, error);
1417  vsprintf (text, error, argptr);
1418  va_end (argptr);
1419 
1420  ri.Sys_Error (ERR_FATAL, "%s", text);
1421 }

Variable Documentation

◆ aliasxcenter

float aliasxcenter

Definition at line 79 of file r_main.c.

◆ aliasxscale

float aliasxscale

Definition at line 79 of file r_main.c.

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

◆ aliasycenter

float aliasycenter

Definition at line 79 of file r_main.c.

◆ aliasyscale

float aliasyscale

Definition at line 79 of file r_main.c.

◆ base_vpn

vec3_t base_vpn

Definition at line 67 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ base_vright

vec3_t base_vright

Definition at line 68 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ base_vup

vec3_t base_vup

Definition at line 66 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ bbextents

◆ bbextentt

fixed16_t bbextentt

Definition at line 177 of file r_main.c.

◆ c_surf

int c_surf

Definition at line 58 of file r_main.c.

Referenced by D_CacheSurface(), and R_PrintTimes().

◆ cacheblock

◆ cachewidth

◆ colormap

void* colormap

Definition at line 45 of file r_main.c.

Referenced by D_Patch().

◆ currentmodel

model_t* currentmodel

Definition at line 37 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_DrawEntitiesOnList().

◆ 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 93 of file r_main.c.

Referenced by R_SetupFrame().

◆ d_tdivzorigin

float d_tdivzorigin

Definition at line 175 of file r_main.c.

◆ d_tdivzstepu

float d_tdivzstepu

Definition at line 173 of file r_main.c.

◆ d_tdivzstepv

float d_tdivzstepv

Definition at line 174 of file r_main.c.

◆ d_viewbuffer

◆ d_ziorigin

float d_ziorigin

Definition at line 175 of file r_main.c.

◆ d_zistepu

float d_zistepu

Definition at line 173 of file r_main.c.

◆ d_zistepv

float d_zistepv

Definition at line 174 of file r_main.c.

◆ d_zrowbytes

unsigned int d_zrowbytes

Definition at line 183 of file r_main.c.

Referenced by D_ViewChanged().

◆ d_zwidth

unsigned int d_zwidth

Definition at line 184 of file r_main.c.

◆ da_time1

float da_time1

Definition at line 106 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ da_time2

float da_time2

Definition at line 106 of file r_main.c.

Referenced by R_RenderFrame().

◆ db_time1

float db_time1

Definition at line 106 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ db_time2

float db_time2

Definition at line 106 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ de_time1

float de_time1

Definition at line 107 of file r_main.c.

Referenced by R_RenderFrame().

◆ de_time2

float de_time2

Definition at line 107 of file r_main.c.

Referenced by R_RenderFrame().

◆ dp_time1

float dp_time1

Definition at line 106 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ dp_time2

float dp_time2

Definition at line 106 of file r_main.c.

Referenced by R_RenderFrame().

◆ pfrustum_indexes

int* pfrustum_indexes[4]

Definition at line 98 of file r_main.c.

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

◆ r_aliasuvscale

float r_aliasuvscale = 1.0

Definition at line 50 of file r_main.c.

Referenced by R_Init(), and R_ViewChanged().

◆ r_clipflags

int r_clipflags

Definition at line 61 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_RenderBmodelFace().

◆ r_cnumsurfs

int r_cnumsurfs

Definition at line 59 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ r_dowarp

qboolean r_dowarp

Definition at line 54 of file r_main.c.

Referenced by R_RenderFrame(), and R_SetupFrame().

◆ r_drawentities

cvar_t* r_drawentities

Definition at line 127 of file r_main.c.

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

◆ r_drawnpolycount

int r_drawnpolycount

Definition at line 95 of file r_main.c.

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

◆ r_drawworld

cvar_t* r_drawworld

Definition at line 126 of file r_main.c.

Referenced by R_Register().

◆ r_dspeeds

cvar_t* r_dspeeds

Definition at line 128 of file r_main.c.

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

◆ r_framecount

int r_framecount = 1

Definition at line 91 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ r_frustum_indexes

int r_frustum_indexes[4 *6]

Definition at line 99 of file r_main.c.

Referenced by R_SetUpFrustumIndexes().

◆ r_fullbright

cvar_t* r_fullbright

Definition at line 129 of file r_main.c.

Referenced by R_Register().

◆ r_lefthand

cvar_t* r_lefthand

Definition at line 111 of file r_main.c.

Referenced by R_Register().

◆ r_lerpmodels

cvar_t* r_lerpmodels

Definition at line 130 of file r_main.c.

Referenced by R_Register().

◆ r_lightlevel

cvar_t* r_lightlevel

Definition at line 134 of file r_main.c.

Referenced by R_Register(), and R_SetLightLevel().

◆ r_maxedgesseen

int r_maxedgesseen

Definition at line 59 of file r_main.c.

Referenced by R_NewMap().

◆ r_maxsurfsseen

int r_maxsurfsseen

Definition at line 59 of file r_main.c.

Referenced by R_NewMap().

◆ r_newrefdef

◆ r_notexture_buffer

byte r_notexture_buffer[1024]

Definition at line 189 of file r_main.c.

Referenced by R_InitTextures().

◆ r_notexture_mip

image_t* r_notexture_mip

Definition at line 104 of file r_main.c.

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

◆ r_novis

cvar_t* r_novis

Definition at line 131 of file r_main.c.

Referenced by R_MarkLeaves(), and R_Register().

◆ r_numallocatededges

int r_numallocatededges

Definition at line 49 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_NewMap().

◆ r_oldviewcluster

int r_oldviewcluster

Definition at line 102 of file r_main.c.

Referenced by R_MarkLeaves().

◆ r_origin

vec3_t r_origin

Definition at line 69 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_DrawEntitiesOnList().

◆ r_outofedges

int r_outofedges

Definition at line 52 of file r_main.c.

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

◆ r_outofsurfaces

int r_outofsurfaces

Definition at line 51 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 94 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 1302 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 133 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ r_surfsonstack

qboolean r_surfsonstack

Definition at line 60 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ r_time1

float r_time1

Definition at line 48 of file r_main.c.

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

◆ r_viewcluster

int r_viewcluster

Definition at line 102 of file r_main.c.

Referenced by R_MarkLeaves(), and R_NewMap().

◆ r_viewleaf

mleaf_t* r_viewleaf

Definition at line 101 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_viewlighting

alight_t r_viewlighting = {128, 192, viewlightvec}

Definition at line 47 of file r_main.c.

◆ r_visframecount

int r_visframecount

Definition at line 92 of file r_main.c.

Referenced by R_FindTopnode(), and R_MarkLeaves().

◆ r_warpbuffer

byte r_warpbuffer[WARP_WIDTH *WARP_HEIGHT]

Definition at line 41 of file r_main.c.

Referenced by D_WarpScreen(), and R_SetupFrame().

◆ r_wholepolycount

int r_wholepolycount

Definition at line 96 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_worldentity

entity_t r_worldentity

Definition at line 29 of file r_main.c.

Referenced by D_SolidSurf(), and R_RenderWorld().

◆ r_worldmodel

model_t* r_worldmodel

Definition at line 39 of file r_main.c.

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

◆ ri

◆ rw_time1

float rw_time1

Definition at line 106 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ rw_time2

float rw_time2

Definition at line 106 of file r_main.c.

Referenced by R_EdgeDrawing().

◆ sadjust

◆ screenedge

mplane_t screenedge[4]

Definition at line 86 of file r_main.c.

Referenced by R_TransformFrustum(), and R_ViewChanged().

◆ se_time1

float se_time1

Definition at line 107 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_PrintDSpeeds().

◆ se_time2

float se_time2

Definition at line 107 of file r_main.c.

Referenced by R_RenderFrame().

◆ sky_images

image_t* sky_images[6]

Definition at line 34 of file r_main.c.

◆ skyaxis

vec3_t skyaxis

Definition at line 33 of file r_main.c.

Referenced by R_SetSky().

◆ skyname

char skyname[MAX_QPATH]

Definition at line 31 of file r_main.c.

Referenced by R_SetSky().

◆ skyrotate

float skyrotate

Definition at line 32 of file r_main.c.

Referenced by R_SetSky().

◆ suf

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

Definition at line 1301 of file r_main.c.

Referenced by R_SetSky().

◆ sw_aliasstats

cvar_t* sw_aliasstats

Definition at line 112 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_allow_modex

cvar_t* sw_allow_modex

Definition at line 113 of file r_main.c.

Referenced by DDRAW_Init(), and R_Register().

◆ sw_clearcolor

cvar_t* sw_clearcolor

Definition at line 114 of file r_main.c.

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

◆ sw_drawflat

cvar_t* sw_drawflat

Definition at line 115 of file r_main.c.

Referenced by D_DrawSurfaces(), and R_Register().

◆ sw_draworder

cvar_t* sw_draworder

Definition at line 116 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_Register().

◆ sw_lockpvs

cvar_t* sw_lockpvs

Definition at line 140 of file r_main.c.

Referenced by R_MarkLeaves(), and R_Register().

◆ sw_maxedges

cvar_t* sw_maxedges

Definition at line 117 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_maxsurfs

cvar_t* sw_maxsurfs

Definition at line 118 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_mode

cvar_t* sw_mode

Definition at line 119 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ sw_reportedgeout

cvar_t* sw_reportedgeout

Definition at line 120 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_reportsurfout

cvar_t* sw_reportsurfout

Definition at line 121 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_state

◆ sw_stipplealpha

cvar_t* sw_stipplealpha

Definition at line 122 of file r_main.c.

Referenced by R_Register().

◆ sw_surfcacheoverride

cvar_t* sw_surfcacheoverride

Definition at line 123 of file r_main.c.

Referenced by R_InitCaches(), and R_Register().

◆ sw_waterwarp

cvar_t* sw_waterwarp

Definition at line 124 of file r_main.c.

Referenced by R_Register(), and R_SetupFrame().

◆ tadjust

fixed16_t tadjust

Definition at line 177 of file r_main.c.

◆ verticalFieldOfView

float verticalFieldOfView

Definition at line 83 of file r_main.c.

Referenced by R_ViewChanged().

◆ vid

◆ vid_fullscreen

cvar_t* vid_fullscreen

Definition at line 136 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ vid_gamma

cvar_t* vid_gamma

Definition at line 137 of file r_main.c.

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

◆ viewlightvec

vec3_t viewlightvec

Definition at line 46 of file r_main.c.

◆ vpn

vec3_t vpn

Definition at line 67 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ vright

vec3_t vright

Definition at line 68 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ vup

vec3_t vup

Definition at line 66 of file r_main.c.

Referenced by R_DrawBEntitiesOnList().

◆ xcenter

◆ xOrigin

float xOrigin

Definition at line 84 of file r_main.c.

Referenced by R_ViewChanged().

◆ xscale

float xscale

Definition at line 76 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 78 of file r_main.c.

Referenced by R_DrawParticles(), and R_ViewChanged().

◆ ycenter

float ycenter

Definition at line 75 of file r_main.c.

◆ yOrigin

float yOrigin

Definition at line 84 of file r_main.c.

◆ yscale

float yscale

Definition at line 76 of file r_main.c.

◆ yscaleinv

float yscaleinv

Definition at line 77 of file r_main.c.

◆ yscaleshrink

float yscaleshrink

Definition at line 78 of file r_main.c.

RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:618
r_pcurrentvertbase
mvertex_t * r_pcurrentvertbase
Definition: r_main.c:56
it_sprite
@ it_sprite
Definition: r_local.h:59
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:177
r_skytexinfo
mtexinfo_t r_skytexinfo[6]
Definition: r_rast.c:70
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:124
refimport_t::Cmd_RemoveCommand
void(* Cmd_RemoveCommand)(char *name)
Definition: ref.h:223
sw_reportedgeout
cvar_t * sw_reportedgeout
Definition: r_main.c:120
rserr_t
rserr_t
Definition: r_local.h:97
height
GLsizei height
Definition: qgl_win.c:69
r_cnumsurfs
int r_cnumsurfs
Definition: r_main.c:59
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:73
entity_s::origin
float origin[3]
Definition: ref.h:57
R_Register
void R_Register(void)
Definition: r_main.c:245
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:607
R_DrawBeam
void R_DrawBeam(entity_t *e)
Definition: r_main.c:1245
r_novis
cvar_t * r_novis
Definition: r_main.c:131
model_s::vis
dvis_t * vis
Definition: r_model.h:229
intsintable
int intsintable[1280]
Definition: r_rast.c:48
oldrefdef_t::vieworg
vec3_t vieworg
Definition: r_local.h:132
r_visframecount
int r_visframecount
Definition: r_main.c:92
base_vpn
vec3_t base_vpn
Definition: r_main.c:67
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:156
Sys_SetFPCW
void Sys_SetFPCW(void)
Definition: rw_imp.c:437
R_ShutdownImages
void R_ShutdownImages(void)
Definition: r_image.c:617
CYCLE
#define CYCLE
Definition: asm_draw.h:16
r_maxsurfsseen
int r_maxsurfsseen
Definition: r_main.c:59
R_BeginRegistration
void R_BeginRegistration(char *map)
Definition: r_model.c:1139
R_BmodelCheckBBox
int R_BmodelCheckBBox(float *minmaxs)
Definition: r_main.c:619
Swap_Init
void Swap_Init(void)
Definition: q_shared.c:1011
Draw_Char
#define Draw_Char
Definition: qmenu.c:50
sw_reportsurfout
cvar_t * sw_reportsurfout
Definition: r_main.c:121
da_time1
float da_time1
Definition: r_main.c:106
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:130
Sys_MakeCodeWriteable
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
Definition: rw_imp.c:408
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:88
r_oldviewcluster
int r_oldviewcluster
Definition: r_main.c:102
insubmodel
qboolean insubmodel
Definition: r_bsp.c:27
R_ScreenShot_f
void R_ScreenShot_f(void)
Definition: r_misc.c:619
BOX_ON_PLANE_SIDE
#define BOX_ON_PLANE_SIDE(emins, emaxs, p)
Definition: q_shared.h:190
model_s::nummodelsurfaces
int nummodelsurfaces
Definition: r_model.h:196
skyname
char skyname[MAX_QPATH]
Definition: r_main.c:31
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:238
ri
refimport_t ri
Definition: r_main.c:25
R_SurfacePatch
void R_SurfacePatch(void)
Definition: r_misc.c:524
BMODEL_FULLY_CLIPPED
#define BMODEL_FULLY_CLIPPED
Definition: r_local.h:212
oldrefdef_t::viewangles
vec3_t viewangles
Definition: r_local.h:133
R_SetSky
void R_SetSky(char *name, float rotate, vec3_t axis)
Definition: r_main.c:1304
refexport_t::DrawStretchRaw
void(* DrawStretchRaw)(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: ref.h:202
vright
vec3_t vright
Definition: r_main.c:68
v
GLdouble v
Definition: qgl_win.c:143
it_wall
@ it_wall
Definition: r_local.h:60
cvar_s::modified
qboolean modified
Definition: q_shared.h:323
refexport_t::Init
int(* Init)(void *hinstance, void *wndproc)
Definition: ref.h:157
R_InitGraphics
void R_InitGraphics(int width, int height)
Definition: r_main.c:1066
r_origin
vec3_t r_origin
Definition: r_main.c:69
R_CalcPalette
void R_CalcPalette(void)
Definition: r_main.c:919
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:115
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:178
r_skysideimage
int r_skysideimage[6]
Definition: r_main.c:1302
refexport_t::DrawFill
void(* DrawFill)(int x, int y, int w, int h, int c)
Definition: ref.h:198
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: r_light.c:224
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:107
refimport_t::Cvar_Get
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
Definition: ref.h:242
sw_draworder
cvar_t * sw_draworder
Definition: r_main.c:116
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:123
R_FindImage
image_t * R_FindImage(char *name, imagetype_t type)
Definition: r_image.c:497
qboolean
qboolean
Definition: q_shared.h:56
x
GLint GLenum GLint x
Definition: qgl_win.c:116
viddef_t::width
int width
Definition: vid.h:29
oldrefdef_t::xOrigin
float xOrigin
Definition: r_local.h:129
entity_s::skinnum
int skinnum
Definition: ref.h:70
SWimp_AppActivate
void SWimp_AppActivate(qboolean active)
Definition: rw_imp.c:378
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:146
modelorg
vec3_t modelorg
Definition: r_bsp.c:29
skyaxis
vec3_t skyaxis
Definition: r_main.c:33
R_DrawSprite
void R_DrawSprite(void)
Definition: r_sprite.c:40
db_time1
float db_time1
Definition: r_main.c:106
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:140
mnode_s
Definition: r_model.h:123
sw_clearcolor
cvar_t * sw_clearcolor
Definition: r_main.c:114
viddef_t::height
int height
Definition: vid.h:29
r_aliasuvscale
float r_aliasuvscale
Definition: r_main.c:50
refdef_t::rdflags
int rdflags
Definition: ref.h:128
SWimp_Shutdown
void SWimp_Shutdown(void)
Definition: rw_imp.c:359
width
GLint GLsizei width
Definition: qgl_win.c:115
r_notexture_buffer
byte r_notexture_buffer[1024]
Definition: r_main.c:189
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:60
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:137
dp_time2
float dp_time2
Definition: r_main.c:106
image_s::registration_sequence
int registration_sequence
Definition: r_local.h:71
refexport_t::AppActivate
void(* AppActivate)(qboolean activate)
Definition: ref.h:211
currententity
entity_t * currententity
Definition: r_bsp.c:28
r_time1
float r_time1
Definition: r_main.c:48
oldrefdef_t::yOrigin
float yOrigin
Definition: r_local.h:130
mod_brush
@ mod_brush
Definition: r_model.h:169
r_notexture_mip
image_t * r_notexture_mip
Definition: r_main.c:104
mleaf_s
Definition: r_model.h:143
vpn
vec3_t vpn
Definition: r_main.c:67
refexport_t::EndRegistration
void(* EndRegistration)(void)
Definition: ref.h:180
r_drawentities
cvar_t * r_drawentities
Definition: r_main.c:127
vup
vec3_t vup
Definition: r_main.c:66
refexport_t::EndFrame
void(* EndFrame)(void)
Definition: ref.h:209
SWimp_SetPalette
void SWimp_SetPalette(const unsigned char *palette)
Definition: rw_imp.c:333
j
GLint j
Definition: qgl_win.c:150
D_WarpScreen
void D_WarpScreen(void)
Definition: r_scan.c:42
Draw_GetPalette
void Draw_GetPalette(void)
Definition: r_main.c:1326
R_Init
int R_Init(void *hInstance, void *wndProc)
Definition: r_main.c:300
de_time2
float de_time2
Definition: r_main.c:107
r_dspeeds
cvar_t * r_dspeeds
Definition: r_main.c:128
Mod_FreeAll
void Mod_FreeAll(void)
Definition: r_model.c:1250
sw_maxedges
cvar_t * sw_maxedges
Definition: r_main.c:117
image_t
struct image_s image_t
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:74
R_EdgeDrawing
void R_EdgeDrawing(void)
Definition: r_main.c:853
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:49
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:620
r_framecount
int r_framecount
Definition: r_main.c:91
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:228
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:743
R_SetLightLevel
void R_SetLightLevel(void)
Definition: r_main.c:970
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
refexport_t::DrawFadeScreen
void(* DrawFadeScreen)(void)
Definition: ref.h:199
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:646
mnode_s::plane
mplane_t * plane
Definition: r_model.h:134
Draw_Fill
#define Draw_Fill
Definition: qmenu.c:53
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:710
Draw_FadeScreen
void Draw_FadeScreen(void)
Definition: r_draw.c:428
sw_mipcap
cvar_t * sw_mipcap
Definition: r_misc.c:26
R_DrawEntitiesOnList
void R_DrawEntitiesOnList(void)
Definition: r_main.c:513
r_speeds
cvar_t * r_speeds
Definition: r_main.c:133
D_FlushCaches
void D_FlushCaches(void)
Definition: r_surf.c:418
SWimp_EndFrame
void SWimp_EndFrame(void)
Definition: rw_imp.c:176
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:58
numleafs
int numleafs
Definition: cmodel.c:77
it_pic
@ it_pic
Definition: r_local.h:61
MINEDGES
#define MINEDGES
Definition: r_local.h:197
entity_s::alpha
float alpha
Definition: ref.h:73
viddef_t::rowbytes
int rowbytes
Definition: r_local.h:91
vid_fullscreen
cvar_t * vid_fullscreen
Definition: r_main.c:136
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:106
db_time2
float db_time2
Definition: r_main.c:106
r_maxedgesseen
int r_maxedgesseen
Definition: r_main.c:59
image_s::height
int height
Definition: r_local.h:69
R_InitTextures
void R_InitTextures(void)
Definition: r_main.c:196
model_s::type
modtype_t type
Definition: r_model.h:177
clipplane_s::leftedge
byte leftedge
Definition: r_local.h:354
refimport_t::Cmd_AddCommand
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
Definition: ref.h:222
clipplane_s::rightedge
byte rightedge
Definition: r_local.h:355
skyrotate
float skyrotate
Definition: r_main.c:32
R_PrintTimes
void R_PrintTimes(void)
Definition: r_misc.c:131
R_InitCaches
void R_InitCaches(void)
Definition: r_surf.c:379
sintable
int sintable[1280]
Definition: r_rast.c:47
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:1160
rserr_invalid_mode
@ rserr_invalid_mode
Definition: r_local.h:102
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:596
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:220
se_time1
float se_time1
Definition: r_main.c:107
R_PrintAliasStats
void R_PrintAliasStats(void)
Definition: r_misc.c:175
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:155
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:39
refexport_t
Definition: ref.h:151
AMP
#define AMP
Definition: r_local.h:231
MINSURFACES
#define MINSURFACES
Definition: r_local.h:199
r_clipflags
int r_clipflags
Definition: r_main.c:61
cvar_s::value
float value
Definition: q_shared.h:324
Draw_TileClear
void Draw_TileClear(int x, int y, int w, int h, char *name)
Definition: r_draw.c:345
base_vright
vec3_t base_vright
Definition: r_main.c:68
R_UnRegister
void R_UnRegister(void)
Definition: r_main.c:288
NUMSTACKEDGES
#define NUMSTACKEDGES
Definition: r_local.h:196
XCENTERING
#define XCENTERING
Definition: r_local.h:215
image_s::type
imagetype_t type
Definition: r_local.h:68
Mod_Init
void Mod_Init(void)
Definition: r_model.c:78
refdef_t::blend
float blend[4]
Definition: ref.h:126
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:195
NULL
#define NULL
Definition: q_shared.h:60
refexport_t::CinematicSetPalette
void(* CinematicSetPalette)(const unsigned char *palette)
Definition: ref.h:207
r_viewcluster
int r_viewcluster
Definition: r_main.c:102
SWimp_SetMode
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
Definition: rw_imp.c:266
surface_p
surf_t * surface_p
Definition: r_edge.c:51
image_s::pixels
byte * pixels[4]
Definition: r_local.h:72
se_time2
float se_time2
Definition: r_main.c:107
image_s::width
int width
Definition: r_local.h:69
R_DrawNullModel
void R_DrawNullModel(void)
Definition: r_main.c:504
dp_time1
float dp_time1
Definition: r_main.c:106
numr_images
int numr_images
Definition: r_image.c:26
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:196
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
R_CinematicSetPalette
void R_CinematicSetPalette(const unsigned char *palette)
Definition: r_main.c:1177
image_s::name
char name[MAX_QPATH]
Definition: r_local.h:67
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:176
it_skin
@ it_skin
Definition: r_local.h:58
AMP2
#define AMP2
Definition: r_local.h:232
blanktable
int blanktable[1280]
Definition: r_rast.c:49
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:182
r_dowarp
qboolean r_dowarp
Definition: r_main.c:54
name
cvar_t * name
Definition: cl_main.c:94
REF_VERSION
#define REF_VERSION
Definition: r_local.h:31
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
refexport_t::BeginRegistration
void(* BeginRegistration)(char *map)
Definition: ref.h:175
mod_sprite
@ mod_sprite
Definition: r_model.h:169
swstate_s::prev_mode
int prev_mode
Definition: r_local.h:820
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:157
R_RenderFrame
void R_RenderFrame(refdef_t *fd)
Definition: r_main.c:992
model_s::maxs
vec3_t maxs
Definition: r_model.h:185
swstate_s::gammatable
byte gammatable[256]
Definition: r_local.h:822
y
GLint y
Definition: qgl_win.c:115
pfrustum_indexes
int * pfrustum_indexes[4]
Definition: r_main.c:98
sw_mode
cvar_t * sw_mode
Definition: r_main.c:119
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1165
re
refexport_t re
Definition: vid_dll.c:31
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:1230
R_FindTopnode
mnode_t * R_FindTopnode(vec3_t mins, vec3_t maxs)
Definition: r_main.c:667
entity_s::frame
int frame
Definition: ref.h:58
Draw_BuildGammaTable
void Draw_BuildGammaTable(void)
Definition: r_main.c:1217
refexport_t::BeginFrame
void(* BeginFrame)(float camera_separation)
Definition: ref.h:208
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
R_EdgeCodeStart
void R_EdgeCodeStart(void)
sw_stipplealpha
cvar_t * sw_stipplealpha
Definition: r_main.c:122
R_InitTurb
void R_InitTurb(void)
Definition: r_main.c:231
sc_base
surfcache_t * sc_base
Definition: r_local.h:753
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
sw_allow_modex
cvar_t * sw_allow_modex
Definition: r_main.c:113
refdef_t::num_entities
int num_entities
Definition: ref.h:134
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:36
refexport_t::SetSky
void(* SetSky)(char *name, float rotate, vec3_t axis)
Definition: ref.h:179
suf
char * suf[6]
Definition: r_main.c:1301
mnode_s::contents
int contents
Definition: r_model.h:126
up
static vec3_t up
Definition: p_view.c:29
R_EndRegistration
void R_EndRegistration(void)
Definition: r_model.c:1208
rserr_ok
@ rserr_ok
Definition: r_local.h:99
r_lightlevel
cvar_t * r_lightlevel
Definition: r_main.c:134
Draw_GetPicSize
void Draw_GetPicSize(int *w, int *h, char *pic)
Definition: r_draw.c:144
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:37
NUMSTACKSURFACES
#define NUMSTACKSURFACES
Definition: r_local.h:198
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:310
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:111
r_drawworld
cvar_t * r_drawworld
Definition: r_main.c:126
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:124
refexport_t::Shutdown
void(* Shutdown)(void)
Definition: ref.h:160
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:192
Draw_Pic
void Draw_Pic(int x, int y, char *name)
Definition: r_draw.c:253
R_ImageList_f
void R_ImageList_f(void)
Definition: r_image.c:34
sw_aliasstats
cvar_t * sw_aliasstats
Definition: r_main.c:112
R_AliasDrawModel
void R_AliasDrawModel(void)
Definition: r_alias.c:1038
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:154
R_EdgeCodeEnd
void R_EdgeCodeEnd(void)
sw_maxsurfs
cvar_t * sw_maxsurfs
Definition: r_main.c:118
refexport_t::DrawTileClear
void(* DrawTileClear)(int x, int y, int w, int h, char *name)
Definition: ref.h:197
ri
refimport_t ri
Definition: r_main.c:25
refexport_t::DrawChar
void(* DrawChar)(int x, int y, int c)
Definition: ref.h:193
R_PrintDSpeeds
void R_PrintDSpeeds(void)
Definition: r_misc.c:151
clipplane_s::dist
float dist
Definition: r_local.h:352
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: r_poly.c:1192
Draw_FindPic
image_t * Draw_FindPic(char *name)
Definition: r_draw.c:35
rw_time1
float rw_time1
Definition: r_main.c:106
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:768
right
GLdouble right
Definition: qgl_win.c:159
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:244
image_s
Definition: r_local.h:65
sw_state
swstate_t sw_state
Definition: r_main.c:43
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:125
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
refdef_t::entities
entity_t * entities
Definition: ref.h:135
r_entorigin
vec3_t r_entorigin
Definition: r_bsp.c:31
R_MarkLeaves
void R_MarkLeaves(void)
Definition: r_main.c:432
cplane_s
Definition: q_shared.h:409
YCENTERING
#define YCENTERING
Definition: r_local.h:216
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:89
Draw_StretchPic
void Draw_StretchPic(int x, int y, int w, int h, char *name)
Definition: r_draw.c:220
model_s::vertexes
mvertex_t * vertexes
Definition: r_model.h:208
STRINGER
#define STRINGER(x)
Definition: r_main.c:143
swstate_s::currentpalette
byte currentpalette[1024]
Definition: r_local.h:823
r_outofsurfaces
int r_outofsurfaces
Definition: r_main.c:51
Mod_Modellist_f
void Mod_Modellist_f(void)
Definition: r_model.c:55
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:90
R_BeginFrame
void R_BeginFrame(float camera_separation)
Definition: r_main.c:1099
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:101
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
R_RegisterSkin
struct image_s * R_RegisterSkin(char *name)
Definition: r_image.c:564
R_SetupFrame
void R_SetupFrame(void)
Definition: r_misc.c:426
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
surf_s
Definition: r_local.h:399
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:182
surfaces
surf_t * surfaces
Definition: r_edge.c:51
r_outofedges
int r_outofedges
Definition: r_main.c:52
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:129
RotatePointAroundVector
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Definition: q_shared.c:32
base_vup
vec3_t base_vup
Definition: r_main.c:66
R_Shutdown
void R_Shutdown(void)
Definition: r_main.c:346
da_time2
float da_time2
Definition: r_main.c:106
edge_s
Definition: r_local.h:421
it_sky
@ it_sky
Definition: r_local.h:62