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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
OHGameControllerAxis *xAxis, *yAxis;
OHGameControllerDirectionalPad *directionalPad;
OHGameControllerButton *up, *down, *left, *right;
for (size_t i = 0; i < numButtons; i++) {
OHGameControllerButton *button =
[[[OHGameControllerButton alloc]
initWithName: buttonNames[i]] autorelease];
[buttons setObject: button forKey: buttonNames[i]];
}
[buttons makeImmutable];
_buttons = [buttons retain];
directionalPads =
[OFMutableDictionary dictionaryWithCapacity: 3];
xAxis = [[[OHGameControllerAxis alloc]
initWithName: @"X"] autorelease];
yAxis = [[[OHGameControllerAxis alloc]
initWithName: @"Y"] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"Thumbstick"
xAxis: xAxis
yAxis: yAxis] autorelease];
[directionalPads setObject: directionalPad
forKey: @"Thumbstick"];
xAxis = [[[OHGameControllerAxis alloc]
initWithName: @"D-Pad X"] autorelease];
yAxis = [[[OHGameControllerAxis alloc]
initWithName: @"D-Pad Y"] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"D-Pad"
xAxis: xAxis
yAxis: yAxis] autorelease];
[directionalPads setObject: directionalPad forKey: @"D-Pad"];
up = [[[OHGameControllerButton alloc]
initWithName: @"C-Up"] autorelease];
down = [[[OHGameControllerButton alloc]
initWithName: @"C-Down"] autorelease];
left = [[[OHGameControllerButton alloc]
initWithName: @"C-Left"] autorelease];
right = [[[OHGameControllerButton alloc]
initWithName: @"C-Right"] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"C-Buttons"
up: up
down: down
left: left
right: right] autorelease];
[directionalPads setObject: directionalPad
forKey: @"C-Buttons"];
[directionalPads makeImmutable];
_directionalPads = [directionalPads retain];
objc_autoreleasePoolPop(pool);
|
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
>
|
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
OHGameControllerAxis *xAxis, *yAxis;
OHGameControllerDirectionalPad *directionalPad;
OHGameControllerButton *up, *down, *left, *right;
for (size_t i = 0; i < numButtons; i++) {
OHGameControllerButton *button =
[[[OHGameControllerButton alloc]
initWithName: buttonNames[i]
analog: false] autorelease];
[buttons setObject: button forKey: buttonNames[i]];
}
[buttons makeImmutable];
_buttons = [buttons retain];
directionalPads =
[OFMutableDictionary dictionaryWithCapacity: 3];
xAxis = [[[OHGameControllerAxis alloc]
initWithName: @"X"
analog: true] autorelease];
yAxis = [[[OHGameControllerAxis alloc]
initWithName: @"Y"
analog: true] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"Thumbstick"
xAxis: xAxis
yAxis: yAxis
analog: true] autorelease];
[directionalPads setObject: directionalPad
forKey: @"Thumbstick"];
xAxis = [[[OHGameControllerAxis alloc]
initWithName: @"D-Pad X"
analog: false] autorelease];
yAxis = [[[OHGameControllerAxis alloc]
initWithName: @"D-Pad Y"
analog: false] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"D-Pad"
xAxis: xAxis
yAxis: yAxis
analog: false] autorelease];
[directionalPads setObject: directionalPad forKey: @"D-Pad"];
up = [[[OHGameControllerButton alloc]
initWithName: @"C-Up"
analog: false] autorelease];
down = [[[OHGameControllerButton alloc]
initWithName: @"C-Down"
analog: false] autorelease];
left = [[[OHGameControllerButton alloc]
initWithName: @"C-Left"
analog: false] autorelease];
right = [[[OHGameControllerButton alloc]
initWithName: @"C-Right"
analog: false] autorelease];
directionalPad = [[[OHGameControllerDirectionalPad alloc]
initWithName: @"C-Buttons"
up: up
down: down
left: left
right: right
analog: false] autorelease];
[directionalPads setObject: directionalPad
forKey: @"C-Buttons"];
[directionalPads makeImmutable];
_directionalPads = [directionalPads retain];
objc_autoreleasePoolPop(pool);
|