Fix from JonoF for using a joystick in combination with SDLayer.

git-svn-id: https://svn.eduke32.com/eduke32@289 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-09-02 02:34:29 +00:00
parent c0f93c2aad
commit 11e8db76a8
2 changed files with 503 additions and 502 deletions

View file

@ -353,6 +353,7 @@ int initinput(void)
joydev = SDL_JoystickOpen(0); joydev = SDL_JoystickOpen(0);
if (joydev) { if (joydev) {
SDL_JoystickEventState(SDL_ENABLE); SDL_JoystickEventState(SDL_ENABLE);
inputdevices |= 4;
joynumaxes = SDL_JoystickNumAxes(joydev); joynumaxes = SDL_JoystickNumAxes(joydev);
joynumbuttons = min(32,SDL_JoystickNumButtons(joydev)); joynumbuttons = min(32,SDL_JoystickNumButtons(joydev));

View file

@ -126,7 +126,7 @@ void CONTROL_CenterJoystick
boolean CONTROL_StartJoy(int32 joy) boolean CONTROL_StartJoy(int32 joy)
{ {
return (inputdevices & 3) == 3; return (inputdevices & 4) == 4;
} }
void CONTROL_ShutJoy(int32 joy) void CONTROL_ShutJoy(int32 joy)
@ -867,7 +867,7 @@ boolean CONTROL_Startup(controltype which, int32 ( *TimeFunction )( void ), int3
// case controltype_keyboardandjoystick: // case controltype_keyboardandjoystick:
CONTROL_NumJoyAxes = min(MAXJOYAXES,joynumaxes); CONTROL_NumJoyAxes = min(MAXJOYAXES,joynumaxes);
CONTROL_NumJoyButtons = min(MAXJOYBUTTONS,joynumbuttons + 4*(joynumhats>0)); CONTROL_NumJoyButtons = min(MAXJOYBUTTONS,joynumbuttons + 4*(joynumhats>0));
CONTROL_JoyPresent = ((inputdevices & 4) == 4); CONTROL_JoyPresent = CONTROL_StartJoy(0);;
CONTROL_JoystickEnabled = CONTROL_JoyPresent; CONTROL_JoystickEnabled = CONTROL_JoyPresent;
// break; // break;
//} //}