i found a crashing bug with the joystick hat code on windows
(DOH, a day late!)
here is the offending block of code:
if ( joyinfo.dwFlags & JOY_RETURNPOV ) {
Uint8 pos;
pos = TranslatePOV(joyinfo.dwPOV);
if ( pos != joystick->hats[0] ) {
SDL_PrivateJoystickHat(joystick, 0, pos);
}
}
on my system, my joystick has no hats. when running on my
computer joystick->hats is NULL. when indexing [0] this
throws out the parachute.
by simply checking joystick->hats before entering the block
my code ran fine. i assume that it will still work for joysticks
with hats, but i cannot test.
first line becomes:
if ( joystick->hats && joyinfo.dwFlags & JOY_RETURNPOV ) {
sam, does that seem like it will still work? there might be
a better way to check for this.
(looks like i’ll disable joystick in my game until 1.1.8)