gain about 3 fps (180 to 183) in null-renderer

This commit is contained in:
Bill Currie 2003-08-07 19:58:39 +00:00
parent 4a680bf981
commit 732a9a80d1
2 changed files with 21 additions and 13 deletions

View file

@ -174,9 +174,9 @@ R_AddDynamicLights_3 (msurface_t *surf)
{
float dist;
int maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
red, green, blue, s, t, td;
red, green, blue, s, t;
unsigned int lnum, i, j;
int sdtable[18];
unsigned int sdtable[18], td;
unsigned int *bl;
vec3_t impact, local;

View file

@ -185,22 +185,14 @@ loc0:
}
}
static inline void
mark_surfaces (msurface_t *surf, const vec3_t lightorigin, dlight_t *light,
int bit)
static void
real_mark_surfaces (float dist, msurface_t *surf, const vec3_t lightorigin,
dlight_t *light, int bit)
{
float dist;
float dist2, d;
float maxdist = light->radius * light->radius;
vec3_t impact;
dist = PlaneDiff(lightorigin, surf->plane);
if (surf->flags & SURF_PLANEBACK)
dist = -dist;
if ((dist < -0.25f && !(surf->flags & SURF_LIGHTBOTHSIDES))
|| dist > light->radius)
return;
dist2 = dist * dist;
dist = -dist;
VectorMA (light->origin, dist, surf->plane->normal, impact);
@ -241,6 +233,22 @@ mark_surfaces (msurface_t *surf, const vec3_t lightorigin, dlight_t *light,
surf->dlightbits |= bit;
}
static inline void
mark_surfaces (msurface_t *surf, const vec3_t lightorigin, dlight_t *light,
int bit)
{
float dist;
dist = PlaneDiff(lightorigin, surf->plane);
if (surf->flags & SURF_PLANEBACK)
dist = -dist;
if ((dist < -0.25f && !(surf->flags & SURF_LIGHTBOTHSIDES))
|| dist > light->radius)
return;
real_mark_surfaces (dist, surf, lightorigin, light, bit);
}
void
R_MarkLights (const vec3_t lightorigin, dlight_t *light, int bit,
model_t *model)