Commit 27dfa550 authored by Rustom Jehangir's avatar Rustom Jehangir

SDL2: Update project files and update joystick open function for SDL2

parent 93f5908c
......@@ -173,7 +173,7 @@ MacBuild {
LIBS += \
-F$$BASEDIR/libs/lib/Frameworks \
-framework SDL
-framework SDL2
} else:LinuxBuild {
PKGCONFIG = sdl2
} else:WindowsBuild {
......
......@@ -49,8 +49,8 @@ iOSBuild | MacBuild {
MacBuild {
# Copy non-standard frameworks into app package
QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/
# SDL Framework
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
# SDL2 Framework
QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL2.framework/Versions/A/SDL2" "@executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET}
}
WindowsBuild {
......@@ -62,7 +62,7 @@ WindowsBuild {
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
$$BASEDIR\\libs\\lib\\sdl\\win32\\SDL.dll \
$$BASEDIR\\libs\\lib\\sdl2\\win32\\SDL2.dll \
$$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \
$$BASEDIR\\deploy\\libeay32.dll
......
......@@ -23,7 +23,16 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl
qCDebug(JoystickLog) << "Available joysticks";
for (int i=0; i<SDL_NumJoysticks(); i++) {
QString name = SDL_JoystickName(i);
QString name = SDL_JoystickNameForIndex(i);
if (SDL_IsGameController(i)) {
qDebug() << name << "supports SDL GameController!";
} else {
qDebug() << name << "DOES NOT support SDL GameController!";
}
SDL_GameController* sdlController = SDL_GameControllerOpen(i);
qDebug() << SDL_GetError();
if (!ret.contains(name)) {
int axisCount, buttonCount, hatCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment