mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
(Menu) Pass hash values to 'init_bind' functions
This commit is contained in:
parent
f84af7ed8b
commit
bb98e35cac
@ -14,6 +14,8 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_entries_cbs.h"
|
||||
#include "menu_setting.h"
|
||||
@ -231,6 +233,7 @@ void menu_entries_cbs_init(void *data,
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
file_list_t *list = (file_list_t*)data;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
uint32_t label_hash = 0, menu_label_hash = 0;
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
@ -259,20 +262,23 @@ void menu_entries_cbs_init(void *data,
|
||||
str_list = NULL;
|
||||
}
|
||||
|
||||
menu_entries_cbs_init_bind_ok(cbs, path, label, type, idx, elem0, elem1, menu_label);
|
||||
menu_entries_cbs_init_bind_cancel(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_scan(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_start(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_select(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_info(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_content_list_switch(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_up(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_down(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_left(cbs, path, label, type, idx, elem0, elem1, menu_label);
|
||||
menu_entries_cbs_init_bind_right(cbs, path, label, type, idx, elem0, elem1, menu_label);
|
||||
menu_entries_cbs_init_bind_deferred_push(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_refresh(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_iterate(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1);
|
||||
menu_entries_cbs_init_bind_title(cbs, path, label, type, idx, elem0, elem1);
|
||||
label_hash = djb2_calculate(label);
|
||||
menu_label_hash = djb2_calculate(menu_label);
|
||||
|
||||
menu_entries_cbs_init_bind_ok(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_cancel(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_scan(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_start(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_select(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_info(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_content_list_switch(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_up(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_down(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_left(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_right(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_deferred_push(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_refresh(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_iterate(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
menu_entries_cbs_init_bind_title(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||
}
|
||||
|
@ -191,67 +191,83 @@ int menu_entries_common_is_settings_entry(const char *label);
|
||||
|
||||
void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label);
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label);
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label);
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
void menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1);
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
|
||||
int deferred_push_content_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type);
|
||||
|
@ -27,7 +27,8 @@ static int action_cancel_pop_default(const char *path,
|
||||
|
||||
void menu_entries_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -18,7 +18,8 @@
|
||||
|
||||
void menu_entries_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_displaylist.h"
|
||||
@ -453,10 +452,10 @@ static int deferred_push_default(menu_displaylist_info_t *info)
|
||||
|
||||
void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
@ -487,7 +486,7 @@ void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_deferred_push = deferred_push_rdb_collection;
|
||||
else
|
||||
{
|
||||
switch (hash)
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_DEFERRED_CORE_UPDATER_LIST:
|
||||
#ifdef HAVE_NETWORKING
|
||||
|
@ -36,7 +36,8 @@ static int action_bind_down_generic(unsigned type, const char *label)
|
||||
|
||||
void menu_entries_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -31,7 +31,8 @@ static int action_info_default(unsigned type, const char *label)
|
||||
|
||||
void menu_entries_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -578,7 +578,8 @@ static int action_iterate_main(const char *label, unsigned action)
|
||||
|
||||
void menu_entries_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (cbs)
|
||||
cbs->action_iterate = action_iterate_main;
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_entries_cbs.h"
|
||||
@ -352,11 +351,10 @@ static int bind_left_generic(unsigned type, const char *label,
|
||||
|
||||
void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label)
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
int i;
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
uint32_t menu_label_hash = djb2_calculate(menu_label);
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
@ -435,7 +433,7 @@ void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_left = core_setting_left;
|
||||
else
|
||||
{
|
||||
switch (hash)
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_SAVESTATE:
|
||||
case MENU_LABEL_LOADSTATE:
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_display.h"
|
||||
@ -1401,9 +1400,9 @@ static int action_ok_video_resolution(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int is_rdb_entry(uint32_t hash)
|
||||
static int is_rdb_entry(uint32_t label_hash)
|
||||
{
|
||||
switch (hash)
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_RDB_ENTRY_PUBLISHER:
|
||||
case MENU_LABEL_RDB_ENTRY_DEVELOPER:
|
||||
@ -1562,7 +1561,7 @@ static int menu_entries_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs
|
||||
}
|
||||
|
||||
static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
||||
uint32_t hash, uint32_t menu_label_hash, unsigned type)
|
||||
uint32_t label_hash, uint32_t menu_label_hash, unsigned type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@ -1609,7 +1608,7 @@ static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_ok = action_ok_compressed_archive_push;
|
||||
break;
|
||||
case MENU_FILE_CORE:
|
||||
if (hash == MENU_LABEL_DEFERRED_CORE_LIST)
|
||||
if (label_hash == MENU_LABEL_DEFERRED_CORE_LIST)
|
||||
cbs->action_ok = action_ok_core_load_deferred;
|
||||
else
|
||||
{
|
||||
@ -1703,16 +1702,13 @@ static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
||||
|
||||
void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label)
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
rarch_setting_t *setting = menu_setting_find(label);
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
uint32_t menu_label_hash = djb2_calculate(menu_label);
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
if (!menu)
|
||||
if (!cbs || !menu)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
@ -1721,7 +1717,7 @@ void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
|
||||
cbs->action_ok = action_ok_lookup_setting;
|
||||
|
||||
if (elem0[0] != '\0' && (is_rdb_entry(hash) == 0))
|
||||
if (elem0[0] != '\0' && (is_rdb_entry(label_hash) == 0))
|
||||
{
|
||||
cbs->action_ok = action_ok_rdb_entry_submenu;
|
||||
return;
|
||||
@ -1746,8 +1742,8 @@ void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
||||
&& type <= MENU_SETTINGS_CHEAT_END)
|
||||
cbs->action_ok = action_ok_cheat;
|
||||
else if (menu_entries_cbs_init_bind_ok_compare_label(cbs, hash) == 0)
|
||||
else if (menu_entries_cbs_init_bind_ok_compare_label(cbs, label_hash) == 0)
|
||||
return;
|
||||
|
||||
menu_entries_cbs_init_bind_ok_compare_type(cbs, hash, menu_label_hash, type);
|
||||
menu_entries_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type);
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ static int action_refresh_default(file_list_t *list, file_list_t *menu_list)
|
||||
|
||||
void menu_entries_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (cbs)
|
||||
cbs->action_refresh = action_refresh_default;
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_entries_cbs.h"
|
||||
@ -788,9 +787,9 @@ static void menu_action_setting_disp_set_label(file_list_t* list,
|
||||
}
|
||||
|
||||
static int menu_entries_cbs_init_bind_get_string_representation_compare_label(
|
||||
menu_file_list_cbs_t *cbs, uint32_t hash)
|
||||
menu_file_list_cbs_t *cbs, uint32_t label_hash)
|
||||
{
|
||||
switch (hash)
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_CHEAT_NUM_PASSES:
|
||||
cbs->action_get_representation =
|
||||
@ -837,9 +836,9 @@ static int menu_entries_cbs_init_bind_get_string_representation_compare_label(
|
||||
|
||||
void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
@ -867,7 +866,7 @@ void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *
|
||||
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||
cbs->action_get_representation =
|
||||
menu_action_setting_disp_set_label_shader_parameter;
|
||||
else if (menu_entries_cbs_init_bind_get_string_representation_compare_label(cbs, hash) == 0)
|
||||
else if (menu_entries_cbs_init_bind_get_string_representation_compare_label(cbs, label_hash) == 0)
|
||||
return;
|
||||
|
||||
switch (type)
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_entries_cbs.h"
|
||||
@ -355,11 +354,10 @@ static int bind_right_generic(unsigned type, const char *label,
|
||||
|
||||
void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label)
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
int i;
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
uint32_t menu_label_hash = djb2_calculate(menu_label);
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
@ -437,7 +435,7 @@ void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_right = core_setting_right;
|
||||
else
|
||||
{
|
||||
switch (hash)
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_SAVESTATE:
|
||||
case MENU_LABEL_LOADSTATE:
|
||||
|
@ -42,7 +42,8 @@ static int action_scan_directory(const char *path,
|
||||
|
||||
void menu_entries_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -59,7 +59,8 @@ static int action_select_directory(const char *path, const char *label, unsigned
|
||||
|
||||
void menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -13,8 +13,6 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <rhash.h>
|
||||
|
||||
#include "menu.h"
|
||||
#include "menu_entries_cbs.h"
|
||||
#include "menu_setting.h"
|
||||
@ -301,16 +299,15 @@ int menu_entries_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
|
||||
|
||||
void menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
cbs->action_start = action_start_lookup_setting;
|
||||
|
||||
if (menu_entries_cbs_init_bind_start_compare_label(cbs, hash) == 0)
|
||||
if (menu_entries_cbs_init_bind_start_compare_label(cbs, label_hash) == 0)
|
||||
return;
|
||||
|
||||
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
||||
|
@ -314,7 +314,8 @@ static int action_get_title_default(const char *path, const char *label,
|
||||
|
||||
void menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
@ -36,7 +36,8 @@ static int action_bind_up_generic(unsigned type, const char *label)
|
||||
|
||||
void menu_entries_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1)
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user