icculus quake2 doxygen  1.0 dev
r_surf.c File Reference
#include "r_local.h"

Go to the source code of this file.

Functions

void R_DrawSurfaceBlock8_mip0 (void)
 
void R_DrawSurfaceBlock8_mip1 (void)
 
void R_DrawSurfaceBlock8_mip2 (void)
 
void R_DrawSurfaceBlock8_mip3 (void)
 
void R_BuildLightMap (void)
 
image_tR_TextureAnimation (mtexinfo_t *tex)
 
void R_DrawSurface (void)
 
void R_InitCaches (void)
 
void D_FlushCaches (void)
 
surfcache_tD_SCAlloc (int width, int size)
 
void D_SCDump (void)
 
int MaskForNum (int num)
 
int D_log2 (int num)
 
surfcache_tD_CacheSurface (msurface_t *surface, int miplevel)
 

Variables

drawsurf_t r_drawsurf
 
int lightleft
 
int sourcesstep
 
int blocksize
 
int sourcetstep
 
int lightdelta
 
int lightdeltastep
 
int lightright
 
int lightleftstep
 
int lightrightstep
 
int blockdivshift
 
unsigned blockdivmask
 
voidprowdestbase
 
unsigned char * pbasesource
 
int surfrowbytes
 
unsigned * r_lightptr
 
int r_stepback
 
int r_lightwidth
 
int r_numhblocks
 
int r_numvblocks
 
unsigned char * r_source
 
unsigned char * r_sourcemax
 
static void(* surfmiptable [4])(void)
 
unsigned blocklights [1024]
 
float surfscale
 
qboolean r_cache_thrash
 
int sc_size
 
surfcache_tsc_rover
 
surfcache_tsc_base
 

Function Documentation

◆ D_CacheSurface()

surfcache_t* D_CacheSurface ( msurface_t surface,
int  miplevel 
)

Definition at line 575 of file r_surf.c.

