mirror of https://github.com/stella-emu/stella.git
Fixed bug occurring when more than 2 controllers had the same name; information
was being saved about only two of them. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3273 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
3b2f534bf7
commit
a35c66e806
|
@ -22,6 +22,11 @@
|
|||
* Fixed bug with 'Medieval Mayhem' ROMs; the paddle range was set too
|
||||
low, and as a result the number of players couldn't be selected.
|
||||
|
||||
* Fixed bug when using more than two input controllers with the same
|
||||
name; each controller after the second one was named the same as the
|
||||
second one. This caused the joystick mappings to be lost, since there
|
||||
was only information about two controllers being saved.
|
||||
|
||||
* Updated internal ROM properties database to ROM-Hunter version 11
|
||||
(thanks go to RomHunter for his tireless research in this area).
|
||||
Related to this, updated the snapshot collection.
|
||||
|
|
|
@ -196,11 +196,11 @@ EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx)
|
|||
myStick = SDL_JoystickOpen(idx);
|
||||
if(myStick)
|
||||
{
|
||||
// There still seems to be some issue with certain controllers not being
|
||||
// recognized. In this case, SDL names the controller as "XInput Controller".
|
||||
// This would be fine except it also appends " #x", where x seems to vary.
|
||||
// Obviously this wreaks havoc with the idea that a joystick will always
|
||||
// have the same name. So we truncate the number.
|
||||
// In Windows, all XBox controllers using the XInput API seem to name
|
||||
// the controller as "XInput Controller". This would be fine, except
|
||||
// it also appends " #x", where x seems to vary. Obviously this wreaks
|
||||
// havoc with the idea that a joystick will always have the same name.
|
||||
// So we truncate the number.
|
||||
const char* sdlname = SDL_JoystickName(myStick);
|
||||
const string& desc = BSPF_startsWithIgnoreCase(sdlname, "XInput Controller")
|
||||
? "XInput Controller" : sdlname;
|
||||
|
|
|
@ -317,13 +317,9 @@ bool EventHandler::JoystickHandler::add(StellaJoystick* stick)
|
|||
// we append ' #x', where 'x' increases consecutively
|
||||
int count = 0;
|
||||
for(const auto& i: myDatabase)
|
||||
{
|
||||
if(BSPF_startsWithIgnoreCase(i.first, stick->name) && i.second.joy)
|
||||
{
|
||||
++count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(count > 0)
|
||||
{
|
||||
ostringstream name;
|
||||
|
|
Loading…
Reference in New Issue