Differences From Artifact [f54e2d335a]:
- File
src/hid/OHGameControllerDirectionalPad.m
— part of check-in
[afae3291bf]
at
2024-06-03 19:39:51
on branch trunk
— ObjFWHID: Change prefix to OH
Let's leave 3 letter prefixes to 3rd parties. (user: js, size: 2957) [annotate] [blame] [check-ins using]
To Artifact [04d6b10457]:
- File src/hid/OHGameControllerDirectionalPad.m — part of check-in [35e4d04158] at 2024-06-08 19:32:08 on branch trunk — OHGameControllerDirectionalPad: Rename methods (user: js, size: 2732) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
21 22 23 24 25 26 27 | #import "OHGameControllerDirectionalPad.h" #import "OHGameControllerEmulatedAxis.h" #import "OHGameControllerEmulatedButton.h" @implementation OHGameControllerDirectionalPad @synthesize xAxis = _xAxis, yAxis = _yAxis; | | < | | | | | | | | | | | | | | | | | | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 | #import "OHGameControllerDirectionalPad.h" #import "OHGameControllerEmulatedAxis.h" #import "OHGameControllerEmulatedButton.h" @implementation OHGameControllerDirectionalPad @synthesize xAxis = _xAxis, yAxis = _yAxis; @synthesize up = _up, down = _down, left = _left, right = _right; - (instancetype)initWithName: (OFString *)name { OF_INVALID_INIT_METHOD } - (instancetype)initWithName: (OFString *)name xAxis: (OHGameControllerAxis *)xAxis yAxis: (OHGameControllerAxis *)yAxis { self = [super initWithName: name]; @try { _xAxis = [xAxis retain]; _yAxis = [yAxis retain]; _up = [[OHGameControllerEmulatedButton alloc] initWithAxis: _yAxis positive: false]; _down = [[OHGameControllerEmulatedButton alloc] initWithAxis: _yAxis positive: true]; _left = [[OHGameControllerEmulatedButton alloc] initWithAxis: _xAxis positive: false]; _right = [[OHGameControllerEmulatedButton alloc] initWithAxis: _xAxis positive: true]; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithName: (OFString *)name up: (OHGameControllerButton *)up down: (OHGameControllerButton *)down left: (OHGameControllerButton *)left right: (OHGameControllerButton *)right { self = [super initWithName: name]; @try { _up = [up retain]; _down = [down retain]; _left = [left retain]; _right = [right retain]; _xAxis = [[OHGameControllerEmulatedAxis alloc] initWithNegativeButton: _left positiveButton: _right]; _yAxis = [[OHGameControllerEmulatedAxis alloc] initWithNegativeButton: _up positiveButton: _down]; } @catch (id e) { [self release]; @throw e; } return self; } - (void)dealloc { [_xAxis release]; [_yAxis release]; [_up release]; [_down release]; [_left release]; [_right release]; [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name]; } @end |