Differences From Artifact [3e95130dc5]:
- File
src/hid/OHXInputExtendedGamepad.m
— part of check-in
[998339ff24]
at
2024-06-09 11:43:49
on branch trunk
— OHGamepad: Move some elements to OHExtendedGamepad
This allows to have a profile for limited gamepads such as found on the
Nintendo DS rather than only having the raw profile for those. (user: js, size: 5163) [annotate] [blame] [check-ins using]
To Artifact [c47a92c25d]:
- File src/hid/OHXInputExtendedGamepad.m — part of check-in [8be13b6bc6] at 2024-06-09 15:12:03 on branch trunk — ObjFWHID: Make OHGameControllerProfile a protocol (user: js, size: 5392) [annotate] [blame] [check-ins using] [more...]
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + + | 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); @implementation OHXInputExtendedGamepad @synthesize buttons = _buttons, directionalPads = _directionalPads; - (instancetype)init { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary *buttons = |
︙ | |||
56 57 58 59 60 61 62 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - - | button = [[OHGameControllerButton alloc] initWithName: buttonNames[i]]; [buttons setObject: button forKey: buttonNames[i]]; } [buttons makeImmutable]; _buttons = [buttons retain]; |
︙ | |||
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | + + + + + + + + + + + + + | } @catch (id e) { [self release]; @throw e; } return self; } - (void)dealloc { [_buttons release]; [_directionalPads release]; [super dealloc]; } - (OFDictionary OF_GENERIC(OFString *, OHGameControllerAxis *) *)axes { return [OFDictionary dictionary]; } - (OHGameControllerButton *)northButton { return [_buttons objectForKey: @"Y"]; } - (OHGameControllerButton *)southButton |
︙ |