diff options
Diffstat (limited to 'pkg/osx/LauncherManager.m')
-rw-r--r-- | pkg/osx/LauncherManager.m | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/pkg/osx/LauncherManager.m b/pkg/osx/LauncherManager.m index 69c59577..a40ac7c9 100644 --- a/pkg/osx/LauncherManager.m +++ b/pkg/osx/LauncherManager.m @@ -278,6 +278,8 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName) { NSString *iwad; NSString *args; + char *executable_name; + const char *game_name; [self saveConfig]; @@ -294,8 +296,12 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName) return; } - ExecuteProgram(PROGRAM_PREFIX "doom", [iwad UTF8String], - [args UTF8String]); + game_name = [self->iwadController getGameName]; + executable_name = malloc(strlen(PROGRAM_PREFIX) + strlen(game_name) + 1); + sprintf(executable_name, "%s%s", PROGRAM_PREFIX, game_name); + + ExecuteProgram(executable_name, [iwad UTF8String], + [args UTF8String]); [NSApp terminate:sender]; } @@ -303,10 +309,22 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName) - (void) runSetup: (id)sender { - [self saveConfig]; + const char *game_name; + char *arg; + [self saveConfig]; [self->iwadController setEnvironment]; - ExecuteProgram(PROGRAM_PREFIX "setup", NULL, NULL); + + // Provide the -game command line parameter to select the game + // to configure, based on the game selected in the dropdown. + + game_name = [self->iwadController getGameName]; + arg = malloc(strlen(game_name) + 8); + sprintf(arg, "-game %s", game_name); + + ExecuteProgram(PROGRAM_PREFIX "setup", NULL, arg); + + free(arg); } // Invoked when the "Terminal" option is selected from the menu, to open |