vmap: Allow non underscore versions of light key/value pairs

This commit is contained in:
Marco Cawthorne 2021-06-29 21:11:40 +02:00
parent bcadd67229
commit 223182aac5
3 changed files with 58 additions and 11 deletions

View File

@ -490,6 +490,26 @@ private:
dupecheck = 1;
else if (!strcmp(key, "message"))
dupecheck = 1;
else if (!strcmp(key, "fade")) /* light keys */
dupecheck = 1;
else if (!strcmp(key, "anglescale"))
dupecheck = 1;
else if (!strcmp(key, "style"))
dupecheck = 1;
else if (!strcmp(key, "light"))
dupecheck = 1;
else if (!strcmp(key, "deviance"))
dupecheck = 1;
else if (!strcmp(key, "samples"))
dupecheck = 1;
else if (!strcmp(key, "filter"))
dupecheck = 1;
else if (!strcmp(key, "color"))
dupecheck = 1;
else if (!strcmp(key, "color255"))
dupecheck = 1;
else if (!strcmp(key, "extradist"))
dupecheck = 1;
KeyValues::iterator i = m_keyValues.find( key );

View File

@ -319,17 +319,16 @@ void HelpImport()
void HelpCommon()
{
struct HelpOption common[] = {
{"-game <gamename>", "Sets a different game directory name (can be used more than once)"},
{"-connect <address>", "Talk to a WorldSpawn instance using a specific XML based protocol"},
{"-force", "Allow reading some broken/unsupported BSP files e.g. when decompiling, may also crash"},
{"-fs_basepath <path>", "Sets the given path as main directory of the game (can be used more than once to look in multiple paths)"},
{"-fs_game <gamename>", "Sets a different game directory name (default for Q3A: baseq3, can be used more than once)"},
{"-fs_homebase <dir>", "Specifies where the user home directory name is on Linux (default for Q3A: .q3a)"},
{"-fs_homepath <path>", "Sets the given path as home directory name"},
{"-fs_nobasepath", "Do not load base paths in VFS, imply -fs_nomagicpath"},
{"-fs_nomagicpath", "Do not try to guess base path magically"},
{"-fs_nohomepath", "Do not load home path in VFS"},
{"-fs_pakpath <path>", "Specify a package directory (can be used more than once to look in multiple paths)"},
{"-game <gamename>", "Load settings for the given game (default: quake3)"},
{"-subdivisions <F>", "multiplier for patch subdivisions quality"},
{"-threads <N>", "number of threads to use"},
{"-v", "Verbose mode"}
@ -341,8 +340,8 @@ void HelpCommon()
void HelpMain(const char* arg)
{
printf("Usage: q3map2 [stage] [common options...] [stage options...] [stage source file]\n");
printf(" q3map2 -help [stage]\n\n");
printf("Usage: vmap [stage] [common options...] [stage options...] [stage source file]\n");
printf(" vmap -help [stage]\n\n");
HelpCommon();

View File

@ -411,7 +411,11 @@ void CreateEntityLights( void ){
}
/* ydnar: set angle scaling (from vlight) */
light->angleScale = FloatForKey( e, "_anglescale" );
light->angleScale = FloatForKey( e, "anglescale" );
if ( light->angleScale != 0.0f ) {
light->angleScale = FloatForKey( e, "_anglescale" );
}
if ( light->angleScale != 0.0f ) {
light->flags |= LIGHT_ATTEN_ANGLE;
}
@ -447,14 +451,22 @@ void CreateEntityLights( void ){
intensity *= scale;
/* ydnar: get deviance and samples */
deviance = FloatForKey( e, "_deviance" );
deviance = FloatForKey( e, "deviance" );
if ( deviance == 0.0f ) {
deviance = FloatForKey( e, "_deviance" );
}
if ( deviance == 0.0f ) {
deviance = FloatForKey( e, "_deviation" );
}
if ( deviance == 0.0f ) {
deviance = FloatForKey( e, "_jitter" );
}
numSamples = IntForKey( e, "_samples" );
numSamples = IntForKey( e, "samples" );
if ( numSamples < 1 ) {
numSamples = IntForKey( e, "_samples" );
}
if ( deviance < 0.0f || numSamples < 1 ) {
deviance = 0.0f;
numSamples = 1;
@ -462,7 +474,10 @@ void CreateEntityLights( void ){
intensity /= numSamples;
/* ydnar: get filter radius */
filterRadius = FloatForKey( e, "_filterradius" );
filterRadius = FloatForKey( e, "filter" );
if ( filterRadius == 0.0f ) {
filterRadius = FloatForKey( e, "_filterradius" );
}
if ( filterRadius == 0.0f ) {
filterRadius = FloatForKey( e, "_filteradius" );
}
@ -475,7 +490,11 @@ void CreateEntityLights( void ){
light->filterRadius = filterRadius;
/* set light color */
_color = ValueForKey( e, "_color" );
_color = ValueForKey( e, "color" );
if ( !(_color && _color[ 0 ]) ) {
_color = ValueForKey( e, "_color" );
}
if ( _color && _color[ 0 ] ) {
sscanf( _color, "%f %f %f", &light->color[ 0 ], &light->color[ 1 ], &light->color[ 2 ] );
if ( colorsRGB ) {
@ -488,7 +507,12 @@ void CreateEntityLights( void ){
}*/
} else {
/* alternative: read color in RGB8 values -eukara */
_color = ValueForKey( e, "_color255" );
_color = ValueForKey( e, "color255" );
if ( !(_color && _color[ 0 ]) ) {
_color = ValueForKey( e, "_color255" );
}
if ( _color && _color[ 0 ] ) {
sscanf( _color, "%f %f %f", &light->color[ 0 ], &light->color[ 1 ], &light->color[ 2 ] );
light->color[0] /= 255;
@ -505,7 +529,11 @@ void CreateEntityLights( void ){
}
}
light->extraDist = FloatForKey( e, "_extradist" );
light->extraDist = FloatForKey( e, "extradist" );
if ( light->extraDist == 0.0f ) {
light->extraDist = FloatForKey( e, "_extradist" );
}
if ( light->extraDist == 0.0f ) {
light->extraDist = extraDist;
}