Note: I have not tried compiling these recent changes under Linux. I wouldn't

be surprised if it doesn't work.

- Reorganized the network startup loops so now they are event driven. There is
  a single function that gets called to drive it, and it uses callbacks to
  perform the different stages of the synchronization. This lets me have a nice,
  responsive abort button instead of the previous unannounced hit-escape-to-
  abort behavior, and I think the rearranged code is slightly easier to
  understand too.
- Increased the number of bytes for version info during D_ArbitrateNetStart(),
  in preparation for the day when NETGAMEVERSION requires more than one byte.
- I noticed an issue with Vista RC1 and the new fatal error setup. Even after
  releasing a DirectDraw or Direct3D interface, the DWM can still use the
  last image drawn using them when it composites the window. It doesn't always
  do it but it does often enough that it is a real problem. At this point, I
  don't know if it's a problem with the release version of Vista or not.
  After messing around, I discovered the problem was caused by ~Win32Video()
  hiding the window and then having it immediately shown soon after. The DWM
  kept an image of the window to do the transition effect with, and then when
  it didn't get a chance to do the transition, it didn't properly forget about
  its saved image and kept plastering it on top of everything else
  underneath.
- Added a network synchronization panel to the window during netgame startup.
- Fixed: PClass::CreateDerivedClass() must initialize StateList to NULL.
  Otherwise, classic DECORATE definitions generate a big, fat crash.
- Resurrected the R_Init progress bar, now as a standard Windows control.
- Removed the sound failure dialog. The FMOD setup already defaulted to no
  sound if initialization failed, so this only applies when snd_output is set
  to "alternate" which now also falls back to no sound. In addition, it wasn't
  working right, and I didn't feel like fixing it for the probably 0% of users
  it affected.
- Fixed: The edit control used for logging output added text in reverse order
  on Win9x.
- Went back to the roots and made graphics initialization one of the last
  things to happen during setup. Now the startup text is visible again. More
  importantly, the main window is no longer created invisible, which seems
  to cause trouble with it not always appearing in the taskbar. The fatal
  error dialog is now also embedded in the main window instead of being a
  separate modal dialog, so you can play with the log window to see any
  problems that might be reported there.
  
  Rather than completely restoring the original startup order, I tried to
  keep things as close to the way they were with early graphics startup. In
  particular, V_Init() now creates a dummy screen so that things that need
  screen dimensions can get them. It gets replaced by the real screen later
  in I_InitGraphics(). Will need to check this under Linux to make sure it
  didn't cause any problems there.
- Removed the following stubs that just called functions in Video:
    - I_StartModeIterator()
    - I_NextMode()
    - I_DisplayType()
  I_FullscreenChanged() was also removed, and a new fullscreen parameter
  was added to IVideo::StartModeIterator(), since that's all it controlled.
- Renamed I_InitHardware() back to I_InitGraphics(), since that's all it's
  initialized post-1.22.


SVN r416 (trunk)
This commit is contained in:
Randy Heit 2006-12-19 04:09:10 +00:00
commit 83373fba88
50 changed files with 2147 additions and 959 deletions

View file

