From 6c533364f63472c7a35b3ba817ba0c97de55d583 Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Mon, 16 Sep 2024 21:15:00 +0200 Subject: [PATCH] Remove outdated '-slowkey', '-alternatejoy' & '-directinput' options Removes key_emulation and joy_emulation toggles from ddio_init_info structures, that were not used in the SDL implementation. All input is now handled using SDL for all platforms, alternatejoy/directinput options were only relevant for Windows-specific DirectInput. 'slowkey' was an unimplemented feature. --- Descent3/init.cpp | 5 +---- ddio/ddio.cpp | 2 +- ddio/ddio_common.h | 2 -- ddio/sdljoy.cpp | 4 ++-- editor/gameeditor.cpp | 6 ------ legacy/FontEditor/FontEditor.cpp | 2 -- lib/joystick.h | 2 +- 7 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Descent3/init.cpp b/Descent3/init.cpp index ccfff435..4a948269 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1433,8 +1433,7 @@ void InitIOSystems(bool editor) { // do io init stuff io_info.obj = Descent; - io_info.joy_emulation = (bool)((FindArg("-alternatejoy") == 0) && (FindArg("-directinput") == 0)); - io_info.key_emulation = true; //(bool)(FindArg("-slowkey")!=0); WIN95: DirectInput is flaky for some keys. + INIT_MESSAGE(("Initializing DDIO systems.")); if (!ddio_Init(&io_info)) { Error("I/O initialization failed."); @@ -2136,8 +2135,6 @@ void RestartD3() { // startup io io_info.obj = Descent; - io_info.key_emulation = true; //(bool)(FindArg("-slowkey")!=0); - io_info.joy_emulation = (bool)((FindArg("-alternatejoy") == 0) && (FindArg("-directinput") == 0)); if (!ddio_Init(&io_info)) { Error("I/O initialization failed."); } diff --git a/ddio/ddio.cpp b/ddio/ddio.cpp index 67081568..78b3d3d9 100644 --- a/ddio/ddio.cpp +++ b/ddio/ddio.cpp @@ -119,7 +119,7 @@ bool ddio_Init(ddio_init_info *init_info) { } first_time = false; DDIO_initialized = true; - joy_Init(init_info->joy_emulation); + joy_Init(); return res; } void ddio_Close() { diff --git a/ddio/ddio_common.h b/ddio/ddio_common.h index 22af91d4..7f5d9aba 100644 --- a/ddio/ddio_common.h +++ b/ddio/ddio_common.h @@ -124,8 +124,6 @@ struct ddio_init_info { oeApplication *obj; // App object used to initialize to IO system - bool key_emulation; // keyboard emulation - bool joy_emulation; // joystick emulation }; // ---------------------------------------------------------------------------- diff --git a/ddio/sdljoy.cpp b/ddio/sdljoy.cpp index 13d24005..eb59a2c5 100644 --- a/ddio/sdljoy.cpp +++ b/ddio/sdljoy.cpp @@ -97,7 +97,7 @@ static bool joy_InitStick(tJoystick joy, char *server_adr); // functions // joystick system initialization -bool joy_Init(bool remote) { +bool joy_Init() { // reinitialize joystick if already initialized. joy_Close(); if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) { @@ -106,7 +106,7 @@ bool joy_Init(bool remote) { } // check if this OS supports joysticks - if (!joyGetNumDevs() && !remote) { + if (!joyGetNumDevs()) { return false; } diff --git a/editor/gameeditor.cpp b/editor/gameeditor.cpp index 52461e94..2c3d652e 100644 --- a/editor/gameeditor.cpp +++ b/editor/gameeditor.cpp @@ -670,10 +670,6 @@ void GameToEditor(bool set_viewer_from_player) { SetWindowLong(theApp.main_frame->m_hWnd, GWL_STYLE, EditorWndStyle); } - // this uses information defined above - io_info.key_emulation = true; //(bool)(FindArg("-slowkey")!=0); - io_info.joy_emulation = (bool)((FindArg("-alternatejoy") == 0) && (FindArg("-directinput") == 0)); - ddio_Init(&io_info); Cinematic_Init(); @@ -871,8 +867,6 @@ void EditorToGame() { // Initialize IO System for child window io_info.obj = Descent; - io_info.key_emulation = true; //(bool)(FindArg("-slowkey")!=0); - io_info.joy_emulation = (bool)((FindArg("-alternatejoy") == 0) && (FindArg("-directinput") == 0)); ddio_Init(&io_info); // Init force feedback diff --git a/legacy/FontEditor/FontEditor.cpp b/legacy/FontEditor/FontEditor.cpp index 3bd82196..4707bfa5 100644 --- a/legacy/FontEditor/FontEditor.cpp +++ b/legacy/FontEditor/FontEditor.cpp @@ -181,8 +181,6 @@ void InitIO(oeApplication *app) { ddio_init_data.obj = app; ddio_init_data.use_lo_res_time = true; - ddio_init_data.key_emulation = true; - ddio_init_data.joy_emulation = true; ddio_Init(&ddio_init_data); GetCurrentDirectory(sizeof(path), path); diff --git a/lib/joystick.h b/lib/joystick.h index 14ca4520..b0d07e46 100644 --- a/lib/joystick.h +++ b/lib/joystick.h @@ -138,7 +138,7 @@ struct tJoyPos { }; // joystick system initialization -bool joy_Init(bool emulation); +bool joy_Init(); void joy_Close(); // retreive information about joystick.