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

Go to the source code of this file.

Macros

#define MakeLightDelta()   { light[0] = lightrighta[0]; light[1] = lightrighta[1]; light[2] = lightrighta[2];};
 
#define PushLightDelta()   { light[0] += lightdelta[0]; light[1] += lightdelta[1]; light[2] += lightdelta[2]; };
 
#define FinishLightDelta()   { psource += sourcetstep; lightrighta[0] += lightrightstepa[0];lightlefta[0] += lightleftstepa[0];lightdelta[0] += lightdeltastep[0]; lightrighta[1] += lightrightstepa[1];lightlefta[1] += lightleftstepa[1];lightdelta[1] += lightdeltastep[1]; lightrighta[2] += lightrightstepa[2];lightlefta[2] += lightleftstepa[2];lightdelta[2] += lightdeltastep[2]; prowdest += surfrowbytes;}
 
#define MIP8RGBX(i)
 
#define Mip0Stuff(i)   { MakeLightDelta(); i(15); PushLightDelta(); i(14); PushLightDelta(); PushLightDelta(); i(13); PushLightDelta(); i(12); PushLightDelta(); i(11); PushLightDelta(); i(10); PushLightDelta(); i(9); PushLightDelta(); i(8); PushLightDelta(); i(7); PushLightDelta(); i(6); PushLightDelta(); i(5); PushLightDelta(); i(4); PushLightDelta(); i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
 
#define Mip1Stuff(i)   { MakeLightDelta(); i(7); PushLightDelta(); i(6); PushLightDelta(); i(5); PushLightDelta(); i(4); PushLightDelta(); i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
 
#define Mip2Stuff(i)   { MakeLightDelta();i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
 
#define Mip3Stuff(i)   { MakeLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
 

Functions

void R_DrawSurfaceBlock8_mip0 (void)
 
void R_DrawSurfaceBlock8_mip1 (void)
 
void R_DrawSurfaceBlock8_mip2 (void)
 
void R_DrawSurfaceBlock8_mip3 (void)
 
static void R_DrawSurfaceBlock8RGBX_mip0 (void)
 
static void R_DrawSurfaceBlock8RGBX_mip1 (void)
 
static void R_DrawSurfaceBlock8RGBX_mip2 (void)
 
static void R_DrawSurfaceBlock8RGBX_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)
 
void R_BuildLightMapRGB (void)
 
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
 
intr_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)
 
int lightlefta [3]
 
int lightrighta [3]
 
int lightleftstepa [3]
 
int lightrightstepa [3]
 
static void(* surfmiptable8RGB [4])(void)
 
byte palmap2 [64][64][64]
 
unsigned blocklights [18 *18 *3]
 
float surfscale
 
qboolean r_cache_thrash
 
int sc_size
 
surfcache_tsc_rover
 
surfcache_tsc_base
 

Macro Definition Documentation

◆ FinishLightDelta

#define FinishLightDelta ( )    { psource += sourcetstep; lightrighta[0] += lightrightstepa[0];lightlefta[0] += lightleftstepa[0];lightdelta[0] += lightdeltastep[0]; lightrighta[1] += lightrightstepa[1];lightlefta[1] += lightleftstepa[1];lightdelta[1] += lightdeltastep[1]; lightrighta[2] += lightrightstepa[2];lightlefta[2] += lightleftstepa[2];lightdelta[2] += lightdeltastep[2]; prowdest += surfrowbytes;}

Definition at line 68 of file r_surf.c.

◆ MakeLightDelta

#define MakeLightDelta ( )    { light[0] = lightrighta[0]; light[1] = lightrighta[1]; light[2] = lightrighta[2];};

Definition at line 66 of file r_surf.c.

◆ Mip0Stuff

#define Mip0Stuff (   i)    { MakeLightDelta(); i(15); PushLightDelta(); i(14); PushLightDelta(); PushLightDelta(); i(13); PushLightDelta(); i(12); PushLightDelta(); i(11); PushLightDelta(); i(10); PushLightDelta(); i(9); PushLightDelta(); i(8); PushLightDelta(); i(7); PushLightDelta(); i(6); PushLightDelta(); i(5); PushLightDelta(); i(4); PushLightDelta(); i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}

Definition at line 75 of file r_surf.c.

◆ Mip1Stuff

#define Mip1Stuff (   i)    { MakeLightDelta(); i(7); PushLightDelta(); i(6); PushLightDelta(); i(5); PushLightDelta(); i(4); PushLightDelta(); i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}

Definition at line 76 of file r_surf.c.

◆ Mip2Stuff

#define Mip2Stuff (   i)    { MakeLightDelta();i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}

Definition at line 77 of file r_surf.c.

◆ Mip3Stuff

#define Mip3Stuff (   i)    { MakeLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}

Definition at line 78 of file r_surf.c.

◆ MIP8RGBX

#define MIP8RGBX (   i)
Value:
{ pix = psource[i]; if(pix == 255) prowdest[i] = 255; else{pix24 = (unsigned char *)&d_8to24table[pix]; \
trans[0] = (pix24[0] * (light[0])) >> 17; trans[1] = (pix24[1] * (light[1])) >> 17; trans[2] = (pix24[2] * (light[2])) >> 17; \
if (trans[0] & ~63) trans[0] = 63; if (trans[1] & ~63) trans[1] = 63; if (trans[2] & ~63) trans[2] = 63; prowdest[i] = palmap2[trans[0]][trans[1]][trans[2]]; }}

Definition at line 71 of file r_surf.c.

◆ PushLightDelta

#define PushLightDelta ( )    { light[0] += lightdelta[0]; light[1] += lightdelta[1]; light[2] += lightdelta[2]; };

