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 string& desc = BSPF::startsWithIgnoreCase(sdlname, "XInput Controller")
? "XInput Controller" : sdlname;
const SDL_JoystickGUID sdlguid = SDL_JoystickGetDeviceGUID(idx);
char chGuid[33];
SDL_JoystickGetGUIDString(sdlguid, chGuid, sizeof(chGuid));
initialize(SDL_JoystickInstanceID(myStick), desc, chGuid,
initialize(SDL_JoystickInstanceID(myStick), desc,
SDL_JoystickNumAxes(myStick), SDL_JoystickNumButtons(myStick),
SDL_JoystickNumHats(myStick), SDL_JoystickNumBalls(myStick));
}

View File

@ -24,9 +24,8 @@
#include "Driving.hxx"
#include "Settings.hxx"
#include "EventHandler.hxx"
#include "Logger.hxx"
#include "MD5.hxx"
#include "PJoystickHandler.hxx"
#include "Logger.hxx"
#ifdef GUI_SUPPORT
#include "DialogContainer.hxx"
@ -139,7 +138,6 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
}
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
mySticks[stick->ID] = stick;
@ -296,9 +294,9 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
if(found)
{
if(saOrder[saCount] == 1)
_stick->name += " (emulates left controller port)";
_stick->name += " (emulates left joystick port)";
else if(saOrder[saCount] == 2)
_stick->name += " (emulates right controller port)";
_stick->name += " (emulates right joystick port)";
saCount++;
// always map Stelladaptor/2600-daptor to emulation mode defaults

View File

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

View File

@ -55,7 +55,7 @@ class PhysicalJoystick
string about() const;
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);
private:
@ -68,7 +68,6 @@ class PhysicalJoystick
Type type{Type::REGULAR};
int ID{-1};
string name{"None"};
string guid{"None"};
int numAxes{0}, numButtons{0}, numHats{0};
IntArray axisLastValue;
IntArray buttonLast;