deathkiller / jazz2

🎮 · Jazz² Resurrection: Open-source reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
495 stars 18 forks source link

ArgumentOutOfRangeException on startup #52

Closed sanmadjack closed 2 years ago

sanmadjack commented 3 years ago

Program is crashing on startup, found this in the event log:

Application: Jazz2.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentOutOfRangeException at OpenTK.Input.JoystickState.SetButton(Int32, Boolean) at OpenTK.Platform.Windows.WinRawJoystick+Device.SetButton(Int32, Boolean) at OpenTK.Platform.Windows.WinRawJoystick.QueryDeviceCaps(Device) at OpenTK.Platform.Windows.WinRawJoystick.RefreshDevices() at OpenTK.Platform.Windows.WinRawJoystick..ctor(IntPtr) at OpenTK.Platform.Windows.WinRawInput.CreateDrivers() at OpenTK.Platform.Windows.WinInputBase.ProcessEvents() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()

I've got a number of joysticks that are hidden via hidhide, then mapped to a vjoy joysticks via Universal Control Remapper. It's possible this is causing an issue, but I'd rather not have to disable my whole setup to make this work. If I have time later I'll download the source and break into debug to see if I can dig up more info.

deathkiller commented 3 years ago

It looks like a bug in OpenTK library. I think it will not be easy to fix, but it's definitely annoying issue. This game uses older version of this library.