Definition at line 67 of file r_surf.c.

Function Documentation

◆ D_CacheSurface()

surfcache_t* D_CacheSurface ( msurface_t surface,
int  miplevel 
)

Definition at line 638 of file r_surf.c.

639 {
640  surfcache_t *cache;
641 
642 //
643 // if the surface is animating or flashing, flush the cache
644 //
646  r_drawsurf.lightadj[0] = r_newrefdef.lightstyles[surface->styles[0]].white*128;
647  r_drawsurf.lightadj[1] = r_newrefdef.lightstyles[surface->styles[1]].white*128;
648  r_drawsurf.lightadj[2] = r_newrefdef.lightstyles[surface->styles[2]].white*128;
649  r_drawsurf.lightadj[3] = r_newrefdef.lightstyles[surface->styles[3]].white*128;
650 
651 //
652 // see if the cache holds apropriate data
653 //
654  cache = surface->cachespots[miplevel];
655 
656  if (cache && !cache->dlight && surface->dlightframe != r_framecount
657  && cache->image == r_drawsurf.image
658  && cache->lightadj[0] == r_drawsurf.lightadj[0]
659  && cache->lightadj[1] == r_drawsurf.lightadj[1]
660  && cache->lightadj[2] == r_drawsurf.lightadj[2]
661  && cache->lightadj[3] == r_drawsurf.lightadj[3] )
662  return cache;
663 
664 //
665 // determine shape of surface
666 //
667  surfscale = 1.0 / (1<<miplevel);
669  r_drawsurf.surfwidth = surface->extents[0] >> miplevel;
671  r_drawsurf.surfheight = surface->extents[1] >> miplevel;
672 
673 //
674 // allocate memory if needed
675 //
676  if (!cache) // if a texture just animated, don't reallocate it
677  {
678  cache = D_SCAlloc (r_drawsurf.surfwidth,
680  surface->cachespots[miplevel] = cache;
681  cache->owner = &surface->cachespots[miplevel];
682  cache->mipscale = surfscale;
683  }
684 
685  if (surface->dlightframe == r_framecount)
686  cache->dlight = 1;
687  else
688  cache->dlight = 0;
689 
690  r_drawsurf.surfdat = (pixel_t *)cache->data;
691 
692  cache->image = r_drawsurf.image;
693  cache->lightadj[0] = r_drawsurf.lightadj[0];
694  cache->lightadj[1] = r_drawsurf.lightadj[1];
695  cache->lightadj[2] = r_drawsurf.lightadj[2];
696  cache->lightadj[3] = r_drawsurf.lightadj[3];
697 
698 //
699 // draw and light the surface texture
700 //
701  r_drawsurf.surf = surface;
702 
703  c_surf++;
704 
705  // calculate the lightings
706  if (coloredlights)
707  R_BuildLightMapRGB(); // leilei - colored lights
708  else
709  R_BuildLightMap();
710 
711  // rasterize the surface into the cache
712  R_DrawSurface ();
713 
714  return cache;
715 }

Referenced by D_SolidSurf(), and R_BuildPolygonFromSurface().

◆ D_FlushCaches()

void D_FlushCaches ( void  )

Definition at line 481 of file r_surf.c.

482 {
483  surfcache_t *c;
484 
485  if (!sc_base)
486  return;
487 
488  for (c = sc_base ; c ; c = c->next)
489  {
490  if (c->owner)
491  *c->owner = NULL;
492  }
493 
494  sc_rover = sc_base;
495  sc_base->next = NULL;
496  sc_base->owner = NULL;
497  sc_base->size = sc_size;
498 }

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

◆ D_log2()

int D_log2 ( int  num)

Definition at line 620 of file r_surf.c.

621 {
622  int c;
623 
624  c = 0;
625 
626  while (num>>=1)
627  c++;
628  return c;
629 }

◆ D_SCAlloc()

surfcache_t* D_SCAlloc ( int  width,
int  size 
)

Definition at line 505 of file r_surf.c.

506 {
507  surfcache_t *new;
508  qboolean wrapped_this_time;
509 
510  if ((width < 0) || (width > 256))
511  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache width %d\n", width);
512 
513  if ((size <= 0) || (size > 0x10000))
514  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache size %d\n", size);
515 
516  size = (intptr_t)&((surfcache_t *)0)->data[size];
517  size = (size + 3) & ~3;
518  if (size > sc_size)
519  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: %i > cache size of %i",size, sc_size);
520 
521 // if there is not size bytes after the rover, reset to the start
522  wrapped_this_time = false;
523 
524  if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
525  {
526  if (sc_rover)
527  {
528  wrapped_this_time = true;
529  }
530  sc_rover = sc_base;
531  }
532 
533 // colect and free surfcache_t blocks until the rover block is large enough
534  new = sc_rover;
535  if (sc_rover->owner)
536  *sc_rover->owner = NULL;
537 
538  while (new->size < size)
539  {
540  // free another
542  if (!sc_rover)
543  ri.Sys_Error (ERR_FATAL,"D_SCAlloc: hit the end of memory");
544  if (sc_rover->owner)
545  *sc_rover->owner = NULL;
546 
547  new->size += sc_rover->size;
548  new->next = sc_rover->next;
549  }
550 
551 // create a fragment out of any leftovers
552  if (new->size - size > 256)
553  {
554  sc_rover = (surfcache_t *)( (byte *)new + size);
555  sc_rover->size = new->size - size;
556  sc_rover->next = new->next;
557  sc_rover->width = 0;
558  sc_rover->owner = NULL;
559  new->next = sc_rover;
560  new->size = size;
561  }
562  else
563  sc_rover = new->next;
564 
565  new->width = width;
566 // DEBUG
567  if (width > 0)
568  new->height = (size - sizeof(*new) + sizeof(new->data)) / width;
569 
570  new->owner = NULL; // should be set properly after return
571 
572  if (d_roverwrapped)
573  {
574  if (wrapped_this_time || (sc_rover >= d_initial_rover))
575  r_cache_thrash = true;
576  }
577  else if (wrapped_this_time)
578  {
579  d_roverwrapped = true;
580  }
581 
582  return new;
583 }

Referenced by D_CacheSurface().

◆ D_SCDump()

void D_SCDump ( void  )

Definition at line 591 of file r_surf.c.

592 {
593  surfcache_t *test;
594 
595  for (test = sc_base ; test ; test = test->next)
596  {
597  if (test == sc_rover)
598  ri.Con_Printf (PRINT_ALL,"ROVER:\n");
599  ri.Con_Printf (PRINT_ALL,"%p : %i bytes %i width\n",test, test->size, test->width);
600  }
601 }

◆ MaskForNum()

int MaskForNum ( int  num)

Definition at line 607 of file r_surf.c.

608 {
609  if (num==128)
610  return 127;
611  if (num==64)
612  return 63;
613  if (num==32)
614  return 31;
615  if (num==16)
616  return 15;
617  return 255;
618 }

◆ R_BuildLightMap()

void R_BuildLightMap ( void  )

Definition at line 551 of file r_light.c.

552 {
553  int smax, tmax;
554  int t;
555  int i, size;
556  byte *lightmap;
557  unsigned scale;
558  int maps;
559  msurface_t *surf;
560 
561  surf = r_drawsurf.surf;
562 
563  smax = (surf->extents[0] >> 4) + 1;
564  tmax = (surf->extents[1] >> 4) + 1;
565  size = smax*tmax;
566 
568  {
569  for (i = 0; i < size; i++)
570  blocklights[i] = 0;
571  return;
572  }
573 
574  // clear to no light
575  for (i = 0; i < size; i++)
576  blocklights[i] = 0;
577 
578 
579  // add all the lightmaps
580  lightmap = surf->samples;
581  if (lightmap)
582  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
583  maps++)
584  {
585  scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
586  for (i = 0; i < size; i++)
587  blocklights[i] += lightmap[i] * scale;
588  lightmap += size; // skip to next lightmap
589  }
590 
591  // add all the dynamic lights
592  if (surf->dlightframe == r_framecount)
594 
595  // bound, invert, and shift
596  for (i = 0; i < size; i++)
597  {
598  t = (int)blocklights[i];
599  if (t < 0)
600  t = 0;
601  t = (255 * 256 - t) >> (8 - VID_CBITS);
602 
603  if (t < (1 << 6))
604  t = (1 << 6);
605 
606  blocklights[i] = t;
607  }
608 }

