mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
Reduce amount of calls to input_event_get_osk_ptr
This commit is contained in:
parent
01a65fa5ba
commit
795801b1f5
21
retroarch.c
21
retroarch.c
@ -14961,28 +14961,31 @@ static unsigned menu_event(
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
{
|
||||
if (input_event_get_osk_ptr() < 33)
|
||||
input_event_set_osk_ptr(input_event_get_osk_ptr()
|
||||
+ OSK_CHARS_PER_LINE);
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr < 33)
|
||||
input_event_set_osk_ptr(old_osk_ptr + OSK_CHARS_PER_LINE);
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
if (input_event_get_osk_ptr() >= OSK_CHARS_PER_LINE)
|
||||
input_event_set_osk_ptr(input_event_get_osk_ptr()
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr >= OSK_CHARS_PER_LINE)
|
||||
input_event_set_osk_ptr(old_osk_ptr
|
||||
- OSK_CHARS_PER_LINE);
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
{
|
||||
if (input_event_get_osk_ptr() < 43)
|
||||
input_event_set_osk_ptr(input_event_get_osk_ptr() + 1);
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr < 43)
|
||||
input_event_set_osk_ptr(old_osk_ptr + 1);
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
{
|
||||
if (input_event_get_osk_ptr() >= 1)
|
||||
input_event_set_osk_ptr(input_event_get_osk_ptr() - 1);
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr >= 1)
|
||||
input_event_set_osk_ptr(old_osk_ptr - 1);
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
|
||||
|
Loading…
x
Reference in New Issue
Block a user