Fix game controller stuff.
authorDavid Thompson <dthompson2@worcester.edu>
Fri, 14 Dec 2018 13:34:14 +0000 (08:34 -0500)
committerDavid Thompson <dthompson2@worcester.edu>
Fri, 14 Dec 2018 13:34:14 +0000 (08:34 -0500)
Forgot to prefix imported procedures since I define procedures with
the same names.

chickadee.scm

index 9b225ba..478cf6c 100644 (file)
@@ -24,7 +24,7 @@
 (define-module (chickadee)
   #:use-module (sdl2)
   #:use-module (sdl2 events)
-  #:use-module (sdl2 input game-controller)
+  #:use-module ((sdl2 input game-controller) #:prefix sdl2:)
   #:use-module (sdl2 input joystick)
   #:use-module ((sdl2 input keyboard) #:prefix sdl2:)
   #:use-module ((sdl2 input mouse) #:prefix sdl2:)
   (hashv-ref *controllers* joystick-id))
 
 (define (add-controller joystick-index)
-  (let ((controller (open-game-controller joystick-index)))
+  (let ((controller (sdl2:open-game-controller joystick-index)))
     (hashv-set! *controllers*
                 (joystick-instance-id
-                 (game-controller-joystick controller))
+                 (sdl2:game-controller-joystick controller))
                 controller)
     controller))
 
@@ -93,7 +93,7 @@
 (define (open-all-controllers)
   (let loop ((i 0))
     (when (< i (num-joysticks))
-      (when (game-controller-index? i)
+      (when (sdl2:game-controller-index? i)
         (add-controller i))
       (loop (+ i 1)))))
 
@@ -192,7 +192,7 @@ not being pushed at all."
                              (controller-device-event-which event))))
             (controller-remove controller)
             (remove-controller (controller-device-event-which event))
-            (close-game-controller controller)))
+            (sdl2:close-game-controller controller)))
          ((controller-button-down-event? event)
           (controller-press (lookup-controller
                              (controller-button-event-which event))