diff options
author | Zack Middleton <zturtleman@gmail.com> | 2013-06-02 21:59:01 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:32 +0100 |
commit | f2566c01933d14fee5c2c252e7c47b993e79b81c (patch) | |
tree | b017a40c0d2a98a464fc803389995a876e348ec9 | |
parent | 9d80a63e44f513ec984375af62969a738a6bbee3 (diff) |
Improve warning for shader missing opening brace
-rw-r--r-- | src/renderergl1/tr_shader.c | 8 | ||||
-rw-r--r-- | src/renderergl2/tr_shader.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/renderergl1/tr_shader.c b/src/renderergl1/tr_shader.c index 76ac27ca..ad0af3cf 100644 --- a/src/renderergl1/tr_shader.c +++ b/src/renderergl1/tr_shader.c @@ -2962,7 +2962,13 @@ static void ScanAndLoadShaderFiles( void ) token = COM_ParseExt(&p, qtrue); if(token[0] != '{' || token[1] != '\0') { - ri.Printf(PRINT_WARNING, "WARNING: Bad shader file %s has incorrect syntax.\n", filename); + ri.Printf(PRINT_WARNING, "WARNING: Ignoring shader file %s. Shader \"%s\" on line %d missing opening brace", + filename, shaderName, shaderLine); + if (token[0]) + { + ri.Printf(PRINT_WARNING, " (found \"%s\" on line %d)", token, COM_GetCurrentParseLine()); + } + ri.Printf(PRINT_WARNING, ".\n"); ri.FS_FreeFile(buffers[i]); buffers[i] = NULL; break; diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c index 63d89025..1ca2fceb 100644 --- a/src/renderergl2/tr_shader.c +++ b/src/renderergl2/tr_shader.c @@ -3602,7 +3602,13 @@ static void ScanAndLoadShaderFiles( void ) token = COM_ParseExt(&p, qtrue); if(token[0] != '{' || token[1] != '\0') { - ri.Printf(PRINT_WARNING, "WARNING: Bad shader file %s has incorrect syntax.\n", filename); + ri.Printf(PRINT_WARNING, "WARNING: Ignoring shader file %s. Shader \"%s\" on line %d missing opening brace", + filename, shaderName, shaderLine); + if (token[0]) + { + ri.Printf(PRINT_WARNING, " (found \"%s\" on line %d)", token, COM_GetCurrentParseLine()); + } + ri.Printf(PRINT_WARNING, ".\n"); ri.FS_FreeFile(buffers[i]); buffers[i] = NULL; break; |