This commit is contained in:
twinaphex 2017-09-09 00:12:40 +02:00
parent 330d8dc59e
commit 3eeae957f6
7 changed files with 79 additions and 69 deletions

View File

@ -63,36 +63,36 @@ struct config_bool_setting
struct config_int_setting struct config_int_setting
{ {
const char *ident; const char *ident;
int *ptr;
bool def_enable; bool def_enable;
int def;
bool handle; bool handle;
int *ptr;
int def;
}; };
struct config_uint_setting struct config_uint_setting
{ {
const char *ident; const char *ident;
unsigned *ptr;
bool def_enable; bool def_enable;
unsigned def;
bool handle; bool handle;
unsigned *ptr;
unsigned def;
}; };
struct config_float_setting struct config_float_setting
{ {
const char *ident; const char *ident;
float *ptr;
bool def_enable; bool def_enable;
float def;
bool handle; bool handle;
float *ptr;
float def;
}; };
struct config_array_setting struct config_array_setting
{ {
const char *ident; const char *ident;
char *ptr; char *ptr;
bool def_enable;
const char *def; const char *def;
bool def_enable;
bool handle; bool handle;
}; };
@ -100,8 +100,8 @@ struct config_path_setting
{ {
const char *ident; const char *ident;
char *ptr; char *ptr;
bool def_enable;
char *def; char *def;
bool def_enable;
bool handle; bool handle;
}; };

View File

@ -172,44 +172,42 @@ typedef struct menu_displaylist_info
bool need_refresh; bool need_refresh;
bool need_entries_refresh; bool need_entries_refresh;
bool need_push; bool need_push;
/* should we clear the displaylist before we push /* should we clear the displaylist before we push
* entries onto it? */ * entries onto it? */
bool need_clear; bool need_clear;
bool push_builtin_cores; bool push_builtin_cores;
/* Should a 'download core' entry be pushed onto the list? /* Should a 'download core' entry be pushed onto the list?
* This will be set to true in case there are no currently * This will be set to true in case there are no currently
* installed cores. */ * installed cores. */
bool download_core; bool download_core;
/* does the navigation index need to be cleared to 0 (first entry) ? */ /* does the navigation index need to be cleared to 0 (first entry) ? */
bool need_navigation_clear; bool need_navigation_clear;
file_list_t *list; enum msg_hash_enums enum_idx;
file_list_t *menu_list;
char path[PATH_MAX_LENGTH]; char path[PATH_MAX_LENGTH];
char path_b[PATH_MAX_LENGTH]; char path_b[PATH_MAX_LENGTH];
char path_c[PATH_MAX_LENGTH]; char path_c[PATH_MAX_LENGTH];
char label[255];
uint32_t label_hash;
char exts[PATH_MAX_LENGTH]; char exts[PATH_MAX_LENGTH];
char label[255];
size_t directory_ptr;
uint32_t label_hash;
unsigned type; unsigned type;
unsigned type_default; unsigned type_default;
size_t directory_ptr;
unsigned flags; unsigned flags;
enum msg_hash_enums enum_idx;
rarch_setting_t *setting; rarch_setting_t *setting;
file_list_t *list;
file_list_t *menu_list;
} menu_displaylist_info_t; } menu_displaylist_info_t;
typedef struct menu_displaylist_ctx_parse_entry typedef struct menu_displaylist_ctx_parse_entry
{ {
void *data;
menu_displaylist_info_t *info;
const char *info_label;
enum msg_hash_enums enum_idx; enum msg_hash_enums enum_idx;
enum menu_displaylist_parse_type parse_type; enum menu_displaylist_parse_type parse_type;
bool add_empty_entry; bool add_empty_entry;
menu_displaylist_info_t *info;
const char *info_label;
void *data;
} menu_displaylist_ctx_parse_entry_t; } menu_displaylist_ctx_parse_entry_t;
typedef struct menu_displaylist_ctx_entry typedef struct menu_displaylist_ctx_entry

