ObjFW  Diff

Differences From Artifact [254b2085d9]:

To Artifact [3ff2d7703f]:


20
21
22
23
24
25
26

27
28
29
30
31
32
33
#include "config.h"

#import "OHXInputGamepad.h"
#import "OFDictionary.h"
#import "OHGameControllerAxis.h"
#import "OHGameControllerButton.h"
#import "OHGameControllerDirectionalPad.h"


static OFString *const buttonNames[] = {
	@"A", @"B", @"X", @"Y", @"LB", @"RB", @"LT", @"RT", @"LSB", @"RSB",
	@"Start", @"Back", @"Guide"
};
static const size_t numButtons = sizeof(buttonNames) / sizeof(*buttonNames);








>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "config.h"

#import "OHXInputGamepad.h"
#import "OFDictionary.h"
#import "OHGameControllerAxis.h"
#import "OHGameControllerButton.h"
#import "OHGameControllerDirectionalPad.h"
#import "OHXInputGameController.h"

static OFString *const buttonNames[] = {
	@"A", @"B", @"X", @"Y", @"LB", @"RB", @"LT", @"RT", @"LSB", @"RSB",
	@"Start", @"Back", @"Guide"
};
static const size_t numButtons = sizeof(buttonNames) / sizeof(*buttonNames);

42
43
44
45
46
47
48
49





50
51
52
53
54
55
56
57
58
59
		    [OFMutableDictionary dictionaryWithCapacity: numButtons];
		OFMutableDictionary *directionalPads;
		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]];

			@try {
				[buttons setObject: button
					    forKey: buttonNames[i]];
			} @finally {
				[button release];
			}
		}







|
>
>
>
>
>
|

<







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

58
59
60
61
62
63
64
		    [OFMutableDictionary dictionaryWithCapacity: numButtons];
		OFMutableDictionary *directionalPads;
		OHGameControllerAxis *xAxis, *yAxis;
		OHGameControllerDirectionalPad *directionalPad;
		OHGameControllerButton *up, *down, *left, *right;

		for (size_t i = 0; i < numButtons; i++) {
			OHGameControllerButton *button;

			if ([buttonNames[i] isEqual: @"Guide"] &&
			    OHXInputVersion == 910)
				continue;

			button = [[OHGameControllerButton alloc]
			    initWithName: buttonNames[i]];

			@try {
				[buttons setObject: button
					    forKey: buttonNames[i]];
			} @finally {
				[button release];
			}
		}