Referenced by D_CacheSurface().

◆ R_BuildLightMapRGB()

void R_BuildLightMapRGB ( void  )

Definition at line 732 of file r_light.c.

733 {
734  int smax, tmax;
735  int i, size;
736  byte *lightmap;
737  int scale;
738  int maps;
739  msurface_t *surf;
740  int r;
741  surf = r_drawsurf.surf;
742 
743  smax = (surf->extents[0] >> 4) + 1;
744  tmax = (surf->extents[1] >> 4) + 1;
745  size = smax*tmax * 3;
746  lightmap = surf->samples;
747 
749  {
750  for (i = 0; i < size; i++){
751  blocklights[i] = 0;
752  blocklights[i + 1] = 0;
753  blocklights[i + 2] = 0;
754  }
755  return;
756  }
757 
758 
759  // clear to ambient
760  for (i = 0; i < size; i++)
762 
763 
764  // add all the lightmaps
765  if (lightmap)
766  for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
767  maps++)
768  {
769  scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
770  for (i = 0; i < size; i += 3)
771  {
772  blocklights[i] += lightmap[i] * scale;
773  blocklights[i + 1] += lightmap[i + 1] * scale;
774  blocklights[i + 2] += lightmap[i + 2] * scale;
775  }
776  lightmap += size; // skip to next lightmap
777  }
778 
779  // add all the dynamic lights
780  if (surf->dlightframe == r_framecount)
782 
783  // bound, invert, and shift
784 
785  // how quake2 should have really looked
786  //qb: always do 'overbrights' on colored lights.
787  for (i = 0; i < size; i++)
788  {
789  r = blocklights[i];
790  blocklights[i] = (r < 256) ? 256 : (r > 65536) ? 65536 : r; // leilei - made min 256 to rid visual artifacts and gain speed
791  }
792 }

Referenced by D_CacheSurface().

◆ R_DrawSurface()

void R_DrawSurface ( void  )

Definition at line 145 of file r_surf.c.

