mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-06-01 09:22:17 +00:00
- moved game state connections of the startup screen out of the backend code.
This commit is contained in:
parent
ea30707c41
commit
612bf20809
4 changed files with 33 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include "i_interface.h"
|
#include "i_interface.h"
|
||||||
|
|
||||||
SystemCallbacks *sysCallbacks;
|
SystemCallbacks *sysCallbacks;
|
||||||
double refreshfreq;
|
double refreshfreq;
|
||||||
|
FString endoomName;
|
||||||
|
|
|
@ -22,3 +22,4 @@ struct WadStuff
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern FString endoomName;
|
||||||
|
|
|
@ -2958,6 +2958,8 @@ static int D_DoomMain_Internal (void)
|
||||||
gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats;
|
gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats;
|
||||||
gameinfo.ConfigName = iwad_info->Configname;
|
gameinfo.ConfigName = iwad_info->Configname;
|
||||||
lastIWAD = iwad;
|
lastIWAD = iwad;
|
||||||
|
endoomName = gameinfo.Endoom;
|
||||||
|
|
||||||
|
|
||||||
if ((gameinfo.flags & GI_SHAREWARE) && pwads.Size() > 0)
|
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 (!batchrun) Printf ("ST_Init: Init startup screen.\n");
|
||||||
if (!restart)
|
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);
|
StartScreen = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,17 +45,16 @@
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "i_input.h"
|
#include "i_input.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "gi.h"
|
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "s_sound.h"
|
|
||||||
#include "m_argv.h"
|
#include "m_argv.h"
|
||||||
#include "d_main.h"
|
|
||||||
#include "engineerrors.h"
|
#include "engineerrors.h"
|
||||||
#include "s_music.h"
|
#include "s_music.h"
|
||||||
|
#include "printf.h"
|
||||||
|
#include "startupinfo.h"
|
||||||
|
#include "i_interface.h"
|
||||||
|
|
||||||
// MACROS ------------------------------------------------------------------
|
// MACROS ------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// How many ms elapse between blinking text flips. On a standard VGA
|
// 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.
|
// 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
|
// 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 (!Args->CheckParm("-nostartup"))
|
||||||
{
|
{
|
||||||
if (GameStartupInfo.Type == FStartupInfo::HexenStartup ||
|
if (GameStartupInfo.Type == FStartupInfo::HexenStartup)
|
||||||
(gameinfo.gametype == GAME_Hexen && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
|
|
||||||
{
|
{
|
||||||
scr = new FHexenStartupScreen(max_progress, hr);
|
scr = new FHexenStartupScreen(max_progress, hr);
|
||||||
}
|
}
|
||||||
else if (GameStartupInfo.Type == FStartupInfo::HereticStartup ||
|
else if (GameStartupInfo.Type == FStartupInfo::HereticStartup)
|
||||||
(gameinfo.gametype == GAME_Heretic && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
|
|
||||||
{
|
{
|
||||||
scr = new FHereticStartupScreen(max_progress, hr);
|
scr = new FHereticStartupScreen(max_progress, hr);
|
||||||
}
|
}
|
||||||
else if (GameStartupInfo.Type == FStartupInfo::StrifeStartup ||
|
else if (GameStartupInfo.Type == FStartupInfo::StrifeStartup)
|
||||||
(gameinfo.gametype == GAME_Strife && GameStartupInfo.Type == FStartupInfo::DefaultStartup))
|
|
||||||
{
|
{
|
||||||
scr = new FStrifeStartupScreen(max_progress, hr);
|
scr = new FStrifeStartupScreen(max_progress, hr);
|
||||||
}
|
}
|
||||||
|
@ -512,12 +508,12 @@ void FStrifeStartupScreen::SetWindowSize()
|
||||||
|
|
||||||
int RunEndoom()
|
int RunEndoom()
|
||||||
{
|
{
|
||||||
if (showendoom == 0 || gameinfo.Endoom.Len() == 0)
|
if (showendoom == 0 || endoomName.Len() == 0)
|
||||||
{
|
{
|
||||||
return 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 endoom_screen[4000];
|
||||||
uint8_t *font;
|
uint8_t *font;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue