mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Only add platform field to love.joystick.getGamepadMappingString's result if it's not there already.
This commit is contained in:
@@ -323,6 +323,8 @@ std::string Joystick::getGamepadMappingString() const
|
|||||||
// Matches SDL_GameControllerAddMappingsFromRW.
|
// Matches SDL_GameControllerAddMappingsFromRW.
|
||||||
if (mappingstr.find_last_of(',') != mappingstr.length() - 1)
|
if (mappingstr.find_last_of(',') != mappingstr.length() - 1)
|
||||||
mappingstr += ",";
|
mappingstr += ",";
|
||||||
|
|
||||||
|
if (mappingstr.find("platform:") == std::string::npos)
|
||||||
mappingstr += "platform:" + std::string(SDL_GetPlatform());
|
mappingstr += "platform:" + std::string(SDL_GetPlatform());
|
||||||
|
|
||||||
return mappingstr;
|
return mappingstr;
|
||||||
|
|||||||
Reference in New Issue
Block a user