mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed bug 3456 - SDL_GameControllerOpen fails if the joystick subsystem isn't initialized
Philipp Wiesemann Maybe the fault is in the SDL_VIDEO_DRIVER_WINDOWS section in SDL_InitSubSystem() of "src/SDL.c". Because there only SDL_INIT_JOYSTICK is checked. The flags are adapted for SDL_INIT_GAMECONTROLLER afterwards.
This commit is contained in:
parent
5af67f49f4
commit
0eb5c976b9
20
src/SDL.c
20
src/SDL.c
@ -115,6 +115,16 @@ SDL_InitSubSystem(Uint32 flags)
|
|||||||
/* Clear the error message */
|
/* Clear the error message */
|
||||||
SDL_ClearError();
|
SDL_ClearError();
|
||||||
|
|
||||||
|
if ((flags & SDL_INIT_GAMECONTROLLER)) {
|
||||||
|
/* game controller implies joystick */
|
||||||
|
flags |= SDL_INIT_JOYSTICK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) {
|
||||||
|
/* video or joystick implies events */
|
||||||
|
flags |= SDL_INIT_EVENTS;
|
||||||
|
}
|
||||||
|
|
||||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||||
if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
|
if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
|
||||||
if (SDL_HelperWindowCreate() < 0) {
|
if (SDL_HelperWindowCreate() < 0) {
|
||||||
@ -127,16 +137,6 @@ SDL_InitSubSystem(Uint32 flags)
|
|||||||
SDL_TicksInit();
|
SDL_TicksInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((flags & SDL_INIT_GAMECONTROLLER)) {
|
|
||||||
/* game controller implies joystick */
|
|
||||||
flags |= SDL_INIT_JOYSTICK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) {
|
|
||||||
/* video or joystick implies events */
|
|
||||||
flags |= SDL_INIT_EVENTS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize the event subsystem */
|
/* Initialize the event subsystem */
|
||||||
if ((flags & SDL_INIT_EVENTS)) {
|
if ((flags & SDL_INIT_EVENTS)) {
|
||||||
#if !SDL_EVENTS_DISABLED
|
#if !SDL_EVENTS_DISABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user