From: Rudolf Polzer Date: Wed, 14 Dec 2011 08:27:49 +0000 (+0100) Subject: option: -sRGBcolor (unused yet) X-Git-Tag: xonotic-v0.6.0~42 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4e45cb8976243b4ab56234e72e73d0e2e02a254;p=xonotic%2Fnetradiant.git option: -sRGBcolor (unused yet) --- diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index e1b1e2fd..8fe5966a 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -684,6 +684,7 @@ int BSPMain( int argc, char **argv ) maxSurfaceIndexes = game->maxSurfaceIndexes; emitFlares = game->emitFlares; texturesRGB = game->texturesRGB; + colorsRGB = game->colorsRGB; /* process arguments */ for( i = 1; i < (argc - 1); i++ ) @@ -934,6 +935,16 @@ int BSPMain( int argc, char **argv ) texturesRGB = qfalse; Sys_Printf( "Textures are linear\n" ); } + else if( !strcmp( argv[ i ], "-sRGBcolor" ) ) + { + colorsRGB = qtrue; + Sys_Printf( "Colors are in sRGB\n" ); + } + else if( !strcmp( argv[ i ], "-nosRGBcolor" ) ) + { + colorsRGB = qfalse; + Sys_Printf( "Colors are linear\n" ); + } else if( !strcmp( argv[ i ], "-altsplit" ) ) { Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" ); diff --git a/tools/quake3/q3map2/game__null.h b/tools/quake3/q3map2/game__null.h index 5ff6aba7..0f1a2a71 100644 --- a/tools/quake3/q3map2/game__null.h +++ b/tools/quake3/q3map2/game__null.h @@ -65,6 +65,7 @@ game_t struct 0, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 0, /* lightmap exposure */ 0, /* lightmap compensate */ 0, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_darkplaces.h b/tools/quake3/q3map2/game_darkplaces.h index ab73baa7..1e09440f 100644 --- a/tools/quake3/q3map2/game_darkplaces.h +++ b/tools/quake3/q3map2/game_darkplaces.h @@ -56,6 +56,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.3f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_dq.h b/tools/quake3/q3map2/game_dq.h index 6507aec1..92b40148 100644 --- a/tools/quake3/q3map2/game_dq.h +++ b/tools/quake3/q3map2/game_dq.h @@ -56,6 +56,7 @@ game_t struct 1.2f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.3f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_ef.h b/tools/quake3/q3map2/game_ef.h index 11136642..7800f2bb 100644 --- a/tools/quake3/q3map2/game_ef.h +++ b/tools/quake3/q3map2/game_ef.h @@ -115,6 +115,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_etut.h b/tools/quake3/q3map2/game_etut.h index 38bc083d..ebc0b92c 100644 --- a/tools/quake3/q3map2/game_etut.h +++ b/tools/quake3/q3map2/game_etut.h @@ -150,6 +150,7 @@ game_t struct 1.0f, /* lightmap gamma */ qtrue, /* lightmap sRGB */ qfalse, /* texture sRGB (yes, this is incorrect, but we better match ET:UT) */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_ja.h b/tools/quake3/q3map2/game_ja.h index 3a1a4d48..daf1f803 100644 --- a/tools/quake3/q3map2/game_ja.h +++ b/tools/quake3/q3map2/game_ja.h @@ -69,6 +69,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_jk2.h b/tools/quake3/q3map2/game_jk2.h index 4dd4d845..b56e6e11 100644 --- a/tools/quake3/q3map2/game_jk2.h +++ b/tools/quake3/q3map2/game_jk2.h @@ -66,6 +66,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_nexuiz.h b/tools/quake3/q3map2/game_nexuiz.h index 386cfd03..dcfc0a22 100644 --- a/tools/quake3/q3map2/game_nexuiz.h +++ b/tools/quake3/q3map2/game_nexuiz.h @@ -65,6 +65,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_prophecy.h b/tools/quake3/q3map2/game_prophecy.h index 6d8b0a21..9de11145 100644 --- a/tools/quake3/q3map2/game_prophecy.h +++ b/tools/quake3/q3map2/game_prophecy.h @@ -56,6 +56,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.4f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_qfusion.h b/tools/quake3/q3map2/game_qfusion.h index 681f75d7..1a2c926f 100644 --- a/tools/quake3/q3map2/game_qfusion.h +++ b/tools/quake3/q3map2/game_qfusion.h @@ -117,6 +117,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_quake3.h b/tools/quake3/q3map2/game_quake3.h index 76b3ff37..90a066e5 100644 --- a/tools/quake3/q3map2/game_quake3.h +++ b/tools/quake3/q3map2/game_quake3.h @@ -114,6 +114,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_quakelive.h b/tools/quake3/q3map2/game_quakelive.h index ba781cdc..e6703fc9 100644 --- a/tools/quake3/q3map2/game_quakelive.h +++ b/tools/quake3/q3map2/game_quakelive.h @@ -66,6 +66,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_reaction.h b/tools/quake3/q3map2/game_reaction.h index ea59e358..55b19c3f 100644 --- a/tools/quake3/q3map2/game_reaction.h +++ b/tools/quake3/q3map2/game_reaction.h @@ -86,6 +86,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_sof2.h b/tools/quake3/q3map2/game_sof2.h index 98081da6..adce6b67 100644 --- a/tools/quake3/q3map2/game_sof2.h +++ b/tools/quake3/q3map2/game_sof2.h @@ -141,6 +141,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_tenebrae.h b/tools/quake3/q3map2/game_tenebrae.h index 9e0658f1..081c9c4d 100644 --- a/tools/quake3/q3map2/game_tenebrae.h +++ b/tools/quake3/q3map2/game_tenebrae.h @@ -114,6 +114,7 @@ game_t struct 2.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_tremulous.h b/tools/quake3/q3map2/game_tremulous.h index 08027fe6..a74c539c 100644 --- a/tools/quake3/q3map2/game_tremulous.h +++ b/tools/quake3/q3map2/game_tremulous.h @@ -72,6 +72,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_wolf.h b/tools/quake3/q3map2/game_wolf.h index 94339e65..d16e2db5 100644 --- a/tools/quake3/q3map2/game_wolf.h +++ b/tools/quake3/q3map2/game_wolf.h @@ -131,6 +131,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_wolfet.h b/tools/quake3/q3map2/game_wolfet.h index bcb30985..f6c69d1d 100644 --- a/tools/quake3/q3map2/game_wolfet.h +++ b/tools/quake3/q3map2/game_wolfet.h @@ -68,6 +68,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/game_xonotic.h b/tools/quake3/q3map2/game_xonotic.h index 25121930..3e132041 100644 --- a/tools/quake3/q3map2/game_xonotic.h +++ b/tools/quake3/q3map2/game_xonotic.h @@ -65,6 +65,7 @@ game_t struct 1.0f, /* lightmap gamma */ qfalse, /* lightmap sRGB */ qfalse, /* texture sRGB */ + qfalse, /* color sRGB */ 1.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index f4a735ca..67c0b4ca 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2083,6 +2083,12 @@ int LightMain( int argc, char **argv ) else Sys_Printf( " texture colorspace: linear\n" ); + colorsRGB = game->colorsRGB; + if(colorsRGB) + Sys_Printf( " _color colorspace: sRGB\n" ); + else + Sys_Printf( " _color colorspace: linear\n" ); + lightmapCompensate = game->lightmapCompensate; Sys_Printf( " lightning compensation: %f\n", lightmapCompensate ); @@ -2259,6 +2265,18 @@ int LightMain( int argc, char **argv ) Sys_Printf( "Textures are linear\n" ); } + else if( !strcmp( argv[ i ], "-sRGBcolor" ) ) + { + colorsRGB = qtrue; + Sys_Printf( "Colors are in sRGB\n" ); + } + + else if( !strcmp( argv[ i ], "-nosRGBcolor" ) ) + { + colorsRGB = qfalse; + Sys_Printf( "Colors are linear\n" ); + } + else if( !strcmp( argv[ i ], "-exposure" ) ) { f = atof( argv[ i + 1 ] ); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 720d63b1..58a6d2fe 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -567,6 +567,7 @@ typedef struct game_s float lightmapGamma; /* default lightmap gamma */ qboolean lightmapsRGB; /* default lightmap sRGB mode */ qboolean texturesRGB; /* default texture sRGB mode */ + qboolean colorsRGB; /* default color sRGB mode */ float lightmapExposure; /* default lightmap exposure */ float lightmapCompensate; /* default lightmap compensate value */ float gridScale; /* vortex: default lightgrid scale (affects both directional and ambient spectres) */ @@ -2302,6 +2303,7 @@ Q_EXTERN qboolean inGrid Q_ASSIGN(0); Q_EXTERN float lightmapGamma Q_ASSIGN( 1.0f ); Q_EXTERN float lightmapsRGB Q_ASSIGN( qfalse ); Q_EXTERN float texturesRGB Q_ASSIGN( qfalse ); +Q_EXTERN float colorsRGB Q_ASSIGN( qfalse ); Q_EXTERN float lightmapExposure Q_ASSIGN( 1.0f ); Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f );