瀏覽代碼

emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index.

Ryan C. Gordon 6 年之前
父節點
當前提交
1829692753
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/emscripten/SDL_sysjoystick.c

+ 1 - 1
src/joystick/emscripten/SDL_sysjoystick.c

@@ -97,7 +97,7 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa
 
 
     ++numjoysticks;
     ++numjoysticks;
 
 
-    SDL_PrivateJoystickAdded(numjoysticks - 1);
+    SDL_PrivateJoystickAdded(item->device_instance);
 
 
 #ifdef DEBUG_JOYSTICK
 #ifdef DEBUG_JOYSTICK
     SDL_Log("Number of joysticks is %d", numjoysticks);
     SDL_Log("Number of joysticks is %d", numjoysticks);