reverted GUID part of last commit

This commit is contained in:
Thomas Jentzsch 2021-05-17 14:51:58 +02:00
parent 783a1a5ac2
commit 4390a21fb7
4 changed files with 7 additions and 16 deletions

View File

@ -262,12 +262,8 @@ EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx)
const char* sdlname = SDL_JoystickName(myStick); const char* sdlname = SDL_JoystickName(myStick);
const string& desc = BSPF::startsWithIgnoreCase(sdlname, "XInput Controller") const string& desc = BSPF::startsWithIgnoreCase(sdlname, "XInput Controller")
? "XInput Controller" : sdlname; ? "XInput Controller" : sdlname;
const SDL_JoystickGUID sdlguid = SDL_JoystickGetDeviceGUID(idx);
char chGuid[33];
SDL_JoystickGetGUIDString(sdlguid, chGuid, sizeof(chGuid)); initialize(SDL_JoystickInstanceID(myStick), desc,
initialize(SDL_JoystickInstanceID(myStick), desc, chGuid,
SDL_JoystickNumAxes(myStick), SDL_JoystickNumButtons(myStick), SDL_JoystickNumAxes(myStick), SDL_JoystickNumButtons(myStick),
SDL_JoystickNumHats(myStick), SDL_JoystickNumBalls(myStick)); SDL_JoystickNumHats(myStick), SDL_JoystickNumBalls(myStick));
} }

View File

@ -24,9 +24,8 @@
#include "Driving.hxx" #include "Driving.hxx"
#include "Settings.hxx" #include "Settings.hxx"
#include "EventHandler.hxx" #include "EventHandler.hxx"
#include "Logger.hxx"
#include "MD5.hxx"
#include "PJoystickHandler.hxx" #include "PJoystickHandler.hxx"
#include "Logger.hxx"
#ifdef GUI_SUPPORT #ifdef GUI_SUPPORT
#include "DialogContainer.hxx" #include "DialogContainer.hxx"
@ -139,7 +138,6 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
} }
stick->type = PhysicalJoystick::Type::REGULAR; stick->type = PhysicalJoystick::Type::REGULAR;
} }
stick->name.append(" (" + MD5::hash(stick->guid).substr(0, 4) + ")");
// The stick *must* be inserted here, since it may be used below // The stick *must* be inserted here, since it may be used below
mySticks[stick->ID] = stick; mySticks[stick->ID] = stick;
@ -296,9 +294,9 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
if(found) if(found)
{ {
if(saOrder[saCount] == 1) if(saOrder[saCount] == 1)
_stick->name += " (emulates left controller port)"; _stick->name += " (emulates left joystick port)";
else if(saOrder[saCount] == 2) else if(saOrder[saCount] == 2)
_stick->name += " (emulates right controller port)"; _stick->name += " (emulates right joystick port)";
saCount++; saCount++;
// always map Stelladaptor/2600-daptor to emulation mode defaults // always map Stelladaptor/2600-daptor to emulation mode defaults

View File

@ -42,13 +42,11 @@ namespace {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystick::initialize(int index, void PhysicalJoystick::initialize(int index, const string& desc,
const string& desc, const string& uid, int axes, int buttons, int hats, int /*balls*/)
int axes, int buttons, int hats, int /*balls*/)
{ {
ID = index; ID = index;
name = desc; name = desc;
guid = uid;
numAxes = axes; numAxes = axes;
numButtons = buttons; numButtons = buttons;

View File

@ -55,7 +55,7 @@ class PhysicalJoystick
string about() const; string about() const;
protected: protected:
void initialize(int index, const string& desc, const string& uid, void initialize(int index, const string& desc,
int axes, int buttons, int hats, int balls); int axes, int buttons, int hats, int balls);
private: private:
@ -68,7 +68,6 @@ class PhysicalJoystick
Type type{Type::REGULAR}; Type type{Type::REGULAR};
int ID{-1}; int ID{-1};
string name{"None"}; string name{"None"};
string guid{"None"};
int numAxes{0}, numButtons{0}, numHats{0}; int numAxes{0}, numButtons{0}, numHats{0};
IntArray axisLastValue; IntArray axisLastValue;
IntArray buttonLast; IntArray buttonLast;