@ -86,6 +86,7 @@
#include "r_polymost.h"
#include "version.h"
#include "v_text.h"
#include "st_start.h"
// MACROS ------------------------------------------------------------------
@ -175,22 +176,23 @@ FTexture *Advisory;
cycle_t FrameCycles;
const char *IWADTypeNames[NUM_IWAD_TYPES] =
const IWADInfo IWADInfos[NUM_IWAD_TYPES] =
{
"DOOM 2: TNT - Evilution",
"DOOM 2: Plutonia Experiment",
"Hexen: Beyond Heretic",
"Hexen: Deathkings of the Dark Citadel",
"DOOM 2: Hell on Earth",
"Heretic Shareware",
"Heretic: Shadow of the Serpent Riders",
"Heretic",
"DOOM Shareware",
"The Ultimate DOOM",
"DOOM Registered",
"Strife: Quest for the Sigil",
"Strife: Teaser (Old Version)",
"Strife: Teaser (New Version)"
// banner text, fg color, bg color
{ "DOOM 2: TNT - Evilution", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "DOOM 2: Plutonia Experiment", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "Hexen: Beyond Heretic", MAKERGB(240,240,240), MAKERGB(107,44,24) },
{ "Hexen: Deathkings of the Dark Citadel", MAKERGB(240,240,240), MAKERGB(139,68,9) },
{ "DOOM 2: Hell on Earth", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "Heretic Shareware", MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "Heretic: Shadow of the Serpent Riders", MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "Heretic", MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "DOOM Shareware", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "The Ultimate DOOM", MAKERGB(84,84,84), MAKERGB(168,168,168) },
{ "DOOM Registered", MAKERGB(84,84,84), MAKERGB(168,168,168) },
{ "Strife: Quest for the Sigil", MAKERGB(224,173,153), MAKERGB(0,107,101) },
{ "Strife: Teaser (Old Version)", MAKERGB(224,173,153), MAKERGB(0,107,101) },
{ "Strife: Teaser (New Version)", MAKERGB(224,173,153), MAKERGB(0,107,101) }
};
// PRIVATE DATA DEFINITIONS ------------------------------------------------
@ -1958,6 +1960,8 @@ void D_DoomMain (void)
rngseed = (DWORD)time (NULL);
FRandom::StaticClearRandom ();
M_FindResponseFile ();
Printf ("M_LoadDefaults: Load system defaults.\n");
M_LoadDefaults (); // load before initing other systems
// [RH] Make sure zdoom.pk3 is always loaded,
@ -1969,11 +1973,9 @@ void D_DoomMain (void)
I_FatalError ("Cannot find " BASEWAD);
}
I_SetTitleString (IWADTypeNames[IdentifyVersion(wad)]);
I_SetIWADInfo (&IWADInfos[IdentifyVersion(wad)]);
GameConfig->DoGameSetup (GameNames[gameinfo.gametype]);
if (!(gameinfo.flags & GI_SHAREWARE))
{
// [RH] zvox.wad - A wad I had intended to be automatically generated
@ -2052,9 +2054,9 @@ void D_DoomMain (void)
delete files1;
delete files2;
Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (&wadfiles);
// [RH] Initialize localizable strings.
GStrings.LoadStrings (false);
@ -2062,25 +2064,35 @@ void D_DoomMain (void)
// 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 ();
// [RH] Parse any SNDINFO lumps
Printf ("S_ParseSndInfo: Load sound definitions.\n");
S_ParseSndInfo ();
S_ParseSndEax ();
Printf ("S_Init: Setting up sound.\n");
S_Init ();
Printf ("ST_Init: Init startup screen.\n");
ST_Init (R_GuesstimateNumTextures() + 5);
// [RH] Now that all text strings are set up,
// insert them into the level and cluster data.
G_MakeEpisodes ();
// [RH] Parse through all loaded mapinfo lumps
Printf ("G_ParseMapInfo: Load map definitions.\n");
G_ParseMapInfo ();
// [RH] Parse any SNDINFO lumps
S_ParseSndInfo ();
S_ParseSndEax ();
FActorInfo::StaticInit ();
// [GRB] Initialize player class list
@ -2096,10 +2108,12 @@ void D_DoomMain (void)
}
FActorInfo::StaticGameSet ();
ST_Progress ();
Printf ("Init DOOM refresh subsystem.\n");
Printf ("R_Init: Init %s refresh subsystem\n", GameNames[gameinfo.gametype]);
R_Init ();
Printf ("DecalLibrary: Load decals.\n");
DecalLibrary.Clear ();
DecalLibrary.ReadAllDecals ();
@ -2161,7 +2175,8 @@ void D_DoomMain (void)
}
flags = dmflags;
Printf ("P_Init: Checking cmd-line parameters...\n");
if (Args.CheckParm ("-nomonsters")) flags |= DF_NO_MONSTERS;
if (Args.CheckParm ("-respawn")) flags |= DF_MONSTERS_RESPAWN;
if (Args.CheckParm ("-fast")) flags |= DF_FAST_MONSTERS;
@ -2224,7 +2239,6 @@ void D_DoomMain (void)
autostart = true;
}
//I_Error ("Oh gnos!");
// [RH] Hack to handle +map
p = Args.CheckParm ("+map");
if (p && p < Args.NumArgs()-1)
@ -2286,16 +2300,13 @@ void D_DoomMain (void)
timelimit = 20.f;
}
Printf ("Init miscellaneous info.\n");
Printf ("M_Init: Init miscellaneous info.\n");
M_Init ();
Printf ("Init Playloop state.\n");
Printf ("P_Init: Init Playloop state.\n");
P_Init ();
Printf ("Setting up sound.\n");
S_Init ();
Printf ("Checking network game status.\n");
Printf ("D_CheckNetGame: Checking network game status.\n");
D_CheckNetGame ();
// [RH] Lock any cvars that should be locked now that we're
@ -2319,6 +2330,9 @@ void D_DoomMain (void)
autostart = true;
}
ST_Done();
V_Init2();
files = Args.GatherFiles ("-playdemo", ".lmp", false);
if (files->NumArgs() > 0)
{
@ -2345,10 +2359,8 @@ void D_DoomMain (void)
G_LoadGame (file);
}
if (gameaction != ga_loadgame)
{
BorderNeedRefresh = screen->GetPageCount ();
if (autostart || netgame)
{
CheckWarpTransMap (startmap, true);