summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2019-01-08 21:13:36 -0500
committerDavid Thompson <dthompson2@worcester.edu>2019-01-08 21:13:36 -0500
commit8350f7b806d612584be1ff56610ef51202965777 (patch)
tree8bd1d50f4ee137eb2c2778fa53f1a73e2fc800b3 /chickadee.scm
parent6b4f2d5ebf81d7eea262ce45ae189e79b103cb09 (diff)
Add SDL2 game controller database file.
This will allow for lots of controllers to be automatically mapped correctly without the user having to do anything. * data/gamecontrollerdb.txt: New file. * Makefile.am (dist_pkgdata_DATA): Add it. * chickadee.scm (run-game): Load game controller db file.
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 7adb4b5..fe41f59 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -31,6 +31,7 @@
#:use-module (sdl2 input text)
#:use-module (sdl2 mixer)
#:use-module (sdl2 video)
+ #:use-module (chickadee config)
#:use-module (chickadee game-loop)
#:use-module (chickadee math matrix)
#:use-module (chickadee render)
@@ -238,6 +239,8 @@ not being pushed at all."
(display "warning: could not enable vsync\n"
(current-error-port))))
(load)
+ (sdl2:load-game-controller-mappings!
+ (scope-datadir "gamecontrollerdb.txt"))
;; Notify about all controllers that were already connected
;; when the game was launched because SDL will not create
;; events for them.