Pārlūkot izejas kodu

Fix joystick test

Remove mapping for gamepad.
master
TheoryOfNekomata pirms 1 gada
vecāks
revīzija
82f85f25ef
2 mainītis faili ar 17 papildinājumiem un 7 dzēšanām
  1. +8
    -0
      __tests__/src/packages/game/input.test.c
  2. +9
    -7
      src/packages/game/input/IZ_joystick.c

+ 8
- 0
__tests__/src/packages/game/input.test.c Parādīt failu

@@ -323,6 +323,14 @@ spec("input") {
state[p].config.control_mapping[i] = IZ_JOYSTICK_DEFAULT_STATE[p].config.control_mapping[i];
action[p] = 0;

if (i == IZ_ACTION_INDEX_ACTION2) {
;
}

if (i == IZ_ACTION_INDEX_ACTION4) {
;
}

IZ_JoystickHandleEvents(&state, &action, e);
check(
action[p] == (0x1u << i),


+ 9
- 7
src/packages/game/input/IZ_joystick.c Parādīt failu

@@ -138,15 +138,17 @@ void IZ_JoystickHandleButtonEvents(IZ_JoystickState* state, IZ_Action* action, S

// TODO test with XInput, make compatible with Apple

// TODO honor mapping with controller

#ifdef IZ_MACOS
//printf("%d\n", e.jbutton.button);
if (e.jbutton.button == 2) {
normalized_button = 4;
} else if (e.jbutton.button == 6) {
normalized_button = 11;
} else if (e.jbutton.button == 4) {
normalized_button = 10;
}
// if (e.jbutton.button == 2) {
// normalized_button = 4;
// } else if (e.jbutton.button == 6) {
// normalized_button = 11;
// } else if (e.jbutton.button == 4) {
// normalized_button = 10;
// }
#endif

if (normalized_button == state->config.control_mapping[control_index]) {


Notiek ielāde…
Atcelt
Saglabāt