146 {
147  unsigned char *basetptr;
148  int smax, tmax, twidth;
149  int u;
150  int soffset, basetoffset, texwidth;
151  int horzblockstep;
152  unsigned char *pcolumndest;
153  void (*pblockdrawer)(void);
154  image_t *mt;
155 
157 
158  mt = r_drawsurf.image;
159 
161 
162 // the fractional light values should range from 0 to (VID_GRADES - 1) << 16
163 // from a source range of 0 - 255
164 
165  texwidth = mt->width >> r_drawsurf.surfmip;
166 
167  blocksize = 16 >> r_drawsurf.surfmip;
169  blockdivmask = (1 << blockdivshift) - 1;
170 
171  r_lightwidth = (r_drawsurf.surf->extents[0]>>4)+1;
172 
175 
176 //==============================
177  if (coloredlights)
178  pblockdrawer = surfmiptable8RGB[r_drawsurf.surfmip]; // leilei - colored lights
179  else
180  pblockdrawer = surfmiptable[r_drawsurf.surfmip];
181 
182 // TODO: only needs to be set when there is a display settings change
183  horzblockstep = blocksize;
184 
185  smax = mt->width >> r_drawsurf.surfmip;
186  twidth = texwidth;
187  tmax = mt->height >> r_drawsurf.surfmip;
188  sourcetstep = texwidth;
189  r_stepback = tmax * twidth;
190 
191  r_sourcemax = r_source + (tmax * smax);
192 
193  soffset = r_drawsurf.surf->texturemins[0];
194  basetoffset = r_drawsurf.surf->texturemins[1];
195 
196 // << 16 components are to guarantee positive values for %
197  soffset = ((soffset >> r_drawsurf.surfmip) + (smax << 16)) % smax;
198  basetptr = &r_source[((((basetoffset >> r_drawsurf.surfmip)
199  + (tmax << 16)) % tmax) * twidth)];
200 
201  pcolumndest = r_drawsurf.surfdat;
202 
203  for (u=0 ; u<r_numhblocks; u++)
204  {
205  // leilei - colored lights
206  if (coloredlights)
207  r_lightptr = (int*)blocklights + u * 3;
208  else
209  // o^_^o
210  r_lightptr = (int*)blocklights + u;
211 
212  prowdestbase = pcolumndest;
213 
214  pbasesource = basetptr + soffset;
215 
216  (*pblockdrawer)();
217 
218  soffset = soffset + blocksize;
219  if (soffset >= smax)
220  soffset = 0;
221 
222  pcolumndest += horzblockstep;
223  }
224 }

Referenced by D_CacheSurface().

◆ R_DrawSurfaceBlock8_mip0()

void R_DrawSurfaceBlock8_mip0 ( void  )

Definition at line 236 of file r_surf.c.

237 {
238  int v, i, b, lightstep, lighttemp, light;
239  unsigned char pix, *psource, *prowdest;
240 
241  psource = pbasesource;
242  prowdest = prowdestbase;
243 
244  for (v=0 ; v<r_numvblocks ; v++)
245  {
246  // FIXME: make these locals?
247  // FIXME: use delta rather than both right and left, like ASM?
248  lightleft = r_lightptr[0];
249  lightright = r_lightptr[1];
251  lightleftstep = (r_lightptr[0] - lightleft) >> 4;
252  lightrightstep = (r_lightptr[1] - lightright) >> 4;
253 
254  for (i=0 ; i<16 ; i++)
255  {
256  lighttemp = lightleft - lightright;
257  lightstep = lighttemp >> 4;
258 
259  light = lightright;
260 
261  for (b=15; b>=0; b--)
262  {
263  pix = psource[b];
264  prowdest[b] = ((unsigned char *)vid.colormap)
265  [(light & 0xFF00) + pix];
266  light += lightstep;
267  }
268 
269  psource += sourcetstep;
272  prowdest += surfrowbytes;
273  }
274 
275  if (psource >= r_sourcemax)
276  psource -= r_stepback;
277  }
278 }

◆ R_DrawSurfaceBlock8_mip1()

void R_DrawSurfaceBlock8_mip1 ( void  )

Definition at line 286 of file r_surf.c.

287 {
288  int v, i, b, lightstep, lighttemp, light;
289  unsigned char pix, *psource, *prowdest;
290 
291  psource = pbasesource;
292  prowdest = prowdestbase;
293 
294  for (v=0 ; v<r_numvblocks ; v++)
295  {
296  // FIXME: make these locals?
297  // FIXME: use delta rather than both right and left, like ASM?
298  lightleft = r_lightptr[0];
299  lightright = r_lightptr[1];
301  lightleftstep = (r_lightptr[0] - lightleft) >> 3;
302  lightrightstep = (r_lightptr[1] - lightright) >> 3;
303 
304  for (i=0 ; i<8 ; i++)
305  {
306  lighttemp = lightleft - lightright;
307  lightstep = lighttemp >> 3;
308 
309  light = lightright;
310 
311  for (b=7; b>=0; b--)
312  {
313  pix = psource[b];
314  prowdest[b] = ((unsigned char *)vid.colormap)
315  [(light & 0xFF00) + pix];
316  light += lightstep;
317  }
318 
319  psource += sourcetstep;
322  prowdest += surfrowbytes;
323  }
324 
325  if (psource >= r_sourcemax)
326  psource -= r_stepback;
327  }
328 }

◆ R_DrawSurfaceBlock8_mip2()

void R_DrawSurfaceBlock8_mip2 ( void  )

Definition at line 336 of file r_surf.c.

337 {
338  int v, i, b, lightstep, lighttemp, light;
339  unsigned char pix, *psource, *prowdest;
340 
341  psource = pbasesource;
342  prowdest = prowdestbase;
343 
344  for (v=0 ; v<r_numvblocks ; v++)
345  {
346  // FIXME: make these locals?
347  // FIXME: use delta rather than both right and left, like ASM?
348  lightleft = r_lightptr[0];
349  lightright = r_lightptr[1];
351  lightleftstep = (r_lightptr[0] - lightleft) >> 2;
352  lightrightstep = (r_lightptr[1] - lightright) >> 2;
353 
354  for (i=0 ; i<4 ; i++)
355  {
356  lighttemp = lightleft - lightright;
357  lightstep = lighttemp >> 2;
358 
359  light = lightright;
360 
361  for (b=3; b>=0; b--)
362  {
363  pix = psource[b];
364  prowdest[b] = ((unsigned char *)vid.colormap)
365  [(light & 0xFF00) + pix];
366  light += lightstep;
367  }
368 
369  psource += sourcetstep;
372  prowdest += surfrowbytes;
373  }
374 
375  if (psource >= r_sourcemax)
376  psource -= r_stepback;
377  }
378 }

