From f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 2 Jan 2013 19:28:25 +0100 Subject: JANITORIAL: Fix or silence a couple of Clang analyzer warnings Clang will produce plenty of warnings (most of them seem to be of the "if the stars align the wrong way, this may happen" variety), but I don't have the time or patience to look at all of them. --- base/commandLine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 44007c494a..7f88dc0b63 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -145,7 +145,7 @@ static const char HELP_STRING[] = static const char *s_appName = "scummvm"; -static void usage(const char *s, ...) GCC_PRINTF(1, 2); +static void NORETURN_PRE usage(const char *s, ...) GCC_PRINTF(1, 2) NORETURN_POST; static void usage(const char *s, ...) { char buf[STRINGBUFLEN]; @@ -314,8 +314,11 @@ void registerDefaults() { Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv) { const char *s, *s2; + if (!argv) + return Common::String(); + // argv[0] contains the name of the executable. - if (argv && argv[0]) { + if (argv[0]) { s = strrchr(argv[0], '/'); s_appName = s ? (s+1) : argv[0]; } @@ -579,8 +582,7 @@ static void listGames() { "-------------------- ------------------------------------------------------\n"); const EnginePlugin::List &plugins = EngineMan.getPlugins(); - EnginePlugin::List::const_iterator iter = plugins.begin(); - for (iter = plugins.begin(); iter != plugins.end(); ++iter) { + for (EnginePlugin::List::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) { GameList list = (**iter)->getSupportedGames(); for (GameList::iterator v = list.begin(); v != list.end(); ++v) { printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str()); -- cgit v1.2.3 From 681f81211f25c4c9fc163e0ec4d005f796da547d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 27 Dec 2012 15:08:54 +0100 Subject: FLUIDSYNTH: Add separate dialog for FluidSynth settings I don't really understand what these parameters do, or what the sensible values are, so for now the sliders are limited only by the allowed (or, in one case, "safe") values. --- base/commandLine.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 44007c494a..b87ec4453f 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -239,6 +239,24 @@ void registerDefaults() { ConfMan.registerDefault("gui_saveload_chooser", "grid"); ConfMan.registerDefault("gui_saveload_last_pos", "0"); + +#ifdef USE_FLUIDSYNTH + // FluidSynth settings. All multiplied by 100, except reverb width + // which is multiplied by 10, and chorus number which is an integer + // to begin with. + ConfMan.registerDefault("fluidsynth_chorus_nr", 3); + ConfMan.registerDefault("fluidsynth_chorus_level", 200); + ConfMan.registerDefault("fluidsynth_chorus_speed", 30); + ConfMan.registerDefault("fluidsynth_chorus_depth", 800); + ConfMan.registerDefault("fluidsynth_chorus_waveform", "sine"); + + ConfMan.registerDefault("fluidsynth_reverb_roomsize", 20); + ConfMan.registerDefault("fluidsynth_reverb_damping", 0); + ConfMan.registerDefault("fluidsynth_reverb_width", 5); + ConfMan.registerDefault("fluidsynth_reverb_level", 90); + + ConfMan.registerDefault("fluidsynth_misc_interpolation", "4th"); +#endif } // -- cgit v1.2.3 From a188a43da6a8d71a8d317b3c1f404088ce608336 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 27 Dec 2012 21:43:33 +0100 Subject: GUI: Make the FluidSynth settings dialog a bit more like Qsynth To help people familiar with Qsynth (I'm not, but it seems to be one of the more polished FluidSynth front ends), use the same presentation and terminology for the FluidSynth settings. More to follow. --- base/commandLine.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index b87ec4453f..a4e836ac05 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -241,18 +241,20 @@ void registerDefaults() { ConfMan.registerDefault("gui_saveload_last_pos", "0"); #ifdef USE_FLUIDSYNTH - // FluidSynth settings. All multiplied by 100, except reverb width - // which is multiplied by 10, and chorus number which is an integer - // to begin with. + // The settings are deliberately stored the same way as in Qsynth. The + // FluidSynth music driver is responsible for transforming them into + // their appropriate values. + ConfMan.registerDefault("fluidsynth_chorus_activate", true); ConfMan.registerDefault("fluidsynth_chorus_nr", 3); - ConfMan.registerDefault("fluidsynth_chorus_level", 200); + ConfMan.registerDefault("fluidsynth_chorus_level", 100); ConfMan.registerDefault("fluidsynth_chorus_speed", 30); - ConfMan.registerDefault("fluidsynth_chorus_depth", 800); + ConfMan.registerDefault("fluidsynth_chorus_depth", 80); ConfMan.registerDefault("fluidsynth_chorus_waveform", "sine"); + ConfMan.registerDefault("fluidsynth_reverb_activate", true); ConfMan.registerDefault("fluidsynth_reverb_roomsize", 20); ConfMan.registerDefault("fluidsynth_reverb_damping", 0); - ConfMan.registerDefault("fluidsynth_reverb_width", 5); + ConfMan.registerDefault("fluidsynth_reverb_width", 1); ConfMan.registerDefault("fluidsynth_reverb_level", 90); ConfMan.registerDefault("fluidsynth_misc_interpolation", "4th"); -- cgit v1.2.3 From 0a3e00b307c7977fda9849b577a81c5c6304b8e5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 27 Jan 2013 19:11:20 +0100 Subject: GUI: Allow user to display hidden files in the browser dialog. This implements feature request #3600774 "File browser: show hidden files". --- base/commandLine.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index c5c9fe3c90..f6d1f1f702 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -240,6 +240,8 @@ void registerDefaults() { ConfMan.registerDefault("gui_saveload_chooser", "grid"); ConfMan.registerDefault("gui_saveload_last_pos", "0"); + ConfMan.registerDefault("gui_browser_show_hidden", false); + #ifdef USE_FLUIDSYNTH // The settings are deliberately stored the same way as in Qsynth. The // FluidSynth music driver is responsible for transforming them into -- cgit v1.2.3 From 03882de79b4fb9ebb995507f136e79db425d8377 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 24 Apr 2013 01:40:46 +0300 Subject: BASE: Fixed code flow warnings. CID 1002239 --- base/commandLine.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index f6d1f1f702..1890513384 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -332,6 +332,10 @@ void registerDefaults() { continue; \ } +// End an option handler +#define END_COMMAND \ + } + Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv) { const char *s, *s2; @@ -366,27 +370,27 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha bool isLongCmd = (s[0] == '-' && s[1] == '-'); DO_COMMAND('h', "help") - END_OPTION + END_COMMAND DO_COMMAND('v', "version") - END_OPTION + END_COMMAND DO_COMMAND('t', "list-targets") - END_OPTION + END_COMMAND DO_COMMAND('z', "list-games") - END_OPTION + END_COMMAND #ifdef DETECTOR_TESTING_HACK // HACK FIXME TODO: This command is intentionally *not* documented! DO_LONG_COMMAND("test-detector") - END_OPTION + END_COMMAND #endif #ifdef UPGRADE_ALL_TARGETS_HACK // HACK FIXME TODO: This command is intentionally *not* documented! DO_LONG_COMMAND("upgrade-targets") - END_OPTION + END_COMMAND #endif DO_LONG_OPTION("list-saves") @@ -412,7 +416,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha END_OPTION DO_LONG_COMMAND("list-audio-devices") - END_OPTION + END_COMMAND DO_LONG_OPTION_INT("output-rate") END_OPTION @@ -542,7 +546,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha END_OPTION DO_LONG_COMMAND("list-themes") - END_OPTION + END_COMMAND DO_LONG_OPTION("target-md5") END_OPTION -- cgit v1.2.3 From 0031c41db855ac4bebd05ca1b2c1fa6694242979 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 2 May 2013 18:26:58 -0400 Subject: COMMON: Change kPlatformPC to kPlatformDOS "PC" was very ambiguous and now it matches what we show in the GUI. This also corrects sword2's platform to Windows. --- base/commandLine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base/commandLine.cpp') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 1890513384..42a3a64d34 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -198,7 +198,7 @@ void registerDefaults() { // Game specific ConfMan.registerDefault("path", ""); - ConfMan.registerDefault("platform", Common::kPlatformPC); + ConfMan.registerDefault("platform", Common::kPlatformDOS); ConfMan.registerDefault("language", "en"); ConfMan.registerDefault("subtitles", false); ConfMan.registerDefault("boot_param", 0); -- cgit v1.2.3