mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Fixed Joystick:getName to be more consistent
This commit is contained in:
@@ -124,11 +124,13 @@ const char *Joystick::getName() const
|
|||||||
if (!isConnected())
|
if (!isConnected())
|
||||||
return name.c_str();
|
return name.c_str();
|
||||||
|
|
||||||
// Prefer SDL's GameController name, if possible.
|
// Prefer the Joystick name for consistency.
|
||||||
if (isGamepad())
|
const char *joyname = SDL_JoystickName(joyhandle);
|
||||||
return SDL_GameControllerName(controller);
|
|
||||||
|
|
||||||
return SDL_JoystickName(joyhandle);
|
if (!joyname && isGamepad())
|
||||||
|
joyname = SDL_GameControllerName(controller);
|
||||||
|
|
||||||
|
return joyname;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Joystick::getAxisCount() const
|
int Joystick::getAxisCount() const
|
||||||
|
|||||||
Reference in New Issue
Block a user