RMG-Input: use SDL GUID (#518)

This commit is contained in:
bmsuseluda authored and GitHub committed 2026-09-17 13:35:41 +02:00
1 parent 90ab075de4
commit aadb31cd53
13 files changed
+93 -13

No files matched your search

+8 -1
View File
@@ -13,6 +13,8 @@
#include <RMG-Core/m64p/api/m64p_types.h>
#include <SDL3/SDL.h>
#include "../Utilities/Sdl3GuidWithIndex.hpp"
using namespace Thread;
SDLThread::SDLThread(QObject *parent) : QThread(parent)
@@ -68,8 +70,11 @@ void SDLThread::run(void)
QString name;
QString path;
QString serial;
QString guid;
QString errorMessage;
std::vector<std::string> guidsWithoutIndex;
SDL_Gamepad* controller;
SDL_Joystick* joystick;
@@ -103,6 +108,7 @@ void SDLThread::run(void)
name = SDL_GetGamepadName(controller);
path = SDL_GetGamepadPath(controller);
serial = SDL_GetGamepadSerial(controller);
guid = QString::fromStdString(Utilities::Sdl3GuidWithIndex(guidsWithoutIndex, joystickId));
SDL_CloseGamepad(controller);
}
else
@@ -118,12 +124,13 @@ void SDLThread::run(void)
name = SDL_GetJoystickName(joystick);
path = SDL_GetJoystickPath(joystick);
serial = SDL_GetJoystickSerial(joystick);
guid = QString::fromStdString(Utilities::Sdl3GuidWithIndex(guidsWithoutIndex, joystickId));
SDL_CloseJoystick(joystick);
}
if (name != nullptr)
{
emit this->OnInputDeviceFound(name, path, serial, joystickId);
emit this->OnInputDeviceFound(name, path, serial, guid, joystickId);
}
}