Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/heretic/doomdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ extern gameaction_t gameaction;

extern boolean paused;

extern boolean sendpause; // send a pause event next tic

extern GameMode_t gamemode;

extern boolean ExtendedWAD; // true if main WAD is the extended version
Expand Down
52 changes: 36 additions & 16 deletions src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ static void DrawCrispness1(void);
static void DrawCrispness2(void);
static void DrawCrispness3(void);
void MN_LoadSlotText(void);
static void MN_SetPaused(void);
static void MN_SetUnpaused(void);

// External Functions

Expand Down Expand Up @@ -1241,7 +1243,7 @@ static boolean SCQuitGame(int option)
typeofask = 1; //quit game
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
return true;
}
Expand All @@ -1263,7 +1265,7 @@ static boolean SCEndGame(int option)
typeofask = 2; //endgame
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
return true;
}
Expand Down Expand Up @@ -1625,7 +1627,7 @@ static boolean SCInfo(int option)
S_StartSound(NULL, sfx_dorcls);
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
return true;
}
Expand Down Expand Up @@ -2182,7 +2184,7 @@ boolean MN_Responder(event_t * event)
}
if (!InfoType)
{
paused = false;
MN_SetUnpaused();
MN_DeactivateMenu();
SB_state = -1; //refresh the statbar
BorderNeedRefresh = true;
Expand Down Expand Up @@ -2215,7 +2217,7 @@ boolean MN_Responder(event_t * event)
players[consoleplayer].messageTics = 0;
//set the msg to be cleared
players[consoleplayer].message = NULL;
paused = false;
MN_SetUnpaused();
#ifndef CRISPY_TRUECOLOR
I_SetPalette(W_CacheLumpName
("PLAYPAL", PU_CACHE));
Expand Down Expand Up @@ -2264,7 +2266,7 @@ boolean MN_Responder(event_t * event)
players[consoleplayer].messageTics = 1; //set the msg to be cleared
askforquit = false;
typeofask = 0;
paused = false;
MN_SetUnpaused();
UpdateState |= I_FULLSCRN;
BorderNeedRefresh = true;
return true;
Expand Down Expand Up @@ -2316,7 +2318,7 @@ boolean MN_Responder(event_t * event)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2334,7 +2336,7 @@ boolean MN_Responder(event_t * event)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2350,7 +2352,7 @@ boolean MN_Responder(event_t * event)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2374,7 +2376,7 @@ boolean MN_Responder(event_t * event)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2388,7 +2390,7 @@ boolean MN_Responder(event_t * event)
typeofask = 3;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_chat);
}
Expand Down Expand Up @@ -2420,7 +2422,7 @@ boolean MN_Responder(event_t * event)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2433,7 +2435,7 @@ boolean MN_Responder(event_t * event)
askforquit = true;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
typeofask = 4;
S_StartSound(NULL, sfx_chat);
Expand Down Expand Up @@ -2629,7 +2631,7 @@ boolean MN_Responder(event_t * event)
askforquit = true;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
typeofask = 5;
S_StartSound(NULL, sfx_chat);
Expand Down Expand Up @@ -2843,7 +2845,7 @@ void MN_ActivateMenu(void)
CurrentItPos = CurrentMenu->oldItPos;
if (!netgame && !demoplayback)
{
paused = true;
MN_SetPaused();
}
S_StartSound(NULL, sfx_dorcls);
slottextloaded = false; //reload the slot text, when needed
Expand All @@ -2868,7 +2870,7 @@ void MN_DeactivateMenu(void)
}
if (!netgame)
{
paused = false;
MN_SetUnpaused();
}
S_StartSound(NULL, sfx_dorcls);
if (soundchanged)
Expand Down Expand Up @@ -3185,3 +3187,21 @@ static void DrawCrispness3(void)
// Crosshair Color
DrawCrispnessMultiItem(crispy->crosshaircolor+1, 185, 125, multiitem_he_crosshaircolor, !crispy->crosshair);
}

static void MN_SetPaused()
{
if (paused) return;
if (demorecording)
sendpause = true;
else
paused = true;
}

static void MN_SetUnpaused()
{
if (!paused) return;
if (demorecording)
sendpause = true;
else
paused = false;
}
Loading