576 {
577  surfcache_t *cache;
578 
579 //
580 // if the surface is animating or flashing, flush the cache
581 //
583  r_drawsurf.lightadj[0] = r_newrefdef.lightstyles[surface->styles[0]].white*128;
584  r_drawsurf.lightadj[1] = r_newrefdef.lightstyles[surface->styles[1]].white*128;
585  r_drawsurf.lightadj[2] = r_newrefdef.lightstyles[surface->styles[2]].white*128;
586  r_drawsurf.lightadj[3] = r_newrefdef.lightstyles[surface->styles[3]].white*128;
587 
588 //
589 // see if the cache holds apropriate data
590 //
591  cache = surface->cachespots[miplevel];
592 
593  if (cache && !cache->dlight && surface->dlightframe != r_framecount
594  && cache->image == r_drawsurf.image
595  && cache->lightadj[0] == r_drawsurf.lightadj[0]
596  && cache->lightadj[1] == r_drawsurf.lightadj[1]
597  && cache->lightadj[2] == r_drawsurf.lightadj[2]
598  && cache->lightadj[3] == r_drawsurf.lightadj[3] )
599  return cache;
600 
601 //
602 // determine shape of surface
603 //
604  surfscale = 1.0 / (1<<miplevel);
606  r_drawsurf.surfwidth = surface->extents[0] >> miplevel;
608  r_drawsurf.surfheight = surface->extents[1] >> miplevel;
609 
610 //
611 // allocate memory if needed
612 //
613  if (!cache) // if a texture just animated, don't reallocate it
614  {
615  cache = D_SCAlloc (r_drawsurf.surfwidth,
617  surface->cachespots[miplevel] = cache;
618  cache->owner = &surface->cachespots[miplevel];
619  cache->mipscale = surfscale;
620  }
621 
622  if (surface->dlightframe == r_framecount)
623  cache->dlight = 1;
624  else
625  cache->dlight = 0;
626 
627  r_drawsurf.surfdat = (pixel_t *)cache->data;
628 
629  cache->image = r_drawsurf.image;
630  cache->lightadj[0] = r_drawsurf.lightadj[0];
631  cache->lightadj[1] = r_drawsurf.lightadj[1];
632  cache->lightadj[2] = r_drawsurf.lightadj[2];
633  cache->lightadj[3] = r_drawsurf.lightadj[3];
634 
635 //
636 // draw and light the surface texture
637 //
638  r_drawsurf.surf = surface;
639 
640  c_surf++;
641 
642  // calculate the lightings
643  R_BuildLightMap ();
644 
645  // rasterize the surface into the cache
646  R_DrawSurface ();
647 
648  return cache;
649 }

Referenced by D_SolidSurf(), and R_BuildPolygonFromSurface().

◆ D_FlushCaches()

void D_FlushCaches ( void  )

Definition at line 418 of file r_surf.c.

419 {
420  surfcache_t *c;
421 
422  if (!sc_base)
423  return;
424 
425  for (c = sc_base ; c ; c = c->next)
426  {
427  if (c->owner)
428  *c->owner = NULL;
429  }
430 
431  sc_rover = sc_base;
432  sc_base->next = NULL;
433  sc_base->owner = NULL;
434  sc_base->size = sc_size;
435 }

Referenced by R_BeginRegistration(), R_InitGraphics(), R_SetupFrame(), and R_Shutdown().

◆ D_log2()

int D_log2 ( int  num)

Definition at line 557 of file r_surf.c.

558 {
559  int c;
560 
561  c = 0;
562 
563  while (num>>=1)
564  c++;
565  return c;
566 }

◆ D_SCAlloc()

surfcache_t* D_SCAlloc ( int  width,
int  size 
)

Definition at line 442 of file r_surf.c.

443 {
444  surfcache_t *new;
445  qboolean wrapped_this_time;
446 
447  if ((width < 0) || (width > 256))
448  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache width %d\n", width);
449 
450  if ((size <= 0) || (size > 0x10000))
451  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache size %d\n", size);
452 
453  size = (int)&((surfcache_t *)0)->data[size];
454  size = (size + 3) & ~3;
455  if (size > sc_size)
456  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: %i > cache size of %i",size, sc_size);
457 
458 // if there is not size bytes after the rover, reset to the start
459  wrapped_this_time = false;
460 
461  if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
462  {
463  if (sc_rover)
464  {
465  wrapped_this_time = true;
466  }
467  sc_rover = sc_base;
468  }
469 
470 // colect and free surfcache_t blocks until the rover block is large enough
471  new = sc_rover;
472  if (sc_rover->owner)
473  *sc_rover->owner = NULL;
474 
475  while (new->size < size)
476  {
477  // free another
479  if (!sc_rover)
480  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: hit the end of memory");
481  if (sc_rover->owner)
482  *sc_rover->owner = NULL;
483 
484  new->size += sc_rover->size;
485  new->next = sc_rover->next;
486  }
487 
488 // create a fragment out of any leftovers
489  if (new->size - size > 256)
490  {
491  sc_rover = (surfcache_t *)( (byte *)new + size);
492  sc_rover->size = new->size - size;
493  sc_rover->next = new->next;
494  sc_rover->width = 0;
495  sc_rover->owner = NULL;
496  new->next = sc_rover;
497  new->size = size;
498  }
499  else
500  sc_rover = new->next;
501 
502  new->width = width;
503 // DEBUG
504  if (width > 0)
505  new->height = (size - sizeof(*new) + sizeof(new->data)) / width;
506 
507  new->owner = NULL; // should be set properly after return
508 
509  if (d_roverwrapped)
510  {
511  if (wrapped_this_time || (sc_rover >= d_initial_rover))
512  r_cache_thrash = true;
513  }
514  else if (wrapped_this_time)
515  {
516  d_roverwrapped = true;
517  }
518 
519  return new;
520 }

Referenced by D_CacheSurface().

◆ D_SCDump()

void D_SCDump ( void  )

Definition at line 528 of file r_surf.c.

529 {
530  surfcache_t *test;
531 
532  for (test = sc_base ; test ; test = test->next)
533  {
534  if (test == sc_rover)
535  ri.Con_Printf (PRINT_ALL,"ROVER:\n");
536  ri.Con_Printf (PRINT_ALL,"%p : %i bytes %i width\n",test, test->size, test->width);
537  }
538 }

◆ MaskForNum()

int MaskForNum ( int  num)

Definition at line 544 of file r_surf.c.

545 {
546  if (num==128)
547  return 127;
548  if (num==64)
549  return 63;
550  if (num==32)
551  return 31;
552  if (num==16)
553  return 15;
554  return 255;
555 }

◆ R_BuildLightMap()

void R_BuildLightMap ( void  )

Definition at line 384 of file r_light.c.

385 {
386  int smax, tmax;
387  int t;
388  int i, size;
389  byte *lightmap;
390  unsigned scale;
391  int maps;
392  msurface_t *surf;
393 
394  surf = r_drawsurf.surf;
395 
396  smax = (surf->extents[0]>>4)+1;
397  tmax = (surf->extents[1]>>4)+1;
398  size = smax*tmax;
399 
401  {
402  for (i=0 ; i<size ; i++)
403  blocklights[i] = 0;
404  return;
405  }
406 
407 // clear to no light
408  for (i=0 ; i<size ; i++)
409  blocklights[i] = 0;
410 
411 
412 // add all the lightmaps
413  lightmap = surf->samples;
414  if (lightmap)
415  for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
416  maps++)
417  {
418  scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
419  for (i=0 ; i<size ; i++)
420  blocklights[i] += lightmap[i] * scale;
421  lightmap += size; // skip to next lightmap
422  }
423 
424 // add all the dynamic lights
425  if (surf->dlightframe == r_framecount)
427 
428 // bound, invert, and shift
429  for (i=0 ; i<size ; i++)
430  {
431  t = (int)blocklights[i];
432  if (t < 0)
433  t = 0;
434  t = (255*256 - t) >> (8 - VID_CBITS);
435 
436  if (t < (1 << 6))
437  t = (1 << 6);
438 
439  blocklights[i] = t;
440  }
441 }

