diff --git a/src/packages/game/input/IZ_joystick.c b/src/packages/game/input/IZ_joystick.c index ae84d49..7eb6c14 100644 --- a/src/packages/game/input/IZ_joystick.c +++ b/src/packages/game/input/IZ_joystick.c @@ -21,8 +21,8 @@ void IZ_HandleJoystickDeviceEvents(SDL_Event e, IZ_JoystickState* state) { void IZ_HandleJoystickAxisEvents(SDL_Event e, IZ_JoystickState* state, IZ_Action* action) { if (e.type == SDL_JOYAXISMOTION) { if ( - e.jaxis.axis == IZ_JOYAXIS_DIRECTION_HORIZONTAL1 - || e.jaxis.axis == IZ_JOYAXIS_DIRECTION_HORIZONTAL2 + e.jaxis.axis == IZ_JOY_AXIS_DIRECTION_HORIZONTAL1 + || e.jaxis.axis == IZ_JOY_AXIS_DIRECTION_HORIZONTAL2 ) { *action &= ~(0x1 << IZ_ACTION_INDEX_RIGHT); *action &= ~(0x1 << IZ_ACTION_INDEX_LEFT); @@ -36,8 +36,8 @@ void IZ_HandleJoystickAxisEvents(SDL_Event e, IZ_JoystickState* state, IZ_Action return; } if ( - e.jaxis.axis == IZ_JOYAXIS_DIRECTION_VERTICAL1 - || e.jaxis.axis == IZ_JOYAXIS_DIRECTION_VERTICAL2 + e.jaxis.axis == IZ_JOY_AXIS_DIRECTION_VERTICAL1 + || e.jaxis.axis == IZ_JOY_AXIS_DIRECTION_VERTICAL2 ) { *action &= ~(0x1 << IZ_ACTION_INDEX_UP); *action &= ~(0x1 << IZ_ACTION_INDEX_DOWN); diff --git a/src/packages/game/input/IZ_joystick.h b/src/packages/game/input/IZ_joystick.h index 642abd0..b0bfb56 100644 --- a/src/packages/game/input/IZ_joystick.h +++ b/src/packages/game/input/IZ_joystick.h @@ -9,10 +9,10 @@ typedef uint8_t IZ_PadButton; typedef enum { - IZ_JOYAXIS_DIRECTION_HORIZONTAL1 = 0, - IZ_JOYAXIS_DIRECTION_VERTICAL1 = 1, - IZ_JOYAXIS_DIRECTION_HORIZONTAL2 = 3, - IZ_JOYAXIS_DIRECTION_VERTICAL2 = 4, + IZ_JOY_AXIS_DIRECTION_HORIZONTAL1 = 0, + IZ_JOY_AXIS_DIRECTION_VERTICAL1 = 1, + IZ_JOY_AXIS_DIRECTION_HORIZONTAL2 = 3, + IZ_JOY_AXIS_DIRECTION_VERTICAL2 = 4, } IZ_JoyAxisDirection; typedef struct { diff --git a/src/packages/game/input/input.test.c b/src/packages/game/input/input.test.c index 1194751..b65b9a9 100644 --- a/src/packages/game/input/input.test.c +++ b/src/packages/game/input/input.test.c @@ -27,7 +27,7 @@ spec("input") { describe("on primary horizontal direction") { before_each() { - e.jaxis.axis = IZ_JOYAXIS_DIRECTION_HORIZONTAL1; + e.jaxis.axis = IZ_JOY_AXIS_DIRECTION_HORIZONTAL1; } it("handles positive motion") { @@ -69,7 +69,7 @@ spec("input") { describe("on secondary horizontal direction") { before_each() { - e.jaxis.axis = IZ_JOYAXIS_DIRECTION_HORIZONTAL2; + e.jaxis.axis = IZ_JOY_AXIS_DIRECTION_HORIZONTAL2; } it("handles positive motion") { @@ -111,7 +111,7 @@ spec("input") { describe("on primary vertical direction") { before_each() { - e.jaxis.axis = IZ_JOYAXIS_DIRECTION_VERTICAL1; + e.jaxis.axis = IZ_JOY_AXIS_DIRECTION_VERTICAL1; } it("handles positive motion") { @@ -153,7 +153,7 @@ spec("input") { describe("on secondary vertical direction") { before_each() { - e.jaxis.axis = IZ_JOYAXIS_DIRECTION_VERTICAL2; + e.jaxis.axis = IZ_JOY_AXIS_DIRECTION_VERTICAL2; } it("handles positive motion") {