From: havoc Date: Sat, 5 Jan 2008 22:25:08 +0000 (+0000) Subject: GLSL code now prints the number of lines of leading text for warnings as X-Git-Tag: xonotic-v0.1.0preview~2589 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5816ac0f8e25dd165015570cc06ea9edb485524d;p=xonotic%2Fdarkplaces.git GLSL code now prints the number of lines of leading text for warnings as 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 --- diff --git a/gl_backend.c b/gl_backend.c index 25f0aa6e..f79f5a21 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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