mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 03:51:18 +00:00
minimap: -boost = contrast boost (like in darkplaces)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@348 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
parent
0375a83f2b
commit
9f8d3f0a00
1 changed files with 25 additions and 0 deletions
|
@ -103,6 +103,7 @@ typedef struct minimap_s
|
||||||
float *sample_offsets;
|
float *sample_offsets;
|
||||||
float sharpen_boxmult;
|
float sharpen_boxmult;
|
||||||
float sharpen_centermult;
|
float sharpen_centermult;
|
||||||
|
float boost;
|
||||||
float *data1f;
|
float *data1f;
|
||||||
float *sharpendata1f;
|
float *sharpendata1f;
|
||||||
vec3_t mins, size;
|
vec3_t mins, size;
|
||||||
|
@ -319,6 +320,17 @@ static void MiniMapSharpen(int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void MiniMapContrastBoost(int y)
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
float *q = &minimap.data1f[y * minimap.width];
|
||||||
|
for(x = 0; x < minimap.width; ++x)
|
||||||
|
{
|
||||||
|
*q = *q * minimap.boost / ((minimap.boost - 1) * *q + 1);
|
||||||
|
++q;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MiniMapMakeMinsMaxs(vec3_t mins_in, vec3_t maxs_in, float border, qboolean keepaspect)
|
void MiniMapMakeMinsMaxs(vec3_t mins_in, vec3_t maxs_in, float border, qboolean keepaspect)
|
||||||
{
|
{
|
||||||
vec3_t mins, maxs, extend;
|
vec3_t mins, maxs, extend;
|
||||||
|
@ -595,6 +607,7 @@ int MiniMapBSPMain( int argc, char **argv )
|
||||||
|
|
||||||
minimap.samples = 1;
|
minimap.samples = 1;
|
||||||
minimap.sample_offsets = NULL;
|
minimap.sample_offsets = NULL;
|
||||||
|
minimap.boost = 1.0;
|
||||||
|
|
||||||
/* process arguments */
|
/* process arguments */
|
||||||
for( i = 1; i < (argc - 1); i++ )
|
for( i = 1; i < (argc - 1); i++ )
|
||||||
|
@ -678,6 +691,12 @@ int MiniMapBSPMain( int argc, char **argv )
|
||||||
mode = MINIMAP_MODE_WHITE;
|
mode = MINIMAP_MODE_WHITE;
|
||||||
Sys_Printf( "Writing as white alpha image\n" );
|
Sys_Printf( "Writing as white alpha image\n" );
|
||||||
}
|
}
|
||||||
|
else if( !strcmp( argv[ i ], "-boost" ) )
|
||||||
|
{
|
||||||
|
minimap.boost = atof(argv[i + 1]);
|
||||||
|
i++;
|
||||||
|
Sys_Printf( "Contrast boost set to %f\n", minimap.boost );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MiniMapMakeMinsMaxs(mins, maxs, border, keepaspect);
|
MiniMapMakeMinsMaxs(mins, maxs, border, keepaspect);
|
||||||
|
@ -725,6 +744,12 @@ int MiniMapBSPMain( int argc, char **argv )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(minimap.boost != 1.0)
|
||||||
|
{
|
||||||
|
Sys_Printf( "\n--- MiniMapContrastBoost (%d) ---\n", minimap.height );
|
||||||
|
RunThreadsOnIndividual(minimap.height, qtrue, MiniMapContrastBoost);
|
||||||
|
}
|
||||||
|
|
||||||
if(minimap.sharpendata1f)
|
if(minimap.sharpendata1f)
|
||||||
{
|
{
|
||||||
Sys_Printf( "\n--- MiniMapSharpen (%d) ---\n", minimap.height );
|
Sys_Printf( "\n--- MiniMapSharpen (%d) ---\n", minimap.height );
|
||||||
|
|
Loading…
Reference in a new issue