(Menu/Disp) Fix core name representation

This commit is contained in:
twinaphex 2014-09-11 01:57:25 +02:00
parent 973004bee3
commit 30b31e3c45
4 changed files with 29 additions and 30 deletions

View File

@ -344,13 +344,11 @@ static void rgui_render(void)
for (i = begin; i < end; i++, y += FONT_HEIGHT_STRIDE)
{
char message[256], type_str[256];
const char *path = NULL;
const char *entry_label = NULL;
unsigned type = 0;
unsigned w = 0;
char entry_title_buf[256];
char type_str_buf[64];
char message[PATH_MAX], type_str[PATH_MAX],
entry_title_buf[PATH_MAX], type_str_buf[PATH_MAX],
path_buf[PATH_MAX];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
bool selected = false;
file_list_get_at_offset(driver.menu->selection_buf, i, &path,
@ -362,12 +360,13 @@ static void rgui_render(void)
disp_set_label(&w, type, i, label,
type_str, sizeof(type_str),
entry_label, path);
entry_label, path,
path_buf, sizeof(path_buf));
selected = (i == driver.menu->selection_ptr);
menu_ticker_line(entry_title_buf, RGUI_TERM_WIDTH - (w + 1 + 2),
g_extern.frame_count / RGUI_TERM_START_X, path, selected);
g_extern.frame_count / RGUI_TERM_START_X, path_buf, selected);
menu_ticker_line(type_str_buf, w, g_extern.frame_count / RGUI_TERM_START_X,
type_str, selected);

View File

@ -217,17 +217,15 @@ static void rmenu_render(void)
for (i = begin; i < end; i++, j++)
{
const char *path = NULL;
const char *entry_label = NULL;
unsigned type = 0;
char message[PATH_MAX], type_str[PATH_MAX],
entry_title_buf[PATH_MAX], type_str_buf[PATH_MAX],
path_buf[PATH_MAX];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
bool selected = false;
file_list_get_at_offset(menu->selection_buf, i,
&path, &entry_label, &type);
char message[256];
char type_str[256];
unsigned w = 0;
char entry_title_buf[256];
char type_str_buf[64];
bool selected = false;
disp_set_label(&w, type, i, label,
type_str, sizeof(type_str),

View File

@ -429,21 +429,20 @@ static void rmenu_xui_render(void)
for (i = begin; i < end; i++/*, y += FONT_HEIGHT_STRIDE */)
{
const char *path = NULL;
const char *entry_label = NULL;
unsigned type = 0;
file_list_get_at_offset(driver.menu->selection_buf, i,
&path, &entry_label, &type);
char message[256];
char type_str[256];
char entry_title_buf[256];
char type_str_buf[64];
char message[PATH_MAX], type_str[PATH_MAX],
entry_title_buf[PATH_MAX], type_str_buf[PATH_MAX],
path_buf[PATH_MAX];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
bool selected = false;
unsigned w = 0;
file_list_get_at_offset(driver.menu->selection_buf, i, &path,
&entry_label, &type);
disp_set_label(&w, type, i, label,
type_str, sizeof(type_str),
entry_label, path);
entry_label, path,
path_buf, sizeof(path_buf));
selected = (i == driver.menu->selection_ptr);

View File

@ -128,7 +128,8 @@ static void disp_set_label(unsigned *w, unsigned type, unsigned i,
const char *label,
char *type_str, size_t type_str_size,
const char *entry_label,
const char *path)
const char *path,
char *path_buf, size_t path_buf_size)
{
*w = 19;
@ -206,6 +207,8 @@ static void disp_set_label(unsigned *w, unsigned type, unsigned i,
driver.menu_ctx->backend->setting_set_label)
driver.menu_ctx->backend->setting_set_label(type_str,
type_str_size, w, type, label, entry_label, i);
strlcpy(path_buf, path, path_buf_size);
}
#endif