ObjFW  Diff

Differences From Artifact [2d485491e2]:

To Artifact [00711b94af]:


203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
		   yAxis: yAxis] autorelease];
}

- (OHGameControllerDirectionalPad *)dPad
{
	OHGameControllerAxis *xAxis = [_rawProfile.axes objectForKey: @"HAT0X"];
	OHGameControllerAxis *yAxis = [_rawProfile.axes objectForKey: @"HAT0Y"];
	OHGameControllerButton *upButton, *downButton;
	OHGameControllerButton *leftButton, *rightButton;

	if (xAxis != nil && yAxis != nil)
		return [[[OHGameControllerDirectionalPad alloc]
		    initWithName: @"D-Pad"
			   xAxis: xAxis
			   yAxis: yAxis] autorelease];

	upButton = [_rawProfile.buttons objectForKey: @"D-Pad Up"];
	downButton = [_rawProfile.buttons objectForKey: @"D-Pad Down"];
	leftButton = [_rawProfile.buttons objectForKey: @"D-Pad Left"];
	rightButton = [_rawProfile.buttons objectForKey: @"D-Pad Right"];

	if (upButton != nil && downButton != nil &&
	    leftButton != nil && rightButton != nil)
		return [[[OHGameControllerDirectionalPad alloc]
		    initWithName: @"D-Pad"
			upButton: upButton
		      downButton: downButton
		      leftButton: leftButton
		     rightButton: rightButton] autorelease];

	return nil;
}
@end







|
<







|
|
|
|

<
|


|
|
|
|




203
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
219
220
221
222

223
224
225
226
227
228
229
230
231
232
233
		   yAxis: yAxis] autorelease];
}

- (OHGameControllerDirectionalPad *)dPad
{
	OHGameControllerAxis *xAxis = [_rawProfile.axes objectForKey: @"HAT0X"];
	OHGameControllerAxis *yAxis = [_rawProfile.axes objectForKey: @"HAT0Y"];
	OHGameControllerButton *up, *down, *left, *right;


	if (xAxis != nil && yAxis != nil)
		return [[[OHGameControllerDirectionalPad alloc]
		    initWithName: @"D-Pad"
			   xAxis: xAxis
			   yAxis: yAxis] autorelease];

	up = [_rawProfile.buttons objectForKey: @"D-Pad Up"];
	down = [_rawProfile.buttons objectForKey: @"D-Pad Down"];
	left = [_rawProfile.buttons objectForKey: @"D-Pad Left"];
	right = [_rawProfile.buttons objectForKey: @"D-Pad Right"];


	if (up != nil && down != nil && left != nil && right != nil)
		return [[[OHGameControllerDirectionalPad alloc]
		    initWithName: @"D-Pad"
			      up: up
			    down: down
			    left: left
			   right: right] autorelease];

	return nil;
}
@end