all repos — mgba @ 3deb44b6263b1c87da1896440d39bd95fb1c7c6f

mGBA Game Boy Advance Emulator

Qt: Fix non-SDL build (fixes #1656)
Vicki Pfau vi@endrift.com
Fri, 31 Jan 2020 18:09:58 -0800
commit

3deb44b6263b1c87da1896440d39bd95fb1c7c6f

parent

d4ca59df163c3ca780b964b817d69f5becd3391d

2 files changed, 13 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -26,6 +26,7 @@ - Qt: Fix extraneous dialog (fixes mgba.io/i/1654)

- Util: Fix crash reading invalid ELFs Misc: - Qt: Renderer can be changed while a game is running + - Qt: Fix non-SDL build (fixes mgba.io/i/1656) - Switch: Make OpenGL scale adjustable while running 0.8.0: (2020-01-21)
M src/platform/qt/InputController.cppsrc/platform/qt/InputController.cpp

@@ -271,9 +271,21 @@ void InputController::setPreferredGamepad(uint32_t type, int index) {

if (!m_config) { return; } +#ifdef BUILD_SDL char name[34] = {0}; +#if SDL_VERSION_ATLEAST(2, 0, 0) SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick), name, sizeof(name)); +#else + const char* name = SDL_JoystickName(SDL_JoystickIndex(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick)); + if (!name) { + return; + } +#endif mInputSetPreferredDevice(m_config->input(), "gba", type, m_playerId, name); +#else + UNUSED(type); + UNUSED(index); +#endif } mRumble* InputController::rumble() {