- slow down frame updates for the start screen for slower GPU's, since this can increase loading time significantly

This commit is contained in:
Rachael Alexanderson 2024-03-20 22:22:11 -04:00 committed by Rachael Alexanderson
parent 29a2ca0b13
commit a1bdc0582c

View file

@ -654,9 +654,11 @@ void FStartScreen::NetProgress(int count)
void FStartScreen::Render(bool force)
{
static uint64_t minwaittime = 30;
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 > 30 || force)
if (nowtime - screen->FrameTime > minwaittime || force)
{
screen->FrameTime = nowtime;
screen->BeginFrame();
@ -689,6 +691,9 @@ void FStartScreen::Render(bool force)
screen->Update();
twod->OnFrameDone();
}
auto newtime = I_msTime();
if (newtime - nowtime > minwaittime) // slow down drawing the start screen if we're on a slow GPU!
minwaittime = (newtime - nowtime);
}
FImageSource* CreateStartScreenTexture(FBitmap& srcdata);