ObjFW  Diff

Differences From Artifact [d2411fda9b]:

To Artifact [e32aeb7c28]:


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
		if (type == WPAD_EXP_CLASSIC)
			_profile = [[OHWiiClassicController alloc] init];
		else if (type == WPAD_EXP_NUNCHUK)
			_profile = [[OHWiimoteWithNunchuk alloc] init];
		else
			_profile = [[OHWiimote alloc] init];

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

	return self;
}

- (void)dealloc
{
	[_profile release];

	[super dealloc];
}

- (void)retrieveState
{
	OFDictionary *buttons = _profile.buttons;
	OFDictionary *directionalPads = _profile.directionalPads;
	WPADData *data;

	if (WPAD_ReadPending(_index, NULL) < WPAD_ERR_NONE)
		@throw [OFReadFailedException







|















|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
		if (type == WPAD_EXP_CLASSIC)
			_profile = [[OHWiiClassicController alloc] init];
		else if (type == WPAD_EXP_NUNCHUK)
			_profile = [[OHWiimoteWithNunchuk alloc] init];
		else
			_profile = [[OHWiimote alloc] init];

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

	return self;
}

- (void)dealloc
{
	[_profile release];

	[super dealloc];
}

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

	if (WPAD_ReadPending(_index, NULL) < WPAD_ERR_NONE)
		@throw [OFReadFailedException