Patch: minor bug in SDL joystick polling

D2X-XL - Descent II update for modern systems with many new features and enhanced graphics. Home Page

Moderators: Grendel, Aus-RED-5

Post Reply
wackston
DBB Cadet
DBB Cadet
Posts: 1
Joined: Fri Mar 24, 2006 3:41 pm

Patch: minor bug in SDL joystick polling

Post by wackston »

The SDL joystick code for flushing joystick state 'joy_flush()' is slightly buggy and doesn't cover the entire button vector.

The result is JS with 'always on' buttons (e.g. the 3-position switches on Saitek)
can't be correctly used as the current switch state is never reset.

Patch to fix (relative to 1.5.179)
307c307
< for (i = 0; i < Joystick.n_buttons; i++) {
---
> for (i = 0; i < MAX_JOYSTICKS * JOY_MAX_BUTTONS; i++) {

cheers,
Andrew
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

thx.
Post Reply