◆ R_DrawSurfaceBlock8_mip3()

void R_DrawSurfaceBlock8_mip3 ( void  )

Definition at line 386 of file r_surf.c.

387 {
388  int v, i, b, lightstep, lighttemp, light;
389  unsigned char pix, *psource, *prowdest;
390 
391  psource = pbasesource;
392  prowdest = prowdestbase;
393 
394  for (v=0 ; v<r_numvblocks ; v++)
395  {
396  // FIXME: make these locals?
397  // FIXME: use delta rather than both right and left, like ASM?
398  lightleft = r_lightptr[0];
399  lightright = r_lightptr[1];
401  lightleftstep = (r_lightptr[0] - lightleft) >> 1;
402  lightrightstep = (r_lightptr[1] - lightright) >> 1;
403 
404  for (i=0 ; i<2 ; i++)
405  {
406  lighttemp = lightleft - lightright;
407  lightstep = lighttemp >> 1;
408 
409  light = lightright;
410 
411  for (b=1; b>=0; b--)
412  {
413  pix = psource[b];
414  prowdest[b] = ((unsigned char *)vid.colormap)
415  [(light & 0xFF00) + pix];
416  light += lightstep;
417  }
418 
419  psource += sourcetstep;
422  prowdest += surfrowbytes;
423  }
424 
425  if (psource >= r_sourcemax)
426  psource -= r_stepback;
427  }
428 }

◆ R_DrawSurfaceBlock8RGBX_mip0()

void R_DrawSurfaceBlock8RGBX_mip0 ( void  )
static

Definition at line 724 of file r_surf.c.

725 {
726  unsigned int v, i;
727  unsigned int light[3];
728  unsigned int lightdelta[3], lightdeltastep[3];
729  unsigned char pix, *psource, *prowdest;
730  unsigned char *pix24;
731  unsigned trans[3];
732  psource = pbasesource;
733  prowdest = prowdestbase;
734 
735 #pragma loop(hint_parallel(8)) //qb: try this
736  for (v=0 ; v<r_numvblocks ; v++)
737  {
738  lightlefta[0] = r_lightptr[0];
739  lightrighta[0] = r_lightptr[3];
740  lightlefta[1] = r_lightptr[0+1];
741  lightrighta[1] = r_lightptr[3+1];
742  lightlefta[2] = r_lightptr[0+2];
743  lightrighta[2] = r_lightptr[3+2];
744 
745  lightdelta[0] = (lightlefta[0] - lightrighta[0]) >> 4;
746  lightdelta[1] = (lightlefta[1] - lightrighta[1]) >> 4;
747  lightdelta[2] = (lightlefta[2] - lightrighta[2]) >> 4;
748 
749 
750  r_lightptr += r_lightwidth * 3;
751 
752  lightleftstepa[0] = (r_lightptr[0] - lightlefta[0]) >> 4;
753  lightrightstepa[0] = (r_lightptr[3] - lightrighta[0]) >> 4;
754 
755  lightleftstepa[1] = (r_lightptr[0+1] - lightlefta[1]) >> 4;
756  lightrightstepa[1] = (r_lightptr[3+1] - lightrighta[1]) >> 4;
757 
758  lightleftstepa[2] = (r_lightptr[0+2] - lightlefta[2]) >> 4;
759  lightrightstepa[2] = (r_lightptr[3+2] - lightrighta[2]) >> 4;
760 
761  lightdeltastep[0] = (lightleftstepa[0] - lightrightstepa[0]) >> 4;
762  lightdeltastep[1] = (lightleftstepa[1] - lightrightstepa[1]) >> 4;
763  lightdeltastep[2] = (lightleftstepa[2] - lightrightstepa[2]) >> 4;
764 
765 
766  for (i=0 ; i<16 ; i++)
767  {
769 
770  }
771 
772  if (psource >= r_sourcemax)
773  psource -= r_stepback;
774 
775  }
776 }

◆ R_DrawSurfaceBlock8RGBX_mip1()

void R_DrawSurfaceBlock8RGBX_mip1 ( void  )
static

Definition at line 781 of file r_surf.c.

782 {
783  unsigned int v, i;
784  unsigned int light[3];
785  unsigned int lightdelta[3], lightdeltastep[3];
786  unsigned char pix, *psource, *prowdest;
787  unsigned char *pix24;
788  unsigned trans[3];
789  psource = pbasesource;
790 
791  prowdest = prowdestbase;
792 
793 #pragma loop(hint_parallel(8)) //qb: try this
794  for (v=0 ; v<r_numvblocks ; v++)
795  {
796  lightlefta[0] = r_lightptr[0];
797  lightrighta[0] = r_lightptr[3];
798  lightlefta[1] = r_lightptr[0+1];
799  lightrighta[1] = r_lightptr[3+1];
800  lightlefta[2] = r_lightptr[0+2];
801  lightrighta[2] = r_lightptr[3+2];
802 
803  lightdelta[0] = (lightlefta[0] - lightrighta[0]) >> 3;
804  lightdelta[1] = (lightlefta[1] - lightrighta[1]) >> 3;
805  lightdelta[2] = (lightlefta[2] - lightrighta[2]) >> 3;
806 
807 
808  r_lightptr += r_lightwidth * 3;
809 
810  lightleftstepa[0] = (r_lightptr[0] - lightlefta[0]) >> 3;
811  lightrightstepa[0] = (r_lightptr[3] - lightrighta[0]) >> 3;
812 
813  lightleftstepa[1] = (r_lightptr[0+1] - lightlefta[1]) >> 3;
814  lightrightstepa[1] = (r_lightptr[3+1] - lightrighta[1]) >> 3;
815 
816  lightleftstepa[2] = (r_lightptr[0+2] - lightlefta[2]) >> 3;
817  lightrightstepa[2] = (r_lightptr[3+2] - lightrighta[2]) >> 3;
818 
819  lightdeltastep[0] = (lightleftstepa[0] - lightrightstepa[0]) >> 3;
820  lightdeltastep[1] = (lightleftstepa[1] - lightrightstepa[1]) >> 3;
821  lightdeltastep[2] = (lightleftstepa[2] - lightrightstepa[2]) >> 3;
822 
823  for (i=0 ; i<8 ; i++)
824  {
826 
827 
828  }
829 
830  if (psource >= r_sourcemax)
831  psource -= r_stepback;
832 
833  }
834 }

