summaryrefslogtreecommitdiff
path: root/src/setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup')
-rw-r--r--src/setup/display.c304
-rw-r--r--src/setup/execute.c55
-rw-r--r--src/setup/execute.h2
-rw-r--r--src/setup/joystick.c4
-rw-r--r--src/setup/mainmenu.c31
-rw-r--r--src/setup/multiplayer.c148
-rw-r--r--src/setup/multiplayer.h1
-rw-r--r--src/setup/txt_joybinput.c1
-rw-r--r--src/setup/txt_keyinput.c1
-rw-r--r--src/setup/txt_mouseinput.c1
10 files changed, 460 insertions, 88 deletions
diff --git a/src/setup/display.c b/src/setup/display.c
index 9fd0963b..f5f190f2 100644
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -26,12 +26,40 @@
#include "libc_wince.h"
#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
#include "textscreen.h"
#include "m_config.h"
#include "mode.h"
#include "display.h"
+extern void RestartTextscreen(void);
+
+typedef struct
+{
+ char *description;
+ int bpp;
+} pixel_depth_t;
+
+// List of supported pixel depths.
+
+static pixel_depth_t pixel_depths[] =
+{
+ { "8-bit", 8 },
+ { "16-bit", 16 },
+ { "24-bit", 24 },
+ { "32-bit", 32 },
+};
+
+// List of strings containing supported pixel depths.
+
+static char **supported_bpps;
+static int num_supported_bpps;
+
typedef struct
{
int w, h;
@@ -69,6 +97,7 @@ static screen_mode_t screen_modes_scaled[] =
// List of fullscreen modes generated at runtime
static screen_mode_t *screen_modes_fullscreen = NULL;
+static int num_screen_modes_fullscreen;
static int vidmode = 0;
@@ -78,6 +107,7 @@ static int aspect_ratio_correct = 1;
static int fullscreen = 1;
static int screen_width = 320;
static int screen_height = 200;
+static int screen_bpp = 8;
static int startup_delay = 1000;
static int graphical_startup = 1;
static int show_endoom = 1;
@@ -90,6 +120,10 @@ static int usegamma = 0;
static int selected_screen_width = 0, selected_screen_height;
+// Index into the supported_bpps of the selected pixel depth.
+
+static int selected_bpp = 0;
+
static int system_video_env_set;
// Set the SDL_VIDEODRIVER environment variable
@@ -133,6 +167,153 @@ void SetDisplayDriver(void)
}
}
+// Query SDL as to whether any fullscreen modes are available for the
+// specified pixel depth.
+
+static int PixelDepthSupported(int bpp)
+{
+ SDL_PixelFormat format;
+ SDL_Rect **modes;
+
+ format.BitsPerPixel = bpp;
+ format.BytesPerPixel = (bpp + 7) / 8;
+
+ modes = SDL_ListModes(&format, SDL_FULLSCREEN);
+
+ return modes != NULL;
+}
+
+// Query SDL and populate the supported_bpps array.
+
+static void IdentifyPixelDepths(void)
+{
+ unsigned int i;
+ unsigned int num_depths = sizeof(pixel_depths) / sizeof(*pixel_depths);
+
+ if (supported_bpps != NULL)
+ {
+ free(supported_bpps);
+ }
+
+ supported_bpps = malloc(sizeof(char *) * num_depths);
+ num_supported_bpps = 0;
+
+ // Check each bit depth to determine if modes are available.
+
+ for (i = 0; i < num_depths; ++i)
+ {
+ // If modes are available, add this bit depth to the list.
+
+ if (PixelDepthSupported(pixel_depths[i].bpp))
+ {
+ supported_bpps[num_supported_bpps] = pixel_depths[i].description;
+ ++num_supported_bpps;
+ }
+ }
+
+ // No supported pixel depths? That's kind of a problem. Add 8bpp
+ // as a fallback.
+
+ if (num_supported_bpps == 0)
+ {
+ supported_bpps[0] = pixel_depths[0].description;
+ ++num_supported_bpps;
+ }
+}
+
+// Get the screen pixel depth corresponding to what selected_bpp is set to.
+
+static int GetSelectedBPP(void)
+{
+ unsigned int num_depths = sizeof(pixel_depths) / sizeof(*pixel_depths);
+ unsigned int i;
+
+ // Find which pixel depth is selected, and set screen_bpp.
+
+ for (i = 0; i < num_depths; ++i)
+ {
+ if (pixel_depths[i].description == supported_bpps[selected_bpp])
+ {
+ return pixel_depths[i].bpp;
+ }
+ }
+
+ // Default fallback value.
+
+ return 8;
+}
+
+// Get the index into supported_bpps of the specified pixel depth string.
+
+static int GetSupportedBPPIndex(char *description)
+{
+ unsigned int i;
+
+ for (i = 0; i < num_supported_bpps; ++i)
+ {
+ if (supported_bpps[i] == description)
+ {
+ return i;
+ }
+ }
+
+ // Shouldn't happen; fall back to the first in the list.
+
+ return 0;
+}
+
+// Set selected_bpp to match screen_bpp.
+
+static int TrySetSelectedBPP(void)
+{
+ unsigned int num_depths = sizeof(pixel_depths) / sizeof(*pixel_depths);
+ unsigned int i;
+
+ // Search pixel_depths, find the bpp that corresponds to screen_bpp,
+ // then set selected_bpp to match.
+
+ for (i = 0; i < num_depths; ++i)
+ {
+ if (pixel_depths[i].bpp == screen_bpp)
+ {
+ selected_bpp = GetSupportedBPPIndex(pixel_depths[i].description);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static void SetSelectedBPP(void)
+{
+ const SDL_VideoInfo *info;
+
+ if (TrySetSelectedBPP())
+ {
+ return;
+ }
+
+ // screen_bpp does not match any supported pixel depth. Query SDL
+ // to find out what it recommends using.
+
+ info = SDL_GetVideoInfo();
+
+ if (info != NULL && info->vfmt != NULL)
+ {
+ screen_bpp = info->vfmt->BitsPerPixel;
+ }
+
+ // Try again.
+
+ if (!TrySetSelectedBPP())
+ {
+ // Give up and just use the first in the list.
+
+ selected_bpp = 0;
+ screen_bpp = GetSelectedBPP();
+ }
+}
+
static void ModeSelected(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(mode))
{
TXT_CAST_ARG(screen_mode_t, mode);
@@ -177,6 +358,7 @@ static int GoodFullscreenMode(screen_mode_t *mode)
static void BuildFullscreenModesList(void)
{
+ SDL_PixelFormat format;
SDL_Rect **modes;
screen_mode_t *m1;
screen_mode_t *m2;
@@ -194,7 +376,10 @@ static void BuildFullscreenModesList(void)
// Get a list of fullscreen modes and find out how many
// modes are in the list.
- modes = SDL_ListModes(NULL, SDL_FULLSCREEN);
+ format.BitsPerPixel = screen_bpp;
+ format.BytesPerPixel = (screen_bpp + 7) / 8;
+
+ modes = SDL_ListModes(&format, SDL_FULLSCREEN);
if (modes == NULL || modes == (SDL_Rect **) -1)
{
@@ -229,6 +414,8 @@ static void BuildFullscreenModesList(void)
memcpy(m1, m2, sizeof(screen_mode_t));
memcpy(m2, &m, sizeof(screen_mode_t));
}
+
+ num_screen_modes_fullscreen = num_modes;
}
static int FindBestMode(screen_mode_t *modes)
@@ -295,7 +482,7 @@ static void GenerateModesTable(TXT_UNCAST_ARG(widget),
// Build the table
TXT_ClearTable(modes_table);
- TXT_SetColumnWidths(modes_table, 15, 15, 15);
+ TXT_SetColumnWidths(modes_table, 14, 14, 14, 14, 14);
for (i=0; modes[i].w != 0; ++i)
{
@@ -317,8 +504,25 @@ static void GenerateModesTable(TXT_UNCAST_ARG(widget),
vidmode = FindBestMode(modes);
- screen_width = modes[vidmode].w;
- screen_height = modes[vidmode].h;
+ if (vidmode > 0)
+ {
+ screen_width = modes[vidmode].w;
+ screen_height = modes[vidmode].h;
+ }
+}
+
+// Callback invoked when the BPP selector is changed.
+
+static void UpdateBPP(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(modes_table))
+{
+ TXT_CAST_ARG(txt_table_t, modes_table);
+
+ screen_bpp = GetSelectedBPP();
+
+ // Rebuild list of fullscreen modes.
+
+ BuildFullscreenModesList();
+ GenerateModesTable(NULL, modes_table);
}
#if defined(_WIN32) && !defined(_WIN32_WCE)
@@ -331,18 +535,6 @@ static char *win32_video_drivers[] =
"Windows GDI",
};
-// Restart the textscreen library. Used when the video_driver variable
-// is changed.
-
-static void RestartTextscreen(void)
-{
- TXT_Shutdown();
-
- SetDisplayDriver();
-
- TXT_Init();
-}
-
static void SetWin32VideoDriver(void)
{
if (!strcmp(video_driver, "windib"))
@@ -372,6 +564,11 @@ static void UpdateVideoDriver(TXT_UNCAST_ARG(widget),
RestartTextscreen();
+ // Rebuild the list of supported pixel depths.
+
+ IdentifyPixelDepths();
+ SetSelectedBPP();
+
// Rebuild the video modes list
BuildFullscreenModesList();
@@ -385,8 +582,18 @@ void ConfigDisplay(void)
{
txt_window_t *window;
txt_table_t *modes_table;
+ txt_table_t *bpp_table;
txt_checkbox_t *fs_checkbox;
txt_checkbox_t *ar_checkbox;
+ txt_dropdown_list_t *bpp_selector;
+ int num_columns;
+ int window_y;
+
+ // What color depths are supported? Generate supported_bpps array
+ // and set selected_bpp to match the current value of screen_bpp.
+
+ IdentifyPixelDepths();
+ SetSelectedBPP();
// First time in? Initialise selected_screen_{width,height}
@@ -400,16 +607,43 @@ void ConfigDisplay(void)
window = TXT_NewWindow("Display Configuration");
- TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
- TXT_SCREEN_W / 2, 5);
-
TXT_AddWidgets(window,
fs_checkbox = TXT_NewCheckBox("Fullscreen", &fullscreen),
ar_checkbox = TXT_NewCheckBox("Correct aspect ratio",
&aspect_ratio_correct),
NULL);
- modes_table = TXT_NewTable(3);
+ // Some machines can have lots of video modes. This tries to
+ // keep a limit of six lines by increasing the number of
+ // columns. In extreme cases, the window is moved up slightly.
+
+ BuildFullscreenModesList();
+
+ window_y = 5;
+
+ if (num_screen_modes_fullscreen <= 18)
+ {
+ num_columns = 3;
+ }
+ else if (num_screen_modes_fullscreen <= 24)
+ {
+ num_columns = 4;
+ }
+ else
+ {
+ num_columns = 5;
+ window_y -= 3;
+ }
+
+ modes_table = TXT_NewTable(num_columns);
+
+ // The window is set at a fixed vertical position. This keeps
+ // the top of the window stationary when switching between
+ // fullscreen and windowed mode (which causes the window's
+ // height to change).
+
+ TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
+ TXT_SCREEN_W / 2, window_y);
// On Windows, there is an extra control to change between
// the Windows GDI and DirectX video drivers.
@@ -442,6 +676,7 @@ void ConfigDisplay(void)
TXT_AddWidgets(window,
TXT_NewSeparator("Screen mode"),
+ bpp_table = TXT_NewTable(2),
modes_table,
TXT_NewSeparator("Misc."),
NULL);
@@ -458,6 +693,15 @@ void ConfigDisplay(void)
TXT_NewCheckBox("Show ENDOOM screen", &show_endoom));
}
+ TXT_AddWidgets(bpp_table,
+ TXT_NewLabel("Color depth: "),
+ bpp_selector = TXT_NewDropdownList(&selected_bpp,
+ supported_bpps,
+ num_supported_bpps),
+ NULL);
+
+
+ TXT_SignalConnect(bpp_selector, "changed", UpdateBPP, modes_table);
TXT_SignalConnect(fs_checkbox, "changed", GenerateModesTable, modes_table);
TXT_SignalConnect(ar_checkbox, "changed", GenerateModesTable, modes_table);
@@ -486,5 +730,25 @@ void BindDisplayVariables(void)
M_BindVariable("graphical_startup", &graphical_startup);
}
+ // Windows Vista or later? Set screen color depth to
+ // 32 bits per pixel, as 8-bit palettized screen modes
+ // don't work properly in recent versions.
+
+#if defined(_WIN32) && !defined(_WIN32_WCE)
+ {
+ OSVERSIONINFOEX version_info;
+
+ ZeroMemory(&version_info, sizeof(OSVERSIONINFOEX));
+ version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+
+ GetVersionEx((OSVERSIONINFO *) &version_info);
+
+ if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && version_info.dwMajorVersion >= 6)
+ {
+ screen_bpp = 32;
+ }
+ }
+#endif
}
diff --git a/src/setup/execute.c b/src/setup/execute.c
index 4be44149..f85b8af4 100644
--- a/src/setup/execute.c
+++ b/src/setup/execute.c
@@ -88,6 +88,42 @@ static char *TempFile(char *s)
return result;
}
+static int ArgumentNeedsEscape(char *arg)
+{
+ char *p;
+
+ for (p = arg; *p != '\0'; ++p)
+ {
+ if (isspace(*p))
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+// Arguments passed to the setup tool should be passed through to the
+// game when launching a game. Calling this adds all arguments from
+// myargv to the output context.
+
+void PassThroughArguments(execute_context_t *context)
+{
+ int i;
+
+ for (i = 1; i < myargc; ++i)
+ {
+ if (ArgumentNeedsEscape(myargv[i]))
+ {
+ AddCmdLineParameter(context, "\"%s\"", myargv[i]);
+ }
+ else
+ {
+ AddCmdLineParameter(context, "%s", myargv[i]);
+ }
+ }
+}
+
execute_context_t *NewExecuteContext(void)
{
execute_context_t *result;
@@ -106,25 +142,6 @@ execute_context_t *NewExecuteContext(void)
return result;
}
-void AddConfigParameters(execute_context_t *context)
-{
- int p;
-
- p = M_CheckParm("-config");
-
- if (p > 0)
- {
- AddCmdLineParameter(context, "-config \"%s\"", myargv[p + 1]);
- }
-
- p = M_CheckParm("-extraconfig");
-
- if (p > 0)
- {
- AddCmdLineParameter(context, "-extraconfig \"%s\"", myargv[p + 1]);
- }
-}
-
void AddCmdLineParameter(execute_context_t *context, char *s, ...)
{
va_list args;
diff --git a/src/setup/execute.h b/src/setup/execute.h
index 24711a16..25f1f10a 100644
--- a/src/setup/execute.h
+++ b/src/setup/execute.h
@@ -35,7 +35,7 @@ typedef struct execute_context_s execute_context_t;
execute_context_t *NewExecuteContext(void);
void AddCmdLineParameter(execute_context_t *context, char *s, ...);
-void AddConfigParameters(execute_context_t *context);
+void PassThroughArguments(execute_context_t *context);
int ExecuteDoom(execute_context_t *context);
int FindInstalledIWADs(void);
diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index fbe3a3f3..0fc00ea1 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -65,8 +65,8 @@ static int joystick_y_invert = 0;
static txt_button_t *joystick_button;
static int *all_joystick_buttons[] = {
- &joybstraferight, &joybstrafeleft, &joybfire, &joybspeed,
- &joybuse, &joybstrafe, &joybjump
+ &joybstraferight, &joybstrafeleft, &joybfire, &joybspeed,
+ &joybuse, &joybstrafe, &joybprevweapon, &joybnextweapon, &joybjump
};
//
diff --git a/src/setup/mainmenu.c b/src/setup/mainmenu.c
index c3cb7db5..55496010 100644
--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -156,7 +156,7 @@ static void LaunchDoom(void *unused1, void *unused2)
// Launch Doom
exec = NewExecuteContext();
- AddConfigParameters(exec);
+ PassThroughArguments(exec);
ExecuteDoom(exec);
exit(0);
@@ -189,6 +189,7 @@ void MainMenu(void)
{
txt_window_t *window;
txt_window_action_t *quit_action;
+ txt_window_action_t *warp_action;
window = TXT_NewWindow("Main Menu");
@@ -230,8 +231,12 @@ void MainMenu(void)
NULL);
quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit");
+ warp_action = TXT_NewWindowAction(KEY_F1, "Warp");
TXT_SignalConnect(quit_action, "pressed", QuitConfirm, NULL);
+ TXT_SignalConnect(warp_action, "pressed",
+ (TxtWidgetSignalFunc) WarpMenu, NULL);
TXT_SetWindowAction(window, TXT_HORIZ_LEFT, quit_action);
+ TXT_SetWindowAction(window, TXT_HORIZ_CENTER, warp_action);
TXT_SetKeyListener(window, MainMenuKeyPress, NULL);
}
@@ -292,11 +297,9 @@ static void SetIcon(void)
free(mask);
}
-//
-// Initialize and run the textscreen GUI.
-//
+// Initialize the textscreen library.
-static void RunGUI(void)
+static void InitTextscreen(void)
{
SetDisplayDriver();
@@ -308,6 +311,24 @@ static void RunGUI(void)
TXT_SetDesktopTitle(PACKAGE_NAME " Setup ver " PACKAGE_VERSION);
SetIcon();
+}
+
+// Restart the textscreen library. Used when the video_driver variable
+// is changed.
+
+void RestartTextscreen(void)
+{
+ TXT_Shutdown();
+ InitTextscreen();
+}
+
+//
+// Initialize and run the textscreen GUI.
+//
+
+static void RunGUI(void)
+{
+ InitTextscreen();
TXT_GUIMainLoop();
}
diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c
index 24cd0670..aed89212 100644
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -70,10 +70,10 @@ static char *iwadfile;
static char *doom_skills[] =
{
- "I'm too young to die!",
+ "I'm too young to die.",
"Hey, not too rough.",
"Hurt me plenty.",
- "Ultra-violence",
+ "Ultra-Violence.",
"NIGHTMARE!",
};
@@ -144,6 +144,7 @@ static int fast = 0;
static int respawn = 0;
static int udpport = 2342;
static int timer = 0;
+static int privateserver = 0;
static txt_dropdown_list_t *skillbutton;
static txt_button_t *warpbutton;
@@ -209,7 +210,11 @@ static void AddIWADParameter(execute_context_t *exec)
}
}
-static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
+// Callback function invoked to launch the game.
+// This is used when starting a server and also when starting a
+// single player game via the "warp" menu.
+
+static void StartGame(int multiplayer)
{
execute_context_t *exec;
@@ -221,7 +226,6 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
AddExtraParameters(exec);
AddIWADParameter(exec);
- AddCmdLineParameter(exec, "-server");
AddCmdLineParameter(exec, "-skill %i", skill + 1);
if (gamemission == hexen)
@@ -244,20 +248,6 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
AddCmdLineParameter(exec, "-respawn");
}
- if (deathmatch == 1)
- {
- AddCmdLineParameter(exec, "-deathmatch");
- }
- else if (deathmatch == 2)
- {
- AddCmdLineParameter(exec, "-altdeath");
- }
-
- if (timer > 0)
- {
- AddCmdLineParameter(exec, "-timer %i", timer);
- }
-
if (warptype == WARP_ExMy)
{
// TODO: select IWAD based on warp type
@@ -268,20 +258,55 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
AddCmdLineParameter(exec, "-warp %i", warpmap);
}
- AddCmdLineParameter(exec, "-port %i", udpport);
+ // Multiplayer-specific options:
+
+ if (multiplayer)
+ {
+ AddCmdLineParameter(exec, "-server");
+ AddCmdLineParameter(exec, "-port %i", udpport);
+
+ if (deathmatch == 1)
+ {
+ AddCmdLineParameter(exec, "-deathmatch");
+ }
+ else if (deathmatch == 2)
+ {
+ AddCmdLineParameter(exec, "-altdeath");
+ }
+
+ if (timer > 0)
+ {
+ AddCmdLineParameter(exec, "-timer %i", timer);
+ }
+
+ if (privateserver)
+ {
+ AddCmdLineParameter(exec, "-privateserver");
+ }
+ }
AddWADs(exec);
TXT_Shutdown();
M_SaveDefaults();
- AddConfigParameters(exec);
+ PassThroughArguments(exec);
ExecuteDoom(exec);
exit(0);
}
+static void StartServerGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
+{
+ StartGame(1);
+}
+
+static void StartSinglePlayerGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
+{
+ StartGame(0);
+}
+
static void UpdateWarpButton(void)
{
char buf[10];
@@ -544,12 +569,27 @@ static txt_widget_t *IWADSelector(void)
return result;
}
-static txt_window_action_t *StartGameAction(void)
+// Create the window action button to start the game. This invokes
+// a different callback depending on whether to start a multiplayer
+// or single player game.
+
+static txt_window_action_t *StartGameAction(int multiplayer)
{
txt_window_action_t *action;
+ TxtWidgetSignalFunc callback;
action = TXT_NewWindowAction(KEY_F10, "Start");
- TXT_SignalConnect(action, "pressed", StartGame, NULL);
+
+ if (multiplayer)
+ {
+ callback = StartServerGame;
+ }
+ else
+ {
+ callback = StartSinglePlayerGame;
+ }
+
+ TXT_SignalConnect(action, "pressed", callback, NULL);
return action;
}
@@ -591,7 +631,11 @@ static txt_window_action_t *WadWindowAction(void)
return action;
}
-void StartMultiGame(void)
+// "Start game" menu. This is used for the start server window
+// and the single player warp menu. The parameters specify
+// the window title and whether to display multiplayer options.
+
+static void StartGameMenu(char *window_title, int multiplayer)
{
txt_window_t *window;
txt_table_t *gameopt_table;
@@ -599,7 +643,7 @@ void StartMultiGame(void)
txt_widget_t *iwad_selector;
int num_mult_types = 2;
- window = TXT_NewWindow("Start multiplayer game");
+ window = TXT_NewWindow(window_title);
TXT_AddWidgets(window,
gameopt_table = TXT_NewTable(2),
@@ -609,14 +653,12 @@ void StartMultiGame(void)
TXT_NewCheckBox("Respawning monsters", &respawn),
TXT_NewSeparator("Advanced"),
advanced_table = TXT_NewTable(2),
- TXT_NewButton2("Add extra parameters...",
- OpenExtraParamsWindow, NULL),
NULL);
TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction());
+ TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction(multiplayer));
- TXT_SetColumnWidths(gameopt_table, 12, 12);
+ TXT_SetColumnWidths(gameopt_table, 12, 6);
if (gamemission == doom)
{
@@ -632,14 +674,8 @@ void StartMultiGame(void)
iwad_selector = IWADSelector(),
TXT_NewLabel("Skill"),
skillbutton = TXT_NewDropdownList(&skill, doom_skills, 5),
- TXT_NewLabel("Game type"),
- TXT_NewDropdownList(&deathmatch, gamemodes, num_mult_types),
TXT_NewLabel("Level warp"),
warpbutton = TXT_NewButton2("????", LevelSelectDialog, NULL),
- TXT_NewLabel("Time limit"),
- TXT_NewHorizBox(TXT_NewIntInputBox(&timer, 2),
- TXT_NewLabel("minutes"),
- NULL),
NULL);
if (gamemission == hexen)
@@ -651,19 +687,49 @@ void StartMultiGame(void)
NULL);
}
- TXT_SetColumnWidths(advanced_table, 12, 12);
+ if (multiplayer)
+ {
+ TXT_AddWidgets(gameopt_table,
+ TXT_NewLabel("Game type"),
+ TXT_NewDropdownList(&deathmatch, gamemodes, num_mult_types),
+ TXT_NewLabel("Time limit"),
+ TXT_NewHorizBox(TXT_NewIntInputBox(&timer, 2),
+ TXT_NewLabel("minutes"),
+ NULL),
+ NULL);
+
+ TXT_AddWidget(window,
+ TXT_NewInvertedCheckBox("Register with master server",
+ &privateserver));
+
+ TXT_AddWidgets(advanced_table,
+ TXT_NewLabel("UDP port"),
+ TXT_NewIntInputBox(&udpport, 5),
+ NULL);
+ }
- TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);
+ TXT_AddWidget(window,
+ TXT_NewButton2("Add extra parameters...",
+ OpenExtraParamsWindow, NULL));
- TXT_AddWidgets(advanced_table,
- TXT_NewLabel("UDP port"),
- TXT_NewIntInputBox(&udpport, 5),
- NULL);
+ TXT_SetColumnWidths(advanced_table, 12, 6);
+
+ TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);
UpdateWarpType(NULL, NULL);
UpdateWarpButton();
}
+void StartMultiGame(void)
+{
+ StartGameMenu("Start multiplayer game", 1);
+}
+
+void WarpMenu(void)
+{
+ StartGameMenu("Level Warp", 0);
+}
+
static void DoJoinGame(void *unused1, void *unused2)
{
execute_context_t *exec;
@@ -695,7 +761,7 @@ static void DoJoinGame(void *unused1, void *unused2)
M_SaveDefaults();
- AddConfigParameters(exec);
+ PassThroughArguments(exec);
ExecuteDoom(exec);
diff --git a/src/setup/multiplayer.h b/src/setup/multiplayer.h
index 7490bc3c..afc8a2a8 100644
--- a/src/setup/multiplayer.h
+++ b/src/setup/multiplayer.h
@@ -23,6 +23,7 @@
#define SETUP_MULTIPLAYER_H
void StartMultiGame(void);
+void WarpMenu(void);
void JoinMultiGame(void);
void MultiplayerConfig(void);
diff --git a/src/setup/txt_joybinput.c b/src/setup/txt_joybinput.c
index 1e132962..cde3d2c2 100644
--- a/src/setup/txt_joybinput.c
+++ b/src/setup/txt_joybinput.c
@@ -206,6 +206,7 @@ static void TXT_JoystickInputMousePress(TXT_UNCAST_ARG(widget), int x, int y, in
txt_widget_class_t txt_joystick_input_class =
{
+ TXT_AlwaysSelectable,
TXT_JoystickInputSizeCalc,
TXT_JoystickInputDrawer,
TXT_JoystickInputKeyPress,
diff --git a/src/setup/txt_keyinput.c b/src/setup/txt_keyinput.c
index 483c325f..08eb9d8c 100644
--- a/src/setup/txt_keyinput.c
+++ b/src/setup/txt_keyinput.c
@@ -171,6 +171,7 @@ static void TXT_KeyInputMousePress(TXT_UNCAST_ARG(widget), int x, int y, int b)
txt_widget_class_t txt_key_input_class =
{
+ TXT_AlwaysSelectable,
TXT_KeyInputSizeCalc,
TXT_KeyInputDrawer,
TXT_KeyInputKeyPress,
diff --git a/src/setup/txt_mouseinput.c b/src/setup/txt_mouseinput.c
index 8b87e651..4f454c8c 100644
--- a/src/setup/txt_mouseinput.c
+++ b/src/setup/txt_mouseinput.c
@@ -164,6 +164,7 @@ static void TXT_MouseInputMousePress(TXT_UNCAST_ARG(widget), int x, int y, int b
txt_widget_class_t txt_mouse_input_class =
{
+ TXT_AlwaysSelectable,
TXT_MouseInputSizeCalc,
TXT_MouseInputDrawer,
TXT_MouseInputKeyPress,