Skip to content

Commit

Permalink
implement outro_wipe field functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin authored and elf-alchemist committed Jan 14, 2025
1 parent ae0063e commit 1dba7b2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,16 @@ void D_ProcessEvents (void)

// wipegamestate can be set to -1 to force a wipe on the next draw
gamestate_t wipegamestate = GS_DEMOSCREEN;
static int screen_melt = wipe_Melt;
static int screen_melt = wipe_Melt, old_screen_melt = -1;

void D_RestoreScreenMelt()
{
if (old_screen_melt >= 0)
{
screen_melt = old_screen_melt;
old_screen_melt = -1;
}
}

void D_Display (void)
{
Expand Down Expand Up @@ -531,6 +540,20 @@ void D_DoAdvanceDemo(void)
demosequence);
break;
}

if (old_screen_melt < 0)
{
old_screen_melt = screen_melt;
}

if (demoloop_point->outro_wipe == WIPE_IMMEDIATE)
{
screen_melt = wipe_None;
}
else if (demoloop_point->outro_wipe == WIPE_MELT)
{
screen_melt = wipe_Melt;
}
}

//
Expand Down
2 changes: 2 additions & 0 deletions src/d_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void D_StartTitle(void);

extern boolean advancedemo;

void D_RestoreScreenMelt(void);

#endif

//----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,9 @@ void G_Ticker(void)
G_DoReborn (i);
P_MapEnd();

if (gameaction != ga_nothing && gameaction != ga_playdemo)
D_RestoreScreenMelt();

// do things to change the game state
while (gameaction != ga_nothing)
switch (gameaction)
Expand Down

0 comments on commit 1dba7b2

Please sign in to comment.