|
35 | 35 | #include <QTime> |
36 | 36 | #include <QTimer> |
37 | 37 |
|
38 | | -#define USE_NEW_REFRESH |
39 | | - |
40 | 38 | InputDaemon::InputDaemon(QMap<SDL_JoystickID, InputDevice *> *joysticks, AntiMicroSettings *settings, bool graphical, |
41 | 39 | QObject *parent) |
42 | 40 | : QObject(parent) |
@@ -180,7 +178,6 @@ void InputDaemon::refreshJoysticks() |
180 | 178 |
|
181 | 179 | for (int i = 0; i < SDL_NumJoysticks(); i++) |
182 | 180 | { |
183 | | -#ifdef USE_NEW_REFRESH |
184 | 181 | int index = i; |
185 | 182 |
|
186 | 183 | // Check if device is considered a Game Controller at the start. |
@@ -251,38 +248,6 @@ void InputDaemon::refreshJoysticks() |
251 | 248 | if (joystick != nullptr) |
252 | 249 | emit deviceAdded(joystick); |
253 | 250 | } |
254 | | - |
255 | | -#else |
256 | | - SDL_Joystick *joystick = SDL_JoystickOpen(i); |
257 | | - if (joystick != nullptr) |
258 | | - { |
259 | | - QString temp = QString(); |
260 | | - SDL_JoystickGUID tempGUID = SDL_JoystickGetGUID(joystick); |
261 | | - char guidString[65] = {'0'}; |
262 | | - SDL_JoystickGetGUIDString(tempGUID, guidString, sizeof(guidString)); |
263 | | - temp = QString(guidString); |
264 | | - |
265 | | - bool disableGameController = m_settings->value(QString("%1Disable").arg(temp), false).toBool(); |
266 | | - |
267 | | - if (SDL_IsGameController(i) && !disableGameController) |
268 | | - { |
269 | | - SDL_GameController *controller = SDL_GameControllerOpen(i); |
270 | | - GameController *damncontroller = new GameController(controller, i, m_settings, this); |
271 | | - connect(damncontroller, &GameController::requestWait, eventWorker, &SDLEventReader::haltServices); |
272 | | - SDL_Joystick *sdlStick = SDL_GameControllerGetJoystick(controller); |
273 | | - SDL_JoystickID joystickID = SDL_JoystickInstanceID(sdlStick); |
274 | | - m_joysticks->insert(joystickID, damncontroller); |
275 | | - trackcontrollers.insert(joystickID, damncontroller); |
276 | | - } else |
277 | | - { |
278 | | - Joystick *curJoystick = new Joystick(joystick, i, m_settings, this); |
279 | | - connect(curJoystick, &Joystick::requestWait, eventWorker, &SDLEventReader::haltServices); |
280 | | - SDL_JoystickID joystickID = SDL_JoystickInstanceID(joystick); |
281 | | - m_joysticks->insert(joystickID, curJoystick); |
282 | | - trackjoysticks.insert(joystickID, curJoystick); |
283 | | - } |
284 | | - } |
285 | | -#endif |
286 | 251 | } |
287 | 252 |
|
288 | 253 | m_settings->endGroup(); |
|
0 commit comments