diff options
author | Zack Middleton <zturtleman@gmail.com> | 2014-07-25 23:34:29 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-08-28 11:13:04 +0100 |
commit | d962e634e350c553fa4b8df380c40bc27c005ce8 (patch) | |
tree | 6c9194c834432e96dc389e651e4a7f7a3047acf3 /src/renderergl2/tr_glsl.c | |
parent | eb26d7c10d8f6dfecc114963c428f064ca69c551 (diff) |
Don't load external GLSL files by default
External GLSL should probably only be used for development testing,
not released products. The GLSL files are tied to the code, and the
code changes some what often.
Fixes using OpenArena 0.8.8 which has incompatible GLSL files in a pk3.
Diffstat (limited to 'src/renderergl2/tr_glsl.c')
-rw-r--r-- | src/renderergl2/tr_glsl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/renderergl2/tr_glsl.c b/src/renderergl2/tr_glsl.c index 58a00e6e..ed078ddf 100644 --- a/src/renderergl2/tr_glsl.c +++ b/src/renderergl2/tr_glsl.c @@ -400,24 +400,30 @@ static int GLSL_LoadGPUShaderText(const char *name, const char *fallback, Com_sprintf(filename, sizeof(filename), "glsl/%s_fp.glsl", name); } - ri.Printf(PRINT_DEVELOPER, "...loading '%s'\n", filename); - size = ri.FS_ReadFile(filename, (void **)&buffer); + if ( r_externalGLSL->integer ) { + size = ri.FS_ReadFile(filename, (void **)&buffer); + } else { + size = 0; + buffer = NULL; + } + if(!buffer) { if (fallback) { - ri.Printf(PRINT_DEVELOPER, "couldn't load, using fallback\n"); + ri.Printf(PRINT_DEVELOPER, "...loading built-in '%s'\n", filename); shaderText = fallback; size = strlen(shaderText); } else { - ri.Printf(PRINT_DEVELOPER, "couldn't load!\n"); + ri.Printf(PRINT_DEVELOPER, "couldn't load '%s'\n", filename); return 0; } } else { + ri.Printf(PRINT_DEVELOPER, "...loading '%s'\n", filename); shaderText = buffer; } |