瀏覽代碼

Fixed mapping a controller other than the first one

Sam Lantinga 2 年之前
父節點
當前提交
1528e7c3c9
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      test/gamepadmap.c

+ 7 - 3
test/gamepadmap.c

@@ -755,9 +755,13 @@ int main(int argc, char *argv[])
             }
             }
         }
         }
         if (consumed <= 0) {
         if (consumed <= 0) {
-            static const char *options[] = { "[--bind-touchpad]", NULL };
-            SDLTest_CommonLogUsage(state, argv[0], options);
-            exit(1);
+            if (argv[i][0] == '-') {
+                static const char *options[] = { "[--bind-touchpad]", NULL };
+                SDLTest_CommonLogUsage(state, argv[0], options);
+                exit(1);
+            } else {
+                break;
+            }
         }
         }
 
 
         i += consumed;
         i += consumed;