Add a main screen option to warp to any episode

This commit is contained in:
Lephenixnoir 2021-08-04 18:44:31 +02:00
parent 4dd99b0695
commit 40fe796d85
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 15 additions and 7 deletions

View File

@ -348,7 +348,7 @@ int Layout_Event(Layout *l, int key)
}
int UI_Main(WADFileInfo *wads, int wad_count, int *dev_info, int *use_mmap,
int *startmap)
int *startmap, int *startepisode)
{
Layout l;
Layout_Init(&l);
@ -374,6 +374,7 @@ int UI_Main(WADFileInfo *wads, int wad_count, int *dev_info, int *use_mmap,
}
Layout_Spacing(&l, 12);
Layout_Integer(&l, "Start at episode:", startepisode);
Layout_Integer(&l, "Start at map:", startmap);
Layout_Spacing(&l, 12);
@ -392,6 +393,8 @@ int UI_Main(WADFileInfo *wads, int wad_count, int *dev_info, int *use_mmap,
if(*startmap < 1)
*startmap = 1;
if(*startepisode < 1)
*startepisode = 1;
}
return -1;

View File

@ -61,9 +61,10 @@ int Layout_Event(Layout *l, int key);
/* Show the program's main screen; returns index of selected WAD file. */
int UI_Main(WADFileInfo *wads, int wad_count,
int *dev_info, /* Enable technical detail screens */
int *use_mmap, /* Map file to memory (as opposed to using Bfile) */
int *startmap /* Warp to this map */
int *dev_info, /* Enable technical detail screens */
int *use_mmap, /* Map file to memory (as opposed to using Bfile) */
int *startmap, /* Warp to this map */
int *startepisode /* Warp to this episode */
);
#endif /* CGDOOM_UI_H */

View File

@ -615,10 +615,14 @@ int main(void){
WADFileInfo wads[16];
int wad_count = FindWADs(wads, 16);
extern int startmap;
extern int startmap, startepisode;
int dev_info = 0;
startmap = 1;
int choice = UI_Main(wads, wad_count, &dev_info, &gWADmethod, &startmap);
startepisode = 1;
int choice = UI_Main(wads, wad_count, &dev_info, &gWADmethod,
&startmap, &startepisode);
if(choice < 0)
return 1;

View File

@ -461,7 +461,7 @@ void D_DoomMain()
else if(skill==3) startskill = sk_hard;
else if(skill==4) startskill = sk_nightmare;
startepisode = episode;
episode = startepisode;
map = startmap;
autostart = false;