This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 3ee500468888a82c1e6f6586d5ecca768b352157
Author: m4n4t4...@gmail.com 
<m4n4t4...@gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Sat Jul 26 09:24:12 2014 +0000

    All: Rend2: Don't load external GLSL files by default
---
 MP/code/rend2/tr_glsl.c  | 14 ++++++++++----
 MP/code/rend2/tr_init.c  |  4 ++++
 MP/code/rend2/tr_local.h |  2 ++
 SP/code/rend2/tr_glsl.c  | 14 ++++++++++----
 SP/code/rend2/tr_init.c  |  4 ++++
 SP/code/rend2/tr_local.h |  2 ++
 6 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/MP/code/rend2/tr_glsl.c b/MP/code/rend2/tr_glsl.c
index a206d29..c304f2b 100644
--- a/MP/code/rend2/tr_glsl.c
+++ b/MP/code/rend2/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;
        }
 
diff --git a/MP/code/rend2/tr_init.c b/MP/code/rend2/tr_init.c
index 7f7e2a1..2500e56 100644
--- a/MP/code/rend2/tr_init.c
+++ b/MP/code/rend2/tr_init.c
@@ -130,6 +130,8 @@ cvar_t  *r_mergeLeafSurfaces;
 
 cvar_t  *r_cameraExposure;
 
+cvar_t  *r_externalGLSL;
+
 cvar_t  *r_hdr;
 cvar_t  *r_floatLightmap;
 cvar_t  *r_postProcess;
@@ -1281,6 +1283,8 @@ void R_Register( void ) {
        r_greyscale = ri.Cvar_Get("r_greyscale", "0", CVAR_ARCHIVE | 
CVAR_LATCH);
        ri.Cvar_CheckRange(r_greyscale, 0, 1, qfalse);
 
+       r_externalGLSL = ri.Cvar_Get( "r_externalGLSL", "0", CVAR_LATCH );
+
        r_hdr = ri.Cvar_Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH );
        r_floatLightmap = ri.Cvar_Get( "r_floatLightmap", "0", CVAR_ARCHIVE | 
CVAR_LATCH );
        r_postProcess = ri.Cvar_Get( "r_postProcess", "1", CVAR_ARCHIVE );
diff --git a/MP/code/rend2/tr_local.h b/MP/code/rend2/tr_local.h
index 09ddc30..ce82ea3 100644
--- a/MP/code/rend2/tr_local.h
+++ b/MP/code/rend2/tr_local.h
@@ -1961,6 +1961,8 @@ extern    cvar_t  *r_anaglyphMode;
 extern  cvar_t  *r_mergeMultidraws;
 extern  cvar_t  *r_mergeLeafSurfaces;
 
+extern  cvar_t  *r_externalGLSL;
+
 extern  cvar_t  *r_hdr;
 extern  cvar_t  *r_floatLightmap;
 extern  cvar_t  *r_postProcess;
diff --git a/SP/code/rend2/tr_glsl.c b/SP/code/rend2/tr_glsl.c
index a206d29..c304f2b 100644
--- a/SP/code/rend2/tr_glsl.c
+++ b/SP/code/rend2/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;
        }
 
diff --git a/SP/code/rend2/tr_init.c b/SP/code/rend2/tr_init.c
index 60ad9ca..7642744 100644
--- a/SP/code/rend2/tr_init.c
+++ b/SP/code/rend2/tr_init.c
@@ -136,6 +136,8 @@ cvar_t  *r_mergeLeafSurfaces;
 
 cvar_t  *r_cameraExposure;
 
+cvar_t  *r_externalGLSL;
+
 cvar_t  *r_hdr;
 cvar_t  *r_floatLightmap;
 cvar_t  *r_postProcess;
@@ -1305,6 +1307,8 @@ void R_Register( void ) {
        r_greyscale = ri.Cvar_Get("r_greyscale", "0", CVAR_ARCHIVE | 
CVAR_LATCH);
        ri.Cvar_CheckRange(r_greyscale, 0, 1, qfalse);
 
+       r_externalGLSL = ri.Cvar_Get( "r_externalGLSL", "0", CVAR_LATCH );
+       
        r_hdr = ri.Cvar_Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH );
        r_floatLightmap = ri.Cvar_Get( "r_floatLightmap", "0", CVAR_ARCHIVE | 
CVAR_LATCH );
        r_postProcess = ri.Cvar_Get( "r_postProcess", "1", CVAR_ARCHIVE );
diff --git a/SP/code/rend2/tr_local.h b/SP/code/rend2/tr_local.h
index 32feb6b..e6be278 100644
--- a/SP/code/rend2/tr_local.h
+++ b/SP/code/rend2/tr_local.h
@@ -1980,6 +1980,8 @@ extern    cvar_t  *r_anaglyphMode;
 extern  cvar_t  *r_mergeMultidraws;
 extern  cvar_t  *r_mergeLeafSurfaces;
 
+extern  cvar_t  *r_externalGLSL;
+
 extern  cvar_t  *r_hdr;
 extern  cvar_t  *r_floatLightmap;
 extern  cvar_t  *r_postProcess;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to