mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Prefer the Joystick name rather than the GameController name for Joystick:getName
This commit is contained in:
@@ -70,11 +70,13 @@ bool Joystick::open(int deviceindex)
|
|||||||
// See if SDL thinks this is a Game Controller.
|
// See if SDL thinks this is a Game Controller.
|
||||||
openGamepad(deviceindex);
|
openGamepad(deviceindex);
|
||||||
|
|
||||||
// Prefer the GameController name.
|
// Prefer the Joystick name for consistency.
|
||||||
if (controller)
|
const char *joyname = SDL_JoystickName(joyhandle);
|
||||||
name = SDL_GameControllerName(controller);
|
if (!joyname && controller)
|
||||||
else
|
joyname = SDL_GameControllerName(controller);
|
||||||
name = SDL_JoystickName(joyhandle);
|
|
||||||
|
if (joyname)
|
||||||
|
name = joyname;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isConnected();
|
return isConnected();
|
||||||
|
|||||||
Reference in New Issue
Block a user