diff options
author | Zack Middleton <zturtleman@gmail.com> | 2015-07-09 22:28:08 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:02:30 +0100 |
commit | 17abbc7123b1f79467d18c64b67235ce41c115c4 (patch) | |
tree | a8076ab6f43aef1aa9f7009476f4352d34bd7ef9 /src | |
parent | adb15c5fd2468d8398916938b17204a40a85e366 (diff) |
Fix OpenGL2 ignoring last light grid point on each axis
Also change light grid bounds clamping to make it more clear what invalid
values are.
Diffstat (limited to 'src')
-rw-r--r-- | src/renderergl1/tr_light.c | 2 | ||||
-rw-r--r-- | src/renderergl2/tr_light.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/renderergl1/tr_light.c b/src/renderergl1/tr_light.c index 779451f1..bd79df55 100644 --- a/src/renderergl1/tr_light.c +++ b/src/renderergl1/tr_light.c @@ -152,7 +152,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) { frac[i] = v - pos[i]; if ( pos[i] < 0 ) { pos[i] = 0; - } else if ( pos[i] >= tr.world->lightGridBounds[i] - 1 ) { + } else if ( pos[i] > tr.world->lightGridBounds[i] - 1 ) { pos[i] = tr.world->lightGridBounds[i] - 1; } } diff --git a/src/renderergl2/tr_light.c b/src/renderergl2/tr_light.c index 5993959e..ec54eab4 100644 --- a/src/renderergl2/tr_light.c +++ b/src/renderergl2/tr_light.c @@ -157,7 +157,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) { frac[i] = v - pos[i]; if ( pos[i] < 0 ) { pos[i] = 0; - } else if ( pos[i] >= world->lightGridBounds[i] - 1 ) { + } else if ( pos[i] > world->lightGridBounds[i] - 1 ) { pos[i] = world->lightGridBounds[i] - 1; } } @@ -190,7 +190,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) { ignore = qfalse; for ( j = 0 ; j < 3 ; j++ ) { if ( i & (1<<j) ) { - if ((pos[j] + 1) >= world->lightGridBounds[j] - 1) + if ((pos[j] + 1) > world->lightGridBounds[j] - 1) { ignore = qtrue; // ignore values outside lightgrid } |