- moved game state connections of the startup screen out of the backend code.

This commit is contained in:
Christoph Oelckers 2020-04-23 00:02:34 +02:00
parent ea30707c41
commit 612bf20809
4 changed files with 33 additions and 13 deletions

View File

@ -1,4 +1,5 @@
#include "i_interface.h"
SystemCallbacks *sysCallbacks;
double refreshfreq;
double refreshfreq;
FString endoomName;

View File

@ -22,3 +22,4 @@ struct WadStuff
};
extern FString endoomName;

View File

@ -2958,6 +2958,8 @@ static int D_DoomMain_Internal (void)
gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats;
gameinfo.ConfigName = iwad_info->Configname;
lastIWAD = iwad;
endoomName = gameinfo.Endoom;
if ((gameinfo.flags & GI_SHAREWARE) && pwads.Size() > 0)
{
@ -3098,6 +3100,26 @@ static int D_DoomMain_Internal (void)
if (!batchrun) Printf ("ST_Init: Init startup screen.\n");
if (!restart)
{
if (GameStartupInfo.Type == FStartupInfo::DefaultStartup)
{
switch (gameinfo.gametype)
{
case GAME_Hexen:
GameStartupInfo.Type = FStartupInfo::HexenStartup;
break;
case GAME_Heretic:
GameStartupInfo.Type = FStartupInfo::HereticStartup;
break;
case GAME_Strife:
GameStartupInfo.Type = FStartupInfo::StrifeStartup;
break;
default:
break;
}
}
StartScreen = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5);
}
else

View File

@ -45,17 +45,16 @@
#include "i_system.h"
#include "i_input.h"
#include "hardware.h"
#include "gi.h"
#include "filesystem.h"
#include "s_sound.h"
#include "m_argv.h"
#include "d_main.h"
#include "engineerrors.h"
#include "s_music.h"
#include "printf.h"
#include "startupinfo.h"
#include "i_interface.h"
// MACROS ------------------------------------------------------------------
// How many ms elapse between blinking text flips. On a standard VGA
// adapter, the characters are on for 16 frames and then off for another 16.
// The number here therefore corresponds roughly to the blink rate on a
@ -117,18 +116,15 @@ FStartupScreen *FStartupScreen::CreateInstance(int max_progress)
if (!Args->CheckParm("-nostartup"))
{
if (GameStartupInfo.Type == FStartupInfo::HexenStartup ||
(gameinfo.gametype == GAME_Hexen && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
if (GameStartupInfo.Type == FStartupInfo::HexenStartup)
{
scr = new FHexenStartupScreen(max_progress, hr);
}
else if (GameStartupInfo.Type == FStartupInfo::HereticStartup ||
(gameinfo.gametype == GAME_Heretic && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
else if (GameStartupInfo.Type == FStartupInfo::HereticStartup)
{
scr = new FHereticStartupScreen(max_progress, hr);
}
else if (GameStartupInfo.Type == FStartupInfo::StrifeStartup ||
(gameinfo.gametype == GAME_Strife && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
else if (GameStartupInfo.Type == FStartupInfo::StrifeStartup)
{
scr = new FStrifeStartupScreen(max_progress, hr);
}
@ -512,12 +508,12 @@ void FStrifeStartupScreen::SetWindowSize()
int RunEndoom()
{
if (showendoom == 0 || gameinfo.Endoom.Len() == 0)
if (showendoom == 0 || endoomName.Len() == 0)
{
return 0;
}
int endoom_lump = fileSystem.CheckNumForFullName (gameinfo.Endoom, true);
int endoom_lump = fileSystem.CheckNumForFullName (endoomName, true);
uint8_t endoom_screen[4000];
uint8_t *font;