Skip to content

Commit

Permalink
Have OpenGL2 "map $lightmap" check for NULL tr.lightmaps too
Browse files Browse the repository at this point in the history
Zero length lightmap lump will have NULL tr.lightmaps.

OpenGL1 already has this check, because r_vertexLight 1
would crash Team Arena. OpenGL2 does not disable loading lightmaps
when r_vertexLight is 1 though, so it does not have that issue.
  • Loading branch information
zturtleman committed May 25, 2014
1 parent 7a4ef47 commit 9c99cf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/renderergl2/tr_shader.c
Expand Up @@ -639,7 +639,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
else if ( !Q_stricmp( token, "$lightmap" ) )
{
stage->bundle[0].isLightmap = qtrue;
if ( shader.lightmapIndex < 0 ) {
if ( shader.lightmapIndex < 0 || !tr.lightmaps ) {
stage->bundle[0].image[0] = tr.whiteImage;
} else {
stage->bundle[0].image[0] = tr.lightmaps[shader.lightmapIndex];
Expand Down

0 comments on commit 9c99cf2

Please sign in to comment.