[iortcw] 55/89: All: Add warnings for animMap and videoMap shader keywords

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:27 UTC 2017


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

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit d6adba9f162ccd4619ecd17bda224d15fee93ac3
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Wed Jul 19 16:49:20 2017 -0400

    All: Add warnings for animMap and videoMap shader keywords
---
 MP/code/rend2/tr_shader.c    | 10 ++++++++++
 MP/code/renderer/tr_shader.c | 10 ++++++++++
 SP/code/rend2/tr_shader.c    | 10 ++++++++++
 SP/code/renderer/tr_shader.c | 10 ++++++++++
 4 files changed, 40 insertions(+)

diff --git a/MP/code/rend2/tr_shader.c b/MP/code/rend2/tr_shader.c
index a83f59f..dcd3f02 100644
--- a/MP/code/rend2/tr_shader.c
+++ b/MP/code/rend2/tr_shader.c
@@ -712,6 +712,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 		// animMap <frequency> <image1> .... <imageN>
 		//
 		else if ( !Q_stricmp( token, "animMap" ) ) {
+			int	totalImages = 0;
+
 			token = COM_ParseExt( text, qfalse );
 			if ( !token[0] ) {
 				ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
@@ -744,6 +746,12 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 					}
 					stage->bundle[0].numImageAnimations++;
 				}
+				totalImages++;
+			}
+
+			if ( totalImages > MAX_IMAGE_ANIMATIONS ) {
+				ri.Printf( PRINT_WARNING, "WARNING: ignoring excess images for 'animMap' (found %d, max is %d) in shader '%s'\n",
+						totalImages, MAX_IMAGE_ANIMATIONS, shader.name );
 			}
 		} else if ( !Q_stricmp( token, "videoMap" ) )    {
 			token = COM_ParseExt( text, qfalse );
@@ -755,6 +763,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 			if ( stage->bundle[0].videoMapHandle != -1 ) {
 				stage->bundle[0].isVideoMap = qtrue;
 				stage->bundle[0].image[0] = tr.scratchImage[stage->bundle[0].videoMapHandle];
+			} else {
+				ri.Printf( PRINT_WARNING, "WARNING: could not load '%s' for 'videoMap' keyword in shader '%s'\n", token, shader.name );
 			}
 		}
 		//
diff --git a/MP/code/renderer/tr_shader.c b/MP/code/renderer/tr_shader.c
index c6564e3..148c87e 100644
--- a/MP/code/renderer/tr_shader.c
+++ b/MP/code/renderer/tr_shader.c
@@ -659,6 +659,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 		// animMap <frequency> <image1> .... <imageN>
 		//
 		else if ( !Q_stricmp( token, "animMap" ) ) {
+			int	totalImages = 0;
+
 			token = COM_ParseExt( text, qfalse );
 			if ( !token[0] ) {
 				ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
@@ -692,6 +694,12 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 					}
 					stage->bundle[0].numImageAnimations++;
 				}
+				totalImages++;
+			}
+
+			if ( totalImages > MAX_IMAGE_ANIMATIONS ) {
+				ri.Printf( PRINT_WARNING, "WARNING: ignoring excess images for 'animMap' (found %d, max is %d) in shader '%s'\n",
+						totalImages, MAX_IMAGE_ANIMATIONS, shader.name );
 			}
 		} else if ( !Q_stricmp( token, "videoMap" ) )    {
 			token = COM_ParseExt( text, qfalse );
@@ -703,6 +711,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 			if ( stage->bundle[0].videoMapHandle != -1 ) {
 				stage->bundle[0].isVideoMap = qtrue;
 				stage->bundle[0].image[0] = tr.scratchImage[stage->bundle[0].videoMapHandle];
+			} else {
+				ri.Printf( PRINT_WARNING, "WARNING: could not load '%s' for 'videoMap' keyword in shader '%s'\n", token, shader.name );
 			}
 		}
 		//
diff --git a/SP/code/rend2/tr_shader.c b/SP/code/rend2/tr_shader.c
index b6a1ae7..7338fe0 100644
--- a/SP/code/rend2/tr_shader.c
+++ b/SP/code/rend2/tr_shader.c
@@ -723,6 +723,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 		// animMap <frequency> <image1> .... <imageN>
 		//
 		else if ( !Q_stricmp( token, "animMap" ) ) {
+			int	totalImages = 0;
+
 			token = COM_ParseExt( text, qfalse );
 			if ( !token[0] ) {
 				ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
@@ -755,6 +757,12 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 					}
 					stage->bundle[0].numImageAnimations++;
 				}
+				totalImages++;
+			}
+
+			if ( totalImages > MAX_IMAGE_ANIMATIONS ) {
+				ri.Printf( PRINT_WARNING, "WARNING: ignoring excess images for 'animMap' (found %d, max is %d) in shader '%s'\n",
+						totalImages, MAX_IMAGE_ANIMATIONS, shader.name );
 			}
 		} else if ( !Q_stricmp( token, "videoMap" ) )    {
 			token = COM_ParseExt( text, qfalse );
@@ -766,6 +774,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 			if ( stage->bundle[0].videoMapHandle != -1 ) {
 				stage->bundle[0].isVideoMap = qtrue;
 				stage->bundle[0].image[0] = tr.scratchImage[stage->bundle[0].videoMapHandle];
+			} else {
+				ri.Printf( PRINT_WARNING, "WARNING: could not load '%s' for 'videoMap' keyword in shader '%s'\n", token, shader.name );
 			}
 		}
 		//
diff --git a/SP/code/renderer/tr_shader.c b/SP/code/renderer/tr_shader.c
index dd05d4b..3fef5bf 100644
--- a/SP/code/renderer/tr_shader.c
+++ b/SP/code/renderer/tr_shader.c
@@ -670,6 +670,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 		// animMap <frequency> <image1> .... <imageN>
 		//
 		else if ( !Q_stricmp( token, "animMap" ) ) {
+			int	totalImages = 0;
+
 			token = COM_ParseExt( text, qfalse );
 			if ( !token[0] ) {
 				ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
@@ -702,6 +704,12 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 					}
 					stage->bundle[0].numImageAnimations++;
 				}
+				totalImages++;
+			}
+
+			if ( totalImages > MAX_IMAGE_ANIMATIONS ) {
+				ri.Printf( PRINT_WARNING, "WARNING: ignoring excess images for 'animMap' (found %d, max is %d) in shader '%s'\n",
+						totalImages, MAX_IMAGE_ANIMATIONS, shader.name );
 			}
 		} else if ( !Q_stricmp( token, "videoMap" ) )    {
 			token = COM_ParseExt( text, qfalse );
@@ -713,6 +721,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
 			if ( stage->bundle[0].videoMapHandle != -1 ) {
 				stage->bundle[0].isVideoMap = qtrue;
 				stage->bundle[0].image[0] = tr.scratchImage[stage->bundle[0].videoMapHandle];
+			} else {
+				ri.Printf( PRINT_WARNING, "WARNING: could not load '%s' for 'videoMap' keyword in shader '%s'\n", token, shader.name );
 			}
 		}
 		//

-- 
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