Skip to content

Commit

Permalink
Fix live centerprint preview when game is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Sep 10, 2024
1 parent 91ba833 commit a7e91e0
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions Quake/gl_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,13 @@ void SCR_CheckDrawCenterString (void)

if (scr_centertime_off <= 0 && !cl.intermission)
return;
if (key_dest != key_game && !M_ForcedCenterPrint (NULL))
return;
if (cl.paused) //johnfitz -- don't show centerprint during a pause
return;
if (!M_ForcedCenterPrint (NULL))
{
if (key_dest != key_game)
return;
if (cl.paused) //johnfitz -- don't show centerprint during a pause
return;
}

SCR_DrawCenterString ();
}
Expand Down Expand Up @@ -1058,18 +1061,31 @@ DrawPause
void SCR_DrawPause (void)
{
qpic_t *pic;
float alpha;

if (!cl.paused)
return;

if (!scr_showpause.value) // turn off for screenshots
return;

if (M_ForcedCenterPrint (&alpha))
{
alpha = 1.f - alpha;
if (alpha <= 0.f)
return;
}
else
alpha = 1.f;

GL_SetCanvas (CANVAS_MENU); //johnfitz
GL_PushCanvasColor (1.f, 1.f, 1.f, alpha);

pic = Draw_CachePic ("gfx/pause.lmp");
Draw_Pic ( (320 - pic->width)/2, (240 - 48 - pic->height)/2, pic); //johnfitz -- stretched menus

GL_PopCanvasColor ();

scr_tileclear_updates = 0; //johnfitz
}

Expand Down

0 comments on commit a7e91e0

Please sign in to comment.