no reason not to use bit-array for game-input key state
parent
606ed8aaa1
commit
99c6c054c2
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue