Show extension in menu select file if too long name

This commit is contained in:
fabio.olimpieri 2013-01-20 12:42:14 +00:00
parent ddcbe793d8
commit 1f134eabf3
2 changed files with 69 additions and 74 deletions

View File

@ -935,8 +935,8 @@ inline void paint_pixels (unsigned char octet,unsigned char ink, unsigned char p
mask = 0x80;
for (bucle = 0; bucle < 8; bucle++) {
for (bucle = 0; bucle < 8; bucle++)
{
if (draw)
{
valor = (octet & mask) ? (int) ink : (int) paper;
@ -962,7 +962,6 @@ inline void paint_pixels (unsigned char octet,unsigned char ink, unsigned char p
}
else
{
switch (ordenador.npixels)
{
case 2:
@ -975,7 +974,6 @@ inline void paint_pixels (unsigned char octet,unsigned char ink, unsigned char p
break;
}
}
ordenador.pixel+=ordenador.next_pixel;
mask = ((mask >> 1) & 0x7F);
}
@ -989,7 +987,8 @@ inline void paint_pixels_precision (unsigned char octet,unsigned char ink, unsig
if (ordenador.pixels_octect==0) mask = 0x80;
for (bucle = 0; bucle < 2; bucle++) {
for (bucle = 0; bucle < 2; bucle++)
{
if (draw)
{
valor = (octet & mask) ? (int) ink : (int) paper;
@ -1027,9 +1026,7 @@ inline void paint_pixels_precision (unsigned char octet,unsigned char ink, unsig
break;
}
}
ordenador.pixel+=ordenador.next_pixel;
mask = ((mask >> 1) & 0x7F);
}
}

View File

@ -425,19 +425,17 @@ void menu_print_font(SDL_Surface *screen, int r, int g, int b,
SDL_Rect dst = {x, y, 0, 0};
SDL_Color color = {r, g, b};
char buf[255];
unsigned int i;
unsigned int i, lenght;
memset(buf, 0, sizeof(buf));
strncpy(buf, msg, 254);
if (buf[0] != '|' && buf[0] != '^' && buf[0] != '.'
&& buf[0] != '-' && buf[0] != ' ' && !strstr(buf, " \""))
{
if (strlen(buf)>max_string)
lenght = strlen(buf);
if (lenght>max_string)
{
//buf[_MAX_STRING-3] = '.';
//buf[_MAX_STRING-2] = '.';
//buf[_MAX_STRING-1] = '.';
buf[max_string] = '\0';
strcpy (buf + max_string-4, buf + lenght-4);
}
}
/* Fixup multi-menu option look */
@ -781,7 +779,7 @@ static void menu_draw(SDL_Surface *screen, menu_t *p_menu, int sel, int font_siz
ptr = strrchr (name, '.');
if (ptr) *ptr = 0;
//Always load from SD card
//Always load from Default device
strcpy(filename,getenv("HOME"));
length=strlen(filename);
if ((length>0)&&(filename[length-1]!='/'))
@ -1094,9 +1092,9 @@ static int menu_select_internal(SDL_Surface *screen,
else if (keys & KEY_DOWN)
select_next(p_menu, 0, 1, 1);
else if (keys & KEY_PAGEUP)
select_next(p_menu, 0, -18, 0);
select_next(p_menu, 0, -19, 0);
else if (keys & KEY_PAGEDOWN)
select_next(p_menu, 0, 18, 0);
select_next(p_menu, 0, 19, 0);
else if (keys & KEY_LEFT)
select_next(p_menu, -1, 0 ,1);
else if (keys & KEY_RIGHT)