- added wipe transitions to screen job

Mainly to have the crossfade, the other styles are mostly bonus.
This also adds proper scoping to the cutscene code, which needs to run in UI scope.
This commit is contained in:
Christoph Oelckers 2022-04-25 17:26:17 +02:00
parent 21b4862460
commit 0dc670da8e
13 changed files with 86 additions and 35 deletions

View file

@ -88,6 +88,7 @@
#include "savegamehelp.h"
#include "v_draw.h"
#include "gamehud.h"
#include "wipe.h"
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, r_ticstability, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -104,6 +105,7 @@ bool r_NoInterpolate;
int entertic;
int oldentertics;
int gametic;
int nextwipe = wipe_None;
FString savename;
FString BackupSaveGame;
@ -375,6 +377,21 @@ static void GameTicker()
}
void DrawOverlays()
{
NetUpdate(); // send out any new accumulation
if (gamestate != GS_INTRO) // do not draw overlays on the intros
{
// Draw overlay elements
CT_Drawer();
C_DrawConsole();
M_Drawer();
FStat::PrintStat(twod);
}
DrawRateStuff();
}
//==========================================================================
//
// Display
@ -388,6 +405,12 @@ void Display()
{
return;
}
FTexture* wipestart = nullptr;
if (nextwipe != wipe_None)
{
wipestart = screen->WipeStartScreen();
}
screen->FrameTime = I_msTimeFS();
tileUpdateAnimations();
@ -408,7 +431,6 @@ void Display()
case GS_INTRO:
case GS_CUTSCENE:
// screen jobs are not bound by the game ticker so they need to be ticked in the display loop.
ScreenJobDraw();
break;
@ -420,6 +442,7 @@ void Display()
screen->SetSceneRenderTarget(gl_ssao != 0);
updateModelInterpolation();
gi->Render();
if (vid_renderer == 0) videoShowFrame();
DrawFullscreenBlends();
drawMapTitle();
break;
@ -430,21 +453,15 @@ void Display()
twod->ClearScreen();
break;
}
NetUpdate(); // send out any new accumulation
if (gamestate != GS_INTRO) // do not draw overlays on the intros
if (nextwipe == wipe_None)
DrawOverlays();
else
{
// Draw overlay elements
CT_Drawer();
C_DrawConsole();
M_Drawer();
FStat::PrintStat(twod);
PerformWipe(wipestart, screen->WipeEndScreen(), nextwipe, true, DrawOverlays);
nextwipe = wipe_None;
}
DrawRateStuff();
if (vid_renderer == 0) videoShowFrame(1);
else screen->Update();
screen->Update();
}
//==========================================================================