diff options
Diffstat (limited to 'uisimulator/tree.c')
-rw-r--r-- | uisimulator/tree.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/uisimulator/tree.c b/uisimulator/tree.c index 5dfafe1824..9a2228467a 100644 --- a/uisimulator/tree.c +++ b/uisimulator/tree.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include "kernel.h" | 28 | #include "kernel.h" |
29 | #include "tree.h" | 29 | #include "tree.h" |
30 | 30 | ||
31 | #include "icons.h" | ||
32 | |||
31 | #include "play.h" | 33 | #include "play.h" |
32 | 34 | ||
33 | #define TREE_MAX_FILENAMELEN 64 | 35 | #define TREE_MAX_FILENAMELEN 64 |
@@ -50,17 +52,15 @@ struct entry { | |||
50 | 52 | ||
51 | #ifdef HAVE_LCD_BITMAP | 53 | #ifdef HAVE_LCD_BITMAP |
52 | 54 | ||
53 | static unsigned char fileimage[] = { | 55 | extern unsigned char bitmap_icons_6x8[LastIcon][6]; |
54 | 0x60, 0x7f, 0x03, 0x63, 0x7f, 0x00 }; | 56 | extern icons_6x8; |
55 | |||
56 | static unsigned char dirimage[] = { | ||
57 | 0x3e, 0x26, 0x26, 0x24, 0x3c, 0x00 }; | ||
58 | 57 | ||
59 | int static | 58 | int static showdir(char *path, struct entry *buffer, int start, |
60 | showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end) | 59 | int scrollpos, int* at_end) |
61 | { | 60 | { |
62 | int i; | 61 | int i; |
63 | int j=0; | 62 | int j=0; |
63 | int icon_type = 0; | ||
64 | DIR *dir = opendir(path); | 64 | DIR *dir = opendir(path); |
65 | struct dirent *entry; | 65 | struct dirent *entry; |
66 | 66 | ||
@@ -89,8 +89,9 @@ showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end) | |||
89 | 89 | ||
90 | buffer[i].file = !(entry->attribute&ATTR_DIRECTORY); | 90 | buffer[i].file = !(entry->attribute&ATTR_DIRECTORY); |
91 | 91 | ||
92 | lcd_bitmap(buffer[i].file? | 92 | buffer[i].file?(icon_type=FileIcon):(icon_type=DirIcon); |
93 | fileimage:dirimage, 6, LINE_Y+i*LINE_HEIGTH, 6, 8, TRUE); | 93 | lcd_bitmap(bitmap_icons_6x8[icon_type], 6, LINE_Y+i*LINE_HEIGTH, 6, |
94 | 8, TRUE); | ||
94 | 95 | ||
95 | if(len < TREE_MAX_LEN_DISPLAY) | 96 | if(len < TREE_MAX_LEN_DISPLAY) |
96 | lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0); | 97 | lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0); |