Referenced by D_CacheSurface().

◆ R_DrawSurface()

void R_DrawSurface ( void  )

Definition at line 90 of file r_surf.c.

91 {
92  unsigned char *basetptr;
93  int smax, tmax, twidth;
94  int u;
95  int soffset, basetoffset, texwidth;
96  int horzblockstep;
97  unsigned char *pcolumndest;
98  void (*pblockdrawer)(void);
99  image_t *mt;
100 
102 
103  mt = r_drawsurf.image;
104 
106 
107 // the fractional light values should range from 0 to (VID_GRADES - 1) << 16
108 // from a source range of 0 - 255
109 
110  texwidth = mt->width >> r_drawsurf.surfmip;
111 
112  blocksize = 16 >> r_drawsurf.surfmip;
114  blockdivmask = (1 << blockdivshift) - 1;
115 
116  r_lightwidth = (r_drawsurf.surf->extents[0]>>4)+1;
117 
120 
121 //==============================
122 
123  pblockdrawer = surfmiptable[r_drawsurf.surfmip];
124 // TODO: only needs to be set when there is a display settings change
125  horzblockstep = blocksize;
126 
127  smax = mt->width >> r_drawsurf.surfmip;
128  twidth = texwidth;
129  tmax = mt->height >> r_drawsurf.surfmip;
130  sourcetstep = texwidth;
131  r_stepback = tmax * twidth;
132 
133  r_sourcemax = r_source + (tmax * smax);
134 
135  soffset = r_drawsurf.surf->texturemins[0];
136  basetoffset = r_drawsurf.surf->texturemins[1];
137 
138 // << 16 components are to guarantee positive values for %
139  soffset = ((soffset >> r_drawsurf.surfmip) + (smax << 16)) % smax;
140  basetptr = &r_source[((((basetoffset >> r_drawsurf.surfmip)
141  + (tmax << 16)) % tmax) * twidth)];
142 
143  pcolumndest = r_drawsurf.surfdat;
144 
145  for (u=0 ; u<r_numhblocks; u++)
146  {
147  r_lightptr = blocklights + u;
148 
149  prowdestbase = pcolumndest;
150 
151  pbasesource = basetptr + soffset;
152 
153  (*pblockdrawer)();
154 
155  soffset = soffset + blocksize;
156  if (soffset >= smax)
157  soffset = 0;
158 
159  pcolumndest += horzblockstep;
160  }
161 }

Referenced by D_CacheSurface().