◆ R_DrawSurfaceBlock8RGBX_mip2()

void R_DrawSurfaceBlock8RGBX_mip2 ( void  )
static

Definition at line 838 of file r_surf.c.

839 {
840  unsigned int v, i;
841  unsigned int light[3];
842  unsigned int lightdelta[3], lightdeltastep[3];
843  unsigned char pix, *psource, *prowdest;
844  unsigned char *pix24;
845  unsigned trans[3];
846  psource = pbasesource;
847 
848  prowdest = prowdestbase;
849 
850 #pragma loop(hint_parallel(8)) //qb: try this
851  for (v=0 ; v<r_numvblocks ; v++)
852  {
853  lightlefta[0] = r_lightptr[0];
854  lightrighta[0] = r_lightptr[3];
855  lightlefta[1] = r_lightptr[0+1];
856  lightrighta[1] = r_lightptr[3+1];
857  lightlefta[2] = r_lightptr[0+2];
858  lightrighta[2] = r_lightptr[3+2];
859 
860  lightdelta[0] = (lightlefta[0] - lightrighta[0]) >> 2;
861  lightdelta[1] = (lightlefta[1] - lightrighta[1]) >> 2;
862  lightdelta[2] = (lightlefta[2] - lightrighta[2]) >> 2;
863 
864 
865  r_lightptr += r_lightwidth * 3;
866 
867  lightleftstepa[0] = (r_lightptr[0] - lightlefta[0]) >> 2;
868  lightrightstepa[0] = (r_lightptr[3] - lightrighta[0]) >> 2;
869 
870  lightleftstepa[1] = (r_lightptr[0+1] - lightlefta[1]) >> 2;
871  lightrightstepa[1] = (r_lightptr[3+1] - lightrighta[1]) >> 2;
872 
873  lightleftstepa[2] = (r_lightptr[0+2] - lightlefta[2]) >> 2;
874  lightrightstepa[2] = (r_lightptr[3+2] - lightrighta[2]) >> 2;
875 
876  lightdeltastep[0] = (lightleftstepa[0] - lightrightstepa[0]) >> 2;
877  lightdeltastep[1] = (lightleftstepa[1] - lightrightstepa[1]) >> 2;
878  lightdeltastep[2] = (lightleftstepa[2] - lightrightstepa[2]) >> 2;
879 
880  for (i=0 ; i<4 ; i++)
881  {
883 
884 
885  }
886 
887  if (psource >= r_sourcemax)
888  psource -= r_stepback;
889 
890  }
891 }

◆ R_DrawSurfaceBlock8RGBX_mip3()

void R_DrawSurfaceBlock8RGBX_mip3 ( void  )
static

Definition at line 894 of file r_surf.c.

895 {
896  unsigned int v, i;
897  unsigned int light[3];
898  unsigned int lightdelta[3], lightdeltastep[3];
899  unsigned char pix, *psource, *prowdest;
900  unsigned char *pix24;
901  unsigned trans[3];
902  psource = pbasesource;
903 
904  prowdest = prowdestbase;
905 
906 #pragma loop(hint_parallel(8)) //qb: try this
907  for (v=0 ; v<r_numvblocks ; v++)
908  {
909  lightlefta[0] = r_lightptr[0];
910  lightrighta[0] = r_lightptr[3];
911  lightlefta[1] = r_lightptr[0+1];
912  lightrighta[1] = r_lightptr[3+1];
913  lightlefta[2] = r_lightptr[0+2];
914  lightrighta[2] = r_lightptr[3+2];
915 
916  lightdelta[0] = (lightlefta[0] - lightrighta[0]) >> 1;
917  lightdelta[1] = (lightlefta[1] - lightrighta[1]) >> 1;
918  lightdelta[2] = (lightlefta[2] - lightrighta[2]) >> 1;
919 
920 
921  r_lightptr += r_lightwidth * 3;
922 
923  lightleftstepa[0] = (r_lightptr[0] - lightlefta[0]) >> 1;
924  lightrightstepa[0] = (r_lightptr[3] - lightrighta[0]) >> 1;
925 
926  lightleftstepa[1] = (r_lightptr[0+1] - lightlefta[1]) >> 1;
927  lightrightstepa[1] = (r_lightptr[3+1] - lightrighta[1]) >> 1;
928 
929  lightleftstepa[2] = (r_lightptr[0+2] - lightlefta[2]) >> 1;
930  lightrightstepa[2] = (r_lightptr[3+2] - lightrighta[2]) >> 1;
931 
932  lightdeltastep[0] = (lightleftstepa[0] - lightrightstepa[0]) >> 1;
933  lightdeltastep[1] = (lightleftstepa[1] - lightrightstepa[1]) >> 1;
934  lightdeltastep[2] = (lightleftstepa[2] - lightrightstepa[2]) >> 1;
935 
936  for (i=0 ; i<2 ; i++)
937  {
939 
940 
941  }
942 
943  if (psource >= r_sourcemax)
944  psource -= r_stepback;
945 
946  }
947 }

