r_glsl_dumpshader: shaderpermutationinfo[i].pretext needs to be checked, otherwise...
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Jan 2010 15:02:04 +0000 (15:02 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Jan 2010 15:02:04 +0000 (15:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9773 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 1323fef..32b747d 100644 (file)
@@ -4164,10 +4164,14 @@ void R_GLSL_DumpShader_f(void)
        {
                FS_Print(file, "/* The engine may define the following macros:\n");
                FS_Print(file, "#define VERTEX_SHADER\n#define GEOMETRY_SHADER\n#define FRAGMENT_SHADER\n");
-               for (i = 0;i < SHADERMODE_COUNT;i++)
-                       FS_Print(file, glslshadermodeinfo[i].pretext);
-               for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
-                       FS_Print(file, shaderpermutationinfo[i].pretext);
+               for (i = 0;i < SHADERMODE_COUNT;i++) {
+                       if (glslshadermodeinfo[i].pretext)
+                               FS_Print(file, glslshadermodeinfo[i].pretext);
+               }
+               for (i = 0;i < SHADERPERMUTATION_COUNT;i++) {
+                       if (shaderpermutationinfo[i].pretext)
+                               FS_Print(file, shaderpermutationinfo[i].pretext);
+               }
                FS_Print(file, "*/\n");
                FS_Print(file, builtinshaderstring);
                FS_Close(file);