start using libpicofe, move some files
[fceu.git] / drivers / gp2x / menu.c
index 30194d9..fa1fa97 100644 (file)
 #include "usbjoy.h"\r
 #include "asmutils.h"\r
 #include "menu.h"\r
-#include "main.h"\r
-#include "fonts.h"\r
+#include "../common/main.h"\r
+#include "../libpicofe/fonts.h"\r
 #include "gp2x.h"\r
 \r
 #include "../../input.h"\r
 #include "../../state.h"\r
 #include "../../palette.h"\r
-#include "readpng.h"\r
+#include "../libpicofe/readpng.h"\r
 \r
 #ifndef _DIRENT_HAVE_D_TYPE\r
-#error "need d_type for file browser\r
+#error need d_type for file browser\r
 #endif\r
 \r
 extern int GP2X_PORT_REV;\r
@@ -345,7 +345,8 @@ static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel)
 \r
 static int scandir_cmp(const void *p1, const void *p2)\r
 {\r
-       struct dirent **d1 = (struct dirent **)p1, **d2 = (struct dirent **)p2;\r
+       const struct dirent **d1 = (const struct dirent **)p1;\r
+       const struct dirent **d2 = (const struct dirent **)p2;\r
        if ((*d1)->d_type == (*d2)->d_type) return alphasort(d1, d2);\r
        if ((*d1)->d_type == DT_DIR) return -1; // put before\r
        if ((*d2)->d_type == DT_DIR) return  1;\r
@@ -392,10 +393,10 @@ static char *filesel_loop(char *curr_path, char *final_dest)
                fname = p+1;\r
        }\r
 \r
-       n = scandir(curr_path, &namelist, scandir_filter, scandir_cmp);\r
+       n = scandir(curr_path, &namelist, scandir_filter, (void *)scandir_cmp);\r
        if (n < 0) {\r
                // try root\r
-               n = scandir("/", &namelist, scandir_filter, scandir_cmp);\r
+               n = scandir("/", &namelist, scandir_filter, (void *)scandir_cmp);\r
                if (n < 0) {\r
                        // oops, we failed\r
                        printf("dir: %s\n", curr_path);\r
@@ -1436,7 +1437,7 @@ static void menu_prepare_bg(void)
        else\r
        {\r
                memset32((int *)menu_bg, 0, 320*240*2/4);\r
-               readpng(menu_bg, "background.png");\r
+               readpng(menu_bg, "background.png", READPNG_BG, 320, 240);\r
        }\r
 }\r
 \r