]> gitweb.factorcode.org Git - factor.git/commitdiff
no reason not to use bit-array for game-input key state
authorJoe Groff <arcata@gmail.com>
Thu, 14 May 2009 22:26:54 +0000 (17:26 -0500)
committerJoe Groff <arcata@gmail.com>
Thu, 14 May 2009 22:26:54 +0000 (17:26 -0500)
basis/game-input/iokit/iokit.factor

index 5f09a054f97e795900b2f90a06bf845dd9ea9187..32440e92b2bb1eabc7471e24411617070c006a81 100755 (executable)
@@ -3,7 +3,7 @@ kernel cocoa.enumeration destructors math.parser cocoa.application
 sequences locals combinators.short-circuit threads
 namespaces assocs vectors arrays combinators hints alien
 core-foundation.run-loop accessors sequences.private
-alien.c-types math parser game-input vectors ;
+alien.c-types math parser game-input vectors bit-arrays ;
 IN: game-input.iokit
 
 SINGLETON: iokit-game-input-backend
@@ -186,7 +186,7 @@ HINTS: record-controller { controller-state alien } ;
         rot ?set-nth
     ] [ 3drop ] if ;
 
-HINTS: record-keyboard { array alien } ;
+HINTS: record-keyboard { bit-array alien } ;
 
 : record-mouse ( mouse-state value -- )
     dup IOHIDValueGetElement {
@@ -285,7 +285,7 @@ M: iokit-game-input-backend reset-mouse
     4 <vector> +controller-states+ set-global
     0 0 0 0 2 <vector> mouse-state boa
         +mouse-state+ set-global
-    256 f <array> +keyboard-state+ set-global ;
+    256 <bit-array> +keyboard-state+ set-global ;
 
 M: iokit-game-input-backend (open-game-input)
     hid-manager-matching-game-devices {