diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index b8529dcf21..b4d2692af4 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -240,7 +240,7 @@ const unsigned char wads_builtin[7][30] = | |||
240 | }; | 240 | }; |
241 | 241 | ||
242 | int namemap[7]; | 242 | int namemap[7]; |
243 | char *addonfiles[10]; | 243 | static struct opt_items addons[10]; |
244 | static struct opt_items demolmp[11]; | 244 | static struct opt_items demolmp[11]; |
245 | char addon[200]; | 245 | char addon[200]; |
246 | // This sets up the base game and builds up myargv/c | 246 | // This sets up the base game and builds up myargv/c |
@@ -297,7 +297,7 @@ bool Dhandle_ver (int dver) | |||
297 | 297 | ||
298 | if(argvlist.addonnum) | 298 | if(argvlist.addonnum) |
299 | { | 299 | { |
300 | snprintf(addon,sizeof(addon),"%s%s", GAMEBASE"addons/", addonfiles[argvlist.addonnum]); | 300 | snprintf(addon,sizeof(addon),"%s%s", GAMEBASE"addons/", addons[argvlist.addonnum].string); |
301 | D_AddFile(addon,source_pwad); | 301 | D_AddFile(addon,source_pwad); |
302 | modifiedgame = true; | 302 | modifiedgame = true; |
303 | } | 303 | } |
@@ -391,35 +391,35 @@ int Dbuild_base (struct opt_items *names) | |||
391 | return i; | 391 | return i; |
392 | } | 392 | } |
393 | 393 | ||
394 | int Dbuild_addons(struct opt_items *names) | 394 | int Dbuild_addons(struct opt_items *names, char *firstentry, char *directory, char *stringmatch) |
395 | { | 395 | { |
396 | int i=1; | 396 | int i=1; |
397 | 397 | ||
398 | DIR *addons; | 398 | DIR *addondir; |
399 | struct dirent *dptr; | 399 | struct dirent *dptr; |
400 | char *startpt; | 400 | char *startpt; |
401 | 401 | ||
402 | startpt=malloc(strlen("No Addon")*sizeof(char)); // Add this on to allow for no addon to be played | 402 | // startpt=malloc(strlen("No Addon")*sizeof(char)); // Add this on to allow for no addon to be played |
403 | strcpy(startpt,"No Addon"); | 403 | // strcpy(startpt,"No Addon"); |
404 | names[0].string=startpt; | 404 | names[0].string=firstentry; |
405 | names[0].voice_id=0; | 405 | names[0].voice_id=0; |
406 | 406 | ||
407 | addons=opendir(GAMEBASE"addons/"); | 407 | addondir=opendir(directory); |
408 | if(addons==NULL) | 408 | if(addondir==NULL) |
409 | return 1; | 409 | return 1; |
410 | 410 | ||
411 | while((dptr=rb->readdir(addons)) && i<10) | 411 | while((dptr=rb->readdir(addondir)) && i<10) |
412 | { | 412 | { |
413 | if(rb->strcasestr(dptr->d_name, ".WAD")) | 413 | if(rb->strcasestr(dptr->d_name, stringmatch)) |
414 | { | 414 | { |
415 | addonfiles[i]=malloc(strlen(dptr->d_name)*sizeof(char)); | 415 | startpt=malloc(strlen(dptr->d_name)*sizeof(char)); |
416 | strcpy(addonfiles[i],dptr->d_name); | 416 | strcpy(startpt,dptr->d_name); |
417 | names[i].string=addonfiles[i]; | 417 | names[i].string=startpt; |
418 | names[i].voice_id=0; | 418 | names[i].voice_id=0; |
419 | i++; | 419 | i++; |
420 | } | 420 | } |
421 | } | 421 | } |
422 | closedir(addons); | 422 | closedir(addondir); |
423 | return i; | 423 | return i; |
424 | } | 424 | } |
425 | 425 | ||
@@ -630,8 +630,6 @@ static const struct opt_items onoff[2] = { | |||
630 | { "On", NULL }, | 630 | { "On", NULL }, |
631 | }; | 631 | }; |
632 | 632 | ||
633 | static struct opt_items addons[10]; | ||
634 | |||
635 | extern int fake_contrast; | 633 | extern int fake_contrast; |
636 | 634 | ||
637 | static bool Doptions() | 635 | static bool Doptions() |
@@ -647,6 +645,7 @@ static bool Doptions() | |||
647 | { "Weapon Recoil", NULL }, | 645 | { "Weapon Recoil", NULL }, |
648 | { "Translucency", NULL }, | 646 | { "Translucency", NULL }, |
649 | { "Fake Contrast", NULL }, | 647 | { "Fake Contrast", NULL }, |
648 | { "Always Run", NULL }, | ||
650 | }; | 649 | }; |
651 | 650 | ||
652 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), | 651 | m = rb->menu_init(items, sizeof(items) / sizeof(*items), |
@@ -659,7 +658,7 @@ static bool Doptions() | |||
659 | { | 658 | { |
660 | case 0: /* Sound */ | 659 | case 0: /* Sound */ |
661 | nosfxparm=!nosfxparm; // Have to invert it before setting | 660 | nosfxparm=!nosfxparm; // Have to invert it before setting |
662 | rb->set_option("Sound", &nosfxparm, INT, onoff, 2, NULL ); | 661 | rb->set_option(items[0].desc, &nosfxparm, INT, onoff, 2, NULL ); |
663 | nosfxparm=!nosfxparm; | 662 | nosfxparm=!nosfxparm; |
664 | break; | 663 | break; |
665 | 664 | ||
@@ -668,23 +667,27 @@ static bool Doptions() | |||
668 | break; | 667 | break; |
669 | 668 | ||
670 | case 2: /* Timedemo */ | 669 | case 2: /* Timedemo */ |
671 | rb->set_option("Timedemo", &argvlist.timedemo, INT, onoff, 2, NULL ); | 670 | rb->set_option(items[2].desc, &argvlist.timedemo, INT, onoff, 2, NULL ); |
672 | break; | 671 | break; |
673 | 672 | ||
674 | case 3: /* Player Bobbing */ | 673 | case 3: /* Player Bobbing */ |
675 | rb->set_option("Player Bobbing", &default_player_bobbing, INT, onoff, 2, NULL ); | 674 | rb->set_option(items[3].desc, &default_player_bobbing, INT, onoff, 2, NULL ); |
676 | break; | 675 | break; |
677 | 676 | ||
678 | case 4: /* Weapon Recoil */ | 677 | case 4: /* Weapon Recoil */ |
679 | rb->set_option("Weapon Recoil", &default_weapon_recoil, INT, onoff, 2, NULL ); | 678 | rb->set_option(items[4].desc, &default_weapon_recoil, INT, onoff, 2, NULL ); |
680 | break; | 679 | break; |
681 | 680 | ||
682 | case 5: /* Translucency */ | 681 | case 5: /* Translucency */ |
683 | rb->set_option("Translucency", &default_translucency, INT, onoff, 2, NULL ); | 682 | rb->set_option(items[5].desc, &default_translucency, INT, onoff, 2, NULL ); |
684 | break; | 683 | break; |
685 | 684 | ||
686 | case 6: /* Fake Contrast */ | 685 | case 6: /* Fake Contrast */ |
687 | rb->set_option("Fake Contrast", &fake_contrast, INT, onoff, 2, NULL ); | 686 | rb->set_option(items[6].desc, &fake_contrast, INT, onoff, 2, NULL ); |
687 | break; | ||
688 | |||
689 | case 7: /* Fake Contrast */ | ||
690 | rb->set_option(items[7].desc, &autorun, INT, onoff, 2, NULL ); | ||
688 | break; | 691 | break; |
689 | 692 | ||
690 | default: | 693 | default: |
@@ -726,7 +729,7 @@ int doom_menu() | |||
726 | return -1; | 729 | return -1; |
727 | } | 730 | } |
728 | 731 | ||
729 | int numadd=Dbuild_addons(addons); | 732 | int numadd=Dbuild_addons(addons, "No Addons", GAMEBASE"addons/", ".WAD" ); |
730 | 733 | ||
731 | int numdemos=Dbuild_demos(demolmp); | 734 | int numdemos=Dbuild_demos(demolmp); |
732 | argvlist.demonum=0; | 735 | argvlist.demonum=0; |
@@ -748,7 +751,6 @@ int doom_menu() | |||
748 | 751 | ||
749 | case 1: /* Addon picker */ | 752 | case 1: /* Addon picker */ |
750 | rb->set_option("Select Addon", &argvlist.addonnum, INT, addons, numadd, NULL ); | 753 | rb->set_option("Select Addon", &argvlist.addonnum, INT, addons, numadd, NULL ); |
751 | //Daddons(numadd); | ||
752 | break; | 754 | break; |
753 | 755 | ||
754 | case 2: /* Demos */ | 756 | case 2: /* Demos */ |
@@ -816,12 +818,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
816 | 818 | ||
817 | #ifdef FANCY_MENU | 819 | #ifdef FANCY_MENU |
818 | rb->lcd_setfont(FONT_UI); | 820 | rb->lcd_setfont(FONT_UI); |
819 | rb->lcd_putsxy(5,LCD_HEIGHT-20, "RockDoom v0.90"); | 821 | rb->lcd_putsxy(5,LCD_HEIGHT-20, "Welcome to RockDoom"); |
820 | rb->lcd_update(); | 822 | rb->lcd_update(); |
821 | rb->sleep(HZ*2); | 823 | rb->sleep(HZ*2); |
822 | rb->lcd_setfont(0); | 824 | rb->lcd_setfont(0); |
823 | #else | 825 | #else |
824 | rb->splash(HZ*2, true, "RockDoom v0.90"); | 826 | rb->splash(HZ*2, true, "Welcome to RockDoom"); |
825 | #endif | 827 | #endif |
826 | 828 | ||
827 | myargv = malloc(sizeof(char *)*MAXARGVS); | 829 | myargv = malloc(sizeof(char *)*MAXARGVS); |
@@ -856,14 +858,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
856 | 858 | ||
857 | I_Quit(); // Make SURE everything was closed out right | 859 | I_Quit(); // Make SURE everything was closed out right |
858 | 860 | ||
859 | printf("There were still: %d files open", fpoint); | 861 | printf("There were still: %d files open\n", fpoint); |
860 | while(fpoint>0) | 862 | while(fpoint>0) |
861 | { | 863 | { |
862 | rb->close(filearray[fpoint]); | 864 | rb->close(filearray[fpoint]); |
863 | fpoint--; | 865 | fpoint--; |
864 | } | 866 | } |
865 | 867 | ||
866 | rb->splash(HZ, true, "Bye"); | 868 | // rb->splash(HZ, true, "Bye"); |
867 | 869 | ||
868 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 870 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
869 | rb->cpu_boost(false); | 871 | rb->cpu_boost(false); |