Commit 4a49c702 authored by Gregory Dymarek's avatar Gregory Dymarek

Fixing compilation issues

parent f31e10ab
......@@ -95,12 +95,12 @@ public:
QVariantList buttonActions(void);
QString name(void) { return _name; }
/*
// Joystick index used by sdl library
// Settable because sdl library remaps indicies after certain events
virtual int index(void) = 0;
virtual void setIndex(int index) = 0;
*/
virtual bool requiresCalibration(void) { return true; }
int throttleMode(void);
......
......@@ -65,6 +65,7 @@ JoystickAndroid::~JoystickAndroid() {
QtAndroidPrivate::unregisterKeyEventListener(this);
}
QMap<QString, Joystick*> JoystickAndroid::discover(MultiVehicleManager* _multiVehicleManager) {
bool joystickFound = false;
static QMap<QString, Joystick*> ret;
......
......@@ -61,9 +61,8 @@ void JoystickManager::init()
_joystickCheckTimer.start(250);
}
#elif defined(__android__)
/*
* Android Joystick not yet supported
*/
_setActiveJoystickFromSettings();
//TODO: Investigate Android events for Joystick hot plugging & run _joystickCheckTimer if possible
#endif
}
......@@ -205,7 +204,7 @@ void JoystickManager::_updateAvailableJoysticks(void)
}
#elif defined(__android__)
/*
* Android Joystick not yet supported
* TODO: Investigate Android events for Joystick hot plugging
*/
#endif
}
......@@ -68,8 +68,9 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl
newRet[name] = new JoystickSDL(name, qMax(0,axisCount), qMax(0,buttonCount), qMax(0,hatCount), i, isGameController, _multiVehicleManager);
} else {
newRet[name] = ret[name];
if (newRet[name]->index() != i) {
newRet[name]->setIndex(i); // This joystick index has been remapped by SDL
JoystickSDL *j = (JoystickSDL*)newRet[name];
if (j->index() != i) {
j->setIndex(i); // This joystick index has been remapped by SDL
}
// Anything left in ret after we exit the loop has been removed (unplugged) and needs to be cleaned up.
// We will handle that in JoystickManager in case the removed joystick was in use.
......
......@@ -36,6 +36,7 @@ private:
SDL_GameController *sdlController;
bool _isGameController;
int _index; ///< Index for SDL_JoystickOpen
};
#endif // JOYSTICKSDL_H
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