diff options
author | Simon Howard | 2009-07-09 20:08:20 +0000 |
---|---|---|
committer | Simon Howard | 2009-07-09 20:08:20 +0000 |
commit | 62df1ab1dd5bd04c5e6228cea09442c5177a955e (patch) | |
tree | 846055b3ece1931e075c2c1b8c52a59de2bf6944 /src/setup/mode.c | |
parent | d03dd75b5c4098f1fa59a4a0074b4770e73d835b (diff) | |
download | chocolate-doom-62df1ab1dd5bd04c5e6228cea09442c5177a955e.tar.gz chocolate-doom-62df1ab1dd5bd04c5e6228cea09442c5177a955e.tar.bz2 chocolate-doom-62df1ab1dd5bd04c5e6228cea09442c5177a955e.zip |
Select the game to configure automatically if the game name is found
inside the name of the executable. Rename the executable for the Windows
CE install packages.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1612
Diffstat (limited to 'src/setup/mode.c')
-rw-r--r-- | src/setup/mode.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/setup/mode.c b/src/setup/mode.c index e300dc9f..ea90c76f 100644 --- a/src/setup/mode.c +++ b/src/setup/mode.c @@ -197,6 +197,32 @@ static mission_config_t *GetMissionForName(char *name) return NULL; } +// Check the name of the executable. If it contains one of the game +// names (eg. chocolate-hexen-setup.exe) then use that game. + +static boolean CheckExecutableName(GameSelectCallback callback) +{ + mission_config_t *config; + char *exe_name; + int i; + + exe_name = M_GetExecutableName(); + + for (i=0; i<arrlen(mission_configs); ++i) + { + config = &mission_configs[i]; + + if (strstr(exe_name, config->name) != NULL) + { + SetMission(config); + callback(); + return true; + } + } + + return false; +} + static void GameSelected(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(config)) { TXT_CAST_ARG(mission_config_t, config); @@ -293,7 +319,7 @@ void SetupMission(GameSelectCallback callback) SetMission(config); callback(); } - else + else if (!CheckExecutableName(callback)) { OpenGameSelectDialog(callback); } |