Make SHADERPERMUTATION_COUNT be the actual size of the array.
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 17:20:09 +0000 (17:20 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 17:20:09 +0000 (17:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9783 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 7eee096..126f024 100644 (file)
@@ -3147,7 +3147,7 @@ typedef enum shaderpermutation_e
        SHADERPERMUTATION_DEFERREDLIGHTMAP = 1<<24, ///< (lightmap) read Texture_ScreenDiffuse/Specular textures and add them on top of lightmapping
        SHADERPERMUTATION_ALPHAKILL = 1<<25, ///< (deferredgeometry) discard pixel if diffuse texture alpha below 0.5
        SHADERPERMUTATION_LIMIT = 1<<26, ///< size of permutations array
-       SHADERPERMUTATION_COUNT = 27 ///< size of shaderpermutationinfo array
+       SHADERPERMUTATION_COUNT = 26 ///< size of shaderpermutationinfo array
 }
 shaderpermutation_t;
 
@@ -4164,14 +4164,10 @@ 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++) {
-                       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);
-               }
+               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);
                FS_Print(file, "*/\n");
                FS_Print(file, builtinshaderstring);
                FS_Close(file);