mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Ignore lines starting with "#" when parsing the mappings string given to love.joystick.loadGamepadMappings.
This commit is contained in:
@@ -489,6 +489,10 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings)
|
|||||||
if (mapping.empty())
|
if (mapping.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Lines starting with "#" are comments.
|
||||||
|
if (mapping[0] == '#')
|
||||||
|
continue;
|
||||||
|
|
||||||
// Strip out and compare any "platform:XYZ," in the mapping.
|
// Strip out and compare any "platform:XYZ," in the mapping.
|
||||||
size_t pstartpos = mapping.find("platform:");
|
size_t pstartpos = mapping.find("platform:");
|
||||||
if (pstartpos != std::string::npos)
|
if (pstartpos != std::string::npos)
|
||||||
|
|||||||
Reference in New Issue
Block a user