From 7787a410eaaacac31adca50acb698ad257b129b8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 1 Jun 2022 09:30:20 +0200 Subject: [PATCH] - Startscreen fixes. * for Strife the game palette must be loaded before the start screen. * increase update frequency of start screen to roughly 35 fps * fixed Strife's laser sprite names. * do not show the native progress bar if a graphical start screen is used. --- src/common/engine/st_start.h | 2 +- src/common/platform/win32/st_start.cpp | 4 ++-- src/common/startscreen/startscreen.cpp | 2 +- src/common/startscreen/startscreen_strife.cpp | 2 ++ src/common/textures/formats/startuptexture.cpp | 4 ++-- src/d_main.cpp | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common/engine/st_start.h b/src/common/engine/st_start.h index 60e62ae99..8e02987d6 100644 --- a/src/common/engine/st_start.h +++ b/src/common/engine/st_start.h @@ -39,7 +39,7 @@ class FStartupScreen { public: - static FStartupScreen *CreateInstance(int max_progress); + static FStartupScreen *CreateInstance(int max_progress, bool showprogress); FStartupScreen(int max_progress) { diff --git a/src/common/platform/win32/st_start.cpp b/src/common/platform/win32/st_start.cpp index ceabf7d0f..07039add2 100644 --- a/src/common/platform/win32/st_start.cpp +++ b/src/common/platform/win32/st_start.cpp @@ -76,9 +76,9 @@ extern HINSTANCE g_hInst; // //========================================================================== -FStartupScreen *FStartupScreen::CreateInstance(int max_progress) +FStartupScreen *FStartupScreen::CreateInstance(int max_progress, bool showprogress) { - return new FBasicStartupScreen(max_progress, true); + return new FBasicStartupScreen(max_progress, showprogress); } //========================================================================== diff --git a/src/common/startscreen/startscreen.cpp b/src/common/startscreen/startscreen.cpp index 7c3b6c5f5..b7a87896d 100644 --- a/src/common/startscreen/startscreen.cpp +++ b/src/common/startscreen/startscreen.cpp @@ -657,7 +657,7 @@ void FStartScreen::Render(bool force) { auto nowtime = I_msTime(); // Do not refresh too often. This function gets called a lot more frequently than the screen can update. - if (nowtime - screen->FrameTime > 100 || force) + if (nowtime - screen->FrameTime > 30 || force) { screen->FrameTime = nowtime; screen->BeginFrame(); diff --git a/src/common/startscreen/startscreen_strife.cpp b/src/common/startscreen/startscreen_strife.cpp index d4da521b5..6587443b8 100644 --- a/src/common/startscreen/startscreen_strife.cpp +++ b/src/common/startscreen/startscreen_strife.cpp @@ -37,6 +37,7 @@ #include "filesystem.h" #include "printf.h" #include "image.h" +#include "textures.h" #include "palettecontainer.h" // Strife startup screen @@ -156,6 +157,7 @@ bool FStrifeStartScreen::DoProgress(int advance) { // Time to update. DrawStuff(NotchPos, notch_pos); NotchPos = notch_pos; + StartupTexture->CleanHardwareData(true); } } return FStartScreen::DoProgress(advance); diff --git a/src/common/textures/formats/startuptexture.cpp b/src/common/textures/formats/startuptexture.cpp index 098d45d50..cce930de6 100644 --- a/src/common/textures/formats/startuptexture.cpp +++ b/src/common/textures/formats/startuptexture.cpp @@ -58,8 +58,8 @@ static StrifeStartupInfo StrifeRawPics[] = { "STRTPB1", 32, 64}, { "STRTPC1", 32, 64}, { "STRTPD1", 32, 64}, - { "STRLZ1", 16, 16}, - { "STRLZ2", 16, 16}, + { "STRTLZ1", 16, 16}, + { "STRTLZ2", 16, 16}, { "STRTBOT", 48, 48} }; diff --git a/src/d_main.cpp b/src/d_main.cpp index 36447ef89..56132ccb7 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3068,6 +3068,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray& allwads, TArr SetMapxxFlag(); D_GrabCVarDefaults(); //parse DEFCVARS + InitPalette(); int max_progress = TexMan.GuesstimateNumTextures(); int per_shader_progress = 0;//screen->GetShaderCount()? (max_progress / 10 / screen->GetShaderCount()) : 0; @@ -3106,7 +3107,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray& allwads, TArr Printf("%s", ci.GetChars()); } - InitPalette(); TexMan.Init(); if (!batchrun) Printf ("V_Init: allocate screen.\n"); @@ -3145,7 +3145,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray& allwads, TArr if (!batchrun) Printf ("ST_Init: Init startup screen.\n"); if (!restart) { - StartWindow = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5); + StartWindow = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5, StartScreen == nullptr); } else {