Go to the documentation of this file.
66 #define MakeLightDelta() { light[0] = lightrighta[0]; light[1] = lightrighta[1]; light[2] = lightrighta[2];};
67 #define PushLightDelta() { light[0] += lightdelta[0]; light[1] += lightdelta[1]; light[2] += lightdelta[2]; };
68 #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;}
71 #define MIP8RGBX(i) { pix = psource[i]; if(pix == 255) prowdest[i] = 255; else{pix24 = (unsigned char *)&d_8to24table[pix]; \
72 trans[0] = (pix24[0] * (light[0])) >> 17; trans[1] = (pix24[1] * (light[1])) >> 17; trans[2] = (pix24[2] * (light[2])) >> 17; \
73 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]]; }}
75 #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();}
76 #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();}
77 #define Mip2Stuff(i) { MakeLightDelta();i(3); PushLightDelta(); i(2); PushLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
78 #define Mip3Stuff(i) { MakeLightDelta(); i(1); PushLightDelta(); i(0); FinishLightDelta();}
98 extern byte palmap2[64][64][64];
147 unsigned char *basetptr;
148 int smax, tmax, twidth;
150 int soffset, basetoffset, texwidth;
152 unsigned char *pcolumndest;
199 + (tmax << 16)) % tmax) * twidth)];
222 pcolumndest += horzblockstep;
238 int v,
i, b, lightstep, lighttemp, light;
239 unsigned char pix, *psource, *prowdest;
254 for (
i=0 ;
i<16 ;
i++)
257 lightstep = lighttemp >> 4;
261 for (b=15; b>=0; b--)
265 [(light & 0xFF00) +
pix];
288 int v,
i, b, lightstep, lighttemp, light;
289 unsigned char pix, *psource, *prowdest;
304 for (
i=0 ;
i<8 ;
i++)
307 lightstep = lighttemp >> 3;
315 [(light & 0xFF00) +
pix];
338 int v,
i, b, lightstep, lighttemp, light;
339 unsigned char pix, *psource, *prowdest;
354 for (
i=0 ;
i<4 ;
i++)
357 lightstep = lighttemp >> 2;
365 [(light & 0xFF00) +
pix];
388 int v,
i, b, lightstep, lighttemp, light;
389 unsigned char pix, *psource, *prowdest;
404 for (
i=0 ;
i<2 ;
i++)
407 lightstep = lighttemp >> 1;
415 [(light & 0xFF00) +
pix];
458 size += (
pix-64000)*3;
462 size = (size + 8191) & ~8191;
513 if ((size <= 0) || (size > 0x10000))
517 size = (size + 3) & ~3;
522 wrapped_this_time =
false;
528 wrapped_this_time =
true;
538 while (new->size < size)
552 if (new->size - size > 256)
568 new->height = (size -
sizeof(*new) +
sizeof(
new->data)) /
width;
577 else if (wrapped_this_time)
727 unsigned int light[3];
729 unsigned char pix, *psource, *prowdest;
730 unsigned char *
pix24;
735 #pragma loop(hint_parallel(8)) //qb: try this
766 for (
i=0 ;
i<16 ;
i++)
784 unsigned int light[3];
786 unsigned char pix, *psource, *prowdest;
787 unsigned char *
pix24;
793 #pragma loop(hint_parallel(8)) //qb: try this
823 for (
i=0 ;
i<8 ;
i++)
841 unsigned int light[3];
843 unsigned char pix, *psource, *prowdest;
844 unsigned char *
pix24;
850 #pragma loop(hint_parallel(8)) //qb: try this
880 for (
i=0 ;
i<4 ;
i++)
897 unsigned int light[3];
899 unsigned char pix, *psource, *prowdest;
900 unsigned char *
pix24;
906 #pragma loop(hint_parallel(8)) //qb: try this
936 for (
i=0 ;
i<2 ;
i++)
void R_BuildLightMapRGB(void)
byte styles[MAXLIGHTMAPS]
void R_DrawSurfaceBlock8_mip0(void)
surfcache_t * D_SCAlloc(int width, int size)
int lightadj[MAXLIGHTMAPS]
cvar_t * sw_surfcacheoverride
unsigned char * pbasesource
static void R_DrawSurfaceBlock8RGBX_mip1(void)
surfcache_t * D_CacheSurface(msurface_t *surface, int miplevel)
static void R_DrawSurfaceBlock8RGBX_mip3(void)
void(* Con_Printf)(int print_level, char *str,...)
void R_DrawSurfaceBlock8_mip3(void)
static unsigned char * pix24
void(* Sys_Error)(int err_level, char *str,...)
unsigned blocklights[18 *18 *3]
struct surfcache_s ** owner
static void(* surfmiptable[4])(void)
image_t * R_TextureAnimation(mtexinfo_t *tex)
static void(* surfmiptable8RGB[4])(void)
unsigned char * r_sourcemax
void R_DrawSurfaceBlock8_mip2(void)
surfcache_t * d_initial_rover
struct surfcache_s * cachespots[MIPLEVELS]
lightstyle_t * lightstyles
void R_BuildLightMap(void)
static void R_DrawSurfaceBlock8RGBX_mip0(void)
fixed8_t lightadj[MAXLIGHTMAPS]
static void R_DrawSurfaceBlock8RGBX_mip2(void)
#define SURFCACHE_SIZE_AT_320X240
struct surfcache_s * next
void R_DrawSurfaceBlock8_mip1(void)
void(APIENTRY *qglAccum)(GLenum op