Rev 6526 | Rev 6559 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6526 | Rev 6535 | ||
---|---|---|---|
Line 20... | Line 20... | ||
20 | #include "kolibri_gui.h" |
20 | #include "kolibri_gui.h" |
21 | #include "kolibri_opendialog.h" |
21 | #include "kolibri_opendialog.h" |
22 | #include "kolibri_libimg.h" |
22 | #include "kolibri_libimg.h" |
Line 23... | Line 23... | ||
23 | 23 | ||
24 | char temp_path[4096]; |
24 | char temp_path[4096]; |
Line 25... | Line 25... | ||
25 | char** sys_path = (char**)0x20; // hack - get path from KOS header |
25 | char** sys_path = (char**)0x20; // hack - get path from KOS header. analog argv[0] |
26 | 26 | ||
27 | int main(int argc, char **argv) |
27 | int main(int argc, char **argv) |
28 | { |
28 | { |
Line 46... | Line 46... | ||
46 | const int icon_rgb_size = 16*16*3; // every icons 16x16 24bpp |
46 | const int icon_rgb_size = 16*16*3; // every icons 16x16 24bpp |
47 | char *image_data_rgb = malloc(icon_rgb_size * 3), |
47 | char *image_data_rgb = malloc(icon_rgb_size * 3), |
48 | *image_data, *pc; |
48 | *image_data, *pc; |
49 | // make full path + argv |
49 | // make full path + argv |
50 | strcpy(temp_path, *sys_path); |
50 | strcpy(temp_path, *sys_path); |
51 | pc = strrchr(temp_path, '/'); |
51 | pc = strrchr(temp_path, '/'); // this fails if has params with '/' within. use argv[0] instead |
52 | if (pc) pc[1] = 0; |
52 | if (pc) pc[1] = 0; |
53 | strcat(temp_path, "reload_16x16_8b.png"); |
53 | strcat(temp_path, "reload_16x16_8b.png"); |
54 | debug_board_write_str(temp_path); |
54 | debug_board_write_str(temp_path); |
55 | FILE *ficon = fopen(temp_path, "rb"); |
55 | FILE *ficon = fopen(temp_path, "rb"); |
56 | if (!ficon) |
56 | if (!ficon) |