summaryrefslogtreecommitdiff
path: root/src/setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup')
-rw-r--r--src/setup/compatibility.c6
-rw-r--r--src/setup/display.c6
-rw-r--r--src/setup/execute.c1
-rw-r--r--src/setup/joystick.c76
-rw-r--r--src/setup/keyboard.c8
-rw-r--r--src/setup/mainmenu.c6
-rw-r--r--src/setup/mouse.c6
-rw-r--r--src/setup/multiplayer.c10
-rw-r--r--src/setup/sound.c4
9 files changed, 103 insertions, 20 deletions
diff --git a/src/setup/compatibility.c b/src/setup/compatibility.c
index df202117..14d5bc35 100644
--- a/src/setup/compatibility.c
+++ b/src/setup/compatibility.c
@@ -22,6 +22,8 @@
#include "compatibility.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-compat"
+
int vanilla_savegame_limit = 1;
int vanilla_demo_limit = 1;
@@ -31,7 +33,9 @@ void CompatibilitySettings(void)
window = TXT_NewWindow("Compatibility");
- TXT_AddWidgets(window,
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
+ TXT_AddWidgets(window,
TXT_NewCheckBox("Vanilla savegame limit",
&vanilla_savegame_limit),
TXT_NewCheckBox("Vanilla demo limit",
diff --git a/src/setup/display.c b/src/setup/display.c
index 1398aaf0..e94db94e 100644
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -28,6 +28,8 @@
#include "display.h"
#include "config.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-display"
+
extern void RestartTextscreen(void);
typedef struct
@@ -535,6 +537,8 @@ static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
window = TXT_NewWindow("Advanced display options");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_SetColumnWidths(window, 35);
TXT_AddWidgets(window,
@@ -595,6 +599,8 @@ void ConfigDisplay(void)
window = TXT_NewWindow("Display Configuration");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
// 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.
diff --git a/src/setup/execute.c b/src/setup/execute.c
index bbb23c38..26f59fd8 100644
--- a/src/setup/execute.c
+++ b/src/setup/execute.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <sys/types.h>
diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index dc94b2f0..22b1a089 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "doomtype.h"
#include "i_joystick.h"
@@ -28,6 +29,8 @@
#include "txt_joyaxis.h"
#include "txt_joybinput.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-gamepad"
+
typedef struct
{
char *name; // Config file name
@@ -136,6 +139,7 @@ static const joystick_config_t empty_defaults[] =
{"joyb_straferight", -1},
{"joyb_prevweapon", -1},
{"joyb_nextweapon", -1},
+ {"joyb_jump", -1},
{"joyb_menu_activate", -1},
{NULL, 0},
};
@@ -292,6 +296,24 @@ static const joystick_config_t buffalo_classic_controller[] =
{NULL, 0},
};
+// Config for if the user is actually using an old PC joystick or gamepad,
+// probably via a USB-Gameport adapter.
+static const joystick_config_t pc_gameport_controller[] =
+{
+ {"joystick_x_axis", 0},
+ {"joystick_y_axis", 1},
+ // Button configuration is the default as used for Vanilla Doom,
+ // Heretic and Hexen. When playing with a Gravis Gamepad, this
+ // layout should also be vaguely similar to the standard layout
+ // described above.
+ {"joyb_fire", 0},
+ {"joyb_strafe", 1},
+ {"joyb_use", 3},
+ {"joyb_speed", 2},
+ {NULL, 0},
+};
+
+
static const known_joystick_t known_joysticks[] =
{
{
@@ -331,6 +353,13 @@ static const known_joystick_t known_joysticks[] =
xbox360_controller_linux,
},
+ // Xbox One controller as it appears on Linux.
+ {
+ "Microsoft X-Box One pad",
+ 6, 11, 1,
+ xbox360_controller_linux,
+ },
+
{
"Logitech Dual Action",
4, 12, 1,
@@ -357,6 +386,25 @@ static const known_joystick_t known_joysticks[] =
6, 14, 1,
ps4_ds4_controller,
},
+
+ // This is the configuration for the USB-Gameport adapter listed on
+ // this page as the "Mayflash USB to Gameport Adapter" (though the
+ // device is labeled as "Super Joy Box 7"):
+ // https://sites.google.com/site/joystickrehab/itemcatal
+ // TODO: Add extra configurations here for other USB-Gameport adapters,
+ // which should just be the same configuration.
+ {
+ "WiseGroup.,Ltd Gameport to USB Controller",
+ 4, 8, 1,
+ pc_gameport_controller,
+ },
+
+ // How the Super Joy Box 7 appears on Mac OS X.
+ {
+ "Gameport to USB Controller",
+ 2, 8, 1,
+ pc_gameport_controller,
+ },
};
static const known_joystick_t *GetJoystickType(int index)
@@ -520,7 +568,7 @@ static int OpenAllJoysticks(void)
result = 0;
- for (i=0; i<num_joysticks; ++i)
+ for (i = 0; i < num_joysticks; ++i)
{
all_joysticks[i] = SDL_JoystickOpen(i);
@@ -556,7 +604,7 @@ static void CloseAllJoysticks(void)
num_joysticks = SDL_NumJoysticks();
- for (i=0; i<num_joysticks; ++i)
+ for (i = 0; i < num_joysticks; ++i)
{
if (all_joysticks[i] != NULL)
{
@@ -587,6 +635,7 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data)
// At this point, we have a button press.
// In the first "center" stage, we're just trying to work out which
// joystick is being configured and which button the user is pressing.
+ usejoystick = 1;
joystick_index = event->jbutton.which;
calibrate_button = event->jbutton.button;
@@ -595,7 +644,6 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data)
if (IsKnownJoystick(joystick_index))
{
LoadKnownConfiguration();
- usejoystick = 1;
TXT_CloseWindow(calibration_window);
}
else
@@ -613,11 +661,12 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data)
static void NoJoystick(void)
{
- TXT_MessageBox(NULL, "No joysticks or gamepads could be found.\n\n"
+ TXT_MessageBox(NULL, "No gamepads or joysticks could be found.\n\n"
"Try configuring your controller from within\n"
"your OS first. Maybe you need to install\n"
"some drivers or otherwise configure it.");
+ usejoystick = 0;
joystick_index = -1;
SetJoystickButtonLabel();
}
@@ -659,7 +708,7 @@ static void CalibrateJoystick(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
TXT_SignalConnect(calibration_window, "closed", CalibrateWindowClosed, NULL);
// Start calibration
-
+ usejoystick = 0;
joystick_index = -1;
}
@@ -685,8 +734,9 @@ void ConfigJoystick(void)
window = TXT_NewWindow("Gamepad/Joystick configuration");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_AddWidgets(window,
- TXT_NewCheckBox("Enable gamepad/joystick", &usejoystick),
joystick_table = TXT_NewTable(2),
TXT_NewSeparator("Axes"),
axis_table = TXT_NewTable(2),
@@ -694,6 +744,13 @@ void ConfigJoystick(void)
button_table = TXT_NewTable(4),
NULL);
+ TXT_SetColumnWidths(joystick_table, 13, 40);
+
+ TXT_AddWidgets(joystick_table,
+ TXT_NewLabel("Controller"),
+ joystick_button = TXT_NewButton("zzzz"),
+ NULL);
+
TXT_SetColumnWidths(axis_table, 20, 15);
TXT_AddWidgets(axis_table,
@@ -711,13 +768,6 @@ void ConfigJoystick(void)
JOYSTICK_AXIS_HORIZONTAL),
NULL);
- TXT_SetColumnWidths(joystick_table, 20, 15);
-
- TXT_AddWidgets(joystick_table,
- TXT_NewLabel("Current controller"),
- joystick_button = TXT_NewButton("zzzz"),
- NULL);
-
TXT_SetColumnWidths(button_table, 16, 12, 14, 11);
AddJoystickControl(button_table, "Fire/Attack", &joybfire);
diff --git a/src/setup/keyboard.c b/src/setup/keyboard.c
index 0d672436..4bbe1507 100644
--- a/src/setup/keyboard.c
+++ b/src/setup/keyboard.c
@@ -25,6 +25,8 @@
#include "joystick.h"
#include "keyboard.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-keyboard"
+
int vanilla_keyboard_mapping = 1;
static int always_run = 0;
@@ -181,6 +183,8 @@ static void ConfigExtraKeys(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
window = TXT_NewWindow("Extra keyboard controls");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
table = TXT_NewTable(2);
TXT_SetColumnWidths(table, 21, 9);
@@ -270,6 +274,8 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
window = TXT_NewWindow("Other keys");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
table = TXT_NewTable(2);
TXT_SetColumnWidths(table, 25, 9);
@@ -356,6 +362,8 @@ void ConfigKeyboard(void)
window = TXT_NewWindow("Keyboard configuration");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_AddWidgets(window,
TXT_NewSeparator("Movement"),
movement_table = TXT_NewTable(4),
diff --git a/src/setup/mainmenu.c b/src/setup/mainmenu.c
index a599812e..e35decd5 100644
--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -38,6 +38,8 @@
#include "multiplayer.h"
#include "sound.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup"
+
static const int cheat_sequence[] =
{
KEY_UPARROW, KEY_UPARROW, KEY_DOWNARROW, KEY_DOWNARROW,
@@ -209,6 +211,8 @@ void MainMenu(void)
window = TXT_NewWindow("Main Menu");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_AddWidgets(window,
TXT_NewButton2("Configure Display",
(TxtWidgetSignalFunc) ConfigDisplay, NULL),
@@ -247,7 +251,7 @@ void MainMenu(void)
NULL);
quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit");
- warp_action = TXT_NewWindowAction(KEY_F1, "Warp");
+ warp_action = TXT_NewWindowAction(KEY_F2, "Warp");
TXT_SignalConnect(quit_action, "pressed", QuitConfirm, NULL);
TXT_SignalConnect(warp_action, "pressed",
(TxtWidgetSignalFunc) WarpMenu, NULL);
diff --git a/src/setup/mouse.c b/src/setup/mouse.c
index 9fdfc833..91e38870 100644
--- a/src/setup/mouse.c
+++ b/src/setup/mouse.c
@@ -25,6 +25,8 @@
#include "mode.h"
#include "mouse.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-mouse"
+
static int usemouse = 1;
static int mouseSensitivity = 5;
@@ -84,6 +86,8 @@ static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
window = TXT_NewWindow("Additional mouse buttons");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_AddWidgets(window,
buttons_table = TXT_NewTable(2),
NULL);
@@ -112,6 +116,8 @@ void ConfigMouse(void)
window = TXT_NewWindow("Mouse configuration");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_AddWidgets(window,
TXT_NewCheckBox("Enable mouse", &usemouse),
TXT_NewInvertedCheckBox("Allow vertical mouse movement",
diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c
index 6b294077..4aaff921 100644
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -355,7 +355,7 @@ static void SetExMyWarp(TXT_UNCAST_ARG(widget), void *val)
{
int l;
- l = (int) val;
+ l = (intptr_t) val;
warpepisode = l / 10;
warpmap = l % 10;
@@ -367,7 +367,7 @@ static void SetMAPxyWarp(TXT_UNCAST_ARG(widget), void *val)
{
int l;
- l = (int) val;
+ l = (intptr_t) val;
warpmap = l;
@@ -389,8 +389,8 @@ static void LevelSelectDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
const iwad_t *iwad;
char buf[10];
int episodes;
- int x, y;
- int l;
+ intptr_t x, y;
+ intptr_t l;
int i;
window = TXT_NewWindow("Select level");
@@ -957,7 +957,7 @@ static void ServerQueryWindow(char *title)
TXT_NewScrollPane(70, 10,
results_table = TXT_NewTable(3)));
- TXT_SetColumnWidths(results_table, 7, 16, 46);
+ TXT_SetColumnWidths(results_table, 7, 22, 40);
TXT_SetPeriodicCallback(QueryPeriodicCallback, results_table, 1);
TXT_SignalConnect(query_window, "closed", QueryWindowClosed, NULL);
diff --git a/src/setup/sound.c b/src/setup/sound.c
index e7670feb..280a6bc2 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -25,6 +25,8 @@
#include "mode.h"
#include "sound.h"
+#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-sound"
+
typedef enum
{
SFXMODE_DISABLED,
@@ -237,6 +239,8 @@ void ConfigSound(void)
window = TXT_NewWindow("Sound configuration");
+ TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
+
TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
TXT_SCREEN_W / 2, 5);