From 45d29f81ca2fe8b1eac4856cebf76b23f28ae29e Mon Sep 17 00:00:00 2001 From: blub Date: Tue, 5 Jan 2010 17:20:09 +0000 Subject: [PATCH] Make SHADERPERMUTATION_COUNT be the actual size of the array. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9783 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=210695e98c4530c1f4999e89191659590f5f5c70 --- gl_rmain.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index e97a1caf..1503081d 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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); -- 2.39.2