- Added startup screen customization, courtesy of Gez.

SVN r3375 (trunk)
This commit is contained in:
Randy Heit 2012-02-21 19:52:40 +00:00
parent 67bbc0f95c
commit d54f9c3616
3 changed files with 45 additions and 5 deletions

View file

@ -1701,6 +1701,25 @@ static FString ParseGameInfo(TArray<FString> &pwads, const char *fn, const char
sc.MustGetString();
DoomStartupInfo.BkColor = V_GetColor(NULL, sc.String);
}
else if (!nextKey.CompareNoCase("STARTUPTYPE"))
{
sc.MustGetString();
FString sttype = sc.String;
if (!sttype.CompareNoCase("DOOM"))
DoomStartupInfo.Type = FStartupInfo::DoomStartup;
else if (!sttype.CompareNoCase("HERETIC"))
DoomStartupInfo.Type = FStartupInfo::HereticStartup;
else if (!sttype.CompareNoCase("HEXEN"))
DoomStartupInfo.Type = FStartupInfo::HexenStartup;
else if (!sttype.CompareNoCase("STRIFE"))
DoomStartupInfo.Type = FStartupInfo::StrifeStartup;
else DoomStartupInfo.Type = FStartupInfo::DefaultStartup;
}
else if (!nextKey.CompareNoCase("STARTUPSONG"))
{
sc.MustGetString();
DoomStartupInfo.Song = sc.String;
}
}
return iwad;
}

View file

@ -94,6 +94,17 @@ struct FStartupInfo
FString Name;
DWORD FgColor; // Foreground color for title banner
DWORD BkColor; // Background color for title banner
FString Song;
int Type;
enum
{
DefaultStartup,
DoomStartup,
HereticStartup,
HexenStartup,
StrifeStartup,
};
};
extern FStartupInfo DoomStartupInfo;

View file

@ -52,6 +52,7 @@
#include "w_wad.h"
#include "s_sound.h"
#include "m_argv.h"
#include "d_main.h"
// MACROS ------------------------------------------------------------------
@ -276,15 +277,18 @@ FStartupScreen *FStartupScreen::CreateInstance(int max_progress)
if (!Args->CheckParm("-nostartup"))
{
if (gameinfo.gametype == GAME_Hexen)
if (DoomStartupInfo.Type == FStartupInfo::HexenStartup ||
(gameinfo.gametype == GAME_Hexen && DoomStartupInfo.Type == FStartupInfo::DefaultStartup))
{
scr = new FHexenStartupScreen(max_progress, hr);
}
else if (gameinfo.gametype == GAME_Heretic)
else if (DoomStartupInfo.Type == FStartupInfo::HereticStartup ||
(gameinfo.gametype == GAME_Heretic && DoomStartupInfo.Type == FStartupInfo::DefaultStartup))
{
scr = new FHereticStartupScreen(max_progress, hr);
}
else if (gameinfo.gametype == GAME_Strife)
else if (DoomStartupInfo.Type == FStartupInfo::StrifeStartup ||
(gameinfo.gametype == GAME_Strife && DoomStartupInfo.Type == FStartupInfo::DefaultStartup))
{
scr = new FStrifeStartupScreen(max_progress, hr);
}
@ -684,8 +688,14 @@ FHexenStartupScreen::FHexenStartupScreen(int max_progress, HRESULT &hr)
LayoutMainWindow (Window, NULL);
InvalidateRect (StartupScreen, NULL, TRUE);
if (DoomStartupInfo.Song.IsNotEmpty())
{
S_ChangeMusic(DoomStartupInfo.Song.GetChars(), true, true);
}
else
{
S_ChangeMusic ("orb", true, true);
}
hr = S_OK;
}