◆ R_InitCaches()

void R_InitCaches ( void  )

Definition at line 442 of file r_surf.c.

443 {
444  int size;
445  int pix;
446 
447  // calculate size to allocate
449  {
450  size = sw_surfcacheoverride->value;
451  }
452  else
453  {
455 
456  pix = vid.width*vid.height;
457  if (pix > 64000)
458  size += (pix-64000)*3;
459  }
460 
461  // round up to page size
462  size = (size + 8191) & ~8191;
463 
464  ri.Con_Printf (PRINT_ALL,"%ik surface cache\n", size/1024);
465 
466  sc_size = size;
467  sc_base = (surfcache_t *)malloc(size);
468  sc_rover = sc_base;
469 
470  sc_base->next = NULL;
471  sc_base->owner = NULL;
472  sc_base->size = sc_size;
473 }

Referenced by R_InitGraphics().

◆ R_TextureAnimation()

image_t* R_TextureAnimation ( mtexinfo_t tex)

Definition at line 122 of file r_surf.c.

123 {
124  int c;
125 
126  if (!tex->next)
127  return tex->image;
128 
129  c = currententity->frame % tex->numframes;
130  while (c)
131  {
132  tex = tex->next;
133  c--;
134  }
135 
136  return tex->image;
137 }

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[18 *18 *3]

◆ blocksize

int blocksize

Definition at line 26 of file r_surf.c.

Referenced by R_DrawSurface().

◆ lightdelta

◆ lightdeltastep

◆ lightleft

◆ lightlefta

◆ lightleftstep

◆ lightleftstepa

◆ lightright

◆ lightrighta

◆ lightrightstep

◆ lightrightstepa

◆ palmap2

byte palmap2[64][64][64]

Definition at line 91 of file r_draw.c.

Referenced by Draw_InitRGBMap(), FindColor(), and R_PolysetDrawSpans8_Opaque_Coloured().

◆ pbasesource

◆ prowdestbase

◆ r_cache_thrash

qboolean r_cache_thrash

Definition at line 110 of file r_surf.c.

Referenced by D_SCAlloc().

◆ r_drawsurf

◆ r_lightptr

◆ r_lightwidth

◆ r_numhblocks

int r_numhblocks

Definition at line 37 of file r_surf.c.

Referenced by R_DrawSurface().

◆ r_numvblocks

◆ r_source

unsigned char* r_source

Definition at line 38 of file r_surf.c.

Referenced by R_DrawSurface().

◆ r_sourcemax

◆ r_stepback

◆ sc_base

surfcache_t * sc_base

Definition at line 113 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 113 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 112 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

◆ surfmiptable8RGB

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

◆ surfrowbytes

◆ surfscale

float surfscale

Definition at line 109 of file r_surf.c.

Referenced by D_CacheSurface().

