ObjFW  Diff

Differences From Artifact [8f7020fe96]:

  • File src/hid/OHWiiGameController.m — part of check-in [9d802a786d] at 2025-01-01 12:58:18 on branch trunk — Update copyright (user: js size: 7444) [more...]

To Artifact [e43747abf7]:

  • File src/hid/OHWiiGameController.m — part of check-in [2399b5b055] at 2025-04-15 22:26:58 on branch trunk — Continue migrating to the ARC functions for RR (user: js size: 7464) [more...]

74
75
76
77
78
79
80
81


82
83

84
85
86
87
88
89
90
74
75
76
77
78
79
80

81
82
83

84
85
86
87
88
89
90
91







-
+
+

-
+








	for (int32_t i = 0; i < WPAD_MAX_WIIMOTES; i++) {
		uint32_t type;

		if (WPAD_Probe(i, &type) == WPAD_ERR_NONE &&
		    (type == WPAD_EXP_NONE || type == WPAD_EXP_NUNCHUK ||
		    type == WPAD_EXP_CLASSIC))
			[controllers addObject: [[[OHWiiGameController alloc]
			[controllers addObject: objc_autorelease(
			    [[OHWiiGameController alloc]
			    oh_initWithIndex: i
					type: type] autorelease]];
					type: type])];
	}

	[controllers makeImmutable];

	objc_autoreleasePoolPop(pool);

	return controllers;
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132







-
+








-
+







		else if (type == WPAD_EXP_NUNCHUK)
			_profile = [[OHWiimoteWithNunchuk alloc] oh_init];
		else
			_profile = [[OHWiimote alloc] oh_init];

		[self updateState];
	} @catch (id e) {
		[self release];
		objc_release(self);
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_profile release];
	objc_release(_profile);

	[super dealloc];
}

- (void)updateState
{
	OFDictionary *buttons = _profile.buttons;