- Merged the GC branch back into the trunk, so now it can receive more

testing from the people who download SVN trunk builds.

SVN r795 (trunk)
This commit is contained in:
Randy Heit 2008-03-12 02:56:11 +00:00
commit f2660dc336
88 changed files with 2541 additions and 1523 deletions

View file

@ -745,7 +745,6 @@ void D_DoomLoop ()
if (singletics)
{
I_StartTic ();
DObject::BeginFrame ();
D_ProcessEvents ();
G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]);
//Added by MC: For some of that bot stuff. The main bot function.
@ -774,7 +773,7 @@ void D_DoomLoop ()
G_Ticker ();
gametic++;
maketic++;
DObject::EndFrame ();
GC::CheckGC ();
Net_NewMakeTic ();
}
else
@ -1644,7 +1643,7 @@ static EIWADType IdentifyVersion (const char *zdoom_wad)
{
WadStuff wads[sizeof(IWADNames)/sizeof(char *)];
size_t foundwads[NUM_IWAD_TYPES] = { 0 };
const char *iwadparm = Args.CheckValue ("-iwad");
const char *iwadparm = Args->CheckValue ("-iwad");
size_t numwads;
int pickwad;
size_t i;
@ -1914,7 +1913,7 @@ static const char *BaseFileSearch (const char *file, const char *ext, bool lookf
bool ConsiderPatches (const char *arg, const char *ext)
{
bool noDef = false;
DArgs *files = Args.GatherFiles (arg, ext, false);
DArgs *files = Args->GatherFiles (arg, ext, false);
if (files->NumArgs() > 0)
{
@ -1930,7 +1929,7 @@ bool ConsiderPatches (const char *arg, const char *ext)
}
noDef = true;
}
delete files;
files->Destroy();
return noDef;
}
@ -2038,8 +2037,7 @@ void D_DoomMain (void)
const IWADInfo *iwad_info;
srand(I_MSTime());
atterm (DObject::StaticShutdown);
PClass::StaticInit ();
atterm (C_DeinitConsole);
@ -2121,19 +2119,19 @@ void D_DoomMain (void)
execFiles = new DArgs;
GameConfig->AddAutoexec (execFiles, GameNames[gameinfo.gametype]);
D_MultiExec (execFiles, true);
delete execFiles;
execFiles->Destroy();
// Run .cfg files at the start of the command line.
execFiles = Args.GatherFiles (NULL, ".cfg", false);
execFiles = Args->GatherFiles (NULL, ".cfg", false);
D_MultiExec (execFiles, true);
delete execFiles;
execFiles->Destroy();
C_ExecCmdLineParams (); // [RH] do all +set commands on the command line
DArgs *files = Args.GatherFiles ("-file", ".wad", true);
DArgs *files1 = Args.GatherFiles (NULL, ".zip", false);
DArgs *files2 = Args.GatherFiles (NULL, ".pk3", false);
DArgs *files3 = Args.GatherFiles (NULL, ".txt", false);
DArgs *files = Args->GatherFiles ("-file", ".wad", true);
DArgs *files1 = Args->GatherFiles (NULL, ".zip", false);
DArgs *files2 = Args->GatherFiles (NULL, ".pk3", false);
DArgs *files3 = Args->GatherFiles (NULL, ".txt", false);
if (files->NumArgs() > 0 || files1->NumArgs() > 0 || files2->NumArgs() > 0 || files3->NumArgs() > 0)
{
// Check for -file in shareware
@ -2160,10 +2158,10 @@ void D_DoomMain (void)
D_AddWildFile (files3->GetArg (i));
}
}
delete files;
delete files1;
delete files2;
delete files3;
files->Destroy();
files1->Destroy();
files2->Destroy();
files3->Destroy();
Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (&wadfiles);
@ -2193,18 +2191,18 @@ void D_DoomMain (void)
Printf ("P_Init: Checking cmd-line parameters...\n");
flags = dmflags;
if (Args.CheckParm ("-nomonsters")) flags |= DF_NO_MONSTERS;
if (Args.CheckParm ("-respawn")) flags |= DF_MONSTERS_RESPAWN;
if (Args.CheckParm ("-fast")) flags |= DF_FAST_MONSTERS;
if (Args->CheckParm ("-nomonsters")) flags |= DF_NO_MONSTERS;
if (Args->CheckParm ("-respawn")) flags |= DF_MONSTERS_RESPAWN;
if (Args->CheckParm ("-fast")) flags |= DF_FAST_MONSTERS;
devparm = !!Args.CheckParm ("-devparm");
devparm = !!Args->CheckParm ("-devparm");
if (Args.CheckParm ("-altdeath"))
if (Args->CheckParm ("-altdeath"))
{
deathmatch = 1;
flags |= DF_ITEMS_RESPAWN;
}
else if (Args.CheckParm ("-deathmatch"))
else if (Args->CheckParm ("-deathmatch"))
{
deathmatch = 1;
flags |= DF_WEAPONS_STAY | DF_ITEMS_RESPAWN;
@ -2223,27 +2221,27 @@ void D_DoomMain (void)
}
autostart = false;
const char *val = Args.CheckValue ("-skill");
const char *val = Args->CheckValue ("-skill");
if (val)
{
gameskill = val[0] - '1';
autostart = true;
}
p = Args.CheckParm ("-warp");
if (p && p < Args.NumArgs() - 1)
p = Args->CheckParm ("-warp");
if (p && p < Args->NumArgs() - 1)
{
int ep, map;
if (gameinfo.flags & GI_MAPxx)
{
ep = 1;
map = atoi (Args.GetArg(p+1));
map = atoi (Args->GetArg(p+1));
}
else
{
ep = atoi (Args.GetArg(p+1));
map = p < Args.NumArgs() - 2 ? atoi (Args.GetArg(p+2)) : 10;
ep = atoi (Args->GetArg(p+1));
map = p < Args->NumArgs() - 2 ? atoi (Args->GetArg(p+2)) : 10;
if (map < 1 || map > 9)
{
map = ep;
@ -2256,19 +2254,19 @@ void D_DoomMain (void)
}
// [RH] Hack to handle +map
p = Args.CheckParm ("+map");
if (p && p < Args.NumArgs()-1)
p = Args->CheckParm ("+map");
if (p && p < Args->NumArgs()-1)
{
MapData * map = P_OpenMapData(Args.GetArg (p+1));
MapData * map = P_OpenMapData(Args->GetArg (p+1));
if (map == NULL)
{
Printf ("Can't find map %s\n", Args.GetArg (p+1));
Printf ("Can't find map %s\n", Args->GetArg (p+1));
}
else
{
delete map;
strncpy (startmap, Args.GetArg (p+1), 8);
Args.GetArg (p)[0] = '-';
strncpy (startmap, Args->GetArg (p+1), 8);
Args->GetArg (p)[0] = '-';
autostart = true;
}
}
@ -2281,7 +2279,7 @@ void D_DoomMain (void)
// We do not need to support -cdrom under Unix, because all the files
// that would go to c:\\zdoomdat are already stored in .zdoom inside
// the user's home directory.
if (Args.CheckParm("-cdrom"))
if (Args->CheckParm("-cdrom"))
{
Printf (GStrings("D_CDROM"));
mkdir (CDROM_DIR, 0);
@ -2293,7 +2291,7 @@ void D_DoomMain (void)
UCVarValue value;
static char one_hundred[] = "100";
value.String = Args.CheckValue ("-turbo");
value.String = Args->CheckValue ("-turbo");
if (value.String == NULL)
value.String = one_hundred;
else
@ -2302,7 +2300,7 @@ void D_DoomMain (void)
turbo.SetGenericRepDefault (value, CVAR_String);
}
v = Args.CheckValue ("-timer");
v = Args->CheckValue ("-timer");
if (v)
{
double time = strtod (v, NULL);
@ -2310,7 +2308,7 @@ void D_DoomMain (void)
timelimit = (float)time;
}
v = Args.CheckValue ("-avg");
v = Args->CheckValue ("-avg");
if (v)
{
Printf ("Austin Virtual Gaming: Levels will end after 20 minutes\n");
@ -2420,10 +2418,10 @@ void D_DoomMain (void)
}
//Added by MC:
bglobal.getspawned = Args.GatherFiles ("-bots", "", false);
bglobal.getspawned = Args->GatherFiles ("-bots", "", false);
if (bglobal.getspawned->NumArgs() == 0)
{
delete bglobal.getspawned;
bglobal.getspawned->Destroy();
bglobal.getspawned = NULL;
}
else
@ -2459,13 +2457,11 @@ void D_DoomMain (void)
// [RH] Run any saved commands from the command line or autoexec.cfg now.
gamestate = GS_FULLCONSOLE;
Net_NewMakeTic ();
DObject::BeginFrame ();
DThinker::RunThinkers ();
DObject::EndFrame ();
gamestate = GS_STARTUP;
// start the apropriate game based on parms
v = Args.CheckValue ("-record");
v = Args->CheckValue ("-record");
if (v)
{
@ -2477,24 +2473,23 @@ void D_DoomMain (void)
StartScreen = NULL;
V_Init2();
files = Args.GatherFiles ("-playdemo", ".lmp", false);
files = Args->GatherFiles ("-playdemo", ".lmp", false);
if (files->NumArgs() > 0)
{
singledemo = true; // quit after one demo
G_DeferedPlayDemo (files->GetArg (0));
delete files;
D_DoomLoop (); // never returns
}
delete files;
files->Destroy();
v = Args.CheckValue ("-timedemo");
v = Args->CheckValue ("-timedemo");
if (v)
{
G_TimeDemo (v);
D_DoomLoop (); // never returns
}
v = Args.CheckValue ("-loadgame");
v = Args->CheckValue ("-loadgame");
if (v)
{
file = v;