- added a 'restart' CCMD that allows restarting the engine with different WADs being loaded without quitting first

SVN r3042 (trunk)
This commit is contained in:
Christoph Oelckers 2010-12-15 11:45:39 +00:00
commit b42952b85c
17 changed files with 418 additions and 233 deletions

View file

@ -1605,7 +1605,7 @@ CCMD (vid_setmode)
// V_Init
//
void V_Init (void)
void V_Init (bool restart)
{
const char *i;
int width, height, bits;
@ -1615,40 +1615,43 @@ void V_Init (void)
// [RH] Initialize palette management
InitPalette ();
width = height = bits = 0;
if ( (i = Args->CheckValue ("-width")) )
width = atoi (i);
if ( (i = Args->CheckValue ("-height")) )
height = atoi (i);
if ( (i = Args->CheckValue ("-bits")) )
bits = atoi (i);
if (width == 0)
if (!restart)
{
if (height == 0)
width = height = bits = 0;
if ( (i = Args->CheckValue ("-width")) )
width = atoi (i);
if ( (i = Args->CheckValue ("-height")) )
height = atoi (i);
if ( (i = Args->CheckValue ("-bits")) )
bits = atoi (i);
if (width == 0)
{
width = vid_defwidth;
height = vid_defheight;
if (height == 0)
{
width = vid_defwidth;
height = vid_defheight;
}
else
{
width = (height * 8) / 6;
}
}
else
else if (height == 0)
{
width = (height * 8) / 6;
height = (width * 6) / 8;
}
}
else if (height == 0)
{
height = (width * 6) / 8;
if (bits == 0)
{
bits = vid_defbits;
}
screen = new DDummyFrameBuffer (width, height);
}
if (bits == 0)
{
bits = vid_defbits;
}
screen = new DDummyFrameBuffer (width, height);
BuildTransTable (GPalette.BaseColors);
}