mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-01 13:16:37 +00:00
Make it possible to run even if SDL was built with joystick disabled. Should fix #8851.
This commit is contained in:
parent
e0845b876f
commit
3fc255b429
@ -426,9 +426,13 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
net::Init();
|
||||
|
||||
bool joystick_enabled = true;
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) {
|
||||
fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
|
||||
return 1;
|
||||
joystick_enabled = false;
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
||||
fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
@ -659,7 +663,11 @@ int main(int argc, char *argv[]) {
|
||||
// Audio must be unpaused _after_ NativeInit()
|
||||
SDL_PauseAudio(0);
|
||||
#ifndef _WIN32
|
||||
joystick = new SDLJoystick();
|
||||
if (joystick_enabled) {
|
||||
joystick = new SDLJoystick();
|
||||
} else {
|
||||
joystick = nullptr;
|
||||
}
|
||||
#endif
|
||||
EnableFZ();
|
||||
|
||||
@ -848,7 +856,9 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
default:
|
||||
#ifndef _WIN32
|
||||
joystick->ProcessInput(event);
|
||||
if (joystick) {
|
||||
joystick->ProcessInput(event);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user