Toggle graphical options from command line

This commit is contained in:
LoadingPleaseWait 2016-06-07 23:37:14 -05:00
parent d234954e14
commit 88dd551229

View File

@ -469,7 +469,7 @@ void setupRaceStart()
Log::warn("main", "Kart '%s' is unknown so will use the "
"default kart.",
UserConfigParams::m_default_kart.c_str());
race_manager->setPlayerKart(0,
race_manager->setPlayerKart(0,
UserConfigParams::m_default_kart.getDefaultValue());
}
else
@ -535,7 +535,7 @@ void cmdLineHelp()
// " n=2: recorded key strokes\n"
// " --test-ai=n Use the test-ai for every n-th AI kart.\n"
// " (so n=1 means all Ais will be the test ai)\n"
// "
// "
" --server=name Start a server (not a playing client).\n"
" --lan-server=name Start a LAN server (not a playing client).\n"
" --server-password= Sets a password for a server (both client&server).\n"
@ -705,6 +705,72 @@ int handleCmdLinePreliminary()
if(CommandLine::has("--windowed") || CommandLine::has("-w"))
UserConfigParams::m_fullscreen = false;
// toggle graphical options
if (CommandLine::has("--enable-glow"))
UserConfigParams::m_glow = true;
else if (CommandLine::has("--disable-glow"))
UserConfigParams::m_glow = false;
if (CommandLine::has("--enable-bloom"))
UserConfigParams::m_bloom = true;
else if (CommandLine::has("--disable-bloom"))
UserConfigParams::m_bloom = false;
if (CommandLine::has("--enable-light-shaft"))
UserConfigParams::m_light_shaft = true;
else if (CommandLine::has("--disable-light-shaft"))
UserConfigParams::m_light_shaft = false;
if (CommandLine::has("--enable-dynamic-lights"))
UserConfigParams::m_dynamic_lights = true;
else if (CommandLine::has("--disable-dynamic-lights"))
UserConfigParams::m_dynamic_lights = false;
// depth of field
if (CommandLine::has("--enable-dof"))
UserConfigParams::m_dof = true;
else if (CommandLine::has("--disable-dof"))
UserConfigParams::m_dof = false;
// global illumination
if (CommandLine::has("--enable-gi"))
UserConfigParams::m_gi = true;
else if (CommandLine::has("--disable-gi"))
UserConfigParams::m_gi = false;
// animated scenery
if (CommandLine::has("--enable-gfx"))
UserConfigParams::m_graphical_effects = true;
else if (CommandLine::has("--disable-gfx"))
UserConfigParams::m_graphical_effects = false;
if (CommandLine::has("--enable-motion-blur"))
UserConfigParams::m_motionblur = true;
else if (CommandLine::has("--disable-motion-blur"))
UserConfigParams::m_motionblur = false;
// anti-aliasing
if (CommandLine::has("--enable-mlaa"))
UserConfigParams::m_mlaa = true;
else if (CommandLine::has("--disable-mlaa"))
UserConfigParams::m_mlaa = false;
if (CommandLine::has("--enable-texture-compression"))
UserConfigParams::m_texture_compression = true;
else if (CommandLine::has("--disable-texture-compression"))
UserConfigParams::m_texture_compression = false;
// screen space ambient occluison
if (CommandLine::has("--enable-ssao"))
UserConfigParams::m_ssao = true;
else if (CommandLine::has("--disable-ssao"))
UserConfigParams::m_ssao = false;
// image based lighting
if (CommandLine::has("--enable-ibl"))
UserConfigParams::m_degraded_IBL = false;
else if (CommandLine::has("--disable-ibl"))
UserConfigParams::m_degraded_IBL = true;
// high definition textures user choice
if (CommandLine::has("--enable-hd-textures"))
UserConfigParams::m_high_definition_textures = 2 | 1;
else if (CommandLine::has("--disable-hd-textures"))
UserConfigParams::m_high_definition_textures = 2;
if (CommandLine::has("--enable-trilinear"))
UserConfigParams::m_trilinear = true;
else if (CommandLine::has("--disable-trilinear"))
UserConfigParams::m_trilinear = false;
// Enable loading grand prix from local directory
if(CommandLine::has("--add-gp-dir", &s))
{
@ -723,6 +789,10 @@ int handleCmdLinePreliminary()
UserConfigParams::m_xmas_mode = n;
if (CommandLine::has("--easter", &n))
UserConfigParams::m_easter_ear_mode = n;
if (CommandLine::has("--shadows", &n))
UserConfigParams::m_shadows_resolution = n;
if (CommandLine::has("--anisotropic", &n))
UserConfigParams::m_anisotropic = n;
// Useful for debugging: the temple navmesh needs 12 minutes in debug
// mode to compute the distance matrix!!
@ -832,7 +902,7 @@ int handleCmdLine()
NetworkConfig::get()->setIsWAN();
STKHost::create();
Log::info("main", "Creating a WAN server '%s'.", s.c_str());
}
}
if (CommandLine::has("--lan-server", &s))
{
NetworkConfig::get()->setServerName(core::stringw(s.c_str()));
@ -840,7 +910,7 @@ int handleCmdLine()
NetworkConfig::get()->setIsLAN();
STKHost::create();
Log::info("main", "Creating a LAN server '%s'.", s.c_str());
}
}
if (CommandLine::has("--server-password", &s))
{
NetworkConfig::get()->setPassword(s);