diff options
| author | Jonathan Gray | 2003-10-01 10:47:19 +0000 |
|---|---|---|
| committer | Jonathan Gray | 2003-10-01 10:47:19 +0000 |
| commit | eecdf67c636a8ff7a04819db4ffbc8717c278b52 (patch) | |
| tree | 950f9d56022b6a52f031e66017812932c3bc2733 /base | |
| parent | 13773455a40f356dfcd65819587c71d516504de5 (diff) | |
| download | scummvm-rg350-eecdf67c636a8ff7a04819db4ffbc8717c278b52.tar.gz scummvm-rg350-eecdf67c636a8ff7a04819db4ffbc8717c278b52.tar.bz2 scummvm-rg350-eecdf67c636a8ff7a04819db4ffbc8717c278b52.zip | |
disable joystick input by default either command line or config file need to be used to enable it now, ability to choose joystick number to use also added
svn-id: r10518
Diffstat (limited to 'base')
| -rw-r--r-- | base/gameDetector.cpp | 24 | ||||
| -rw-r--r-- | base/gameDetector.h | 1 |
2 files changed, 19 insertions, 6 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 096804e22d..65dba3bb71 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -54,7 +54,7 @@ static const char USAGE_STRING[] = "\tscummvm [OPTIONS] [game]\n" "Options:\n" "\t-p<path> - Look for game in <path>\n" - "\t-x[<num>] - Load this savegame (default: 0 - autosave)\n" + "\t-x[num] - Load this savegame (default: 0 - autosave)\n" "\t-f - Full-screen mode (-F forces window mode.)\n" "\t-g<mode> - Graphics mode (normal,2x,3x,2xsai,super2xsai,\n" "\t supereagle,advmame2x,advmame3x,hq2x,hq3x,\n" @@ -64,6 +64,7 @@ static const char USAGE_STRING[] = "\t gb,hb)\n" "\n" "\t-c<num> - Use cdrom <num> for cd audio\n" + "\t-j[num] - Enable input with joystick (default: 0 - 1st joystick)\n" "\t-m<num> - Set music volume to <num> (0-255)\n" "\t-o<num> - Set master volume to <num> (0-255)\n" "\t-s<num> - Set sfx volume to <num> (0-255)\n" @@ -74,16 +75,16 @@ static const char USAGE_STRING[] = "\n" "\t-l<file> - Load config file instead of default\n" #if defined(UNIX) - "\t-w[<file>] - Write to config file [~/.scummvmrc]\n" + "\t-w[file] - Write to config file [~/.scummvmrc]\n" #else - "\t-w[<file>] - Write to config file [scummvm.ini]\n" + "\t-w[file] - Write to config file [scummvm.ini]\n" #endif "\t-v - Show version info and exit\n" "\t-h - Display this text and exit\n" "\t-z - Display list of games\n" "\n" "\t-b<num> - Pass number to the boot script (boot param)\n" - "\t-d[<num>] - Enable debug output (debug level [1])\n" + "\t-d[num] - Enable debug output (debug level [1])\n" "\t-u - Dump scripts\n" "\n" "\t--platform= - Specify version of game (amiga,atari-st,macintosh)\n" @@ -199,6 +200,7 @@ GameDetector::GameDetector() { _native_mt32 = false; _cdrom = 0; + _joystick_num = 0; _save_slot = 0; _saveconfig = false; @@ -221,6 +223,8 @@ void GameDetector::updateconfig() { _save_slot = g_config->getInt("save_slot", _save_slot); + _joystick_num = g_config->getInt("joystick_num", _joystick_num); + _cdrom = g_config->getInt("cdrom", _cdrom); if ((val = g_config->get("music_driver"))) @@ -325,6 +329,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { char c; bool long_option_value; _save_slot = -1; + _joystick_num = -1; // Parse the arguments // into a transient "_COMMAND_LINE" config comain. @@ -375,7 +380,14 @@ void GameDetector::parseCommandLine(int argc, char **argv) { g_config->set("gfx_mode", option, "scummvm"); break; // case 'h': reserved for help - // case 'j': reserved for joystick select + case 'j': + _joystick_num = 0; + HANDLE_OPT_OPTION(); + if (option != NULL) { + _joystick_num = atoi(option); + g_config->setInt("joystick_num", _joystick_num); + } + break; case 'l': HANDLE_OPTION(); { @@ -738,7 +750,7 @@ OSystem *GameDetector::createSystem() { return OSystem_PALMOS_create(_gfx_mode, _fullScreen); #else /* SDL is the default driver for now */ - return OSystem_SDL_create(_gfx_mode, _fullScreen, _aspectRatio); + return OSystem_SDL_create(_gfx_mode, _fullScreen, _aspectRatio, _joystick_num); #endif } diff --git a/base/gameDetector.h b/base/gameDetector.h index 606f4d24a0..2f88080060 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -152,6 +152,7 @@ public: bool _native_mt32; int _cdrom; + int _joystick_num; int _save_slot; bool _saveconfig; |
