mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
This adds a fast light culling test for non-sloped floors and ceilings (TerminX suggested that change).
git-svn-id: https://svn.eduke32.com/eduke32@1419 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e8cbecf935
commit
6a7fe88d68
1 changed files with 20 additions and 5 deletions
|
@ -4489,6 +4489,7 @@ static inline void polymer_culllight(int16_t lighti)
|
|||
int32_t back;
|
||||
int32_t i;
|
||||
int32_t j;
|
||||
int32_t zdiff;
|
||||
_prsector *s;
|
||||
_prwall *w;
|
||||
sectortype *sec;
|
||||
|
@ -4508,13 +4509,27 @@ static inline void polymer_culllight(int16_t lighti)
|
|||
|
||||
polymer_pokesector(sectorqueue[front]);
|
||||
|
||||
if (polymer_planeinlight(&s->floor, light)) {
|
||||
polymer_addplanelight(&s->floor, lighti);
|
||||
}
|
||||
zdiff = light->z - s->floorz;
|
||||
if (zdiff < 0)
|
||||
zdiff = -zdiff;
|
||||
zdiff >>= 4;
|
||||
|
||||
if (polymer_planeinlight(&s->ceil, light)) {
|
||||
if (!light->radius && !sec->floorheinum) {
|
||||
if (zdiff < light->range)
|
||||
polymer_addplanelight(&s->floor, lighti);
|
||||
} else if (polymer_planeinlight(&s->floor, light))
|
||||
polymer_addplanelight(&s->floor, lighti);
|
||||
|
||||
zdiff = light->z - s->ceilingz;
|
||||
if (zdiff < 0)
|
||||
zdiff = -zdiff;
|
||||
zdiff >>= 4;
|
||||
|
||||
if (!light->radius && !sec->ceilingheinum) {
|
||||
if (zdiff < light->range)
|
||||
polymer_addplanelight(&s->ceil, lighti);
|
||||
} else if (polymer_planeinlight(&s->ceil, light))
|
||||
polymer_addplanelight(&s->ceil, lighti);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (i < sec->wallnum)
|
||||
|
|
Loading…
Reference in a new issue