From dde645fa506df5e07ca30f8bd32db51c84a9468a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 21 Jul 2014 22:40:21 +0200 Subject: [PATCH] (Lakka) Use systemname for lakka menu icons --- frontend/info/core_info.c | 1 + frontend/info/core_info.h | 1 + frontend/menu/disp/lakka.c | 14 ++++++-------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/info/core_info.c b/frontend/info/core_info.c index eebcf26dcd..1e89662a38 100644 --- a/frontend/info/core_info.c +++ b/frontend/info/core_info.c @@ -146,6 +146,7 @@ core_info_list_t *core_info_list_new(const char *modules_path) { unsigned count = 0; config_get_string(core_info[i].data, "display_name", &core_info[i].display_name); + config_get_string(core_info[i].data, "systemname", &core_info[i].systemname); config_get_uint(core_info[i].data, "firmware_count", &count); core_info[i].firmware_count = count; if (config_get_string(core_info[i].data, "supported_extensions", &core_info[i].supported_extensions) && diff --git a/frontend/info/core_info.h b/frontend/info/core_info.h index fef2123e89..1cfa470fb4 100644 --- a/frontend/info/core_info.h +++ b/frontend/info/core_info.h @@ -39,6 +39,7 @@ typedef struct char *path; config_file_t *data; char *display_name; + char *systemname; char *supported_extensions; char *authors; char *permissions; diff --git a/frontend/menu/disp/lakka.c b/frontend/menu/disp/lakka.c index 884ccea161..2d74219a5a 100644 --- a/frontend/menu/disp/lakka.c +++ b/frontend/menu/disp/lakka.c @@ -824,14 +824,12 @@ static void lakka_context_reset(void *data) if (info_list) info = (core_info_t*)&info_list->list[i-1]; - strlcpy(core_id, basename(info->path), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, ".so", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, ".dll", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, ".dylib", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, "-libretro", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, "_libretro", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, "libretro-", ""), sizeof(core_id)); - strlcpy(core_id, str_replace(core_id, "libretro_", ""), sizeof(core_id)); + if (info->systemname) { + strlcpy(core_id, info->systemname, sizeof(core_id)); + strlcpy(core_id, str_replace(core_id, "/", " "), sizeof(core_id)); + } else { + strlcpy(core_id, "default", sizeof(core_id)); + } strlcpy(texturepath, themepath, sizeof(texturepath)); strlcat(texturepath, core_id, sizeof(texturepath));