Add option to skip title screen

This commit is contained in:
Lephenixnoir 2021-09-10 22:34:03 +02:00
parent 535a55e60c
commit 83bb8184e8
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 17 additions and 8 deletions

View File

@ -354,7 +354,8 @@ int Layout_Event(Layout *l, int key)
}
int UI_Main(WADFileInfo *wads, int wad_count, int *dev_info, int *use_mmap,
int *startmap, int *startepisode, int *trustunaligned)
int *startmap, int *startepisode, int *trustunaligned,
int *autostart)
{
Layout l;
Layout_Init(&l);
@ -390,6 +391,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_Checkbox(&l, "Skip title screen:", autostart);
Layout_Spacing(&l, 12);
Layout_Checkbox(&l, "Developer info:", dev_info);

View File

@ -67,7 +67,8 @@ int UI_Main(WADFileInfo *wads, int wad_count,
int *use_mmap, /* Map file to memory (as opposed to using Bfile) */
int *startmap, /* Warp to this map */
int *startepisode, /* Warp to this episode */
int *trustunaligned /* Trust unaligned lumps */
int *trustunaligned, /* Trust unaligned lumps */
int *autostart /* Skip main menu, straight to gameplay */
);
#endif /* CGDOOM_UI_H */

View File

@ -3,6 +3,7 @@
#include "cgdoom.h"
#include <stdlib.h>
#include "libprof.h"
#include "doomtype.h"
#ifndef CG_EMULATOR
# include "cgdoom-alloc.h"
@ -616,6 +617,8 @@ void abort(void){
///////////////////////////////////////////////////////////////////////////////////////////////////
int main(void)
{
extern boolean autostart;
int autostart_ = 0;
startmap = 1;
startepisode = 1;
@ -635,10 +638,12 @@ int main(void)
int dev_info = 0;
int choice = UI_Main(wads, wad_count, &dev_info, &gWADmethod,
&startmap, &startepisode, &CGD_TrustUnalignedLumps);
&startmap, &startepisode, &CGD_TrustUnalignedLumps, &autostart_);
if(choice < 0)
return 1;
autostart = autostart_;
unsigned tmp=((unsigned)getSecondaryVramAddress()+3)&(~3);
SaveVRAMBuffer = (unsigned char*)tmp;
/* Graph 90+E: RAM starts at 0x0c000000 in physical memory */

View File

@ -475,10 +475,6 @@ void D_DoomMain()
else if(skill==3) startskill = sk_hard;
else if(skill==4) startskill = sk_nightmare;
episode = startepisode;
map = startmap;
autostart = false;
// init subsystems
//printf ("V_Init: Allocate screens\n");
V_Init ();
@ -532,7 +528,12 @@ void D_DoomMain()
//printf ("ST_Init: Init status bar\n");
ST_Init ();
//printf ("Engage... \n");
D_StartTitle ();
if (autostart)
G_DeferedInitNew (startskill, startepisode, startmap);
else
D_StartTitle ();
D_DoomLoop (); // never returns, except when it does
I_Restore (); //calckill = bad