Index: src/OFGameController.h ================================================================== --- src/OFGameController.h +++ src/OFGameController.h @@ -44,13 +44,13 @@ * @brief The currently pressed buttons on the controller. */ @property (readonly, nonatomic) OFSet OF_GENERIC(OFString *) *pressedButtons; /** - * @brief The number of axes the controller has. + * @brief The number of analog sticks the controller has. */ -@property (readonly, nonatomic) size_t numAxes; +@property (readonly, nonatomic) size_t numAnalogSticks; /** * @brief Returns the number of available controllers. * * @return The number of available controllers @@ -66,16 +66,16 @@ + (OFGameController *)controllerWithIndex: (size_t)index; - (instancetype)init OF_UNAVAILABLE; /** - * @brief Returns the current position of the specified axis. + * @brief Returns the current position of the specified analog stick. * * The range is from (-1, -1) to (1, 1). * - * @param index The index of the axis whose position to return - * @return The current position of the specified axis + * @param index The index of the analog stick whose position to return + * @return The current position of the specified analog stick */ -- (OFPoint)positionOfAxisWithIndex: (size_t)index; +- (OFPoint)positionOfAnalogStickWithIndex: (size_t)index; @end OF_ASSUME_NONNULL_END Index: src/OFGameController.m ================================================================== --- src/OFGameController.m +++ src/OFGameController.m @@ -27,11 +27,11 @@ # include "platform/NintendoDS/OFGameController.m" #elif defined(F_NINTENDO_3DS) # include "platform/Nintendo3DS/OFGameController.m" #else @implementation OFGameController -@dynamic buttons, pressedButtons, numAxes; +@dynamic buttons, pressedButtons, numAnalogSticks; + (size_t)numControllers { return 0; } @@ -44,11 +44,11 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -- (OFPoint)positionOfAxisWithIndex: (size_t)index +- (OFPoint)positionOfAnalogSticksWithIndex: (size_t)index { OF_UNRECOGNIZED_SELECTOR } @end #endif Index: src/platform/Nintendo3DS/OFGameController.m ================================================================== --- src/platform/Nintendo3DS/OFGameController.m +++ src/platform/Nintendo3DS/OFGameController.m @@ -124,16 +124,16 @@ [pressedButtons makeImmutable]; return pressedButtons; } -- (size_t)numAxes +- (size_t)numAnalogSticks { return 1; } -- (OFPoint)positionOfAxisWithIndex: (size_t)index +- (OFPoint)positionOfAnalogStickWithIndex: (size_t)index { circlePosition pos; if (index > 0) @throw [OFOutOfRangeException exception]; Index: src/platform/NintendoDS/OFGameController.m ================================================================== --- src/platform/NintendoDS/OFGameController.m +++ src/platform/NintendoDS/OFGameController.m @@ -111,15 +111,15 @@ [pressedButtons makeImmutable]; return pressedButtons; } -- (size_t)numAxes +- (size_t)numAnalogSticks { return 0; } -- (OFPoint)positionOfAxisWithIndex: (size_t)index +- (OFPoint)positionOfAnalogStickWithIndex: (size_t)index { @throw [OFOutOfRangeException exception]; } @end