mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
gain about 3 fps (180 to 183) in null-renderer
This commit is contained in:
parent
4a680bf981
commit
732a9a80d1
2 changed files with 21 additions and 13 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue