Turn input_pop_analog_dpad into macro

This commit is contained in:
twinaphex 2016-12-04 20:23:52 +01:00
parent 59c317dc1d
commit c19a6dd018
2 changed files with 6 additions and 15 deletions

View File

@ -306,20 +306,6 @@ void input_push_analog_dpad(struct retro_keybind *binds, unsigned mode)
binds[i].joyaxis = binds[j--].joyaxis;
}
/**
* input_pop_analog_dpad:
* @binds : Binds to modify.
*
* Restores binds temporarily overridden by input_push_analog_dpad().
**/
void input_pop_analog_dpad(struct retro_keybind *binds)
{
unsigned i;
for (i = RETRO_DEVICE_ID_JOYPAD_UP; i <= RETRO_DEVICE_ID_JOYPAD_RIGHT; i++)
binds[i].joyaxis = binds[i].orig_joyaxis;
}
/**
* input_translate_coord_viewport:
* @mouse_x : Pointer X coordinate.

View File

@ -197,7 +197,12 @@ void input_push_analog_dpad(struct retro_keybind *binds, unsigned mode);
*
* Restores binds temporarily overridden by input_push_analog_dpad().
**/
void input_pop_analog_dpad(struct retro_keybind *binds);
#define input_pop_analog_dpad(binds) \
{ \
unsigned i; \
for (i = RETRO_DEVICE_ID_JOYPAD_UP; i <= RETRO_DEVICE_ID_JOYPAD_RIGHT; i++) \
(binds)[i].joyaxis = (binds)[i].orig_joyaxis; \
}
/**
* input_poll: