summaryrefslogtreecommitdiff
path: root/src/renderergl2
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2013-03-12 22:00:51 -0700
committerTim Angus <tim@ngus.net>2013-03-19 16:41:20 +0000
commitee7ec241bf5fec5dcb97414e255573df52f42b0a (patch)
tree39b1840174620bdae1f590ca3c6455451fe40c68 /src/renderergl2
parentbb1aa0f33293103de2729d3328ac37f8fbc8cfb0 (diff)
Remove some more automatic sRGB image flags.
Diffstat (limited to 'src/renderergl2')
-rw-r--r--src/renderergl2/tr_shader.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c
index 90869b47..5dfe4d5f 100644
--- a/src/renderergl2/tr_shader.c
+++ b/src/renderergl2/tr_shader.c
@@ -757,7 +757,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
}
num = stage->bundle[0].numImageAnimations;
if ( num < MAX_IMAGE_ANIMATIONS ) {
- imgFlags_t flags = IMGFLAG_SRGB;
+ imgFlags_t flags = IMGFLAG_NONE;
if (!shader.noMipMaps)
flags |= IMGFLAG_MIPMAP;
@@ -765,6 +765,9 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
if (!shader.noPicMip)
flags |= IMGFLAG_PICMIP;
+ if (r_srgb->integer)
+ flags |= IMGFLAG_SRGB;
+
stage->bundle[0].image[num] = R_FindImageFile( token, IMGTYPE_COLORALPHA, flags );
if ( !stage->bundle[0].image[num] )
{
@@ -1377,6 +1380,10 @@ static void ParseSkyParms( char **text ) {
static char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
char pathname[MAX_QPATH];
int i;
+ imgFlags_t imgFlags = IMGFLAG_MIPMAP | IMGFLAG_PICMIP;
+
+ if (r_srgb->integer)
+ imgFlags |= IMGFLAG_SRGB;
// outerbox
token = COM_ParseExt( text, qfalse );
@@ -1388,7 +1395,7 @@ static void ParseSkyParms( char **text ) {
for (i=0 ; i<6 ; i++) {
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga"
, token, suf[i] );
- shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP | IMGFLAG_CLAMPTOEDGE );
+ shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags | IMGFLAG_CLAMPTOEDGE );
if ( !shader.sky.outerbox[i] ) {
shader.sky.outerbox[i] = tr.defaultImage;
@@ -1419,7 +1426,7 @@ static void ParseSkyParms( char **text ) {
for (i=0 ; i<6 ; i++) {
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga"
, token, suf[i] );
- shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP );
+ shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags );
if ( !shader.sky.innerbox[i] ) {
shader.sky.innerbox[i] = tr.defaultImage;
}