8000 Automatic controller mappings are not overwritten by manual mappings without CRC · Issue #13127 · libsdl-org/SDL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Automatic controller mappings are not overwritten by manual mappings without CRC #13127
Open
@ThadHouse

Description

@ThadHouse

I'm not sure if this is a bug or a feature, but it's confusing behavior, so likely more towards the bug category.

When automatic gamepad mappings are generated, the CRC is included in the GUID used. This means that if a mapping for that gamepad is added after the automatic mapping is generated, the added mapping will be ignored, unless the added mapping includes the CRC. This essentially means you have to add mappings before calling SDL_Init, as if any gamepads are plugged in during SDL_Init, they'll have automatically generated mappings created, and any mappings added later will not be used.

What makes me think this is a bug is SDL_PrivateMatchGamepadMappingForGUID has the following comment in it.

// Clear the CRC from the GUID for matching, the mappings never include it in the GUID
SDL_SetJoystickGUIDCRC(&guid, 0);

Which makes me think adding a mapping with a GUID included is a bug.

< 55F3 /div>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0