No longer use CB_ hashes

This commit is contained in:
twinaphex 2016-06-20 16:14:59 +02:00
parent c2c59e8e16
commit d2c9c280fe
9 changed files with 23 additions and 19 deletions

View File

@ -1108,6 +1108,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "core_settings"; return "core_settings";
case MENU_ENUM_LABEL_CB_MENU_WALLPAPER: case MENU_ENUM_LABEL_CB_MENU_WALLPAPER:
return "cb_menu_wallpaper"; return "cb_menu_wallpaper";
case MENU_ENUM_LABEL_CB_MENU_THUMBNAIL:
return "cb_menu_thumbnail";
case MENU_ENUM_LABEL_CB_LAKKA_LIST: case MENU_ENUM_LABEL_CB_LAKKA_LIST:
return "cb_lakka_list"; return "cb_lakka_list";
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST: case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:

View File

@ -929,7 +929,7 @@ static int generic_action_ok(const char *path,
strlcpy(settings->path.menu_wallpaper, strlcpy(settings->path.menu_wallpaper,
action_path, sizeof(settings->path.menu_wallpaper)); action_path, sizeof(settings->path.menu_wallpaper));
task_push_image_load(action_path, task_push_image_load(action_path,
msg_hash_to_str(MENU_ENUM_LABEL_CB_MENU_WALLPAPER), MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
} }
break; break;

View File

@ -1216,7 +1216,8 @@ static void mui_context_reset(void *data)
menu_display_allocate_white_texture(); menu_display_allocate_white_texture();
mui_context_reset_textures(mui); mui_context_reset_textures(mui);
task_push_image_load(settings->path.menu_wallpaper, "cb_menu_wallpaper", task_push_image_load(settings->path.menu_wallpaper,
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
} }

View File

@ -364,7 +364,8 @@ static void nk_menu_context_reset(void *data)
wimp_context_bg_destroy(nk); wimp_context_bg_destroy(nk);
nk_menu_context_reset_textures(nk, iconpath); nk_menu_context_reset_textures(nk, iconpath);
task_push_image_load(settings->path.menu_wallpaper, "cb_menu_wallpaper", task_push_image_load(settings->path.menu_wallpaper,
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
} }

View File

@ -714,7 +714,8 @@ static void xmb_update_thumbnail_image(void *data)
return; return;
if (path_file_exists(xmb->thumbnail_file_path)) if (path_file_exists(xmb->thumbnail_file_path))
task_push_image_load(xmb->thumbnail_file_path, "cb_menu_thumbnail", task_push_image_load(xmb->thumbnail_file_path,
MENU_ENUM_LABEL_CB_MENU_THUMBNAIL,
menu_display_handle_thumbnail_upload, NULL); menu_display_handle_thumbnail_upload, NULL);
else if (xmb->depth == 1) else if (xmb->depth == 1)
xmb->thumbnail = 0; xmb->thumbnail = 0;
@ -1051,7 +1052,8 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
{ {
if(path_file_exists(path)) if(path_file_exists(path))
{ {
task_push_image_load(path, "cb_menu_wallpaper", task_push_image_load(path,
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
strlcpy(xmb->background_file_path, strlcpy(xmb->background_file_path,
path, sizeof(xmb->background_file_path)); path, sizeof(xmb->background_file_path));
@ -2737,7 +2739,8 @@ static void xmb_context_reset_background(const char *iconpath)
strlcpy(path, settings->path.menu_wallpaper, sizeof(path)); strlcpy(path, settings->path.menu_wallpaper, sizeof(path));
if (path_file_exists(path)) if (path_file_exists(path))
task_push_image_load(path, "cb_menu_wallpaper", task_push_image_load(path,
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
} }

View File

@ -1006,7 +1006,7 @@ static void *zarch_init(void **userdata)
if (!string_is_empty(settings->path.menu_wallpaper)) if (!string_is_empty(settings->path.menu_wallpaper))
task_push_image_load(settings->path.menu_wallpaper, task_push_image_load(settings->path.menu_wallpaper,
"cb_menu_wallpaper", MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL); menu_display_handle_wallpaper_upload, NULL);
matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1); matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1);
@ -1091,7 +1091,8 @@ static void zarch_context_reset(void *data)
zarch_context_bg_destroy(zui); zarch_context_bg_destroy(zui);
task_push_image_load(settings->path.menu_wallpaper, task_push_image_load(settings->path.menu_wallpaper,
"cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
menu_display_handle_wallpaper_upload, NULL);
menu_display_allocate_white_texture(); menu_display_allocate_white_texture();

View File

@ -1489,6 +1489,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS, MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS,
MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST, MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST,
MENU_ENUM_LABEL_CB_MENU_WALLPAPER, MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
MENU_ENUM_LABEL_CB_MENU_THUMBNAIL,
MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST,
MENU_ENUM_LABEL_CB_LAKKA_LIST, MENU_ENUM_LABEL_CB_LAKKA_LIST,
MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST, MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST,

View File

@ -322,22 +322,15 @@ bool task_image_load_handler(retro_task_t *task)
} }
bool task_push_image_load(const char *fullpath, bool task_push_image_load(const char *fullpath,
const char *type, retro_task_callback_t cb, void *user_data) enum msg_hash_enums enum_idx, retro_task_callback_t cb, void *user_data)
{ {
nbio_handle_t *nbio = NULL; nbio_handle_t *nbio = NULL;
retro_task_t *t = NULL; retro_task_t *t = NULL;
uint32_t cb_type_hash = djb2_calculate(type);
struct nbio_t *handle = NULL; struct nbio_t *handle = NULL;
nbio_image_handle_t *image = NULL; nbio_image_handle_t *image = NULL;
switch (cb_type_hash) if (enum_idx == MSG_UNKNOWN)
{ goto error_msg;
case CB_MENU_WALLPAPER:
case CB_MENU_THUMBNAIL:
break;
default:
goto error_msg;
}
t = (retro_task_t*)calloc(1, sizeof(*t)); t = (retro_task_t*)calloc(1, sizeof(*t));
if (!t) if (!t)

View File

@ -27,6 +27,7 @@
#include "../content.h" #include "../content.h"
#include "../core_type.h" #include "../core_type.h"
#include "../msg_hash.h"
RETRO_BEGIN_DECLS RETRO_BEGIN_DECLS
@ -85,7 +86,8 @@ void *task_push_http_transfer(const char *url, bool mute, const char *type,
task_retriever_info_t *http_task_get_transfer_list(void); task_retriever_info_t *http_task_get_transfer_list(void);
#endif #endif
bool task_push_image_load(const char *fullpath, const char *type, bool task_push_image_load(const char *fullpath,
enum msg_hash_enums enum_idx,
retro_task_callback_t cb, void *userdata); retro_task_callback_t cb, void *userdata);
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB