diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2006-06-10 18:47:11 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2006-06-10 18:47:11 +0000 |
commit | 26dd5c5e9cdf24ef55190511a5d79a38f4436742 (patch) | |
tree | 864341a3a50d1fa3b237a571b7ea66ff33970818 /apps/plugins/doom/rockdoom.c | |
parent | 630e9586b6ffae9d7b321bc66ba6eb6a68d71414 (diff) | |
download | rockbox-26dd5c5e9cdf24ef55190511a5d79a38f4436742.tar.gz rockbox-26dd5c5e9cdf24ef55190511a5d79a38f4436742.zip |
Fix the menu start for rockdoom
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10097 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/rockdoom.c')
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 89 |
1 files changed, 8 insertions, 81 deletions
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index d9a0dbafa7..26afad6dc1 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -188,30 +188,6 @@ inline void* memcpy(void* dst, const void* src, size_t size) | |||
188 | return rb->memcpy(dst, src, size); | 188 | return rb->memcpy(dst, src, size); |
189 | } | 189 | } |
190 | 190 | ||
191 | // From suduku | ||
192 | int doom_menu_cb(int key, int m) | ||
193 | { | ||
194 | (void)m; | ||
195 | switch(key) | ||
196 | { | ||
197 | #ifdef MENU_ENTER2 | ||
198 | case MENU_ENTER2: | ||
199 | #endif | ||
200 | case MENU_ENTER: | ||
201 | key = BUTTON_NONE; /* eat the downpress, next menu reacts on release */ | ||
202 | break; | ||
203 | |||
204 | #ifdef MENU_ENTER2 | ||
205 | case MENU_ENTER2 | BUTTON_REL: | ||
206 | #endif | ||
207 | case MENU_ENTER | BUTTON_REL: | ||
208 | key = MENU_ENTER; /* fake downpress, next menu doesn't like release */ | ||
209 | break; | ||
210 | } | ||
211 | |||
212 | return key; | ||
213 | } | ||
214 | |||
215 | struct argvlist | 191 | struct argvlist |
216 | { | 192 | { |
217 | int timedemo; // 1 says there's a timedemo | 193 | int timedemo; // 1 says there's a timedemo |
@@ -393,59 +369,6 @@ int Dbuild_base (struct opt_items *names) | |||
393 | return i; | 369 | return i; |
394 | } | 370 | } |
395 | 371 | ||
396 | #if 0 | ||
397 | // This is a general function that takes in an opt_items structure and makes a list | ||
398 | // of files within it based on matching the string stringmatch to the files. | ||
399 | int Dbuild_filelist(struct opt_items **names, char *firstentry, char *directory, char *stringmatch) | ||
400 | { | ||
401 | int i=0; | ||
402 | DIR *filedir; | ||
403 | struct dirent *dptr; | ||
404 | char *startpt; | ||
405 | struct opt_items *temp; | ||
406 | |||
407 | filedir=opendir(directory); | ||
408 | |||
409 | if(filedir==NULL) | ||
410 | { | ||
411 | temp=malloc(sizeof(struct opt_items)); | ||
412 | temp[0].string=firstentry; | ||
413 | temp[0].voice_id=0; | ||
414 | *names=temp; | ||
415 | return 1; | ||
416 | } | ||
417 | |||
418 | // Get the total number of entries | ||
419 | while((dptr=rb->readdir(filedir))) | ||
420 | i++; | ||
421 | |||
422 | // Reset the directory | ||
423 | closedir(filedir); | ||
424 | filedir=opendir(directory); | ||
425 | |||
426 | i++; | ||
427 | temp=malloc(i*sizeof(struct opt_items)); | ||
428 | temp[0].string=firstentry; | ||
429 | temp[0].voice_id=0; | ||
430 | i=1; | ||
431 | |||
432 | while((dptr=rb->readdir(filedir))) | ||
433 | { | ||
434 | if(rb->strcasestr(dptr->d_name, stringmatch)) | ||
435 | { | ||
436 | startpt=malloc(strlen(dptr->d_name)*sizeof(char)); | ||
437 | strcpy(startpt,dptr->d_name); | ||
438 | temp[i].string=startpt; | ||
439 | temp[i].voice_id=0; | ||
440 | i++; | ||
441 | } | ||
442 | } | ||
443 | closedir(filedir); | ||
444 | *names=temp; | ||
445 | return i; | ||
446 | } | ||
447 | #endif | ||
448 | |||
449 | // This is a general function that takes in an menu_item structure and makes a list | 372 | // This is a general function that takes in an menu_item structure and makes a list |
450 | // of files within it based on matching the string stringmatch to the files. | 373 | // of files within it based on matching the string stringmatch to the files. |
451 | int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory, char *stringmatch) | 374 | int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory, char *stringmatch) |
@@ -595,7 +518,7 @@ int Oset_keys() | |||
595 | }; | 518 | }; |
596 | 519 | ||
597 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), | 520 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), |
598 | doom_menu_cb, NULL, NULL, NULL); | 521 | NULL, NULL, NULL, NULL); |
599 | 522 | ||
600 | while(!menuquit) | 523 | while(!menuquit) |
601 | { | 524 | { |
@@ -693,7 +616,7 @@ static bool Doptions() | |||
693 | }; | 616 | }; |
694 | 617 | ||
695 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), | 618 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), |
696 | doom_menu_cb, NULL, NULL, NULL); | 619 | NULL, NULL, NULL, NULL); |
697 | 620 | ||
698 | while(!menuquit) | 621 | while(!menuquit) |
699 | { | 622 | { |
@@ -757,7 +680,7 @@ int menuchoice(struct menu_item *menu, int items) | |||
757 | { | 680 | { |
758 | int m, result; | 681 | int m, result; |
759 | 682 | ||
760 | m = rb->menu_init(menu, items,doom_menu_cb, NULL, NULL, NULL); | 683 | m = rb->menu_init(menu, items,NULL, NULL, NULL, NULL); |
761 | 684 | ||
762 | result= rb->menu_show(m); | 685 | result= rb->menu_show(m); |
763 | rb->menu_exit(m); | 686 | rb->menu_exit(m); |
@@ -803,8 +726,12 @@ int doom_menu() | |||
803 | 726 | ||
804 | gamever=status-1; | 727 | gamever=status-1; |
805 | 728 | ||
729 | /* Clean out the button Queue */ | ||
730 | while (rb->button_get(false) != BUTTON_NONE) | ||
731 | rb->yield(); | ||
732 | |||
806 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), | 733 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), |
807 | doom_menu_cb, NULL, NULL, NULL); | 734 | NULL, NULL, NULL, NULL); |
808 | 735 | ||
809 | while(!menuquit) | 736 | while(!menuquit) |
810 | { | 737 | { |