- Added IWAD-based [*.Autoload] ini support for games that have more than one

IWAD. They are:
  * [Doom1.Autoload]
  * [Doom2.Autoload]
  * [Plutonia.Autoload]
  * [TNT.Autoload]
  * [HexenDK.Autoload]
  These are loaded after the more general game-specific [Doom.Autoload] and
  [Hexen.Autoload] sections if those are present.
- Changed the banner texts for the Final Doom IWADs to identify them as Final
  Doom rather than as DOOM 2. I know this differs from the original behavior,
  but they're marketed as Final Doom, not Doom 2.


SVN r582 (trunk)
This commit is contained in:
Randy Heit 2007-12-06 22:38:45 +00:00
parent 1dede60c5c
commit 7f52e6537b
4 changed files with 59 additions and 28 deletions

View file

@ -1,4 +1,16 @@
December 6, 2007 December 6, 2007
- Added IWAD-based [*.Autoload] ini support for games that have more than one
IWAD. They are:
* [Doom1.Autoload]
* [Doom2.Autoload]
* [Plutonia.Autoload]
* [TNT.Autoload]
* [HexenDK.Autoload]
These are loaded after the more general game-specific [Doom.Autoload] and
[Hexen.Autoload] sections if those are present.
- Changed the banner texts for the Final Doom IWADs to identify them as Final
Doom rather than as DOOM 2. I know this differs from the original behavior,
but they're marketed as Final Doom, not Doom 2.
- New: On Windows, the game now checks the registry to see if you have Steam - New: On Windows, the game now checks the registry to see if you have Steam
installed. If so, it checks your SteamApps directory for any IWADs you may installed. If so, it checks your SteamApps directory for any IWADs you may
have purchased through Steam and adds any it finds to the list of available have purchased through Steam and adds any it finds to the list of available

View file

@ -31,6 +31,7 @@ bool FileExists (const char *filename);
extern char progdir[1024]; extern char progdir[1024];
void FixPathSeperator (char *path); void FixPathSeperator (char *path);
static void inline FixPathSeperator (FString &path) { path.ReplaceChars('\\', '/'); }
void DefaultExtension (char *path, const char *extension); void DefaultExtension (char *path, const char *extension);
void DefaultExtension (FString &path, const char *extension); void DefaultExtension (FString &path, const char *extension);

View file

