From d09ae5ef5b3f337808ab203427c4e0086f9a671b Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 9 Feb 2025 17:47:50 +0100 Subject: [PATCH] init JoyInfo stuff on startup just in case --- src/sdl/i_system.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 5e087f7ca..026f0c317 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -346,7 +346,7 @@ static void write_backtrace(bt_crash_reason_t reason) fprintf(out, "Program name: %s %s\n", SRB2APPLICATION, VERSIONSTRING); if (compdate && comptime && comprevision && compbranch) - fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch); + fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch); if (gamestate == GS_LEVEL) { @@ -1343,8 +1343,6 @@ void I_InitJoystick(UINT8 index) SDL_SetHint(SDL_HINT_AUTO_UPDATE_SENSORS, "0"); - //I_ShutdownJoystick(); - //SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE); if (M_CheckParm("-nojoy")) return; @@ -1373,6 +1371,11 @@ void I_InitJoystick(UINT8 index) } } + JoyInfo[index].dev = NULL; + JoyInfo[index].oldjoy = -1; + JoyInfo[index].id = -1; + JoyInfo[index].axises = JoyInfo[index].buttons = JoyInfo[index].hats = JoyInfo[index].balls = 0; + if (cv_usejoystick[index].value) newcontroller = SDL_GameControllerOpen(cv_usejoystick[index].value-1);