View File

@ -992,7 +992,8 @@ static int setting_action_start_bind_device(void *data)
return -1; return -1;
configuration_set_uint(settings, configuration_set_uint(settings,
settings->uints.input_joypad_map[index_offset], setting->index_offset); settings->uints.input_joypad_map[setting->index_offset],
setting->index_offset);
return 0; return 0;
} }

View File

@ -45,13 +45,13 @@ enum menu_entry_type
typedef struct menu_entry typedef struct menu_entry
{ {
enum msg_hash_enums enum_idx;
char path[255]; char path[255];
char label[255]; char label[255];
char sublabel[255]; char sublabel[255];
char rich_label[255]; char rich_label[255];
char value[255]; char value[255];
size_t entry_idx; size_t entry_idx;
enum msg_hash_enums enum_idx;
unsigned idx; unsigned idx;
unsigned type; unsigned type;
unsigned spacing; unsigned spacing;

View File

@ -119,7 +119,7 @@ void filebrowser_parse(void *data, unsigned type_data)
{ {
for (i = 0; i < list_size; i++) for (i = 0; i < list_size; i++)
{ {
char label[PATH_MAX_LENGTH]; char label[32];
bool is_dir = false; bool is_dir = false;
enum msg_hash_enums enum_idx = MSG_UNKNOWN; enum msg_hash_enums enum_idx = MSG_UNKNOWN;
enum msg_file_type file_type = FILE_TYPE_NONE; enum msg_file_type file_type = FILE_TYPE_NONE;

View File

@ -49,16 +49,14 @@ struct menu_bind_axis_state
struct menu_bind_state struct menu_bind_state
{ {
struct retro_keybind *target; bool skip;
/* For keyboard binding. */
rarch_timer_t timer;
unsigned begin; unsigned begin;
unsigned last; unsigned last;
unsigned user; unsigned user;
rarch_timer_t timer;
struct retro_keybind *target;
struct menu_bind_state_port state[MAX_USERS]; struct menu_bind_state_port state[MAX_USERS];
struct menu_bind_axis_state axis_state[MAX_USERS]; struct menu_bind_axis_state axis_state[MAX_USERS];
bool skip;
}; };
static unsigned menu_bind_port = 0; static unsigned menu_bind_port = 0;
@ -73,7 +71,8 @@ static bool menu_input_key_bind_custom_bind_keyboard_cb(
menu_input_binds.begin++; menu_input_binds.begin++;
menu_input_binds.target++; menu_input_binds.target++;
rarch_timer_begin_new_time(&menu_input_binds.timer, settings->uints.input_bind_timeout); rarch_timer_begin_new_time(&menu_input_binds.timer,
settings->uints.input_bind_timeout);
return (menu_input_binds.begin <= menu_input_binds.last); return (menu_input_binds.begin <= menu_input_binds.last);
} }
@ -170,7 +169,7 @@ static void menu_input_key_bind_poll_bind_state_internal(
unsigned port, unsigned port,
bool timed_out) bool timed_out)
{ {
unsigned b, a, h; uint8_t b, a, h;
if (!joypad) if (!joypad)
return; return;
@ -269,10 +268,12 @@ static bool menu_input_key_bind_poll_find_trigger_pad(
struct menu_bind_state *new_state, struct menu_bind_state *new_state,
unsigned p) unsigned p)
{ {
unsigned a, b, h; uint8_t a, b, h;
const struct menu_bind_state_port *n = (const struct menu_bind_state_port*) const struct menu_bind_state_port *n =
(const struct menu_bind_state_port*)
&new_state->state[p]; &new_state->state[p];
const struct menu_bind_state_port *o = (const struct menu_bind_state_port*) const struct menu_bind_state_port *o =
(const struct menu_bind_state_port*)
&state->state[p]; &state->state[p];
for (b = 0; b < MENU_MAX_BUTTONS; b++) for (b = 0; b < MENU_MAX_BUTTONS; b++)
@ -345,8 +346,9 @@ static bool menu_input_key_bind_poll_find_trigger(
struct menu_bind_state *state, struct menu_bind_state *state,
struct menu_bind_state *new_state) struct menu_bind_state *new_state)
{ {
unsigned i; uint8_t i;
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS)); unsigned max_users = *(input_driver_get_uint(
INPUT_ACTION_MAX_USERS));
if (!state || !new_state) if (!state || !new_state)
return false; return false;
@ -391,7 +393,8 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
menu_input_binds.begin++; menu_input_binds.begin++;
menu_input_binds.target++; menu_input_binds.target++;
rarch_timer_begin_new_time(&menu_input_binds.timer, settings->uints.input_bind_timeout); rarch_timer_begin_new_time(&menu_input_binds.timer,
settings->uints.input_bind_timeout);
timed_out = true; timed_out = true;
} }
@ -410,7 +413,8 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
/* We won't be getting any key events, so just cancel early. */ /* We won't be getting any key events, so just cancel early. */
if (timed_out) if (timed_out)
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL); input_keyboard_ctl(
RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL);
return true; return true;
} }
@ -432,12 +436,14 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
if (binds.begin > binds.last) if (binds.begin > binds.last)
{ {
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL); input_keyboard_ctl(
RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL);
return true; return true;
} }
binds.target++; binds.target++;
rarch_timer_begin_new_time(&binds.timer, settings->uints.input_bind_timeout); rarch_timer_begin_new_time(&binds.timer,
settings->uints.input_bind_timeout);
} }
menu_input_binds = binds; menu_input_binds = binds;

