diff --git a/src/d_main.cpp b/src/d_main.cpp index 1b1d94a56..72afd1912 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1701,6 +1701,25 @@ static FString ParseGameInfo(TArray &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; } diff --git a/src/d_main.h b/src/d_main.h index 7dd75a107..e4641c41d 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -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; diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index 1f0838ef2..a82ed53fd 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -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); - S_ChangeMusic ("orb", true, true); - + if (DoomStartupInfo.Song.IsNotEmpty()) + { + S_ChangeMusic(DoomStartupInfo.Song.GetChars(), true, true); + } + else + { + S_ChangeMusic ("orb", true, true); + } hr = S_OK; }