summaryrefslogtreecommitdiff
path: root/src/renderergl1/tr_light.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
committerTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
commitf45fbef604e05144057dec8d1dbfc5d4f5a2a822 (patch)
tree152d2a428b078f7a89756ea9e156695fc69f1686 /src/renderergl1/tr_light.c
parent7f9e97d611b4b267d9dd913144cb9632f96c90c2 (diff)
parent87abdd914988724e164ffb16380ad26be8420b84 (diff)
Merge branch 'master' into gpp
Diffstat (limited to 'src/renderergl1/tr_light.c')
-rw-r--r--src/renderergl1/tr_light.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/renderergl1/tr_light.c b/src/renderergl1/tr_light.c
index 779451f1..35233739 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;
}
}
@@ -183,6 +183,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
data = gridData;
for ( j = 0 ; j < 3 ; j++ ) {
if ( i & (1<<j) ) {
+ if ( pos[j] + 1 > tr.world->lightGridBounds[j] - 1 ) {
+ break; // ignore values outside lightgrid
+ }
factor *= frac[j];
data += gridStep[j];
} else {
@@ -190,6 +193,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
}
}
+ if ( j != 3 ) {
+ continue;
+ }
if ( !(data[0]+data[1]+data[2]) ) {
continue; // ignore samples in walls
}