View File

@ -23,10 +23,10 @@
struct menu_list struct menu_list
{ {
file_list_t **menu_stack;
size_t menu_stack_size; size_t menu_stack_size;
file_list_t **selection_buf;
size_t selection_buf_size; size_t selection_buf_size;
file_list_t **menu_stack;
file_list_t **selection_buf;
}; };
void menu_list_free_list(file_list_t *list) void menu_list_free_list(file_list_t *list)
@ -79,17 +79,20 @@ void menu_list_free(menu_list_t *menu_list)
menu_list_t *menu_list_new(void) menu_list_t *menu_list_new(void)
{ {
unsigned i; unsigned i;
menu_list_t *list = (menu_list_t*)calloc(1, sizeof(*list)); menu_list_t *list = (menu_list_t*)calloc(1,
sizeof(*list));
if (!list) if (!list)
return NULL; return NULL;
list->menu_stack = (file_list_t**)calloc(1, sizeof(*list->menu_stack)); list->menu_stack = (file_list_t**)calloc(1,
sizeof(*list->menu_stack));
if (!list->menu_stack) if (!list->menu_stack)
goto error; goto error;
list->selection_buf = (file_list_t**)calloc(1, sizeof(*list->selection_buf)); list->selection_buf = (file_list_t**)calloc(1,
sizeof(*list->selection_buf));
if (!list->selection_buf) if (!list->selection_buf)
goto error; goto error;
@ -98,10 +101,12 @@ menu_list_t *menu_list_new(void)
list->selection_buf_size = 1; list->selection_buf_size = 1;
for (i = 0; i < list->menu_stack_size; i++) for (i = 0; i < list->menu_stack_size; i++)
list->menu_stack[i] = (file_list_t*)calloc(1, sizeof(*list->menu_stack[i])); list->menu_stack[i] = (file_list_t*)calloc(1,
sizeof(*list->menu_stack[i]));
for (i = 0; i < list->selection_buf_size; i++) for (i = 0; i < list->selection_buf_size; i++)
list->selection_buf[i] = (file_list_t*)calloc(1, sizeof(*list->selection_buf[i])); list->selection_buf[i] = (file_list_t*)calloc(1,
sizeof(*list->selection_buf[i]));
return list; return list;