Refactor this a bit and document it

This commit is contained in:
twinaphex 2018-04-30 15:24:40 +02:00
parent 25a7cb0f66
commit 1c90866070
3 changed files with 15 additions and 10 deletions

View File

@ -794,7 +794,7 @@ int generic_action_ok_displaylist_push(const char *path,
break;
case ACTION_OK_DL_DEFERRED_CORE_LIST_SET:
info.directory_ptr = idx;
menu->rdb_entry_start_game_selection_ptr = (unsigned)idx;
menu->scratchpad.unsigned_var = (unsigned)idx;
info_path =
settings->paths.directory_libretro;
info_label = msg_hash_to_str(
@ -1706,7 +1706,7 @@ static int action_ok_playlist_entry_start_content(const char *path,
!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return menu_cbs_exit();
selection_ptr = menu->rdb_entry_start_game_selection_ptr;
selection_ptr = menu->scratchpad.unsigned_var;
playlist_get_index(playlist, selection_ptr,
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
@ -2390,7 +2390,7 @@ static int action_ok_core_deferred_set(const char *new_core_path,
settings->bools.show_hidden_files);
command_playlist_update_write(
NULL,
menu->rdb_entry_start_game_selection_ptr,
menu->scratchpad.unsigned_var,
NULL,
content_label,
new_core_path,

View File

@ -1585,7 +1585,8 @@ static enum msg_file_type extension_to_file_hash_type(const char *ext)
return FILE_TYPE_NONE;
}
static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
static int menu_displaylist_parse_database_entry(
menu_displaylist_info_t *info)
{
unsigned i, j, k;
char path_playlist[PATH_MAX_LENGTH];
@ -1698,7 +1699,7 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
if (!match_found)
continue;
menu->rdb_entry_start_game_selection_ptr = j;
menu->scratchpad.unsigned_var = j;
}
}

View File

@ -367,12 +367,7 @@ typedef struct menu_display_ctx_driver
typedef struct
{
unsigned rpl_entry_selection_ptr;
unsigned rdb_entry_start_game_selection_ptr;
size_t core_len;
struct
{
unsigned unsigned_var;
} scratchpad;
uint64_t state;
char *core_buf;
@ -387,6 +382,15 @@ typedef struct
char db_playlist_file[PATH_MAX_LENGTH];
char filebrowser_label[PATH_MAX_LENGTH];
char detect_content_path[PATH_MAX_LENGTH];
/* This is used for storing intermediary variables
* that get used later on during menu actions -
* for instance, selecting a shader pass for a shader
* slot */
struct
{
unsigned unsigned_var;
} scratchpad;
} menu_handle_t;
typedef struct menu_display_ctx_draw