◆ R_DrawSurfaceBlock8_mip0()

void R_DrawSurfaceBlock8_mip0 ( void  )

Definition at line 173 of file r_surf.c.

174 {
175  int v, i, b, lightstep, lighttemp, light;
176  unsigned char pix, *psource, *prowdest;
177 
178  psource = pbasesource;
179  prowdest = prowdestbase;
180 
181  for (v=0 ; v<r_numvblocks ; v++)
182  {
183  // FIXME: make these locals?
184  // FIXME: use delta rather than both right and left, like ASM?
185  lightleft = r_lightptr[0];
186  lightright = r_lightptr[1];
188  lightleftstep = (r_lightptr[0] - lightleft) >> 4;
189  lightrightstep = (r_lightptr[1] - lightright) >> 4;
190 
191  for (i=0 ; i<16 ; i++)
192  {
193  lighttemp = lightleft - lightright;
194  lightstep = lighttemp >> 4;
195 
196  light = lightright;
197 
198  for (b=15; b>=0; b--)
199  {
200  pix = psource[b];
201  prowdest[b] = ((unsigned char *)vid.colormap)
202  [(light & 0xFF00) + pix];
203  light += lightstep;
204  }
205 
206  psource += sourcetstep;
209  prowdest += surfrowbytes;
210  }
211 
212  if (psource >= r_sourcemax)
213  psource -= r_stepback;
214  }
215 }

◆ R_DrawSurfaceBlock8_mip1()

void R_DrawSurfaceBlock8_mip1 ( void  )

Definition at line 223 of file r_surf.c.

224 {
225  int v, i, b, lightstep, lighttemp, light;
226  unsigned char pix, *psource, *prowdest;
227 
228  psource = pbasesource;
229  prowdest = prowdestbase;
230 
231  for (v=0 ; v<r_numvblocks ; v++)
232  {
233  // FIXME: make these locals?
234  // FIXME: use delta rather than both right and left, like ASM?
235  lightleft = r_lightptr[0];
236  lightright = r_lightptr[1];
238  lightleftstep = (r_lightptr[0] - lightleft) >> 3;
239  lightrightstep = (r_lightptr[1] - lightright) >> 3;
240 
241  for (i=0 ; i<8 ; i++)
242  {
243  lighttemp = lightleft - lightright;
244  lightstep = lighttemp >> 3;
245 
246  light = lightright;
247 
248  for (b=7; b>=0; b--)
249  {
250  pix = psource[b];
251  prowdest[b] = ((unsigned char *)vid.colormap)
252  [(light & 0xFF00) + pix];
253  light += lightstep;
254  }
255 
256  psource += sourcetstep;
259  prowdest += surfrowbytes;
260  }
261 
262  if (psource >= r_sourcemax)
263  psource -= r_stepback;
264  }
265 }

◆ R_DrawSurfaceBlock8_mip2()

void R_DrawSurfaceBlock8_mip2 ( void  )

Definition at line 273 of file r_surf.c.

274 {
275  int v, i, b, lightstep, lighttemp, light;
276  unsigned char pix, *psource, *prowdest;
277 
278  psource = pbasesource;
279  prowdest = prowdestbase;
280 
281  for (v=0 ; v<r_numvblocks ; v++)
282  {
283  // FIXME: make these locals?
284  // FIXME: use delta rather than both right and left, like ASM?
285  lightleft = r_lightptr[0];
286  lightright = r_lightptr[1];
288  lightleftstep = (r_lightptr[0] - lightleft) >> 2;
289  lightrightstep = (r_lightptr[1] - lightright) >> 2;
290 
291  for (i=0 ; i<4 ; i++)
292  {
293  lighttemp = lightleft - lightright;
294  lightstep = lighttemp >> 2;
295 
296  light = lightright;
297 
298  for (b=3; b>=0; b--)
299  {
300  pix = psource[b];
301  prowdest[b] = ((unsigned char *)vid.colormap)
302  [(light & 0xFF00) + pix];
303  light += lightstep;
304  }
305 
306  psource += sourcetstep;
309  prowdest += surfrowbytes;
310  }
311 
312  if (psource >= r_sourcemax)
313  psource -= r_stepback;
314  }
315 }

