Index: src/hid/OHEvdevGameController.m ================================================================== --- src/hid/OHEvdevGameController.m +++ src/hid/OHEvdevGameController.m @@ -328,11 +328,11 @@ info.minimum, info.maximum); } } } -- (void)retrieveState +- (void)updateState { void *pool = objc_autoreleasePoolPush(); struct input_event event; for (;;) { Index: src/hid/OHGameController.h ================================================================== --- src/hid/OHGameController.h +++ src/hid/OHGameController.h @@ -92,18 +92,18 @@ * @return The available controllers */ + (OFArray OF_GENERIC(OHGameController *) *)controllers; /** - * @brief Retrieves the current state from the game controller. + * @brief Updates the current state from the game controller. * * The state returned by @ref OHGameController's methods does not change until * this method is called. * * @throw OFReadFailedException The controller's state could not be read */ -- (void)retrieveState; +- (void)updateState; @end #ifdef __cplusplus extern "C" { #endif Index: src/hid/OHGameController.m ================================================================== --- src/hid/OHGameController.m +++ src/hid/OHGameController.m @@ -99,11 +99,11 @@ - (OFNumber *)productID { return nil; } -- (void)retrieveState +- (void)updateState { OF_UNRECOGNIZED_SELECTOR } - (id )gamepad Index: src/hid/OHNintendo3DSGameController.m ================================================================== --- src/hid/OHNintendo3DSGameController.m +++ src/hid/OHNintendo3DSGameController.m @@ -62,11 +62,11 @@ self = [super init]; @try { _extendedGamepad = [[OHNintendo3DSExtendedGamepad alloc] init]; - [self retrieveState]; + [self updateState]; } @catch (id e) { [self release]; @throw e; } @@ -78,11 +78,11 @@ [_extendedGamepad release]; [super dealloc]; } -- (void)retrieveState +- (void)updateState { void *pool = objc_autoreleasePoolPush(); OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *buttons = _extendedGamepad.buttons; OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *) Index: src/hid/OHNintendoDSGameController.m ================================================================== --- src/hid/OHNintendoDSGameController.m +++ src/hid/OHNintendoDSGameController.m @@ -61,11 +61,11 @@ self = [super init]; @try { _gamepad = [[OHNintendoDSGamepad alloc] init]; - [self retrieveState]; + [self updateState]; } @catch (id e) { [self release]; @throw e; } @@ -77,11 +77,11 @@ [_gamepad release]; [super dealloc]; } -- (void)retrieveState +- (void)updateState { OFDictionary *buttons = _gamepad.buttons; OHGameControllerDirectionalPad *dPad = [_gamepad.directionalPads objectForKey: @"D-Pad"]; u32 keys; Index: src/hid/OHNintendoSwitchGameController.m ================================================================== --- src/hid/OHNintendoSwitchGameController.m +++ src/hid/OHNintendoSwitchGameController.m @@ -85,11 +85,11 @@ exceptionWithClass: self.class]; _extendedGamepad = [[OHNintendoSwitchExtendedGamepad alloc] init]; - [self retrieveState]; + [self updateState]; } @catch (id e) { [self release]; @throw e; } @@ -101,11 +101,11 @@ [_extendedGamepad release]; [super dealloc]; } -- (void)retrieveState +- (void)updateState { void *pool = objc_autoreleasePoolPush(); OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *buttons = _extendedGamepad.buttons; OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *) Index: src/hid/OHWiiGameController.m ================================================================== --- src/hid/OHWiiGameController.m +++ src/hid/OHWiiGameController.m @@ -99,11 +99,11 @@ else if (type == WPAD_EXP_NUNCHUK) _profile = [[OHWiimoteWithNunchuk alloc] init]; else _profile = [[OHWiimote alloc] init]; - [self retrieveState]; + [self updateState]; } @catch (id e) { [self release]; @throw e; } @@ -115,11 +115,11 @@ [_profile release]; [super dealloc]; } -- (void)retrieveState +- (void)updateState { OFDictionary *buttons = _profile.buttons; OFDictionary *directionalPads = _profile.directionalPads; WPADData *data; Index: src/hid/OHXInputGameController.m ================================================================== --- src/hid/OHXInputGameController.m +++ src/hid/OHXInputGameController.m @@ -142,11 +142,11 @@ } _extendedGamepad = [[OHXboxGamepad alloc] initWithHasGuideButton: (XInputVersion != 910)]; - [self retrieveState]; + [self updateState]; } @catch (id e) { [self release]; @throw e; } @@ -160,11 +160,11 @@ [_extendedGamepad release]; [super dealloc]; } -- (void)retrieveState +- (void)updateState { XINPUT_STATE state = { 0 }; if (XInputGetStateFuncPtr(_index, &state) != ERROR_SUCCESS) @throw [OFReadFailedException exceptionWithObject: self Index: src/test/OTAppDelegate.m ================================================================== --- src/test/OTAppDelegate.m +++ src/test/OTAppDelegate.m @@ -292,11 +292,11 @@ OHGameController *controller = [[OHGameController controllers] objectAtIndex: 0]; OHGameControllerButton *button = [controller.profile.buttons objectForKey: @"A"]; - [controller retrieveState]; + [controller updateState]; if (button.pressed) break; # ifdef OF_NINTENDO_SWITCH @@ -550,11 +550,11 @@ [controller.profile.buttons objectForKey: @"Home"]; # else [controller.profile.buttons objectForKey: @"Start"]; # endif - [controller retrieveState]; + [controller updateState]; if (button.pressed) break; [OFThread waitForVerticalBlank]; Index: tests/gamecontroller/GameControllerTests.m ================================================================== --- tests/gamecontroller/GameControllerTests.m +++ tests/gamecontroller/GameControllerTests.m @@ -219,11 +219,11 @@ [OFStdOut setForegroundColor: [OFColor green]]; [OFStdOut writeLine: controller.description]; @try { - [controller retrieveState]; + [controller updateState]; } @catch (OFReadFailedException *e) { [OFStdOut setForegroundColor: [OFColor red]]; [OFStdOut writeString: e.description]; continue; }