1
0
Fork 0

Mark enhanced lighting options and --adf as deprecated

Print an error message and exit if --{enable,disable}-enhanced-lighting
or --adf are used (those deprecated options will be removed in a future
version of FlightGear).
This commit is contained in:
Alessandro Menti 2017-06-04 16:49:53 +02:00
parent ac89ec94a3
commit 7245357751
No known key found for this signature in database
GPG key ID: 467AC0B4D6A6F336
3 changed files with 25 additions and 11 deletions

View file

@ -46,8 +46,6 @@ _fgfs_options=(
'--fog-disable[Disable fog/haze]' \
'--fog-fastest[Enable fastest fog/haze]' \
'--fog-nicest[Enable nicest fog/haze]' \
'--disable-enhanced-lighting[Disable enhanced runway lighting]' \
'--enable-enhanced-lighting[Enable enhanced runway lighting]' \
'--disable-distance-attenuation[Disable runway light distance attenuation]' \
'--enable-distance-attenuation[Enable runway light distance attenuation]' \
'--disable-specular-highlight[Disable specular reflections on textured objects]' \
@ -134,7 +132,8 @@ _fgfs_options=(
'--flight-plan=[Read all waypoints from a file]:Waypoints file:_files' \
'--nav1=[Set the NAV1 radio frequency, optionally preceded by a radial]' \
'--nav2=[Set the NAV2 radio frequency, optionally preceded by a radial]' \
'--adf=[Set the ADF radio frequency, optionally preceded by a card rotation]' \
'--adf1=[Set the ADF1 radio frequency, optionally preceded by a card rotation]' \
'--adf2=[Set the ADF2 radio frequency, optionally preceded by a card rotation]' \
'--dme=[Slave the ADF to one of the NAV radios, or set its internal frequency]' \
'--visibility=[Specify initial visibility (in meters)]' \
'--visibility-miles=[Specify initial visibility (in miles)]' \

View file

@ -204,7 +204,6 @@ void fgSetDefaults ()
fgSetInt("/sim/rendering/filtering", 1);
fgSetBool("/sim/rendering/wireframe", false);
fgSetBool("/sim/rendering/horizon-effect", false);
fgSetBool("/sim/rendering/enhanced-lighting", false);
fgSetBool("/sim/rendering/distance-attenuation", false);
fgSetBool("/sim/rendering/specular-highlight", true);
fgSetString("/sim/rendering/materials-file", "materials.xml");
@ -868,6 +867,16 @@ fgOptFgScenery( const char *arg )
return FG_OPTIONS_OK;
}
static int
fgOptEnhancedLighting( const char *arg )
{
SG_LOG(SG_ALL,SG_ALERT,
"the options --enable-enhanced-lighting and "
"--disable-enhanced-lighting are no longer supported and will be "
"removed in a future FlightGear version! Please do not use them");
return FG_OPTIONS_EXIT;
}
static int
fgOptAllowNasalRead( const char *arg )
{
@ -1298,6 +1307,15 @@ fgOptNAV2( const char * arg )
return FG_OPTIONS_OK;
}
static int
fgOptADF( const char * arg )
{
SG_LOG(SG_ALL,SG_ALERT,
"the option --adf is no longer supported! Please use --adf1 "
"instead.");
return FG_OPTIONS_EXIT;
}
static int
fgOptADF1( const char * arg )
{
@ -1662,8 +1680,8 @@ struct OptionDesc {
{"fog-nicest", false, OPTION_STRING, "/sim/rendering/fog", false, "nicest", 0 },
{"disable-horizon-effect", false, OPTION_BOOL, "/sim/rendering/horizon-effect", false, "", 0 },
{"enable-horizon-effect", false, OPTION_BOOL, "/sim/rendering/horizon-effect", true, "", 0 },
{"disable-enhanced-lighting", false, OPTION_BOOL, "/sim/rendering/enhanced-lighting", false, "", 0 },
{"enable-enhanced-lighting", false, OPTION_BOOL, "/sim/rendering/enhanced-lighting", true, "", 0 },
{"disable-enhanced-lighting", false, OPTION_FUNC, "", false, "", fgOptEnhancedLighting },
{"enable-enhanced-lighting", false, OPTION_FUNC, "", false, "", fgOptEnhancedLighting },
{"disable-distance-attenuation", false, OPTION_BOOL, "/sim/rendering/distance-attenuation", false, "", 0 },
{"enable-distance-attenuation", false, OPTION_BOOL, "/sim/rendering/distance-attenuation", true, "", 0 },
{"disable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", false, "", 0 },
@ -1763,7 +1781,7 @@ struct OptionDesc {
{"com2", true, OPTION_DOUBLE, "/instrumentation/comm[1]/frequencies/selected-mhz", false, "", 0 },
{"nav1", true, OPTION_FUNC, "", false, "", fgOptNAV1 },
{"nav2", true, OPTION_FUNC, "", false, "", fgOptNAV2 },
{"adf", /*legacy*/ true, OPTION_FUNC, "", false, "", fgOptADF1 },
{"adf", /*legacy*/ true, OPTION_FUNC, "", false, "", fgOptADF },
{"adf1", true, OPTION_FUNC, "", false, "", fgOptADF1 },
{"adf2", true, OPTION_FUNC, "", false, "", fgOptADF2 },
{"dme", true, OPTION_FUNC, "", false, "", fgOptDME },

View file

@ -557,7 +557,6 @@ FGRenderer::init( void )
_splash_alpha = fgGetNode("/sim/startup/splash-alpha", true);
_point_sprites = fgGetNode("/sim/rendering/point-sprites", true);
_enhanced_lighting = fgGetNode("/sim/rendering/enhanced-lighting", true);
_distance_attenuation = fgGetNode("/sim/rendering/distance-attenuation", true);
_horizon_effect = fgGetNode("/sim/rendering/horizon-effect", true);
@ -567,11 +566,9 @@ FGRenderer::init( void )
_visibility_m = fgGetNode("/environment/visibility-m", true);
bool use_point_sprites = _point_sprites->getBoolValue();
bool enhanced_lighting = _enhanced_lighting->getBoolValue();
bool distance_attenuation = _distance_attenuation->getBoolValue();
SGConfigureDirectionalLights( use_point_sprites, enhanced_lighting,
distance_attenuation );
SGConfigureDirectionalLights( use_point_sprites, distance_attenuation );
if (const char* tc = fgGetString("/sim/rendering/texture-compression", NULL)) {
if (strcmp(tc, "false") == 0 || strcmp(tc, "off") == 0 ||