◆ R_DrawSurfaceBlock8_mip3()

void R_DrawSurfaceBlock8_mip3 ( void  )

Definition at line 323 of file r_surf.c.

324 {
325  int v, i, b, lightstep, lighttemp, light;
326  unsigned char pix, *psource, *prowdest;
327 
328  psource = pbasesource;
329  prowdest = prowdestbase;
330 
331  for (v=0 ; v<r_numvblocks ; v++)
332  {
333  // FIXME: make these locals?
334  // FIXME: use delta rather than both right and left, like ASM?
335  lightleft = r_lightptr[0];
336  lightright = r_lightptr[1];
338  lightleftstep = (r_lightptr[0] - lightleft) >> 1;
339  lightrightstep = (r_lightptr[1] - lightright) >> 1;
340 
341  for (i=0 ; i<2 ; i++)
342  {
343  lighttemp = lightleft - lightright;
344  lightstep = lighttemp >> 1;
345 
346  light = lightright;
347 
348  for (b=1; b>=0; b--)
349  {
350  pix = psource[b];
351  prowdest[b] = ((unsigned char *)vid.colormap)
352  [(light & 0xFF00) + pix];
353  light += lightstep;
354  }
355 
356  psource += sourcetstep;
359  prowdest += surfrowbytes;
360  }
361 
362  if (psource >= r_sourcemax)
363  psource -= r_stepback;
364  }
365 }

◆ R_InitCaches()

void R_InitCaches ( void  )

Definition at line 379 of file r_surf.c.

380 {
381  int size;
382  int pix;
383 
384  // calculate size to allocate
386  {
387  size = sw_surfcacheoverride->value;
388  }
389  else
390  {
392 
393  pix = vid.width*vid.height;
394  if (pix > 64000)
395  size += (pix-64000)*3;
396  }
397 
398  // round up to page size
399  size = (size + 8191) & ~8191;
400 
401  ri.Con_Printf (PRINT_ALL,"%ik surface cache\n", size/1024);
402 
403  sc_size = size;
404  sc_base = (surfcache_t *)malloc(size);
405  sc_rover = sc_base;
406 
407  sc_base->next = NULL;
408  sc_base->owner = NULL;
409  sc_base->size = sc_size;
410 }

Referenced by R_InitGraphics().

◆ R_TextureAnimation()

image_t* R_TextureAnimation ( mtexinfo_t tex)

Definition at line 67 of file r_surf.c.

68 {
69  int c;
70 
71  if (!tex->next)
72  return tex->image;
73 
74  c = currententity->frame % tex->numframes;
75  while (c)
76  {
77  tex = tex->next;
78  c--;
79  }
80 
81  return tex->image;
82 }

Referenced by D_CacheSurface().

Variable Documentation

◆ blockdivmask

unsigned blockdivmask

Definition at line 29 of file r_surf.c.

Referenced by R_DrawSurface().

◆ blockdivshift

int blockdivshift

Definition at line 28 of file r_surf.c.

Referenced by R_DrawSurface().

◆ blocklights

unsigned blocklights[1024]

Definition at line 277 of file r_light.c.

Referenced by R_AddDynamicLights(), R_BuildLightMap(), and R_DrawSurface().

◆ blocksize

int blocksize

Definition at line 26 of file r_surf.c.

Referenced by R_DrawSurface().

◆ lightdelta

int lightdelta

Definition at line 27 of file r_surf.c.

◆ lightdeltastep

int lightdeltastep

Definition at line 27 of file r_surf.c.

◆ lightleft

◆ lightleftstep

◆ lightright

◆ lightrightstep

◆ pbasesource

unsigned char* pbasesource

◆ prowdestbase

◆ r_cache_thrash

qboolean r_cache_thrash

Definition at line 55 of file r_surf.c.

Referenced by D_SCAlloc().

◆ r_drawsurf

drawsurf_t r_drawsurf

Definition at line 24 of file r_surf.c.

Referenced by D_CacheSurface(), R_AddDynamicLights(), R_BuildLightMap(), and R_DrawSurface().

◆ r_lightptr

◆ r_lightwidth

◆ r_numhblocks

int r_numhblocks

Definition at line 36 of file r_surf.c.

