Page MenuHome

BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related
ClosedPublic

Authored by Jorge Bernal (lordloki) on Mar 6 2015, 1:47 AM.

Diff Detail

Repository
rB Blender

Event Timeline

Jorge Bernal (lordloki) retitled this revision from to BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related.
Jorge Bernal (lordloki) updated this object.

I'd like to know why this wasn't a problem in the past. Did other code change? Is SDL2 less forgiving?

This comes from the change to SDL2. Maybe it is related with the new way of SDL2 internal indexing to support hotplugging

Joystick (Logitech Force 3D Pro) on Win7 64-bit works fine here, with and without the patch.
@Jorge Bernal (lordloki) do you know any steps to reproduce crashes or other issues?

Strange. Maybe it is related to if SDL considers your joystick as a controller or a joystick.
Mine, It is considered a generic joystick Rainbow 7310. You can test it using testcontroller.c which comes with SDL2 source.

The steps for the issues are easy:

1st issue:

  • Connect joystick
  • Start blender
  • start/stop BGE pressing "p" 9 times.
  • crash

If you modify JOYINDEX_MAX blender will crash earlier (i.e if JOYINDEX_MAX = 2 it will crash after 3rd BGE start).

2nd issue:

  • Connect joystick
  • Start blender
  • load a blend using joystick sensor
  • start BGE
  • first time it works perfectly
  • stop BGE and start again
  • second time doesn't works.

Edit: I forgot, it occurs always for both cases under windows. Linux it is working for me.

Sybren A. Stüvel (sybren) edited edge metadata.

My joystick, according to testgamecontroller.c:

% ./testjoystick2.exe
INFO: Joystick 0: Logitech Force 3D Pro (guid 6d0486c2000000000000504944564944)
INFO: There are 0 game controller(s) attached (1 joystick(s))

Apparently you need to have the joystick sensor set to Axis. I had it set to Hat, which doesn't cause this crash.

I can confirm the issues, and confirm that this patch fixes them. It fixes T43876 and probably fixes T43883 + T43456 too (but they didn't attach a blend file to test with).

This revision is now accepted and ready to land.Mar 7 2015, 11:13 AM

Correction: T43883 did include a test file, and it's fixed too.

Jorge Bernal (lordloki) edited edge metadata.
  • Only destroys the joysticks that were created
This revision was automatically updated to reflect the committed changes.