Add warnings for animMap and videoMap shader keywords

This commit is contained in:
Zack Middleton 2017-07-02 16:57:49 -05:00
parent 5aa7fb39c2
commit 4dffc52c1d
2 changed files with 20 additions and 0 deletions

View file

@ -687,6 +687,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
//
else if ( !Q_stricmp( token, "animMap" ) )
{
int totalImages = 0;
token = COM_ParseExt( text, qfalse );
if ( !token[0] )
{
@ -721,6 +723,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" ) )
@ -735,6 +743,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 );
}
}
//

View file

@ -744,6 +744,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
//
else if ( !Q_stricmp( token, "animMap" ) )
{
int totalImages = 0;
token = COM_ParseExt( text, qfalse );
if ( !token[0] )
{
@ -778,6 +780,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" ) )
@ -792,6 +800,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 );
}
}
//