1 #include "badge_main_loop.h"
3 #include "jumpnrun/jumpnrun.h"
4 #include "ui/display.h"
14 #define MAX_LEVELS 1024
16 void badge_main_loop(void) {
17 char menu_buf
[MAX_LEVELS
][32];
18 FILE *fd
= fopen("../badge/jumpnrun/levels.txt", "r");
22 for(i
= 0; i
< MAX_LEVELS
&& fgets(menu_buf
[i
], sizeof(menu_buf
[i
]), fd
); ++i
) {
23 menu_buf
[i
][strlen(menu_buf
[i
]) - 1] = '\0';
29 for(int j
= 0; j
< i
; ++j
) {
30 menu
[j
] = menu_buf
[j
];
34 size_t first_visible
= 0;
37 choice
= badge_menu(menu
, ARRAY_SIZE(menu
), &first_visible
, choice
);
39 sprintf(lvname
, "../badge/jumpnrun/%s.lvl", menu
[choice
]);
41 jumpnrun_play_level(lvname
);
This page took 0.039853 seconds and 5 git commands to generate.