]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
GLSL code now prints the number of lines of leading text for warnings as
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Jan 2008 22:25:08 +0000 (22:25 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Jan 2008 22:25:08 +0000 (22:25 +0000)
well as error messages (making warnings easier to fix)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7915 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 25f0aa6e25c80313d4102b833f9394b54ffd8294..f79f5a2102daa23207d9f0399839cc57e0220713 100644 (file)
@@ -933,8 +933,15 @@ qboolean GL_Backend_CompileShader(int programobject, GLenum shadertypeenum, cons
        qglCompileShaderARB(shaderobject);CHECKGLERROR
        qglGetObjectParameterivARB(shaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &shadercompiled);CHECKGLERROR
        qglGetInfoLogARB(shaderobject, sizeof(compilelog), NULL, compilelog);CHECKGLERROR
-       if (compilelog[0])
-               Con_DPrintf("%s shader compile log:\n%s\n", shadertype, compilelog);
+       if (compilelog[0] && developer.integer > 0)
+       {
+               int i, j, pretextlines = 0;
+               for (i = 0;i < numstrings - 1;i++)
+                       for (j = 0;strings[i][j];j++)
+                               if (strings[i][j] == '\n')
+                                       pretextlines++;
+               Con_DPrintf("%s shader compile log:\n%s\n(line offset for any above warnings/errors: %i)\n", shadertype, compilelog, pretextlines);
+       }
        if (!shadercompiled)
        {
                qglDeleteObjectARB(shaderobject);CHECKGLERROR