浏览代码

Remove the CRC from automatically generated gamepad mappings

Fixes https://github.com/libsdl-org/SDL/issues/13127

(cherry picked from commit 638acdc02a8dd6314674775dfec37ac6b90dd8cf)
Sam Lantinga 3 月之前
父节点
当前提交
55b023c961
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/joystick/SDL_gamepad.c

+ 5 - 0
src/joystick/SDL_gamepad.c

@@ -1786,6 +1786,11 @@ static GamepadMapping_t *SDL_PrivateGenerateAutomaticGamepadMapping(const char *
     char name_string[128];
     char mapping[1024];
 
+    // Remove the CRC from the GUID
+    // We already know that this GUID doesn't have a mapping without the CRC, and we want newly
+    // added mappings without a CRC to override this mapping.
+    SDL_SetJoystickGUIDCRC(&guid, 0);
+
     // Remove any commas in the name
     SDL_strlcpy(name_string, name, sizeof(name_string));
     {