]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a C99 lazy variable issue with non-C99 compilers
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 4 Mar 2006 02:45:32 +0000 (02:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 4 Mar 2006 02:45:32 +0000 (02:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6052 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index d6b8a8b19f8da587643f6b547bc8dfd1b9013a02..35b7379f70777f902c766864cdb6b07769530815 100644 (file)
@@ -459,15 +459,15 @@ const char *builtinshader_light_frag =
 
 int R_Shadow_CompileShaderPermutation(int permutation)
 {
-       if (r_shadow_program_compiledlight[permutation])
-               return r_shadow_program_light[permutation];
-       r_shadow_program_compiledlight[permutation] = true;
        char *vertstring, *fragstring;
        int vertstrings_count;
        int fragstrings_count;
        const char *vertstrings_list[SHADERPERMUTATION_COUNT+1];
        const char *fragstrings_list[SHADERPERMUTATION_COUNT+1];
        char permutationname[256];
+       if (r_shadow_program_compiledlight[permutation])
+               return r_shadow_program_light[permutation];
+       r_shadow_program_compiledlight[permutation] = true;
        vertstring = (char *)FS_LoadFile("glsl/light.vert", tempmempool, false, NULL);
        fragstring = (char *)FS_LoadFile("glsl/light.frag", tempmempool, false, NULL);
        vertstrings_count = 0;