[iortcw] 362/497: All: Backport ignoring values outside lightgrid

Simon McVittie smcv at debian.org
Fri Sep 8 10:37:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 4009313702877953f70dd3eed620c87be3ef1ea5
Author: Donny <M4N4T4RMS at gmail.com>
Date:   Mon Jul 13 06:53:10 2015 -0400

    All: Backport ignoring values outside lightgrid
---
 MP/code/rend2/tr_light.c    | 9 +++------
 MP/code/renderer/tr_light.c | 6 ++++++
 SP/code/rend2/tr_light.c    | 9 +++------
 SP/code/renderer/tr_light.c | 6 ++++++
 4 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/MP/code/rend2/tr_light.c b/MP/code/rend2/tr_light.c
index b88ffee..71584cd 100644
--- a/MP/code/rend2/tr_light.c
+++ b/MP/code/rend2/tr_light.c
@@ -195,15 +195,12 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) {
 		byte    *data;
 		int lat, lng;
 		vec3_t normal;
-		qboolean ignore;
 		factor = 1.0;
 		data = gridData;
-		ignore = qfalse;
 		for ( j = 0 ; j < 3 ; j++ ) {
 			if ( i & ( 1 << j ) ) {
-				if ((pos[j] + 1) > world->lightGridBounds[j] - 1)
-				{
-					ignore = qtrue; // ignore values outside lightgrid
+				if ( pos[j] + 1 > world->lightGridBounds[j] - 1 ) {
+					break; // ignore values outside lightgrid
 				}
 				factor *= frac[j];
 				data += gridStep[j];
@@ -212,7 +209,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) {
 			}
 		}
 
-		if ( ignore )
+		if ( j != 3 )
 			continue;
 
 		if (world->hdrLightGrid)
diff --git a/MP/code/renderer/tr_light.c b/MP/code/renderer/tr_light.c
index 68e3625..ad7b039 100644
--- a/MP/code/renderer/tr_light.c
+++ b/MP/code/renderer/tr_light.c
@@ -195,6 +195,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 {
@@ -202,6 +205,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
 			}
 		}
 
+		if ( j != 3 ) {
+			continue;
+		}
 		if ( !( data[0] + data[1] + data[2] ) ) {
 			continue;   // ignore samples in walls
 		}
diff --git a/SP/code/rend2/tr_light.c b/SP/code/rend2/tr_light.c
index 1d3df03..a24b626 100644
--- a/SP/code/rend2/tr_light.c
+++ b/SP/code/rend2/tr_light.c
@@ -195,16 +195,13 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) {
 		byte    *data;
 		int lat, lng;
 		vec3_t normal;
-		qboolean ignore;
 
 		factor = 1.0;
 		data = gridData;
-		ignore = qfalse;
 		for ( j = 0 ; j < 3 ; j++ ) {
 			if ( i & ( 1 << j ) ) {
-				if ((pos[j] + 1) > world->lightGridBounds[j] - 1)
-				{
-					ignore = qtrue; // ignore values outside lightgrid
+				if ( pos[j] + 1 > world->lightGridBounds[j] - 1 ) {
+					break; // ignore values outside lightgrid
 				}
 				factor *= frac[j];
 				data += gridStep[j];
@@ -213,7 +210,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent, world_t *world ) {
 			}
 		}
 
-		if ( ignore )
+		if ( j != 3 )
 			continue;
 
 		if (world->hdrLightGrid)
diff --git a/SP/code/renderer/tr_light.c b/SP/code/renderer/tr_light.c
index 89841d8..02ec0e5 100644
--- a/SP/code/renderer/tr_light.c
+++ b/SP/code/renderer/tr_light.c
@@ -195,6 +195,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 {
@@ -202,6 +205,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
 			}
 		}
 
+		if ( j != 3 ) {
+			continue;
+		}
 		if ( !( data[0] + data[1] + data[2] ) ) {
 			continue;   // ignore samples in walls
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list