projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove a branch that could never trigger (unsigned < 0) and some other logic errors...
[enjoyable.git]
/
JoystickController.m
diff --git
a/JoystickController.m
b/JoystickController.m
index
976b531
..
1bf5b43
100644
(file)
--- a/
JoystickController.m
+++ b/
JoystickController.m
@@
-65,7
+65,7
@@
void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDVal
IOHIDDeviceRef device = IOHIDQueueGetDevice((IOHIDQueueRef) inSender);
Joystick* js = [self findJoystickByRef: device];
IOHIDDeviceRef device = IOHIDQueueGetDevice((IOHIDQueueRef) inSender);
Joystick* js = [self findJoystickByRef: device];
- if([[[NSApplication sharedApplication] delegate] active]) {
+ if([
(ApplicationController *)
[[NSApplication sharedApplication] delegate] active]) {
// for reals
JSAction* mainAction = [js actionForEvent: value];
if(!mainAction)
// for reals
JSAction* mainAction = [js actionForEvent: value];
if(!mainAction)
@@
-148,10
+148,10
@@
void add_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDevic
}
-(Joystick*) findJoystickByRef: (IOHIDDeviceRef) device {
}
-(Joystick*) findJoystickByRef: (IOHIDDeviceRef) device {
-
for(int i=0; i<[joysticks count]; i++
)
-
if([[joysticks objectAtIndex:i] device]
== device)
-
return [joysticks objectAtIndex:i]
;
- return
NULL
;
+
for (Joystick *js in joysticks
)
+
if (js.device
== device)
+
return js
;
+ return
nil
;
}
void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDeviceRef device) {
}
void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDeviceRef device) {