50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
-
+
+
-
+
+
-
+
+
-
+
+
|
[OFMutableDictionary dictionaryWithCapacity: numButtons];
OHGameControllerAxis *xAxis, *yAxis;
OHGameControllerDirectionalPad *directionalPad;
for (size_t i = 0; i < numButtons; i++) {
OHGameControllerButton *button =
[[[OHGameControllerButton alloc]
initWithName: buttonNames[i]] autorelease];
initWithName: buttonNames[i]
analog: false] autorelease];
[buttons setObject: button forKey: buttonNames[i]];
}
[buttons makeImmutable];
_buttons = [buttons retain];
xAxis = [[[OHGameControllerAxis alloc]
initWithName: @"X"] autorelease];
initWithName: @"X"
analog: true] autorelease];
yAxis = [[[OHGameControllerAxis alloc]
initWithName: @"Y"] autorelease];
initWithName: @"Y"
analog: true] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"Right Thumbstick"
xAxis: xAxis
yAxis: yAxis] autorelease];
yAxis: yAxis
analog: true] autorelease];
_directionalPads = [[OFDictionary alloc]
initWithObject: directionalPad
forKey: @"Right Thumbstick"];
objc_autoreleasePoolPop(pool);
} @catch (id e) {
|