mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-31 01:10:52 +00:00
* Updated to ZDoom r3042:
- Added a 'restart' CCMD that allows restarting the engine with different WADs being loaded without quitting first - Fixed handling of missing backgrounds for intermission text screens for real this time. - Added automap patch to mark trigger lines. - Fixed: The TouchedActors array in the Dehacked parser was not freed after parsing was done. - Initialize the alt HUD explicitly in D_DoomMain. - Don't let S_UnloadReverbDef leave a broken list of sound environments behind. - Added more code to explicitly delete data before initializing it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1129 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
e6750550a5
commit
d2cef2f3be
42 changed files with 665 additions and 326 deletions
|
@ -91,7 +91,7 @@ struct AMColor
|
|||
static AMColor Background, YourColor, WallColor, TSWallColor,
|
||||
FDWallColor, CDWallColor, ThingColor,
|
||||
ThingColor_Item, ThingColor_CountItem, ThingColor_Monster, ThingColor_Friend,
|
||||
SecretWallColor, GridColor, XHairColor,
|
||||
SpecialWallColor, SecretWallColor, GridColor, XHairColor,
|
||||
NotSeenColor,
|
||||
LockedColor,
|
||||
AlmostBackground,
|
||||
|
@ -167,6 +167,7 @@ CVAR (Color, am_backcolor, 0x6c5440, CVAR_ARCHIVE);
|
|||
CVAR (Color, am_yourcolor, 0xfce8d8, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_wallcolor, 0x2c1808, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_secretwallcolor, 0x000000, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_specialwallcolor, 0xffffff, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_tswallcolor, 0x888888, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_fdwallcolor, 0x887058, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_cdwallcolor, 0x4c3820, CVAR_ARCHIVE);
|
||||
|
@ -177,6 +178,7 @@ CVAR (Color, am_notseencolor, 0x6c6c6c, CVAR_ARCHIVE);
|
|||
CVAR (Color, am_lockedcolor, 0x007800, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovyourcolor, 0xfce8d8, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovwallcolor, 0x00ff00, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovspecialwallcolor, 0xffffff, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovotherwallscolor, 0x008844, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovunseencolor, 0x00226e, CVAR_ARCHIVE);
|
||||
|
@ -188,6 +190,7 @@ CVAR (Color, am_ovsecretsectorcolor,0x00ffff, CVAR_ARCHIVE);
|
|||
CVAR (Int, am_map_secrets, 1, CVAR_ARCHIVE);
|
||||
CVAR (Bool, am_drawmapback, true, CVAR_ARCHIVE);
|
||||
CVAR (Bool, am_showkeys, true, CVAR_ARCHIVE);
|
||||
CVAR (Bool, am_showtriggerlines, false, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_thingcolor_monster, 0xfcfcfc, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_thingcolor_item, 0xfcfcfc, CVAR_ARCHIVE);
|
||||
|
@ -897,6 +900,7 @@ static void AM_initColors (bool overlayed)
|
|||
{
|
||||
YourColor.FromCVar (am_ovyourcolor);
|
||||
WallColor.FromCVar (am_ovwallcolor);
|
||||
SpecialWallColor.FromCVar(am_ovspecialwallcolor);
|
||||
SecretWallColor = WallColor;
|
||||
SecretSectorColor.FromCVar (am_ovsecretsectorcolor);
|
||||
ThingColor_Item.FromCVar (am_ovthingcolor_item);
|
||||
|
@ -919,6 +923,7 @@ static void AM_initColors (bool overlayed)
|
|||
Background.FromCVar (am_backcolor);
|
||||
YourColor.FromCVar (am_yourcolor);
|
||||
SecretWallColor.FromCVar (am_secretwallcolor);
|
||||
SpecialWallColor.FromCVar (am_specialwallcolor);
|
||||
WallColor.FromCVar (am_wallcolor);
|
||||
TSWallColor.FromCVar (am_tswallcolor);
|
||||
FDWallColor.FromCVar (am_fdwallcolor);
|
||||
|
@ -960,6 +965,7 @@ static void AM_initColors (bool overlayed)
|
|||
AlmostBackground = DoomColors[2];
|
||||
SecretSectorColor =
|
||||
SecretWallColor =
|
||||
SpecialWallColor =
|
||||
WallColor = DoomColors[3];
|
||||
TSWallColor = DoomColors[4];
|
||||
FDWallColor = DoomColors[5];
|
||||
|
@ -981,6 +987,7 @@ static void AM_initColors (bool overlayed)
|
|||
AlmostBackground = DoomColors[2];
|
||||
SecretSectorColor =
|
||||
SecretWallColor =
|
||||
SpecialWallColor =
|
||||
WallColor = StrifeColors[3];
|
||||
TSWallColor = StrifeColors[4];
|
||||
FDWallColor = StrifeColors[5];
|
||||
|
@ -1002,6 +1009,7 @@ static void AM_initColors (bool overlayed)
|
|||
AlmostBackground = DoomColors[2];
|
||||
SecretSectorColor =
|
||||
SecretWallColor =
|
||||
SpecialWallColor =
|
||||
WallColor = RavenColors[3];
|
||||
TSWallColor = RavenColors[4];
|
||||
FDWallColor = RavenColors[5];
|
||||
|
@ -1836,14 +1844,16 @@ void AM_drawWalls (bool allmap)
|
|||
else if (lines[i].special == Door_LockedRaise ||
|
||||
lines[i].special == ACS_LockedExecute ||
|
||||
lines[i].special == ACS_LockedExecuteDoor ||
|
||||
(lines[i].special == Generic_Door && lines[i].args[4] !=0 ))
|
||||
(lines[i].special == Door_Animated && lines[i].args[3] != 0) ||
|
||||
(lines[i].special == Generic_Door && lines[i].args[4] != 0))
|
||||
{
|
||||
if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors
|
||||
{
|
||||
int P_GetMapColorForLock(int lock);
|
||||
int lock;
|
||||
|
||||
if (lines[i].special==Door_LockedRaise) lock=lines[i].args[3];
|
||||
if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated)
|
||||
lock=lines[i].args[3];
|
||||
else lock=lines[i].args[4];
|
||||
|
||||
int color = P_GetMapColorForLock(lock);
|
||||
|
@ -1860,6 +1870,17 @@ void AM_drawWalls (bool allmap)
|
|||
AM_drawMline (&l, LockedColor); // locked special
|
||||
}
|
||||
}
|
||||
else if (am_showtriggerlines && am_colorset == 0 && lines[i].special != 0
|
||||
&& lines[i].special != Door_Open
|
||||
&& lines[i].special != Door_Close
|
||||
&& lines[i].special != Door_CloseWaitOpen
|
||||
&& lines[i].special != Door_Raise
|
||||
&& lines[i].special != Door_Animated
|
||||
&& lines[i].special != Generic_Door
|
||||
&& (lines[i].activation & SPAC_PlayerActivate))
|
||||
{
|
||||
AM_drawMline(&l, SpecialWallColor); // wall with special non-door action the player can do
|
||||
}
|
||||
else if (lines[i].backsector == NULL)
|
||||
{
|
||||
AM_drawMline(&l, WallColor); // one-sided wall
|
||||
|
|
|
@ -600,6 +600,11 @@ void FBaseCVar::EnableCallbacks ()
|
|||
}
|
||||
}
|
||||
|
||||
void FBaseCVar::DisableCallbacks ()
|
||||
{
|
||||
m_UseCallback = false;
|
||||
}
|
||||
|
||||
//
|
||||
// Boolean cvar implementation
|
||||
//
|
||||
|
|
|
@ -117,6 +117,7 @@ public:
|
|||
|
||||
static void EnableNoSet (); // enable the honoring of CVAR_NOSET
|
||||
static void EnableCallbacks ();
|
||||
static void DisableCallbacks ();
|
||||
static void ResetColors (); // recalc color cvars' indices after screen change
|
||||
|
||||
static void ListVars (const char *filter, bool plain);
|
||||
|
|
|
@ -2880,6 +2880,8 @@ void FinishDehPatch ()
|
|||
// Now that all Dehacked patches have been processed, it's okay to free StateMap.
|
||||
StateMap.Clear();
|
||||
StateMap.ShrinkToFit();
|
||||
TouchedActors.Clear();
|
||||
TouchedActors.ShrinkToFit();
|
||||
}
|
||||
|
||||
void ModifyDropAmount(AInventory *inv, int dropamount);
|
||||
|
|
580
src/d_main.cpp
580
src/d_main.cpp
|
@ -122,6 +122,7 @@ extern void M_SetDefaultMode ();
|
|||
extern void R_ExecuteSetViewSize ();
|
||||
extern void G_NewInit ();
|
||||
extern void SetupPlayerClasses ();
|
||||
extern void HUD_InitHud();
|
||||
const FIWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
@ -222,6 +223,8 @@ FTexture *Page;
|
|||
FTexture *Advisory;
|
||||
bool nospriterename;
|
||||
FStartupInfo DoomStartupInfo;
|
||||
FString lastIWAD;
|
||||
int restart = 0;
|
||||
|
||||
cycle_t FrameCycles;
|
||||
|
||||
|
@ -889,7 +892,7 @@ void D_Display ()
|
|||
//
|
||||
// D_ErrorCleanup ()
|
||||
//
|
||||
// Cleanup after a recoverable error.
|
||||
// Cleanup after a recoverable error or a restart
|
||||
//==========================================================================
|
||||
|
||||
void D_ErrorCleanup ()
|
||||
|
@ -2024,269 +2027,368 @@ void D_DoomMain (void)
|
|||
}
|
||||
FString basewad = wad;
|
||||
|
||||
// Load zdoom.pk3 alone so that we can get access to the internal gameinfos before
|
||||
// the IWAD is known.
|
||||
|
||||
GetCmdLineFiles(pwads);
|
||||
FString iwad = CheckGameInfo(pwads);
|
||||
// reinit from here
|
||||
|
||||
FIWadManager *iwad_man = new FIWadManager;
|
||||
const FIWADInfo *iwad_info = iwad_man->FindIWAD(allwads, iwad, basewad);
|
||||
gameinfo.gametype = iwad_info->gametype;
|
||||
gameinfo.flags = iwad_info->flags;
|
||||
gameinfo.ConfigName = iwad_info->Configname;
|
||||
|
||||
GameConfig->DoGameSetup (gameinfo.ConfigName);
|
||||
|
||||
AddAutoloadFiles(iwad_info->Autoname);
|
||||
|
||||
// Run automatically executed files
|
||||
execFiles = new DArgs;
|
||||
GameConfig->AddAutoexec (execFiles, gameinfo.ConfigName);
|
||||
D_MultiExec (execFiles, true);
|
||||
|
||||
// Run .cfg files at the start of the command line.
|
||||
execFiles = Args->GatherFiles ("-exec");
|
||||
D_MultiExec (execFiles, true);
|
||||
|
||||
C_ExecCmdLineParams (); // [RH] do all +set commands on the command line
|
||||
|
||||
CopyFiles(allwads, pwads);
|
||||
|
||||
// Since this function will never leave we must delete this array here manually.
|
||||
pwads.Clear();
|
||||
pwads.ShrinkToFit();
|
||||
|
||||
Printf ("W_Init: Init WADfiles.\n");
|
||||
Wads.InitMultipleFiles (allwads);
|
||||
allwads.Clear();
|
||||
allwads.ShrinkToFit();
|
||||
SetMapxxFlag();
|
||||
|
||||
// [RH] Initialize localizable strings.
|
||||
GStrings.LoadStrings (false);
|
||||
|
||||
V_InitFontColors ();
|
||||
|
||||
// [RH] Moved these up here so that we can do most of our
|
||||
// startup output in a fullscreen console.
|
||||
|
||||
CT_Init ();
|
||||
|
||||
Printf ("I_Init: Setting up machine state.\n");
|
||||
I_Init ();
|
||||
|
||||
Printf ("V_Init: allocate screen.\n");
|
||||
V_Init ();
|
||||
|
||||
// Base systems have been inited; enable cvar callbacks
|
||||
FBaseCVar::EnableCallbacks ();
|
||||
|
||||
Printf ("S_Init: Setting up sound.\n");
|
||||
S_Init ();
|
||||
|
||||
Printf ("ST_Init: Init startup screen.\n");
|
||||
StartScreen = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5);
|
||||
|
||||
ParseCompatibility();
|
||||
|
||||
CheckCmdLine();
|
||||
|
||||
// [RH] Load sound environments
|
||||
S_ParseReverbDef ();
|
||||
|
||||
// [RH] Parse through all loaded mapinfo lumps
|
||||
Printf ("G_ParseMapInfo: Load map definitions.\n");
|
||||
G_ParseMapInfo (iwad_info->MapInfo);
|
||||
ReadStatistics();
|
||||
|
||||
// [RH] Parse any SNDINFO lumps
|
||||
Printf ("S_InitData: Load sound definitions.\n");
|
||||
S_InitData ();
|
||||
|
||||
Printf ("Texman.Init: Init texture manager.\n");
|
||||
TexMan.Init();
|
||||
C_InitConback();
|
||||
|
||||
// [CW] Parse any TEAMINFO lumps.
|
||||
Printf ("ParseTeamInfo: Load team definitions.\n");
|
||||
TeamLibrary.ParseTeamInfo ();
|
||||
|
||||
FActorInfo::StaticInit ();
|
||||
|
||||
// [GRB] Initialize player class list
|
||||
SetupPlayerClasses ();
|
||||
|
||||
|
||||
// [RH] Load custom key and weapon settings from WADs
|
||||
D_LoadWadSettings ();
|
||||
|
||||
// [GRB] Check if someone used clearplayerclasses but not addplayerclass
|
||||
if (PlayerClasses.Size () == 0)
|
||||
do
|
||||
{
|
||||
I_FatalError ("No player classes defined");
|
||||
}
|
||||
|
||||
StartScreen->Progress ();
|
||||
|
||||
Printf ("R_Init: Init %s refresh subsystem.\n", gameinfo.ConfigName.GetChars());
|
||||
StartScreen->LoadingStatus ("Loading graphics", 0x3f);
|
||||
R_Init ();
|
||||
|
||||
Printf ("DecalLibrary: Load decals.\n");
|
||||
DecalLibrary.Clear ();
|
||||
DecalLibrary.ReadAllDecals ();
|
||||
|
||||
// [RH] Add any .deh and .bex files on the command line.
|
||||
// If there are none, try adding any in the config file.
|
||||
// Note that the command line overrides defaults from the config.
|
||||
|
||||
if ((ConsiderPatches("-deh") | ConsiderPatches("-bex")) == 0 &&
|
||||
gameinfo.gametype == GAME_Doom && GameConfig->SetSection ("Doom.DefaultDehacked"))
|
||||
{
|
||||
const char *key;
|
||||
const char *value;
|
||||
|
||||
while (GameConfig->NextInSection (key, value))
|
||||
if (restart)
|
||||
{
|
||||
if (stricmp (key, "Path") == 0 && FileExists (value))
|
||||
{
|
||||
Printf ("Applying patch %s\n", value);
|
||||
D_LoadDehFile(value);
|
||||
}
|
||||
C_InitConsole(SCREENWIDTH, SCREENHEIGHT, false);
|
||||
}
|
||||
}
|
||||
nospriterename = false;
|
||||
|
||||
// Load embedded Dehacked patches
|
||||
D_LoadDehLumps();
|
||||
// Load zdoom.pk3 alone so that we can get access to the internal gameinfos before
|
||||
// the IWAD is known.
|
||||
|
||||
// Create replacements for dehacked pickups
|
||||
FinishDehPatch();
|
||||
GetCmdLineFiles(pwads);
|
||||
FString iwad = CheckGameInfo(pwads);
|
||||
|
||||
FActorInfo::StaticSetActorNums ();
|
||||
// The IWAD selection dialogue dpes not show in fullscreen so if the
|
||||
// restart is initiated without a defined IWAD assume for now that it's not going to change.
|
||||
if (iwad.Len() == 0) iwad = lastIWAD;
|
||||
|
||||
//Added by MC:
|
||||
bglobal.getspawned.Clear();
|
||||
argcount = Args->CheckParmList("-bots", &args);
|
||||
for (p = 0; p < argcount; ++p)
|
||||
{
|
||||
bglobal.getspawned.Push(args[p]);
|
||||
}
|
||||
bglobal.spawn_tries = 0;
|
||||
bglobal.wanted_botnum = bglobal.getspawned.Size();
|
||||
FIWadManager *iwad_man = new FIWadManager;
|
||||
const FIWADInfo *iwad_info = iwad_man->FindIWAD(allwads, iwad, basewad);
|
||||
gameinfo.gametype = iwad_info->gametype;
|
||||
gameinfo.flags = iwad_info->flags;
|
||||
gameinfo.ConfigName = iwad_info->Configname;
|
||||
lastIWAD = iwad;
|
||||
|
||||
Printf ("M_Init: Init menus.\n");
|
||||
M_Init ();
|
||||
FBaseCVar::DisableCallbacks();
|
||||
GameConfig->DoGameSetup (gameinfo.ConfigName);
|
||||
|
||||
Printf ("P_Init: Init Playloop state.\n");
|
||||
StartScreen->LoadingStatus ("Init game engine", 0x3f);
|
||||
AM_StaticInit();
|
||||
P_Init ();
|
||||
AddAutoloadFiles(iwad_info->Autoname);
|
||||
|
||||
P_SetupWeapons_ntohton();
|
||||
// Run automatically executed files
|
||||
execFiles = new DArgs;
|
||||
GameConfig->AddAutoexec (execFiles, gameinfo.ConfigName);
|
||||
D_MultiExec (execFiles, true);
|
||||
|
||||
//SBarInfo support.
|
||||
SBarInfo::Load();
|
||||
// Run .cfg files at the start of the command line.
|
||||
execFiles = Args->GatherFiles ("-exec");
|
||||
D_MultiExec (execFiles, true);
|
||||
|
||||
// [RH] User-configurable startup strings. Because BOOM does.
|
||||
static const char *startupString[5] = {
|
||||
"STARTUP1", "STARTUP2", "STARTUP3", "STARTUP4", "STARTUP5"
|
||||
};
|
||||
for (p = 0; p < 5; ++p)
|
||||
{
|
||||
const char *str = GStrings[startupString[p]];
|
||||
if (str != NULL && str[0] != '\0')
|
||||
{
|
||||
Printf ("%s\n", str);
|
||||
}
|
||||
}
|
||||
C_ExecCmdLineParams (); // [RH] do all +set commands on the command line
|
||||
|
||||
Printf ("D_CheckNetGame: Checking network game status.\n");
|
||||
StartScreen->LoadingStatus ("Checking network game status.", 0x3f);
|
||||
D_CheckNetGame ();
|
||||
CopyFiles(allwads, pwads);
|
||||
|
||||
// [RH] Lock any cvars that should be locked now that we're
|
||||
// about to begin the game.
|
||||
FBaseCVar::EnableNoSet ();
|
||||
// Since this function will never leave we must delete this array here manually.
|
||||
pwads.Clear();
|
||||
pwads.ShrinkToFit();
|
||||
|
||||
delete iwad_man; // now we won't need this anymore
|
||||
|
||||
// [RH] Run any saved commands from the command line or autoexec.cfg now.
|
||||
gamestate = GS_FULLCONSOLE;
|
||||
Net_NewMakeTic ();
|
||||
DThinker::RunThinkers ();
|
||||
gamestate = GS_STARTUP;
|
||||
|
||||
// start the apropriate game based on parms
|
||||
v = Args->CheckValue ("-record");
|
||||
|
||||
if (v)
|
||||
{
|
||||
G_RecordDemo (v);
|
||||
autostart = true;
|
||||
}
|
||||
|
||||
delete StartScreen;
|
||||
StartScreen = NULL;
|
||||
|
||||
if (Args->CheckParm("-norun"))
|
||||
{
|
||||
throw CNoRunExit();
|
||||
}
|
||||
|
||||
V_Init2();
|
||||
|
||||
v = Args->CheckValue("-playdemo");
|
||||
if (v != NULL)
|
||||
{
|
||||
singledemo = true; // quit after one demo
|
||||
G_DeferedPlayDemo (v);
|
||||
D_DoomLoop (); // never returns
|
||||
}
|
||||
|
||||
v = Args->CheckValue ("-timedemo");
|
||||
if (v)
|
||||
{
|
||||
G_TimeDemo (v);
|
||||
D_DoomLoop (); // never returns
|
||||
}
|
||||
Printf ("W_Init: Init WADfiles.\n");
|
||||
Wads.InitMultipleFiles (allwads);
|
||||
allwads.Clear();
|
||||
allwads.ShrinkToFit();
|
||||
SetMapxxFlag();
|
||||
|
||||
v = Args->CheckValue ("-loadgame");
|
||||
if (v)
|
||||
{
|
||||
FString file(v);
|
||||
FixPathSeperator (file);
|
||||
DefaultExtension (file, ".zds");
|
||||
G_LoadGame (file);
|
||||
}
|
||||
// [RH] Initialize localizable strings.
|
||||
GStrings.LoadStrings (false);
|
||||
|
||||
if (gameaction != ga_loadgame)
|
||||
{
|
||||
if (autostart || netgame)
|
||||
V_InitFontColors ();
|
||||
|
||||
// [RH] Moved these up here so that we can do most of our
|
||||
// startup output in a fullscreen console.
|
||||
|
||||
CT_Init ();
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
// Do not do any screenwipes when autostarting a game.
|
||||
if (!Args->CheckParm("-warpwipe"))
|
||||
Printf ("I_Init: Setting up machine state.\n");
|
||||
I_Init ();
|
||||
}
|
||||
|
||||
Printf ("V_Init: allocate screen.\n");
|
||||
V_Init (!!restart);
|
||||
|
||||
// Base systems have been inited; enable cvar callbacks
|
||||
FBaseCVar::EnableCallbacks ();
|
||||
|
||||
Printf ("S_Init: Setting up sound.\n");
|
||||
S_Init ();
|
||||
|
||||
Printf ("ST_Init: Init startup screen.\n");
|
||||
if (!restart) StartScreen = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5);
|
||||
else StartScreen = new FStartupScreen(0);
|
||||
|
||||
ParseCompatibility();
|
||||
|
||||
CheckCmdLine();
|
||||
|
||||
// [RH] Load sound environments
|
||||
S_ParseReverbDef ();
|
||||
|
||||
// [RH] Parse through all loaded mapinfo lumps
|
||||
Printf ("G_ParseMapInfo: Load map definitions.\n");
|
||||
G_ParseMapInfo (iwad_info->MapInfo);
|
||||
ReadStatistics();
|
||||
|
||||
// [RH] Parse any SNDINFO lumps
|
||||
Printf ("S_InitData: Load sound definitions.\n");
|
||||
S_InitData ();
|
||||
|
||||
Printf ("Texman.Init: Init texture manager.\n");
|
||||
TexMan.Init();
|
||||
C_InitConback();
|
||||
|
||||
// [CW] Parse any TEAMINFO lumps.
|
||||
Printf ("ParseTeamInfo: Load team definitions.\n");
|
||||
TeamLibrary.ParseTeamInfo ();
|
||||
|
||||
FActorInfo::StaticInit ();
|
||||
|
||||
// [GRB] Initialize player class list
|
||||
SetupPlayerClasses ();
|
||||
|
||||
|
||||
// [RH] Load custom key and weapon settings from WADs
|
||||
D_LoadWadSettings ();
|
||||
|
||||
// [GRB] Check if someone used clearplayerclasses but not addplayerclass
|
||||
if (PlayerClasses.Size () == 0)
|
||||
{
|
||||
I_FatalError ("No player classes defined");
|
||||
}
|
||||
|
||||
StartScreen->Progress ();
|
||||
|
||||
Printf ("R_Init: Init %s refresh subsystem.\n", gameinfo.ConfigName.GetChars());
|
||||
StartScreen->LoadingStatus ("Loading graphics", 0x3f);
|
||||
R_Init ();
|
||||
|
||||
Printf ("DecalLibrary: Load decals.\n");
|
||||
DecalLibrary.ReadAllDecals ();
|
||||
|
||||
// [RH] Add any .deh and .bex files on the command line.
|
||||
// If there are none, try adding any in the config file.
|
||||
// Note that the command line overrides defaults from the config.
|
||||
|
||||
if ((ConsiderPatches("-deh") | ConsiderPatches("-bex")) == 0 &&
|
||||
gameinfo.gametype == GAME_Doom && GameConfig->SetSection ("Doom.DefaultDehacked"))
|
||||
{
|
||||
const char *key;
|
||||
const char *value;
|
||||
|
||||
while (GameConfig->NextInSection (key, value))
|
||||
{
|
||||
NoWipe = TICRATE;
|
||||
if (stricmp (key, "Path") == 0 && FileExists (value))
|
||||
{
|
||||
Printf ("Applying patch %s\n", value);
|
||||
D_LoadDehFile(value);
|
||||
}
|
||||
}
|
||||
CheckWarpTransMap (startmap, true);
|
||||
if (demorecording)
|
||||
G_BeginRecording (startmap);
|
||||
G_InitNew (startmap, false);
|
||||
}
|
||||
|
||||
// Load embedded Dehacked patches
|
||||
D_LoadDehLumps();
|
||||
|
||||
// Create replacements for dehacked pickups
|
||||
FinishDehPatch();
|
||||
|
||||
FActorInfo::StaticSetActorNums ();
|
||||
|
||||
//Added by MC:
|
||||
bglobal.getspawned.Clear();
|
||||
argcount = Args->CheckParmList("-bots", &args);
|
||||
for (p = 0; p < argcount; ++p)
|
||||
{
|
||||
bglobal.getspawned.Push(args[p]);
|
||||
}
|
||||
bglobal.spawn_tries = 0;
|
||||
bglobal.wanted_botnum = bglobal.getspawned.Size();
|
||||
|
||||
Printf ("M_Init: Init menus.\n");
|
||||
M_Init ();
|
||||
|
||||
Printf ("P_Init: Init Playloop state.\n");
|
||||
StartScreen->LoadingStatus ("Init game engine", 0x3f);
|
||||
AM_StaticInit();
|
||||
P_Init ();
|
||||
|
||||
P_SetupWeapons_ntohton();
|
||||
|
||||
//SBarInfo support.
|
||||
SBarInfo::Load();
|
||||
HUD_InitHud();
|
||||
|
||||
// [RH] User-configurable startup strings. Because BOOM does.
|
||||
static const char *startupString[5] = {
|
||||
"STARTUP1", "STARTUP2", "STARTUP3", "STARTUP4", "STARTUP5"
|
||||
};
|
||||
for (p = 0; p < 5; ++p)
|
||||
{
|
||||
const char *str = GStrings[startupString[p]];
|
||||
if (str != NULL && str[0] != '\0')
|
||||
{
|
||||
Printf ("%s\n", str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
Printf ("D_CheckNetGame: Checking network game status.\n");
|
||||
StartScreen->LoadingStatus ("Checking network game status.", 0x3f);
|
||||
D_CheckNetGame ();
|
||||
}
|
||||
|
||||
// [RH] Lock any cvars that should be locked now that we're
|
||||
// about to begin the game.
|
||||
FBaseCVar::EnableNoSet ();
|
||||
|
||||
delete iwad_man; // now we won't need this anymore
|
||||
|
||||
// [RH] Run any saved commands from the command line or autoexec.cfg now.
|
||||
gamestate = GS_FULLCONSOLE;
|
||||
Net_NewMakeTic ();
|
||||
DThinker::RunThinkers ();
|
||||
gamestate = GS_STARTUP;
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
// start the apropriate game based on parms
|
||||
v = Args->CheckValue ("-record");
|
||||
|
||||
if (v)
|
||||
{
|
||||
G_RecordDemo (v);
|
||||
autostart = true;
|
||||
}
|
||||
|
||||
delete StartScreen;
|
||||
StartScreen = NULL;
|
||||
|
||||
if (Args->CheckParm("-norun"))
|
||||
{
|
||||
throw CNoRunExit();
|
||||
}
|
||||
|
||||
V_Init2();
|
||||
|
||||
v = Args->CheckValue("-playdemo");
|
||||
if (v != NULL)
|
||||
{
|
||||
singledemo = true; // quit after one demo
|
||||
G_DeferedPlayDemo (v);
|
||||
D_DoomLoop (); // never returns
|
||||
}
|
||||
|
||||
v = Args->CheckValue ("-timedemo");
|
||||
if (v)
|
||||
{
|
||||
G_TimeDemo (v);
|
||||
D_DoomLoop (); // never returns
|
||||
}
|
||||
|
||||
v = Args->CheckValue ("-loadgame");
|
||||
if (v)
|
||||
{
|
||||
FString file(v);
|
||||
FixPathSeperator (file);
|
||||
DefaultExtension (file, ".zds");
|
||||
G_LoadGame (file);
|
||||
}
|
||||
|
||||
if (gameaction != ga_loadgame)
|
||||
{
|
||||
if (autostart || netgame)
|
||||
{
|
||||
// Do not do any screenwipes when autostarting a game.
|
||||
if (!Args->CheckParm("-warpwipe"))
|
||||
{
|
||||
NoWipe = TICRATE;
|
||||
}
|
||||
CheckWarpTransMap (startmap, true);
|
||||
if (demorecording)
|
||||
G_BeginRecording (startmap);
|
||||
G_InitNew (startmap, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
D_StartTitle (); // start up intro loop
|
||||
}
|
||||
}
|
||||
else if (demorecording)
|
||||
{
|
||||
G_BeginRecording (NULL);
|
||||
}
|
||||
|
||||
atterm (D_QuitNetGame); // killough
|
||||
}
|
||||
else
|
||||
{
|
||||
// These calls from inside V_Init2 are still necessary
|
||||
C_NewModeAdjust();
|
||||
M_InitVideoModesMenu();
|
||||
D_StartTitle (); // start up intro loop
|
||||
setmodeneeded = false; // This may be set to true here, but isn't needed for a restart
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
D_DoomLoop (); // never returns
|
||||
}
|
||||
catch (CRestartException &ex)
|
||||
{
|
||||
// Music and sound should be stopped first
|
||||
S_StopMusic(true);
|
||||
S_StopAllChannels ();
|
||||
|
||||
// clean up game state
|
||||
ST_Clear();
|
||||
D_ErrorCleanup ();
|
||||
P_FreeLevelData();
|
||||
P_FreeExtraLevelData();
|
||||
|
||||
M_SaveDefaults(NULL); // save config before the restart
|
||||
|
||||
// delete all data that cannot be left until reinitialization
|
||||
V_ClearFonts(); // must clear global font pointers
|
||||
R_DeinitTranslationTables(); // some tables are initialized from outside the translation code.
|
||||
gameinfo.~gameinfo_t();
|
||||
new (&gameinfo) gameinfo_t; // Reset gameinfo
|
||||
S_Shutdown(); // free all channels and delete playlist
|
||||
C_ClearAliases(); // CCMDs won't be reinitialized so these need to be deleted here
|
||||
|
||||
GC::FullGC(); // perform one final garbage collection before deleting the class data
|
||||
PClass::ClearRuntimeData(); // clear all runtime generated class data
|
||||
restart++;
|
||||
}
|
||||
}
|
||||
else if (demorecording)
|
||||
{
|
||||
G_BeginRecording (NULL);
|
||||
}
|
||||
|
||||
atterm (D_QuitNetGame); // killough
|
||||
while (1);
|
||||
}
|
||||
|
||||
D_DoomLoop (); // never returns
|
||||
//==========================================================================
|
||||
//
|
||||
// restart the game
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
CCMD(restart)
|
||||
{
|
||||
// remove command line args that would get in the way during restart
|
||||
Args->RemoveArgs("-iwad");
|
||||
Args->RemoveArgs("-deh");
|
||||
Args->RemoveArgs("-bex");
|
||||
Args->RemoveArgs("-playdemo");
|
||||
Args->RemoveArgs("-file");
|
||||
Args->RemoveArgs("-altdeath");
|
||||
Args->RemoveArgs("-deathmatch");
|
||||
Args->RemoveArgs("-skill");
|
||||
Args->RemoveArgs("-savedir");
|
||||
Args->RemoveArgs("-xlat");
|
||||
Args->RemoveArgs("-oldsprites");
|
||||
|
||||
if (argv.argc() > 1)
|
||||
{
|
||||
for(int i=1;i<argv.argc(); i++)
|
||||
{
|
||||
Args->AppendArg(argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// initiate the restart
|
||||
throw CRestartException();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -2336,6 +2438,14 @@ void FStartupScreen::AppendStatusLine(const char *status)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
void FStartupScreen::Progress(void) {}
|
||||
void FStartupScreen::NetInit(char const *,int) {}
|
||||
void FStartupScreen::NetProgress(int) {}
|
||||
void FStartupScreen::NetMessage(char const *,...) {}
|
||||
void FStartupScreen::NetDone(void) {}
|
||||
bool FStartupScreen::NetLoop(bool (*)(void *),void *) { return false; }
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// STAT fps
|
||||
|
|
|
@ -36,6 +36,12 @@ struct event_t;
|
|||
// calls all startup code, parses command line options.
|
||||
// If not overrided by user input, calls N_AdvanceDemo.
|
||||
//
|
||||
|
||||
struct CRestartException
|
||||
{
|
||||
char dummy;
|
||||
};
|
||||
|
||||
void D_DoomMain (void);
|
||||
|
||||
|
||||
|
|
|
@ -80,6 +80,24 @@ void PClass::StaticInit ()
|
|||
}
|
||||
}
|
||||
|
||||
void PClass::ClearRuntimeData ()
|
||||
{
|
||||
StaticShutdown();
|
||||
|
||||
m_RuntimeActors.Clear();
|
||||
m_Types.Clear();
|
||||
memset(TypeHash, 0, sizeof(TypeHash));
|
||||
bShutdown = false;
|
||||
|
||||
// Immediately reinitialize the internal classes
|
||||
FAutoSegIterator probe(CRegHead, CRegTail);
|
||||
|
||||
while (*++probe != NULL)
|
||||
{
|
||||
((ClassReg *)*probe)->RegisterClass ();
|
||||
}
|
||||
}
|
||||
|
||||
void PClass::StaticShutdown ()
|
||||
{
|
||||
TArray<size_t *> uniqueFPs(64);
|
||||
|
@ -105,6 +123,8 @@ void PClass::StaticShutdown ()
|
|||
uniqueFPs.Push(const_cast<size_t *>(type->FlatPointers));
|
||||
}
|
||||
}
|
||||
type->FlatPointers = NULL;
|
||||
|
||||
// For runtime classes, this call will also delete the PClass.
|
||||
PClass::StaticFreeData (type);
|
||||
}
|
||||
|
|
|
@ -125,6 +125,7 @@ struct PClass
|
|||
static void StaticInit ();
|
||||
static void StaticShutdown ();
|
||||
static void StaticFreeData (PClass *type);
|
||||
static void ClearRuntimeData();
|
||||
|
||||
// Per-class information -------------------------------------
|
||||
FName TypeName; // this class's name
|
||||
|
|
|
@ -2573,6 +2573,7 @@ bool G_CheckDemoStatus (void)
|
|||
|
||||
C_RestoreCVars (); // [RH] Restore cvars demo might have changed
|
||||
M_Free (demobuffer);
|
||||
demobuffer = NULL;
|
||||
|
||||
P_SetupWeapons_ntohton();
|
||||
demoplayback = false;
|
||||
|
|
|
@ -383,6 +383,7 @@ DBaseStatusBar *CreateCustomStatusBar(int script=0);
|
|||
|
||||
void ST_FormatMapName(FString &mapname, const char *mapnamecolor = "");
|
||||
void ST_LoadCrosshair(bool alwaysload=false);
|
||||
void ST_Clear();
|
||||
extern FTexture *CrosshairImage;
|
||||
|
||||
#endif /* __SBAR_H__ */
|
||||
|
|
|
@ -423,6 +423,8 @@ static void FreeSBarInfoScript()
|
|||
|
||||
void SBarInfo::Load()
|
||||
{
|
||||
FreeSBarInfoScript();
|
||||
MugShotStates.Clear();
|
||||
if(gameinfo.statusbar.IsNotEmpty())
|
||||
{
|
||||
int lump = Wads.CheckNumForFullName(gameinfo.statusbar, true);
|
||||
|
|
|
@ -769,14 +769,11 @@ static void DrawCoordinates(player_t * CPlayer)
|
|||
// draw the overlay
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void HUD_InitHud();
|
||||
|
||||
void DrawHUD()
|
||||
{
|
||||
player_t * CPlayer = StatusBar->CPlayer;
|
||||
|
||||
if (HudFont==NULL) HUD_InitHud();
|
||||
|
||||
players[consoleplayer].inventorytics = 0;
|
||||
if (hud_althudscale && SCREENWIDTH>640)
|
||||
{
|
||||
|
|
|
@ -197,6 +197,23 @@ void ST_LoadCrosshair(bool alwaysload)
|
|||
CrosshairImage = TexMan[TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch)];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// ST_Clear
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void ST_Clear()
|
||||
{
|
||||
if (StatusBar != NULL)
|
||||
{
|
||||
StatusBar->Destroy();
|
||||
StatusBar = NULL;
|
||||
}
|
||||
CrosshairImage = NULL;
|
||||
CrosshairNum = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Constructor
|
||||
|
@ -236,6 +253,7 @@ void DBaseStatusBar::Destroy ()
|
|||
msg->Destroy();
|
||||
msg = next;
|
||||
}
|
||||
Messages = NULL;
|
||||
Super::Destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -110,8 +110,11 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
|
|||
{
|
||||
texname = GStrings[texname+1];
|
||||
}
|
||||
mBackground = TexMan.CheckForTexture(texname, FTexture::TEX_MiscPatch);
|
||||
mFlatfill = desc->mFlatfill;
|
||||
if (texname[0] != 0)
|
||||
{
|
||||
mBackground = TexMan.CheckForTexture(texname, FTexture::TEX_MiscPatch);
|
||||
mFlatfill = desc->mFlatfill;
|
||||
}
|
||||
S_Sound (CHAN_VOICE | CHAN_UI, desc->mSound, 1.0f, ATTN_NONE);
|
||||
if (desc->mPalette.IsNotEmpty() && (lumpnum = Wads.CheckNumForFullName(desc->mPalette, true)) > 0)
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ void DeinitIntermissions()
|
|||
delete pair->Value;
|
||||
pair->Value = NULL;
|
||||
}
|
||||
IntermissionDescriptors.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -833,7 +834,15 @@ void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int
|
|||
textscreen->mText << '$' << text;
|
||||
}
|
||||
textscreen->mTextDelay = 10;
|
||||
textscreen->mBackground = flat;
|
||||
if (flat != NULL && *flat != 0)
|
||||
{
|
||||
textscreen->mBackground = flat;
|
||||
}
|
||||
else
|
||||
{
|
||||
// force a black screen if no texture is set.
|
||||
textscreen->mBackground = "-";
|
||||
}
|
||||
textscreen->mFlatfill = !finalePic;
|
||||
|
||||
if (music != NULL && *music != 0)
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "w_wad.h"
|
||||
|
||||
TArray<FKeySection> KeySections;
|
||||
extern TArray<FString> KeyConfWeapons;
|
||||
|
||||
static void LoadKeys (const char *modname, bool dbl)
|
||||
{
|
||||
|
@ -159,6 +160,7 @@ void D_LoadWadSettings ()
|
|||
|
||||
ParsingKeyConf = true;
|
||||
KeySections.Clear();
|
||||
KeyConfWeapons.Clear();
|
||||
|
||||
while ((lump = Wads.FindLump ("KEYCONF", &lastlump)) != -1)
|
||||
{
|
||||
|
|
|
@ -230,6 +230,26 @@ FString DArgs::TakeValue(const char *check)
|
|||
return out;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// DArgs :: RemoveArg
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void DArgs::RemoveArgs(const char *check)
|
||||
{
|
||||
int i = CheckParm(check);
|
||||
|
||||
if (i > 0 && i < (int)Argv.Size() - 1)
|
||||
{
|
||||
do
|
||||
{
|
||||
RemoveArg(i);
|
||||
}
|
||||
while (Argv[i][0] != '+' && Argv[i][0] != '-' && i < (int)Argv.Size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// DArgs :: GetArg
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
void AppendArg(FString arg);
|
||||
void AppendArgs(int argc, const FString *argv);
|
||||
void RemoveArg(int argindex);
|
||||
void RemoveArgs(const char *check);
|
||||
void SetArgs(int argc, char **argv);
|
||||
void CollectFiles(const char *param, const char *extension);
|
||||
DArgs *GatherFiles(const char *param) const;
|
||||
|
|
|
@ -53,9 +53,10 @@
|
|||
class DLoadSaveMenu : public DListMenu
|
||||
{
|
||||
DECLARE_CLASS(DLoadSaveMenu, DListMenu)
|
||||
friend void ClearSaveGames();
|
||||
|
||||
protected:
|
||||
static TDeletingArray<FSaveGameNode*> SaveGames;
|
||||
static TArray<FSaveGameNode*> SaveGames;
|
||||
static int LastSaved;
|
||||
static int LastAccessed;
|
||||
|
||||
|
@ -114,7 +115,7 @@ public:
|
|||
|
||||
IMPLEMENT_CLASS(DLoadSaveMenu)
|
||||
|
||||
TDeletingArray<FSaveGameNode*> DLoadSaveMenu::SaveGames;
|
||||
TArray<FSaveGameNode*> DLoadSaveMenu::SaveGames;
|
||||
int DLoadSaveMenu::LastSaved = -1;
|
||||
int DLoadSaveMenu::LastAccessed = -1;
|
||||
|
||||
|
@ -126,6 +127,21 @@ FSaveGameNode *quickSaveSlot;
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void ClearSaveGames()
|
||||
{
|
||||
for(unsigned i=0;i<DLoadSaveMenu::SaveGames.Size(); i++)
|
||||
{
|
||||
delete DLoadSaveMenu::SaveGames[i];
|
||||
}
|
||||
DLoadSaveMenu::SaveGames.Clear();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Save data maintenance (stored statically)
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
int DLoadSaveMenu::RemoveSaveSlot (int index)
|
||||
{
|
||||
FSaveGameNode *file = SaveGames[index];
|
||||
|
@ -194,6 +210,8 @@ void DLoadSaveMenu::ReadSaveStrings ()
|
|||
findstate_t c_file;
|
||||
FString filter;
|
||||
|
||||
LastSaved = LastAccessed = -1;
|
||||
quickSaveSlot = NULL;
|
||||
filter = G_BuildSaveName ("*.zds", -1);
|
||||
filefirst = I_FindFirst (filter.GetChars(), &c_file);
|
||||
if (filefirst != ((void *)(-1)))
|
||||
|
|
|
@ -111,6 +111,22 @@ struct FListMenuDescriptor : public FMenuDescriptor
|
|||
const PClass *mClass;
|
||||
FMenuDescriptor *mRedirect; // used to redirect overlong skill and episode menus to option menu based alternatives
|
||||
bool mCenter;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
// Reset the default settings (ignore all other values in the struct)
|
||||
mSelectOfsX = 0;
|
||||
mSelectOfsY = 0;
|
||||
mSelector.SetInvalid();
|
||||
mDisplayTop = 0;
|
||||
mXpos = 0;
|
||||
mYpos = 0;
|
||||
mLinespacing = 0;
|
||||
mNetgameMessage = "";
|
||||
mFont = NULL;
|
||||
mFontColor = CR_UNTRANSLATED;
|
||||
mFontColor2 = CR_UNTRANSLATED;
|
||||
}
|
||||
};
|
||||
|
||||
struct FOptionMenuSettings
|
||||
|
@ -141,6 +157,14 @@ struct FOptionMenuDescriptor : public FMenuDescriptor
|
|||
|
||||
void CalcIndent();
|
||||
FOptionMenuItem *GetItem(FName name);
|
||||
void Reset()
|
||||
{
|
||||
// Reset the default settings (ignore all other values in the struct)
|
||||
mPosition = 0;
|
||||
mScrollTop = 0;
|
||||
mIndent = 0;
|
||||
mDontDim = 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
|
||||
#include "optionmenuitems.h"
|
||||
|
||||
void ClearSaveGames();
|
||||
|
||||
MenuDescriptorList MenuDescriptors;
|
||||
static FListMenuDescriptor DefaultListMenuSettings; // contains common settings for all list menus
|
||||
static FOptionMenuDescriptor DefaultOptionMenuSettings; // contains common settings for all Option menus
|
||||
|
@ -83,7 +85,11 @@ static void DeinitMenus()
|
|||
pair->Value = NULL;
|
||||
}
|
||||
}
|
||||
MenuDescriptors.Clear();
|
||||
OptionValues.Clear();
|
||||
DMenu::CurrentMenu = NULL;
|
||||
DefaultListMenuSettings.mItems.Clear();
|
||||
ClearSaveGames();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -825,8 +831,11 @@ void M_ParseMenuDefs()
|
|||
OptionSettings.mFontColorHeader = V_FindFontColor(gameinfo.mFontColorHeader);
|
||||
OptionSettings.mFontColorHighlight = V_FindFontColor(gameinfo.mFontColorHighlight);
|
||||
OptionSettings.mFontColorSelection = V_FindFontColor(gameinfo.mFontColorSelection);
|
||||
DefaultListMenuSettings.Reset();
|
||||
DefaultOptionMenuSettings.Reset();
|
||||
|
||||
atterm( DeinitMenus);
|
||||
DeinitMenus();
|
||||
while ((lump = Wads.FindLump ("MENUDEF", &lastlump)) != -1)
|
||||
{
|
||||
FScanner sc(lump);
|
||||
|
@ -841,6 +850,10 @@ void M_ParseMenuDefs()
|
|||
else if (sc.Compare("DEFAULTLISTMENU"))
|
||||
{
|
||||
ParseListMenuBody(sc, &DefaultListMenuSettings);
|
||||
if (DefaultListMenuSettings.mItems.Size() > 0)
|
||||
{
|
||||
I_FatalError("You cannot add menu items to the menu default settings.");
|
||||
}
|
||||
}
|
||||
else if (sc.Compare("OPTIONVALUE"))
|
||||
{
|
||||
|
@ -861,6 +874,10 @@ void M_ParseMenuDefs()
|
|||
else if (sc.Compare("DEFAULTOPTIONMENU"))
|
||||
{
|
||||
ParseOptionMenuBody(sc, &DefaultOptionMenuSettings);
|
||||
if (DefaultOptionMenuSettings.mItems.Size() > 0)
|
||||
{
|
||||
I_FatalError("You cannot add menu items to the menu default settings.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1221,10 +1238,11 @@ void M_CreateMenus()
|
|||
// THe skill menu must be refeshed each time it starts up
|
||||
//
|
||||
//=============================================================================
|
||||
extern int restart;
|
||||
|
||||
void M_StartupSkillMenu(FGameStartup *gs)
|
||||
{
|
||||
static bool done = false;
|
||||
static int done = -1;
|
||||
bool success = false;
|
||||
FMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_Skillmenu);
|
||||
if (desc != NULL)
|
||||
|
@ -1250,9 +1268,9 @@ void M_StartupSkillMenu(FGameStartup *gs)
|
|||
}
|
||||
}
|
||||
|
||||
if (!done)
|
||||
if (done != restart)
|
||||
{
|
||||
done = true;
|
||||
done = restart;
|
||||
int defskill = DefaultSkill;
|
||||
if ((unsigned int)defskill >= AllSkills.Size())
|
||||
{
|
||||
|
|
|
@ -1822,6 +1822,7 @@ void P_SetLineID (line_t *ld)
|
|||
{
|
||||
ld->id = ld->args[0];
|
||||
}
|
||||
ld->special = 0;
|
||||
break;
|
||||
|
||||
case TranslucentLine:
|
||||
|
@ -4144,11 +4145,7 @@ static void P_Shutdown ()
|
|||
P_DeinitKeyMessages ();
|
||||
P_FreeLevelData ();
|
||||
P_FreeExtraLevelData ();
|
||||
if (StatusBar != NULL)
|
||||
{
|
||||
StatusBar->Destroy();
|
||||
StatusBar = NULL;
|
||||
}
|
||||
ST_Clear();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -133,6 +133,7 @@ void SetupPlayerClasses ()
|
|||
{
|
||||
FPlayerClass newclass;
|
||||
|
||||
PlayerClasses.Clear();
|
||||
for (unsigned i=0; i<gameinfo.PlayerClasses.Size(); i++)
|
||||
{
|
||||
newclass.Flags = 0;
|
||||
|
|
|
@ -127,6 +127,22 @@ void R_SetDefaultColormap (const char *name)
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// R_DeinitColormaps
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void R_DeinitColormaps ()
|
||||
{
|
||||
fakecmaps.Clear();
|
||||
if (realcolormaps != NULL)
|
||||
{
|
||||
delete[] realcolormaps;
|
||||
realcolormaps = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// R_InitColormaps
|
||||
|
@ -141,6 +157,8 @@ void R_InitColormaps ()
|
|||
|
||||
FakeCmap cm;
|
||||
|
||||
R_DeinitColormaps();
|
||||
|
||||
cm.name[0] = 0;
|
||||
cm.blend = 0;
|
||||
fakecmaps.Push(cm);
|
||||
|
@ -215,21 +233,6 @@ void R_InitColormaps ()
|
|||
numfakecmaps = fakecmaps.Size();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// R_DeinitColormaps
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void R_DeinitColormaps ()
|
||||
{
|
||||
if (realcolormaps != NULL)
|
||||
{
|
||||
delete[] realcolormaps;
|
||||
realcolormaps = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// [RH] Returns an index into realcolormaps. Multiply it by
|
||||
|
|
|
@ -866,7 +866,10 @@ void R_InitSprites ()
|
|||
numskins++;
|
||||
}
|
||||
|
||||
SpriteFrames.Clear();
|
||||
|
||||
// [RH] Do some preliminary setup
|
||||
if (skins != NULL) delete [] skins;
|
||||
skins = new FPlayerSkin[numskins];
|
||||
memset (skins, 0, sizeof(*skins) * numskins);
|
||||
for (i = 0; i < numskins; i++)
|
||||
|
|
|
@ -869,7 +869,9 @@ void R_DeinitTranslationTables()
|
|||
translationtables[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
translationtables[i].Clear();
|
||||
}
|
||||
BloodTranslationColors.Clear();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -587,6 +587,7 @@ void S_ParseReverbDef ()
|
|||
int lump, lastlump = 0;
|
||||
|
||||
atterm (S_UnloadReverbDef);
|
||||
S_UnloadReverbDef ();
|
||||
|
||||
while ((lump = Wads.FindLump ("REVERBS", &lastlump)) != -1)
|
||||
{
|
||||
|
@ -597,15 +598,21 @@ void S_ParseReverbDef ()
|
|||
void S_UnloadReverbDef ()
|
||||
{
|
||||
ReverbContainer *probe = Environments;
|
||||
ReverbContainer **pNext = NULL;
|
||||
|
||||
while (probe != NULL)
|
||||
{
|
||||
ReverbContainer *next = probe->Next;
|
||||
if (!probe->Builtin)
|
||||
{
|
||||
if (pNext != NULL) *pNext = probe->Next;
|
||||
delete[] const_cast<char *>(probe->Name);
|
||||
delete probe;
|
||||
}
|
||||
else
|
||||
{
|
||||
pNext = &probe->Next;
|
||||
}
|
||||
probe = next;
|
||||
}
|
||||
Environments = &Off;
|
||||
|
|
|
@ -502,6 +502,24 @@ static void AssignHexenTranslations (void)
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// S_ClearSndSeq
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void S_ClearSndSeq()
|
||||
{
|
||||
for (unsigned int i = 0; i < Sequences.Size(); i++)
|
||||
{
|
||||
if (Sequences[i])
|
||||
{
|
||||
M_Free(Sequences[i]);
|
||||
}
|
||||
}
|
||||
Sequences.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// S_ParseSndSeq
|
||||
|
@ -523,14 +541,7 @@ void S_ParseSndSeq (int levellump)
|
|||
|
||||
// First free the old SNDSEQ data. This allows us to reload this for each level
|
||||
// and specify a level specific SNDSEQ lump!
|
||||
for (unsigned int i = 0; i < Sequences.Size(); i++)
|
||||
{
|
||||
if (Sequences[i])
|
||||
{
|
||||
M_Free(Sequences[i]);
|
||||
}
|
||||
}
|
||||
Sequences.Clear();
|
||||
S_ClearSndSeq();
|
||||
|
||||
// be gone, compiler warnings
|
||||
stopsound = 0;
|
||||
|
|
|
@ -292,6 +292,7 @@ void S_Init ()
|
|||
if (S_SoundCurve != NULL)
|
||||
{
|
||||
delete[] S_SoundCurve;
|
||||
S_SoundCurve = NULL;
|
||||
}
|
||||
|
||||
// Heretic and Hexen have sound curve lookup tables. Doom does not.
|
||||
|
|
|
@ -42,15 +42,15 @@ public:
|
|||
FStartupScreen(int max_progress);
|
||||
virtual ~FStartupScreen();
|
||||
|
||||
virtual void Progress() = 0;
|
||||
virtual void Progress();
|
||||
virtual void LoadingStatus(const char *message, int colors); // Used by Heretic only
|
||||
virtual void AppendStatusLine(const char *status); // Used by Heretic only
|
||||
|
||||
virtual void NetInit(const char *message, int num_players) = 0;
|
||||
virtual void NetProgress(int count) = 0;
|
||||
virtual void NetMessage(const char *format, ...) = 0; // cover for printf
|
||||
virtual void NetDone() = 0;
|
||||
virtual bool NetLoop(bool (*timer_callback)(void *), void *userdata) = 0;
|
||||
virtual void NetInit(const char *message, int num_players);
|
||||
virtual void NetProgress(int count);
|
||||
virtual void NetMessage(const char *format, ...); // cover for printf
|
||||
virtual void NetDone();
|
||||
virtual bool NetLoop(bool (*timer_callback)(void *), void *userdata);
|
||||
protected:
|
||||
int MaxPos, CurPos, NotchPos;
|
||||
};
|
||||
|
|
|
@ -130,11 +130,11 @@ extern TArray<level_info_t> wadlevelinfos;
|
|||
|
||||
static void ParseStatistics(const char *fn, TArray<FStatistics> &statlist)
|
||||
{
|
||||
statlist.Clear();
|
||||
try
|
||||
{
|
||||
FScanner sc;
|
||||
sc.OpenFile(fn);
|
||||
statlist.Clear();
|
||||
|
||||
while (sc.GetString())
|
||||
{
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "3038"
|
||||
#define ZD_SVN_REVISION_NUMBER 3038
|
||||
#define ZD_SVN_REVISION_STRING "3042"
|
||||
#define ZD_SVN_REVISION_NUMBER 3042
|
||||
|
|
|
@ -337,6 +337,8 @@ void LoadActors ()
|
|||
{
|
||||
int lastlump, lump;
|
||||
|
||||
StateParams.Clear();
|
||||
GlobalSymbols.ReleaseSymbols();
|
||||
DropItemList.Clear();
|
||||
FScriptPosition::ResetErrorCounter();
|
||||
InitThingdef();
|
||||
|
|
|
@ -123,7 +123,8 @@ class FStateExpressions
|
|||
TArray<FStateExpression> expressions;
|
||||
|
||||
public:
|
||||
~FStateExpressions();
|
||||
~FStateExpressions() { Clear(); }
|
||||
void Clear();
|
||||
int Add(FxExpression *x, const PClass *o, bool c);
|
||||
int Reserve(int num, const PClass *cls);
|
||||
void Set(int num, FxExpression *x, bool cloned = false);
|
||||
|
|
|
@ -2765,7 +2765,7 @@ FStateExpressions StateParams;
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FStateExpressions::~FStateExpressions()
|
||||
void FStateExpressions::Clear()
|
||||
{
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
{
|
||||
|
@ -2774,6 +2774,7 @@ FStateExpressions::~FStateExpressions()
|
|||
delete expressions[i].expr;
|
||||
}
|
||||
}
|
||||
expressions.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -2050,6 +2050,11 @@ void V_InitFontColors ()
|
|||
|
||||
info.Index = -1;
|
||||
|
||||
TranslationParms[0].Clear();
|
||||
TranslationParms[1].Clear();
|
||||
TranslationLookup.Clear();
|
||||
TranslationColors.Clear();
|
||||
|
||||
while ((lump = Wads.FindLump ("TEXTCOLO", &lastlump)) != -1)
|
||||
{
|
||||
if (gameinfo.flags & GI_NOTEXTCOLOR)
|
||||
|
@ -2435,3 +2440,13 @@ void V_InitFonts()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void V_ClearFonts()
|
||||
{
|
||||
while (FFont::FirstFont != NULL)
|
||||
{
|
||||
delete FFont::FirstFont;
|
||||
}
|
||||
FFont::FirstFont = NULL;
|
||||
SmallFont = SmallFont2 = BigFont = ConFont = IntermissionFont = NULL;
|
||||
}
|
|
@ -128,7 +128,7 @@ protected:
|
|||
static FFont *FirstFont;
|
||||
friend struct FontsDeleter;
|
||||
|
||||
friend void V_Shutdown();
|
||||
friend void V_ClearFonts();
|
||||
|
||||
friend FArchive &SerializeFFontPtr (FArchive &arc, FFont* &font);
|
||||
};
|
||||
|
@ -137,6 +137,7 @@ protected:
|
|||
extern FFont *SmallFont, *SmallFont2, *BigFont, *ConFont, *IntermissionFont;
|
||||
|
||||
void V_InitFonts();
|
||||
void V_ClearFonts();
|
||||
EColorRange V_FindFontColor (FName name);
|
||||
PalEntry V_LogColorFromColorRange (EColorRange range);
|
||||
EColorRange V_ParseFontColor (const BYTE *&color_value, int normalcolor, int boldcolor);
|
||||
|
|
|
@ -447,6 +447,7 @@ void InitPalette ()
|
|||
int lump;
|
||||
|
||||
atterm (FreeSpecialLights);
|
||||
FreeSpecialLights();
|
||||
|
||||
if ((lump = Wads.CheckNumForFullName ("palette.dat")) >= 0 && Wads.LumpLength (lump) >= 768)
|
||||
{
|
||||
|
@ -780,6 +781,7 @@ static void FreeSpecialLights()
|
|||
delete[] colormap->Maps;
|
||||
delete colormap;
|
||||
}
|
||||
NormalLight.Next = NULL;
|
||||
}
|
||||
|
||||
// Builds NUMCOLORMAPS colormaps lit with the specified color
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -1692,10 +1695,7 @@ void V_Shutdown()
|
|||
s->ObjectFlags |= OF_YesReallyDelete;
|
||||
delete s;
|
||||
}
|
||||
while (FFont::FirstFont != NULL)
|
||||
{
|
||||
delete FFont::FirstFont;
|
||||
}
|
||||
V_ClearFonts();
|
||||
}
|
||||
|
||||
EXTERN_CVAR (Bool, vid_tft)
|
||||
|
|
|
@ -473,7 +473,7 @@ extern "C" DWORD Col2RGB8_Inverse[65][256];
|
|||
// --111111111111111111111111111111 = 0x3FFFFFFF
|
||||
|
||||
// Allocates buffer screens, call before R_Init.
|
||||
void V_Init ();
|
||||
void V_Init (bool restart);
|
||||
|
||||
// Initializes graphics mode for the first time.
|
||||
void V_Init2 ();
|
||||
|
|
|
@ -156,16 +156,23 @@ struct XlatParseContext : public FParseContext
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void P_ClearTranslator()
|
||||
{
|
||||
SimpleLineTranslations.Clear();
|
||||
NumBoomish = 0;
|
||||
SectorTranslations.Clear();
|
||||
SectorMasks.Clear();
|
||||
memset(LineFlagTranslations, 0, sizeof(LineFlagTranslations));
|
||||
LastTranslator = "";
|
||||
}
|
||||
|
||||
void P_LoadTranslator(const char *lumpname)
|
||||
{
|
||||
// Only read the lump if it differs from the previous one.
|
||||
if (LastTranslator.CompareNoCase(lumpname))
|
||||
{
|
||||
// Clear the old data before parsing the lump.
|
||||
SimpleLineTranslations.Clear();
|
||||
NumBoomish = 0;
|
||||
SectorTranslations.Clear();
|
||||
SectorMasks.Clear();
|
||||
P_ClearTranslator();
|
||||
|
||||
void *pParser = XlatParseAlloc(malloc);
|
||||
|
||||
|
@ -179,3 +186,5 @@ void P_LoadTranslator(const char *lumpname)
|
|||
LastTranslator = lumpname;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -870,6 +870,7 @@ OptionMenu AutomapOptions
|
|||
Option "Show map label", "am_showmaplabel", "MaplabelTypes"
|
||||
Option "Draw map background", "am_drawmapback", "OnOff"
|
||||
Option "Show keys (cheat)", "am_showkeys", "OnOff"
|
||||
Option "Show trigger lines", "am_showtriggerlines", "OnOff"
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
@ -922,6 +923,7 @@ OptionMenu MapColorMenu
|
|||
ColorPicker "Teleporter to the same map", "am_intralevelcolor"
|
||||
ColorPicker "Teleporter to a different map", "am_interlevelcolor"
|
||||
ColorPicker "Secret sector", "am_secretsectorcolor"
|
||||
ColorPicker "Special trigger lines", "am_specialwallcolor"
|
||||
StaticText " "
|
||||
StaticText "Cheat Mode", 1
|
||||
ColorPicker "Invisible 2-sided walls", "am_tswallcolor"
|
||||
|
@ -939,6 +941,7 @@ OptionMenu MapColorMenu
|
|||
ColorPicker "Not-yet-seen walls", "am_ovunseencolor"
|
||||
ColorPicker "Teleporter", "am_ovtelecolor"
|
||||
ColorPicker "Secret sector", "am_ovsecretsectorcolor"
|
||||
ColorPicker "Special trigger lines", "am_ovspecialwallcolor"
|
||||
StaticText " "
|
||||
StaticText "Overlay Cheat Mode", 1
|
||||
ColorPicker "Actors", "am_ovthingcolor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue