Remove redundant open-all-controllers procedure.
authorDavid Thompson <dthompson2@worcester.edu>
Sun, 6 Jan 2019 05:06:34 +0000 (00:06 -0500)
committerDavid Thompson <dthompson2@worcester.edu>
Sun, 6 Jan 2019 05:06:34 +0000 (00:06 -0500)
I thought this was necessary to process controllers that were already
connected to the computer before a Chickadee-using program was
launched, but that doesn't seem to be the case.

* chickadee.scm (open-all-controllers): Delete.
(run-game): Remove call to open-all-controllers.

chickadee.scm

index 0b46237..7adb4b5 100644 (file)
 (define (remove-controller joystick-id)
   (hashv-remove! *controllers* joystick-id))
 
-(define (open-all-controllers)
-  (let loop ((i 0))
-    (when (< i (num-joysticks))
-      (when (sdl2:game-controller-index? i)
-        (add-controller i))
-      (loop (+ i 1)))))
-
 (define (controller-button-pressed? controller button)
   "Return #t if BUTTON is currently being pressed on CONTROLLER."
   (sdl2:game-controller-button-pressed? controller button))
@@ -145,7 +138,6 @@ not being pushed at all."
   (false-if-exception (mixer-init))
   (open-audio)
   (start-text-input)
-  (open-all-controllers)
   (let* ((window (make-window #:opengl? #t
                               #:title window-title
                               #:size (list window-width window-height)