@ -176,23 +176,26 @@ FTexture *Advisory;
cycle_t FrameCycles; cycle_t FrameCycles;
// If autoname is NULL, that's either because that game doesn't allow
// loading of external wads or because it's already caught by the
// general game-specific wads section.
const IWADInfo IWADInfos[NUM_IWAD_TYPES] = const IWADInfo IWADInfos[NUM_IWAD_TYPES] =
{ {
// banner text, fg color, bg color // banner text, autoname, fg color, bg color
{ "DOOM 2: TNT - Evilution", MAKERGB(168,0,0), MAKERGB(168,168,168) }, { "Final Doom: TNT - Evilution", "TNT", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "DOOM 2: Plutonia Experiment", MAKERGB(168,0,0), MAKERGB(168,168,168) }, { "Final Doom: Plutonia Experiment", "Plutonia", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "Hexen: Beyond Heretic", MAKERGB(240,240,240), MAKERGB(107,44,24) }, { "Hexen: Beyond Heretic", NULL, MAKERGB(240,240,240), MAKERGB(107,44,24) },
{ "Hexen: Deathkings of the Dark Citadel", MAKERGB(240,240,240), MAKERGB(139,68,9) }, { "Hexen: Deathkings of the Dark Citadel", "HexenDK", MAKERGB(240,240,240), MAKERGB(139,68,9) },
{ "DOOM 2: Hell on Earth", MAKERGB(168,0,0), MAKERGB(168,168,168) }, { "DOOM 2: Hell on Earth", "Doom2", MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "Heretic Shareware", MAKERGB(252,252,0), MAKERGB(168,0,0) }, { "Heretic Shareware", NULL, MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "Heretic: Shadow of the Serpent Riders", MAKERGB(252,252,0), MAKERGB(168,0,0) }, { "Heretic: Shadow of the Serpent Riders", NULL, MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "Heretic", MAKERGB(252,252,0), MAKERGB(168,0,0) }, { "Heretic", NULL, MAKERGB(252,252,0), MAKERGB(168,0,0) },
{ "DOOM Shareware", MAKERGB(168,0,0), MAKERGB(168,168,168) }, { "DOOM Shareware", NULL, MAKERGB(168,0,0), MAKERGB(168,168,168) },
{ "The Ultimate DOOM", MAKERGB(84,84,84), MAKERGB(168,168,168) }, { "The Ultimate DOOM", "Doom1", MAKERGB(84,84,84), MAKERGB(168,168,168) },
{ "DOOM Registered", MAKERGB(84,84,84), MAKERGB(168,168,168) }, { "DOOM Registered", "Doom1", MAKERGB(84,84,84), MAKERGB(168,168,168) },
{ "Strife: Quest for the Sigil", MAKERGB(224,173,153), MAKERGB(0,107,101) }, { "Strife: Quest for the Sigil", NULL, MAKERGB(224,173,153), MAKERGB(0,107,101) },
{ "Strife: Teaser (Old Version)", MAKERGB(224,173,153), MAKERGB(0,107,101) }, { "Strife: Teaser (Old Version)", NULL, MAKERGB(224,173,153), MAKERGB(0,107,101) },
{ "Strife: Teaser (New Version)", MAKERGB(224,173,153), MAKERGB(0,107,101) } { "Strife: Teaser (New Version)", NULL, MAKERGB(224,173,153), MAKERGB(0,107,101) }
}; };
// PRIVATE DATA DEFINITIONS ------------------------------------------------ // PRIVATE DATA DEFINITIONS ------------------------------------------------
@ -1963,12 +1966,11 @@ void D_MultiExec (DArgs *list, bool usePullin)
void D_DoomMain (void) void D_DoomMain (void)
{ {
int p, flags; int p, flags;
char file[PATH_MAX]; FString file;
char *v; char *v;
const char *wad; const char *wad;
DArgs *execFiles; DArgs *execFiles;
const IWADInfo *iwad_info;
file[PATH_MAX-1] = 0;
srand(I_MSTime()); srand(I_MSTime());
@ -1996,7 +1998,8 @@ void D_DoomMain (void)
I_FatalError ("Cannot find " BASEWAD); I_FatalError ("Cannot find " BASEWAD);
} }
I_SetIWADInfo (&IWADInfos[IdentifyVersion(wad)]); iwad_info = &IWADInfos[IdentifyVersion(wad)];
I_SetIWADInfo(iwad_info);
GameConfig->DoGameSetup (GameNames[gameinfo.gametype]); GameConfig->DoGameSetup (GameNames[gameinfo.gametype]);
if (!(gameinfo.flags & GI_SHAREWARE)) if (!(gameinfo.flags & GI_SHAREWARE))
@ -2012,17 +2015,22 @@ void D_DoomMain (void)
// [RH] Add any .wad files in the skins directory // [RH] Add any .wad files in the skins directory
#ifdef unix #ifdef unix
sprintf (file, "%sskins", SHARE_DIR); file = SHARE_DIR;
#else #else
sprintf (file, "%sskins", progdir); file = progdir;
#endif #endif
file += "skins";
D_AddDirectory (file); D_AddDirectory (file);
const char *home = getenv ("HOME"); const char *home = getenv ("HOME");
if (home) if (home)
{ {
sprintf (file, "%s%s.zdoom/skins", home, file = home;
home[strlen(home)-1] == '/' ? "" : "/"); if (home[strlen(home) - 1] != '/')
{
file += '/';
}
file += ".zdoom/skins";
D_AddDirectory (file); D_AddDirectory (file);
} }
@ -2031,8 +2039,17 @@ void D_DoomMain (void)
D_AddConfigWads ("Global.Autoload"); D_AddConfigWads ("Global.Autoload");
// Add game-specific wads // Add game-specific wads
sprintf (file, "%s.Autoload", GameNames[gameinfo.gametype]); file = GameNames[gameinfo.gametype];
file += ".Autoload";
D_AddConfigWads (file); D_AddConfigWads (file);
// Add IWAD-specific wads
if (iwad_info->Autoname != NULL)
{
file = iwad_info->Autoname;
file += ".Autoload";
D_AddConfigWads(file);
}
} }
// Run automatically executed files // Run automatically executed files
@ -2396,7 +2413,7 @@ void D_DoomMain (void)
v = Args.CheckValue ("-loadgame"); v = Args.CheckValue ("-loadgame");
if (v) if (v)
{ {
strncpy (file, v, sizeof(file)-1); file = v;
FixPathSeperator (file); FixPathSeperator (file);
DefaultExtension (file, ".zds"); DefaultExtension (file, ".zds");
G_LoadGame (file); G_LoadGame (file);

View file

@ -85,9 +85,10 @@ struct WadStuff
struct IWADInfo struct IWADInfo
{ {
const char *Name; // Title banner text for this IWAD const char *Name; // Title banner text for this IWAD
DWORD FgColor; // Foreground color for title banner const char *Autoname; // Name of autoload ini section for this IWAD
DWORD BkColor; // Background color for title banner DWORD FgColor; // Foreground color for title banner
DWORD BkColor; // Background color for title banner
}; };
extern const IWADInfo IWADInfos[NUM_IWAD_TYPES]; extern const IWADInfo IWADInfos[NUM_IWAD_TYPES];