Fast lights clean

This commit is contained in:
Denis Pauk 2019-01-30 23:19:10 +02:00
parent dcc2892de0
commit e43859de4a
2 changed files with 8 additions and 14 deletions

View file

@ -298,6 +298,7 @@ R_AddDynamicLights (drawsurf_t* drawsurf)
for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++)
{
light_t *plightdest = blocklights;
if (!(surf->dlightbits & (1<<lnum)))
continue; // not lit by this light
@ -355,17 +356,18 @@ R_AddDynamicLights (drawsurf_t* drawsurf)
if(!negativeLight)
{
if (dist < minlight)
blocklights[t*smax + s] += (rad - dist)*256;
*plightdest += (rad - dist)*256;
}
else
{
if (dist < minlight)
blocklights[t*smax + s] -= (rad - dist)*256;
if(blocklights[t*smax + s] < minlight)
blocklights[t*smax + s] = minlight;
*plightdest -= (rad - dist)*256;
if(*plightdest < minlight)
*plightdest = minlight;
}
//PGM
//====
plightdest ++;
}
}
}
@ -394,15 +396,12 @@ R_BuildLightMap (drawsurf_t* drawsurf)
if (r_fullbright->value || !r_worldmodel->lightdata)
{
for (i=0 ; i<size ; i++)
blocklights[i] = 0;
memset(blocklights, 0, size * sizeof(light_t));
return;
}
// clear to no light
for (i=0 ; i<size ; i++)
blocklights[i] = 0;
memset(blocklights, 0, size * sizeof(light_t));
// add all the lightmaps
lightmap = surf->samples;

View file

@ -190,11 +190,6 @@ zvalue_t *d_pzbuffer;
qboolean insubmodel;
static struct texture_buffer {
image_t image;
byte buffer[1024];
} r_notexture_buffer;
static void Draw_GetPalette (void);
static void RE_BeginFrame( float camera_separation );
static void Draw_BuildGammaTable(void);