mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
move osk_ptr global state to rarch_state
This commit is contained in:
parent
e0090010f4
commit
8daa90da23
@ -33,7 +33,6 @@
|
||||
|
||||
/* TODO/FIXME - static public global variables */
|
||||
static char *osk_grid[45] = {NULL};
|
||||
static int osk_ptr = 0;
|
||||
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
/* This file has a UTF8 BOM, we assume HAVE_LANGEXTRA is only enabled for compilers that can support this. */
|
||||
@ -59,16 +58,6 @@ static const char *lowercase_grid[] = {
|
||||
"z","x","c","v","b","n","m"," ","-",".","Next"};
|
||||
#endif
|
||||
|
||||
int input_event_get_osk_ptr(void)
|
||||
{
|
||||
return osk_ptr;
|
||||
}
|
||||
|
||||
void input_event_set_osk_ptr(int i)
|
||||
{
|
||||
osk_ptr = i;
|
||||
}
|
||||
|
||||
void input_event_osk_append(enum osk_type *osk_idx, int ptr, bool is_rgui)
|
||||
{
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
|
@ -49,8 +49,6 @@ enum osk_type
|
||||
|
||||
int input_event_get_osk_ptr(void);
|
||||
|
||||
void input_event_set_osk_ptr(int a);
|
||||
|
||||
void input_event_osk_append(enum osk_type *osk_idx, int ptr, bool is_rgui);
|
||||
|
||||
void input_event_osk_iterate(enum osk_type osk_idx);
|
||||
|
21
retroarch.c
21
retroarch.c
@ -1762,6 +1762,7 @@ typedef struct discord_state discord_state_t;
|
||||
struct rarch_state
|
||||
{
|
||||
enum osk_type osk_idx;
|
||||
int osk_ptr;
|
||||
enum rarch_core_type current_core_type;
|
||||
enum rarch_core_type explicit_current_core_type;
|
||||
enum rotation initial_screen_orientation;
|
||||
@ -3615,6 +3616,12 @@ static const menu_ctx_driver_t *menu_ctx_drivers[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
int input_event_get_osk_ptr(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
return p_rarch->osk_ptr;
|
||||
}
|
||||
|
||||
gfx_thumbnail_state_t *gfx_thumb_get_ptr(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
@ -22917,29 +22924,29 @@ static unsigned menu_event(
|
||||
{
|
||||
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);
|
||||
p_rarch->osk_ptr = old_osk_ptr + OSK_CHARS_PER_LINE;
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
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);
|
||||
p_rarch->osk_ptr = old_osk_ptr
|
||||
- OSK_CHARS_PER_LINE;
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
{
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr < 43)
|
||||
input_event_set_osk_ptr(old_osk_ptr + 1);
|
||||
p_rarch->osk_ptr = old_osk_ptr + 1;
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
{
|
||||
int old_osk_ptr = input_event_get_osk_ptr();
|
||||
if (old_osk_ptr >= 1)
|
||||
input_event_set_osk_ptr(old_osk_ptr - 1);
|
||||
p_rarch->osk_ptr = old_osk_ptr - 1;
|
||||
}
|
||||
|
||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
|
||||
@ -23344,7 +23351,7 @@ static int menu_input_pointer_post_iterate(
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_OSK_PTR_AT_POS, &point);
|
||||
if (point.retcode > -1)
|
||||
input_event_set_osk_ptr(point.retcode);
|
||||
p_rarch->osk_ptr = point.retcode;
|
||||
}
|
||||
|
||||
/* Select + X/Y position */
|
||||
@ -23636,7 +23643,7 @@ static int menu_input_pointer_post_iterate(
|
||||
menu->driver_ctx &&
|
||||
menu->driver_ctx->set_texture);
|
||||
|
||||
input_event_set_osk_ptr(point.retcode);
|
||||
p_rarch->osk_ptr = point.retcode;
|
||||
input_event_osk_append(&p_rarch->osk_idx,
|
||||
point.retcode,
|
||||
menu_has_fb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user