R_AddDynamicLights
void R_AddDynamicLights(void)
Definition: r_light.c:451
r_cache_thrash
qboolean r_cache_thrash
Definition: r_surf.c:110
drawsurf_t::image
image_t * image
Definition: r_local.h:348
R_BuildLightMapRGB
void R_BuildLightMapRGB(void)
Definition: r_light.c:732
surfcache_s::size
int size
Definition: r_local.h:395
c_surf
int c_surf
Definition: r_main.c:64
r_framecount
int r_framecount
Definition: r_main.c:97
r_numvblocks
int r_numvblocks
Definition: r_surf.c:37
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:236
D_SCAlloc
surfcache_t * D_SCAlloc(int width, int size)
Definition: r_surf.c:505
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
surfcache_s
Definition: r_local.h:389
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:35
pix
static int pix
Definition: r_part.c:472
blocklights
unsigned blocklights[1024 *3]
Definition: r_light.c:444
qboolean
qboolean
Definition: q_shared.h:63
surfcache_s::lightadj
int lightadj[MAXLIGHTMAPS]
Definition: r_local.h:393
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: r_main.c:129
i
int i
Definition: q_shared.c:305
msurface_s::dlightframe
int dlightframe
Definition: r_model.h:97
blockdivshift
int blockdivshift
Definition: r_surf.c:28
sourcetstep
int sourcetstep
Definition: r_surf.c:26
pbasesource
unsigned char * pbasesource
Definition: r_surf.c:31
R_DrawSurfaceBlock8RGBX_mip1
static void R_DrawSurfaceBlock8RGBX_mip1(void)
Definition: r_surf.c:781
r_lightwidth
int r_lightwidth
Definition: r_surf.c:36
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:399
msurface_s::extents
short extents[2]
Definition: r_model.h:110
r_numhblocks
int r_numhblocks
Definition: r_surf.c:37
R_DrawSurfaceBlock8RGBX_mip3
static void R_DrawSurfaceBlock8RGBX_mip3(void)
Definition: r_surf.c:894
R_DrawSurface
void R_DrawSurface(void)
Definition: r_surf.c:145
sc_rover
surfcache_t * sc_rover
Definition: r_surf.c:113
lightrightstepa
int lightrightstepa[3]
Definition: r_surf.c:61
Mip0Stuff
#define Mip0Stuff(i)
Definition: r_surf.c:75
lightleftstepa
int lightleftstepa[3]
Definition: r_surf.c:61
surfrowbytes
int surfrowbytes
Definition: r_surf.c:32
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
u
static int u
Definition: r_part.c:472
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
R_DrawSurfaceBlock8_mip3
void R_DrawSurfaceBlock8_mip3(void)
Definition: r_surf.c:386
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
prowdestbase
void * prowdestbase
Definition: r_surf.c:30
lightdelta
int lightdelta
Definition: r_surf.c:27
miplevel
static int miplevel
Definition: r_edge.c:77
pix24
static unsigned char * pix24
Definition: r_polyse.c:927
r
GLdouble GLdouble r
Definition: qgl_win.c:336
viddef_t::width
unsigned width
Definition: vid.h:29
image_s::height
int height
Definition: r_local.h:75
Mip3Stuff
#define Mip3Stuff(i)
Definition: r_surf.c:78
msurface_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:112
drawsurf_t::surfheight
int surfheight
Definition: r_local.h:351
t
GLdouble t
Definition: qgl_win.c:328
MIP8RGBX
#define MIP8RGBX(i)
Definition: r_surf.c:71
drawsurf_t::rowbytes
int rowbytes
Definition: r_local.h:344
surfcache_s::mipscale
float mipscale
Definition: r_local.h:398
pixel_t
unsigned char pixel_t
Definition: r_local.h:84
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
d_roverwrapped
qboolean d_roverwrapped
Definition: r_misc.c:30
Mip1Stuff
#define Mip1Stuff(i)
Definition: r_surf.c:76
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
viddef_t::height
unsigned height
Definition: vid.h:29
drawsurf_t::surfmip
int surfmip
Definition: r_local.h:349
blocklights
unsigned blocklights[18 *18 *3]
Definition: r_light.c:444
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
surfcache_s::owner
struct surfcache_s ** owner
Definition: r_local.h:392
cvar_s::value
float value
Definition: q_shared.h:331
model_s::lightdata
byte * lightdata
Definition: r_model.h:231
lightrighta
int lightrighta[3]
Definition: r_surf.c:61
sc_base
surfcache_t * sc_base
Definition: r_surf.c:113
lightleftstep
int lightleftstep
Definition: r_surf.c:28
drawsurf_t::surfdat
byte * surfdat
Definition: r_local.h:343
blocksize
int blocksize
Definition: r_surf.c:26
NULL
#define NULL
Definition: q_shared.h:67
surfmiptable
static void(* surfmiptable[4])(void)
Definition: r_surf.c:45
R_TextureAnimation
image_t * R_TextureAnimation(mtexinfo_t *tex)
Definition: r_surf.c:122
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
image_s::width
int width
Definition: r_local.h:75
surfmiptable8RGB
static void(* surfmiptable8RGB[4])(void)
Definition: r_surf.c:88
r_sourcemax
unsigned char * r_sourcemax
Definition: r_surf.c:38
coloredlights
int coloredlights
Definition: r_main.c:156
MAXLIGHTMAPS
#define MAXLIGHTMAPS
Definition: qfiles.h:409
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
Mip2Stuff
#define Mip2Stuff(i)
Definition: r_surf.c:77
r_lightptr
int * r_lightptr
Definition: r_surf.c:34
R_DrawSurfaceBlock8_mip2
void R_DrawSurfaceBlock8_mip2(void)
Definition: r_surf.c:336
d_initial_rover
surfcache_t * d_initial_rover
Definition: r_misc.c:29
surfscale
float surfscale
Definition: r_surf.c:109
mtexinfo_s::next
struct mtexinfo_s * next
Definition: r_model.h:90
entity_s::frame
int frame
Definition: ref.h:58
R_AddDynamicLightsRGB
void R_AddDynamicLightsRGB(void)
Definition: r_light.c:620
msurface_s::cachespots
struct surfcache_s * cachespots[MIPLEVELS]
Definition: r_model.h:107
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:114
trans
static int trans[3]
Definition: r_polyse.c:928
drawsurf_t::surf
msurface_t * surf
Definition: r_local.h:345
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
R_BuildLightMap
void R_BuildLightMap(void)
Definition: r_light.c:551
lightleft
int lightleft
Definition: r_surf.c:26
R_DrawSurfaceBlock8RGBX_mip0
static void R_DrawSurfaceBlock8RGBX_mip0(void)
Definition: r_surf.c:724
lightlefta
int lightlefta[3]
Definition: r_surf.c:59
drawsurf_t::lightadj
fixed8_t lightadj[MAXLIGHTMAPS]
Definition: r_local.h:346
surfcache_s::data
byte data[4]
Definition: r_local.h:400
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:394
msurface_s::texturemins
short texturemins[2]
Definition: r_model.h:109
surfcache_s::width
unsigned width
Definition: r_local.h:396
lightstyle_t::white
float white
Definition: ref.h:99
R_DrawSurfaceBlock8RGBX_mip2
static void R_DrawSurfaceBlock8RGBX_mip2(void)
Definition: r_surf.c:838
image_s
Definition: r_local.h:71
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:95
SURFCACHE_SIZE_AT_320X240
#define SURFCACHE_SIZE_AT_320X240
Definition: r_local.h:218
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:137
surfcache_s::next
struct surfcache_s * next
Definition: r_local.h:391
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
r_source
unsigned char * r_source
Definition: r_surf.c:38
drawsurf_t::surfwidth
int surfwidth
Definition: r_local.h:350
VID_CBITS
#define VID_CBITS
Definition: r_local.h:158
palmap2
byte palmap2[64][64][64]
Definition: r_draw.c:91
R_DrawSurfaceBlock8_mip1
void R_DrawSurfaceBlock8_mip1(void)
Definition: r_surf.c:286
lightdeltastep
int lightdeltastep
Definition: r_surf.c:27
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
void
void(APIENTRY *qglAccum)(GLenum op
oldrefdef_t::ambientlight
unsigned ambientlight
Definition: r_local.h:141
sc_size
int sc_size
Definition: r_surf.c:112
vid
viddef_t vid
Definition: r_main.c:24