Referenced by R_DrawSurface().

◆ r_numvblocks

◆ r_source

unsigned char* r_source

Definition at line 37 of file r_surf.c.

Referenced by R_DrawSurface().

◆ r_sourcemax

unsigned char * r_sourcemax

◆ r_stepback

◆ sc_base

surfcache_t * sc_base

Definition at line 58 of file r_surf.c.

Referenced by D_FlushCaches(), D_SCAlloc(), D_SCDump(), and R_InitCaches().

◆ sc_rover

surfcache_t* sc_rover

Definition at line 58 of file r_surf.c.

Referenced by D_FlushCaches(), D_SCAlloc(), D_SCDump(), R_InitCaches(), and R_SetupFrame().

◆ sc_size

int sc_size

Definition at line 57 of file r_surf.c.

Referenced by D_FlushCaches(), D_SCAlloc(), and R_InitCaches().

◆ sourcesstep

int sourcesstep

Definition at line 26 of file r_surf.c.

◆ sourcetstep

◆ surfmiptable

void(* surfmiptable[4])(void)
static

◆ surfrowbytes

◆ surfscale

float surfscale

Definition at line 54 of file r_surf.c.

Referenced by D_CacheSurface().

R_AddDynamicLights
void R_AddDynamicLights(void)
Definition: r_light.c:284
r_cache_thrash
qboolean r_cache_thrash
Definition: r_surf.c:55
drawsurf_t::image
image_t * image
Definition: r_local.h:325
surfcache_s::size
int size
Definition: r_local.h:366
c_surf
int c_surf
Definition: r_main.c:58
r_framecount
int r_framecount
Definition: r_main.c:91
blocklights
unsigned blocklights[1024]
Definition: r_light.c:277
r_numvblocks
int r_numvblocks
Definition: r_surf.c:36
msurface_s::styles
byte styles[MAXLIGHTMAPS]
Definition: r_model.h:115
mtexinfo_s::numframes
int numframes
Definition: r_model.h:89
R_DrawSurfaceBlock8_mip0
void R_DrawSurfaceBlock8_mip0(void)
Definition: r_surf.c:173
D_SCAlloc
surfcache_t * D_SCAlloc(int width, int size)
Definition: r_surf.c:442
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
surfcache_s
Definition: r_local.h:360
ri
refimport_t ri
Definition: r_main.c:25
lightrightstep
int lightrightstep
Definition: r_surf.c:28
v
GLdouble v
Definition: qgl_win.c:143
r_stepback
int r_stepback
Definition: r_surf.c:34
qboolean
qboolean
Definition: q_shared.h:56
viddef_t::width
int width
Definition: vid.h:29
surfcache_s::lightadj
int lightadj[MAXLIGHTMAPS]
Definition: r_local.h:364
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: r_main.c:123
i
int i
Definition: q_shared.c:305
msurface_s::dlightframe
int dlightframe
Definition: r_model.h:97
r_lightptr
unsigned * r_lightptr
Definition: r_surf.c:33
blockdivshift
int blockdivshift
Definition: r_surf.c:28
sourcetstep
int sourcetstep
Definition: r_surf.c:26
viddef_t::height
int height
Definition: vid.h:29
pbasesource
unsigned char * pbasesource
Definition: r_surf.c:31
r_lightwidth
int r_lightwidth
Definition: r_surf.c:35
msurface_s::samples
byte * samples
Definition: r_model.h:116
width
GLint GLsizei width
Definition: qgl_win.c:115
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
currententity
entity_t * currententity
Definition: r_bsp.c:28
surfcache_s::image
image_t * image
Definition: r_local.h:370
msurface_s::extents
short extents[2]
Definition: r_model.h:110
r_numhblocks
int r_numhblocks
Definition: r_surf.c:36
R_DrawSurface
void R_DrawSurface(void)
Definition: r_surf.c:90
sc_rover
surfcache_t * sc_rover
Definition: r_surf.c:58
surfrowbytes
int surfrowbytes
Definition: r_surf.c:32
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_DrawSurfaceBlock8_mip3
void R_DrawSurfaceBlock8_mip3(void)
Definition: r_surf.c:323
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
prowdestbase
void * prowdestbase
Definition: r_surf.c:30
miplevel
static int miplevel
Definition: r_edge.c:77
image_s::height
int height
Definition: r_local.h:69
blocklights
unsigned blocklights[1024]
Definition: r_light.c:277
msurface_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:112
drawsurf_t::surfheight
int surfheight
Definition: r_local.h:328
t
GLdouble t
Definition: qgl_win.c:328
drawsurf_t::rowbytes
int rowbytes
Definition: r_local.h:321
surfcache_s::mipscale
float mipscale
Definition: r_local.h:369
pixel_t
unsigned char pixel_t
Definition: r_local.h:78
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:220
d_roverwrapped
qboolean d_roverwrapped
Definition: r_misc.c:30
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:36
drawsurf_t::surfmip
int surfmip
Definition: r_local.h:326
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:39
surfcache_s::owner
struct surfcache_s ** owner
Definition: r_local.h:363
cvar_s::value
float value
Definition: q_shared.h:324
model_s::lightdata
byte * lightdata
Definition: r_model.h:231
sc_base
surfcache_t * sc_base
Definition: r_surf.c:58
lightleftstep
int lightleftstep
Definition: r_surf.c:28
drawsurf_t::surfdat
byte * surfdat
Definition: r_local.h:320
blocksize
int blocksize
Definition: r_surf.c:26
NULL
#define NULL
Definition: q_shared.h:60
surfmiptable
static void(* surfmiptable[4])(void)
Definition: r_surf.c:44
R_TextureAnimation
image_t * R_TextureAnimation(mtexinfo_t *tex)
Definition: r_surf.c:67
image_s::pixels
byte * pixels[4]
Definition: r_local.h:72
image_s::width
int width
Definition: r_local.h:69
r_sourcemax
unsigned char * r_sourcemax
Definition: r_surf.c:37
MAXLIGHTMAPS
#define MAXLIGHTMAPS
Definition: qfiles.h:409
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
R_DrawSurfaceBlock8_mip2
void R_DrawSurfaceBlock8_mip2(void)
Definition: r_surf.c:273
d_initial_rover
surfcache_t * d_initial_rover
Definition: r_misc.c:29
surfscale
float surfscale
Definition: r_surf.c:54
mtexinfo_s::next
struct mtexinfo_s * next
Definition: r_model.h:90
entity_s::frame
int frame
Definition: ref.h:58
msurface_s::cachespots
struct surfcache_s * cachespots[MIPLEVELS]
Definition: r_model.h:107
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:132
drawsurf_t::surf
msurface_t * surf
Definition: r_local.h:322
R_BuildLightMap
void R_BuildLightMap(void)
Definition: r_light.c:384
lightleft
int lightleft
Definition: r_surf.c:26
drawsurf_t::lightadj
fixed8_t lightadj[MAXLIGHTMAPS]
Definition: r_local.h:323
surfcache_s::data
byte data[4]
Definition: r_local.h:371
msurface_s
Definition: r_model.h:93
blockdivmask
unsigned blockdivmask
Definition: r_surf.c:29
lightright
int lightright
Definition: r_surf.c:28
surfcache_s::dlight
int dlight
Definition: r_local.h:365
msurface_s::texturemins
short texturemins[2]
Definition: r_model.h:109
surfcache_s::width
unsigned width
Definition: r_local.h:367
lightstyle_t::white
float white
Definition: ref.h:117
image_s
Definition: r_local.h:65
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:89
SURFCACHE_SIZE_AT_320X240
#define SURFCACHE_SIZE_AT_320X240
Definition: r_local.h:210
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:129
surfcache_s::next
struct surfcache_s * next
Definition: r_local.h:362
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
r_source
unsigned char * r_source
Definition: r_surf.c:37
drawsurf_t::surfwidth
int surfwidth
Definition: r_local.h:327
VID_CBITS
#define VID_CBITS
Definition: r_local.h:152
R_DrawSurfaceBlock8_mip1
void R_DrawSurfaceBlock8_mip1(void)
Definition: r_surf.c:223
void
void(APIENTRY *qglAccum)(GLenum op
sc_size
int sc_size
Definition: r_surf.c:57
vid
viddef_t vid
Definition: r_main.c:24