# Conflicts:
#	source/core/gamecontrol.h
#	source/duke3d/src/game.cpp
#	source/exhumed/src/exhumed.cpp
#	source/rr/src/game.cpp
This commit is contained in:
Christoph Oelckers 2020-05-31 23:30:10 +02:00
commit 68c97e3c25
43 changed files with 277 additions and 346 deletions

View file

@ -104,7 +104,6 @@ double g_gameUpdateAvgTime = 0.001;
bool gQuitGame;
int gQuitRequest;
bool gPaused;
enum gametokens
{
@ -663,7 +662,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
gGameMessageMgr.SetCoordinates(gViewX0S+1,gViewY0S+15);
netWaitForEveryone(0);
totalclock = 0;
gPaused = 0;
paused = 0;
gGameStarted = 1;
ready2send = 1;
}
@ -823,8 +822,7 @@ void ProcessFrame(void)
if (gPlayer[i].input.keyFlags.pause)
{
gPlayer[i].input.keyFlags.pause = 0;
gPaused = !gPaused;
if (gPaused && gGameOptions.nGameType > 0 && numplayers > 1)
if (paused && gGameOptions.nGameType > 0 && numplayers > 1)
{
sprintf(buffer,"%s paused the game",gProfile[i].name);
viewSetMessage(buffer);
@ -834,7 +832,7 @@ void ProcessFrame(void)
viewClearInterpolations();
if (!gDemo.at1)
{
if (gPaused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && M_Active()))
if (paused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && M_Active()))
return;
if (gDemo.at0)
gDemo.Write(gFifoInput[(gNetFifoTail-1)&255]);
@ -1214,7 +1212,7 @@ RESTART:
{
char gameUpdate = false;
double const gameUpdateStartTime = timerGetHiTicks();
while (gPredictTail < gNetFifoHead[myconnectindex] && !gPaused)
while (gPredictTail < gNetFifoHead[myconnectindex] && !paused)
{
viewUpdatePrediction(&gFifoInput[gPredictTail&255][myconnectindex]);
}

View file

@ -121,7 +121,6 @@ extern double g_gameUpdateTime, g_gameUpdateAndDrawTime;
extern double g_gameUpdateAvgTime;
extern int blood_globalflags;
extern bool gPaused;
extern bool gSavingGame;
extern bool gQuitGame;
extern int gQuitRequest;

View file

@ -78,8 +78,17 @@ int gViewLookRecenter;
void ctrlGetInput(void)
{
int prevPauseState = paused;
ControlInfo info;
static double lastInputTicks;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
lastInputTicks = currentHiTicks;
auto scaleAdjustmentToInterval = [=](double x) { return x * kTicsPerSec / (1000.0 / elapsedInputTicks); };
if (!gGameStarted || gInputMode != kInputGame)
{
gInput = {};
@ -87,14 +96,16 @@ void ctrlGetInput(void)
return;
}
updatePauseStatus();
if (paused != prevPauseState)
{
gInput.keyFlags.pause = 1;
}
if (paused)
return;
GINPUT input = {};
static double lastInputTicks;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
lastInputTicks = currentHiTicks;
auto scaleAdjustmentToInterval = [=](double x) { return x * kTicsPerSec / (1000.0 / elapsedInputTicks); };
D_ProcessEvents();
@ -366,12 +377,6 @@ void ctrlGetInput(void)
if (!in_mouseflip)
input.q16mlook = -input.q16mlook;
if (inputState.GetKeyStatus(sc_Pause)) // 0xc5 in disassembly
{
gInput.keyFlags.pause = 1;
inputState.ClearKeyStatus(sc_Pause);
}
if (!gViewMap.bFollowMode && gViewMode == 4)
{
gViewMap.turn += input.q16turn<<2;
@ -385,7 +390,7 @@ void ctrlGetInput(void)
gInput.strafe = clamp(gInput.strafe + input.strafe, -2048, 2048);
gInput.q16turn = fix16_sadd(gInput.q16turn, input.q16turn);
gInput.q16mlook = fix16_clamp(fix16_sadd(gInput.q16mlook, input.q16mlook), fix16_from_int(-127)>>2, fix16_from_int(127)>>2);
if (gMe && gMe->pXSprite->health != 0 && !gPaused)
if (gMe && gMe->pXSprite->health != 0 && !paused)
{
int upAngle = 289;
int downAngle = -347;

View file

@ -561,7 +561,7 @@ bool GameInterface::LoadGame(FSaveGameNode* node)
gFrame = 0;
gFrameRate = 0;
totalclock = 0;
gPaused = 0;
paused = 0;
gGameStarted = 1;
bVanilla = false;
@ -662,7 +662,7 @@ void MyLoadSave::Load(void)
Read(&totalclock, sizeof(totalclock));
totalclock = nGameClock;
Read(&gLevelTime, sizeof(gLevelTime));
Read(&gPaused, sizeof(gPaused));
Read(&paused, sizeof(paused));
Read(baseWall, sizeof(baseWall[0])*numwalls);
Read(baseSprite, sizeof(baseSprite[0])*nNumSprites);
Read(baseFloor, sizeof(baseFloor[0])*numsectors);
@ -755,7 +755,7 @@ void MyLoadSave::Save(void)
ClockTicks nGameClock = totalclock;
Write(&nGameClock, sizeof(nGameClock));
Write(&gLevelTime, sizeof(gLevelTime));
Write(&gPaused, sizeof(gPaused));
Write(&paused, sizeof(paused));
Write(baseWall, sizeof(baseWall[0])*numwalls);
Write(baseSprite, sizeof(baseSprite[0])*nNumSprites);
Write(baseFloor, sizeof(baseFloor[0])*numsectors);

View file

@ -3089,7 +3089,7 @@ void viewDrawScreen(bool sceneonly)
if (delta < 0)
delta = 0;
lastUpdate = totalclock;
if (!gPaused && (!M_Active() || gGameOptions.nGameType != 0))
if (!paused && (!M_Active() || gGameOptions.nGameType != 0))
{
gInterpolate = ((totalclock-gNetFifoClock)+4).toScale16()/4;
}
@ -3559,7 +3559,7 @@ void viewDrawScreen(bool sceneonly)
viewDrawMapTitle();
viewDrawAimedPlayerName();
if (gPaused)
if (paused)
{
viewDrawText(1, GStrings("TXTB_PAUSED"), 160, 10, 0, 0, 1, 0);
}

View file

@ -166,9 +166,9 @@ static bool S_StartMusicPlaying(ZMusic_MusicStream song, bool loop, float rel_vo
//==========================================================================
//
// S_PauseSound
// S_PauseMusic
//
// Stop music and sound effects, during game PAUSE.
// Stop music, during game PAUSE.
//==========================================================================
void S_PauseMusic ()
@ -183,9 +183,9 @@ void S_PauseMusic ()
//==========================================================================
//
// S_ResumeSound
// S_ResumeMusic
//
// Resume music and sound effects, after game PAUSE.
// Resume music, after game PAUSE.
//==========================================================================
void S_ResumeMusic ()

View file

@ -135,6 +135,9 @@ CVAR(Bool, disableautoload, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALC
extern int hud_size_max;
int paused;
bool pausedWithKey;
CUSTOM_CVAR(Int, cl_gender, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self < 0 || self > 3) self = 0;
@ -937,6 +940,45 @@ CCMD(snd_reset)
Mus_ResumeSaved();
}
//==========================================================================
//
// S_PauseSound
//
// Stop music and sound effects, during game PAUSE.
//
//==========================================================================
void S_PauseSound (bool notmusic, bool notsfx)
{
if (!notmusic)
{
S_PauseMusic();
}
if (!notsfx)
{
soundEngine->SetPaused(true);
GSnd->SetSfxPaused (true, 0);
}
}
//==========================================================================
//
// S_ResumeSound
//
// Resume music and sound effects, after game PAUSE.
//
//==========================================================================
void S_ResumeSound (bool notsfx)
{
S_ResumeMusic();
if (!notsfx)
{
soundEngine->SetPaused(false);
GSnd->SetSfxPaused (false, 0);
}
}
//==========================================================================
//
// S_SetSoundPaused
@ -947,7 +989,6 @@ CCMD(snd_reset)
void S_SetSoundPaused(int state)
{
#if 0
if (state)
{
if (paused == 0)
@ -966,21 +1007,10 @@ void S_SetSoundPaused(int state)
S_PauseSound(false, true);
if (GSnd != nullptr)
{
GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ?
SoundRenderer::INACTIVE_Complete :
SoundRenderer::INACTIVE_Mute);
GSnd->SetInactive(SoundRenderer::INACTIVE_Complete);
}
}
}
if (!netgame
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
#endif
}
int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int realgameticspersec)
@ -1051,3 +1081,32 @@ bool CheckCheatmode(bool printmsg)
return false;
}
void updatePauseStatus()
{
bool GUICapture = System_WantGuiCapture();
if (M_Active() || GUICapture)
{
paused = 1;
}
else if ((!M_Active() || !GUICapture) && !pausedWithKey)
{
paused = 0;
}
if (inputState.GetKeyStatus(sc_Pause))
{
inputState.ClearKeyStatus(sc_Pause);
paused = !paused;
if (paused)
{
S_PauseSound(!paused, !paused);
}
else
{
S_ResumeSound(paused);
}
pausedWithKey = paused;
}
}

View file

@ -149,6 +149,9 @@ const char* G_DefaultConFile(void);
const char* G_ConFile(void);
TArray<GrpEntry> GrpScan();
void S_PauseSound(bool notmusic, bool notsfx);
void S_ResumeSound(bool notsfx);
void S_SetSoundPaused(int state);
void G_FatalEngineError(void);
int CalcSmoothRatio(const ClockTicks& totalclk, const ClockTicks& ototalclk, int realgameticspersec);
@ -161,3 +164,5 @@ enum
PAUSESFX_CONSOLE = 2
};
void updatePauseStatus();
extern int paused;

View file

@ -425,7 +425,7 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
void GameInterface::MenuOpened()
{
S_PauseSounds(true);
S_PauseSound(true, false);
if ((!g_netServer && ud.multimode < 2))
{
ready2send = 0;
@ -491,7 +491,7 @@ void GameInterface::MenuClosed()
}
G_UpdateScreenArea();
S_PauseSounds(false);
S_ResumeSound(false);
}
}

View file

@ -117,7 +117,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
ud.reccnt = 0;
ud.god = ud.cashman = ud.eog = gFullMap = 0;
ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= ud.pause_on = 0;
ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= paused = 0;
totalclock = ototalclock = lockclock = 0;
@ -588,7 +588,7 @@ RECHECK:
Demo_FinishProfile();
while (totalclock >= (lockclock+TICSPERFRAME)
// || (ud.reccnt > REALGAMETICSPERSEC*2 && ud.pause_on)
// || (ud.reccnt > REALGAMETICSPERSEC*2 && paused)
|| (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt))
{
if (ud.reccnt<=0)

View file

@ -3746,7 +3746,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
spritesortcnt++;
}
if (g_player[playerNum].input->extbits & (1 << 7) && !ud.pause_on && spritesortcnt < maxspritesonscreen)
if (g_player[playerNum].input->extbits & (1 << 7) && !paused && spritesortcnt < maxspritesonscreen)
{
auto const playerTyping = &tsprite[spritesortcnt];
@ -5913,7 +5913,9 @@ MAIN_LOOP_RESTART:
bool gameUpdate = false;
double gameUpdateStartTime = timerGetHiTicks();
if (M_Active() || GUICapture || ud.pause_on != 0)
updatePauseStatus();
if (paused)
{
ototalclock = totalclock - TICSPERFRAME;
buttonMap.ResetButtonStates();
@ -5922,8 +5924,8 @@ MAIN_LOOP_RESTART:
{
while (((g_netClient || g_netServer) || (myplayer.gm & (MODE_MENU | MODE_DEMO)) == 0) && (int)(totalclock - ototalclock) >= TICSPERFRAME)
{
ototalclock += TICSPERFRAME;
if (g_networkMode != NET_DEDICATED_SERVER)
{
P_GetInput(myconnectindex);
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
@ -5944,8 +5946,11 @@ MAIN_LOOP_RESTART:
}
localInput = {};
}
if ((!System_WantGuiCapture() || ud.recstat == 2 || (g_netServer || ud.multimode > 1))
ototalclock += TICSPERFRAME;
if (paused == 0 && (!System_WantGuiCapture() || ud.recstat == 2 || (g_netServer || ud.multimode > 1))
&& (myplayer.gm & MODE_GAME))
{
Net_GetPackets();
@ -6120,11 +6125,8 @@ int G_DoMoveThings(void)
everyothertime++;
if (g_earthquakeTime > 0) g_earthquakeTime--;
if (ud.pause_on == 0)
{
g_globalRandom = krand();
A_MoveDummyPlayers();//ST 13
}
for (bssize_t TRAVERSE_CONNECT(i))
{
@ -6143,14 +6145,10 @@ int G_DoMoveThings(void)
P_HandleSharedKeys(i);
if (ud.pause_on == 0)
{
P_ProcessInput(i);
P_CheckSectors(i);
}
}
if (ud.pause_on == 0)
G_MoveWorld();
// Net_CorrectPrediction();

View file

@ -317,7 +317,7 @@ static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk
if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
(g_netServer || ud.multimode > 1) ||
ud.recstat == 2) ||
ud.pause_on)
paused)
{
return 65536;
}

View file

@ -1394,7 +1394,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2)
case USERDEFS_OVERHEAD_ON: labelNum = ud.overhead_on; break;
case USERDEFS_LAST_OVERHEAD: labelNum = ud.last_overhead; break;
case USERDEFS_SHOWWEAPONS: labelNum = ud.showweapons; break;
case USERDEFS_PAUSE_ON: labelNum = ud.pause_on; break;
case USERDEFS_PAUSE_ON: labelNum = paused; break;
case USERDEFS_FROM_BONUS: labelNum = ud.from_bonus; break;
case USERDEFS_CAMERASPRITE: labelNum = ud.camerasprite; break;
case USERDEFS_LAST_CAMSPRITE: labelNum = ud.last_camsprite; break;
@ -1582,7 +1582,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons
case USERDEFS_OVERHEAD_ON: ud.overhead_on = iSet; break;
case USERDEFS_LAST_OVERHEAD: ud.last_overhead = iSet; break;
case USERDEFS_SHOWWEAPONS: ud.showweapons = iSet; break;
case USERDEFS_PAUSE_ON: ud.pause_on = iSet; break;
case USERDEFS_PAUSE_ON: paused = iSet; break;
case USERDEFS_FROM_BONUS: ud.from_bonus = iSet; break;
case USERDEFS_CAMERASPRITE: ud.camerasprite = iSet; break;
case USERDEFS_LAST_CAMSPRITE: ud.last_camsprite = iSet; break;

View file

@ -2275,7 +2275,7 @@ static void Net_ReceiveServerUpdate(ENetEvent *event)
Bmemcpy(&serverupdate, updatebuf, sizeof(serverupdate_t));
updatebuf += sizeof(serverupdate_t);
inputfifo[0][0] = serverupdate.nsyn;
ud.pause_on = serverupdate.pause_on;
paused = serverupdate.pause_on;
ticrandomseed = serverupdate.seed;
@ -4945,7 +4945,7 @@ void Net_SendServerUpdates(void)
serverupdate.header = PACKET_MASTER_TO_SLAVE;
serverupdate.seed = ticrandomseed;
serverupdate.nsyn = *nsyn;
serverupdate.pause_on = ud.pause_on;
serverupdate.pause_on = paused;
serverupdate.numplayers = 0;
updatebuf = tempnetbuf.Data() + sizeof(serverupdate_t);

View file

@ -2364,7 +2364,7 @@ void P_DisplayWeapon(void)
goto enddisplayweapon;
#ifndef EDUKE32_STANDALONE
int const doAnim = !(sprite[pPlayer->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm & MODE_MENU);
int const doAnim = !(sprite[pPlayer->i].pal == 1 || paused || g_player[myconnectindex].ps->gm & MODE_MENU);
int const halfLookAng = fix16_to_int(pPlayer->q16look_ang) >> 1;
int const weaponPal = P_GetHudPal(pPlayer);
@ -3073,7 +3073,15 @@ void P_GetInput(int const playerNum)
auto const pSprite = &sprite[pPlayer->i];
ControlInfo info;
if (g_cheatBufLen > 1 || (pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
if (g_cheatBufLen > 1 || (pPlayer->gm & (MODE_MENU|MODE_TYPE)) || paused)
{
if (!(pPlayer->gm&MODE_MENU))
CONTROL_GetInput(&info);
@ -3134,14 +3142,6 @@ void P_GetInput(int const playerNum)
input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
if (buttonMap.ButtonDown(gamefunc_Strafe))
@ -3274,7 +3274,6 @@ void P_GetInput(int const playerNum)
localInput.bits |= (mouseaim << SK_AIMMODE);
localInput.bits |= (g_gameQuit << SK_GAMEQUIT);
localInput.bits |= inputState.GetKeyStatus(sc_Pause) << SK_PAUSE;
//localInput.bits |= ((uint32_t)inputState.GetKeyStatus(sc_Escape)) << SK_ESCAPE; fixme.This needs to be done differently
if (buttonMap.ButtonDown(gamefunc_Dpad_Select))

View file

@ -871,7 +871,7 @@ static void P_PrepForNewLevel(int playerNum, int gameMode)
ud.camerasprite = -1;
ud.eog = 0;
ud.pause_on = 0;
paused = 0;
if (((gameMode & MODE_EOL) != MODE_EOL && numplayers < 2 && !g_netServer)
|| (!(g_gametypeFlags[ud.coop] & GAMETYPE_PRESERVEINVENTORYDEATH) && numplayers > 1))
@ -1728,7 +1728,7 @@ int G_EnterLevel(int gameMode)
if (g_networkMode != NET_DEDICATED_SERVER)
{
S_PauseSounds(false);
S_ResumeSound(false);
FX_StopAllSounds();
S_ClearSoundLocks();
FX_SetReverb(0);

View file

@ -1093,7 +1093,7 @@ static const dataspec_t svgm_udnetw[] =
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
{ DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 },
{ 0, &ud.pause_on, sizeof(ud.pause_on), 1 },
{ 0, &paused, sizeof(paused), 1 },
{ 0, connectpoint2, sizeof(connectpoint2), 1 },
{ 0, &randomseed, sizeof(randomseed), 1 },
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },

View file

@ -784,7 +784,7 @@ void G_DisplayRest(int32_t smoothratio)
if (ud.scrollmode == 0)
{
if (pp->newowner == -1 && !ud.pause_on)
if (pp->newowner == -1 && !paused)
{
cposx = pp->opos.x + mulscale16(pp->pos.x-pp->opos.x, smoothratio);
cposy = pp->opos.y + mulscale16(pp->pos.y-pp->opos.y, smoothratio);
@ -799,7 +799,7 @@ void G_DisplayRest(int32_t smoothratio)
}
else
{
if (!ud.pause_on)
if (!paused)
{
ud.fola += ud.folavel>>3;
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
@ -898,10 +898,10 @@ void G_DisplayRest(int32_t smoothratio)
renderSetAspect(vr, asp);
}
if (ud.pause_on==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
if (paused==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
menutext_center(100, GStrings("Game Paused"));
mdpause = (ud.pause_on || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2));
mdpause = (paused || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2));
// JBF 20040124: display level stats in screen corner
if (ud.overhead_on != 2 && hud_stats && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0)

View file

@ -2651,28 +2651,7 @@ void P_HandleSharedKeys(int playerNum)
if (playerBits && TEST_SYNC_KEY(playerBits, SK_MULTIFLAG) == 0)
{
if (TEST_SYNC_KEY(playerBits, SK_PAUSE))
{
inputState.ClearKeyStatus(sc_Pause);
if (ud.pause_on)
ud.pause_on = 0;
else ud.pause_on = 1+SHIFTS_IS_PRESSED;
if (ud.pause_on)
{
Mus_SetPaused(true);
S_PauseSounds(true);
}
else
{
Mus_SetPaused(false);
S_PauseSounds(false);
pub = NUMPAGES;
pus = NUMPAGES;
}
}
if (ud.pause_on) return;
if (paused) return;
if (sprite[pPlayer->i].extra <= 0) return; // if dead...

View file

@ -80,17 +80,6 @@ TArray<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
//
//==========================================================================
void S_PauseSounds(bool paused)
{
soundEngine->SetPaused(paused);
}
//==========================================================================
//
//
//
//==========================================================================
void cacheAllSounds(void)
{
auto& sfx = soundEngine->GetSounds();

View file

@ -58,7 +58,6 @@ inline void S_ClearSoundLocks(void) {}
void cacheAllSounds(void);
void S_MenuSound(void);
void S_PauseMusic(bool paused);
void S_PauseSounds(bool paused);
void S_PlayLevelMusicOrNothing(unsigned int);
int S_TryPlaySpecialMusic(unsigned int);
void S_PlaySpecialMusicOrNothing(unsigned int);

View file

@ -730,7 +730,6 @@ short screensize;
short bSnakeCam = kFalse;
short bRecord = kFalse;
short bPlayback = kFalse;
short bPause = kFalse;
short bInDemo = kFalse;
short bSlipMode = kFalse;
short bDoFlashes = kTrue;
@ -1012,26 +1011,8 @@ void CheckKeys()
return;
}
if (inputState.GetKeyStatus(sc_Pause))
if (paused)
{
if (!nNetPlayerCount)
{
if (bPause)
{
ototalclock = totalclock = tclocks;
bPause = kFalse;
}
else
{
bPause = kTrue;
// NoClip();
// int nLen = MyGetStringWidth("PAUSED");
// myprintext((320 - nLen) / 2, 100, "PAUSED", 0);
// Clip();
// videoNextPage();
}
inputState.ClearKeyStatus(sc_Pause);
}
return;
}
@ -1463,7 +1444,7 @@ void G_Polymer_UnInit(void) { }
static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk)
{
if (bRecord || bPlayback || nFreeze != 0 || bCamera || bPause)
if (bRecord || bPlayback || nFreeze != 0 || bCamera || paused)
return 65536;
return CalcSmoothRatio(totalclk, ototalclk, 30);
@ -1525,7 +1506,7 @@ static void GameDisplay(void)
DrawView(smoothRatio);
if (bPause)
if (paused && !M_Active())
{
int nLen = MyGetStringWidth("PAUSED");
myprintext((320 - nLen) / 2, 100, "PAUSED", 0);
@ -2214,6 +2195,7 @@ GAMELOOP:
}
// TODO CONTROL_GetButtonInput();
updatePauseStatus();
CheckKeys();
if (bRecord || bPlayback)
@ -2279,12 +2261,12 @@ GAMELOOP:
else
{
// loc_11FBC:
while (bPause)
while (paused)
{
inputState.ClearAllInput();
if (WaitAnyKey(-1) != sc_Pause)
{
bPause = kFalse;
paused = kFalse;
}
}
}
@ -2332,7 +2314,7 @@ GAMELOOP:
{
bInMove = kTrue;
if (System_WantGuiCapture() || bPause)
if (paused)
{
tclocks = totalclock - 4;
buttonMap.ResetButtonStates();
@ -3267,7 +3249,7 @@ int DoSpiritHead()
bool GameInterface::CanSave()
{
return !bRecord && !bPlayback && !bPause && !bInDemo && nTotalPlayers == 1;
return !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1;
}
void GameInterface::UpdateScreenSize()

View file

@ -159,6 +159,18 @@ void PlayerInterruptKeys()
ControlInfo info;
memset(&info, 0, sizeof(ControlInfo)); // this is done within CONTROL_GetInput() anyway
CONTROL_GetInput(&info);
static double lastInputTicks;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
lastInputTicks = currentHiTicks;
auto scaleAdjustmentToInterval = [=](double x) { return x * (120 / 4) / (1000.0 / elapsedInputTicks); };
if (paused)
return;
D_ProcessEvents();
localInput = {};
@ -207,14 +219,6 @@ void PlayerInterruptKeys()
input.xVel -= info.dx * keyMove / analogExtent;
input.yVel -= info.dz * keyMove / analogExtent;
static double lastInputTicks;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
lastInputTicks = currentHiTicks;
auto scaleAdjustmentToInterval = [=](double x) { return x * (120 / 4) / (1000.0 / elapsedInputTicks); };
if (buttonMap.ButtonDown(gamefunc_Strafe))
{
if (buttonMap.ButtonDown(gamefunc_Turn_Left))

View file

@ -580,7 +580,7 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
void GameInterface::MenuOpened()
{
S_PauseSounds(true);
S_PauseSound(true, false);
if ((!g_netServer && ud.multimode < 2))
{
ready2send = 0;
@ -646,7 +646,7 @@ void GameInterface::MenuClosed()
}
G_UpdateScreenArea();
S_PauseSounds(false);
S_ResumeSound(false);
}
}

View file

@ -120,7 +120,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
gFullMap = false;
ud.god = ud.cashman = ud.eog = 0;
ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= ud.pause_on = 0;
ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= paused = 0;
totalclock = ototalclock = lockclock = 0;
@ -591,7 +591,7 @@ RECHECK:
Demo_FinishProfile();
while (totalclock >= (lockclock+TICSPERFRAME)
// || (ud.reccnt > REALGAMETICSPERSEC*2 && ud.pause_on)
// || (ud.reccnt > REALGAMETICSPERSEC*2 && paused)
|| (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt))
{
if (ud.reccnt<=0)

View file

@ -850,7 +850,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
videoSetCorrectedAspect();
}
if (ud.pause_on || pPlayer->on_crane > -1)
if (paused || pPlayer->on_crane > -1)
smoothRatio = 65536;
else
smoothRatio = calc_smoothratio(totalclock, ototalclock);
@ -925,7 +925,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
if (RRRA && pPlayer->drug_mode > 0)
{
while (pPlayer->drug_timer < totalclock && !(pPlayer->gm & MODE_MENU) && !ud.pause_on && !System_WantGuiCapture())
while (pPlayer->drug_timer < totalclock && !(pPlayer->gm & MODE_MENU) && !paused && !System_WantGuiCapture())
{
int aspect;
if (pPlayer->drug_stat[0] == 0)
@ -5028,7 +5028,7 @@ default_case1:
spritesortcnt++;
}
if (g_player[playerNum].input->extbits & (1 << 7) && !ud.pause_on && spritesortcnt < maxspritesonscreen)
if (g_player[playerNum].input->extbits & (1 << 7) && !paused && spritesortcnt < maxspritesonscreen)
{
tspritetype *const playerTyping = t;
@ -7303,7 +7303,9 @@ MAIN_LOOP_RESTART:
char gameUpdate = false;
double const gameUpdateStartTime = timerGetHiTicks();
if (M_Active() || GUICapture || ud.pause_on != 0)
updatePauseStatus();
if (paused)
{
ototalclock = totalclock - TICSPERFRAME;
buttonMap.ResetButtonStates();
@ -7312,8 +7314,6 @@ MAIN_LOOP_RESTART:
{
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && (int)(totalclock - ototalclock) >= TICSPERFRAME)
{
ototalclock += TICSPERFRAME;
if (RRRA && g_player[myconnectindex].ps->on_motorcycle)
P_GetInputMotorcycle(myconnectindex);
else if (RRRA && g_player[myconnectindex].ps->on_boat)
@ -7337,7 +7337,9 @@ MAIN_LOOP_RESTART:
g_player[myconnectindex].movefifoend++;
if (((!System_WantGuiCapture() && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
ototalclock += TICSPERFRAME;
if (paused == 0 && (!System_WantGuiCapture() || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
(g_player[myconnectindex].ps->gm&MODE_GAME))
{
G_MoveLoop();
@ -7535,11 +7537,8 @@ int G_DoMoveThings(void)
everyothertime++;
if (g_earthquakeTime > 0) g_earthquakeTime--;
if (ud.pause_on == 0)
{
g_globalRandom = krand2();
A_MoveDummyPlayers();//ST 13
}
for (bssize_t TRAVERSE_CONNECT(i))
{
@ -7561,15 +7560,11 @@ int G_DoMoveThings(void)
if (!DEER)
P_HandleSharedKeys(i);
if (ud.pause_on == 0)
{
P_ProcessInput(i);
if (!DEER)
P_CheckSectors(i);
}
}
if (ud.pause_on == 0)
G_MoveWorld();
Net_CorrectPrediction();

View file

@ -314,7 +314,7 @@ static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk
if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
(g_netServer || ud.multimode > 1) ||
ud.recstat == 2) ||
ud.pause_on)
paused)
{
return 65536;
}

View file

@ -2093,7 +2093,7 @@ void P_DisplayWeapon(void)
if (!RR && currentWeapon == KNEE_WEAPON && *weaponFrame == 0)
goto enddisplayweapon;
int const doAnim = !(sprite[pPlayer->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm & MODE_MENU);
int const doAnim = !(sprite[pPlayer->i].pal == 1 || paused || g_player[myconnectindex].ps->gm & MODE_MENU);
int const halfLookAng = fix16_to_int(pPlayer->q16look_ang) >> 1;
int const weaponPal = P_GetHudPal(pPlayer);
@ -3209,7 +3209,15 @@ void P_GetInput(int const playerNum)
auto const pSprite = &sprite[pPlayer->i];
ControlInfo info;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || paused)
{
if (!(pPlayer->gm&MODE_MENU))
CONTROL_GetInput(&info);
@ -3272,14 +3280,6 @@ void P_GetInput(int const playerNum)
input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
if (buttonMap.ButtonDown(gamefunc_Strafe))
@ -3631,7 +3631,15 @@ void P_GetInputMotorcycle(int playerNum)
auto const pSprite = &sprite[pPlayer->i];
ControlInfo info;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || paused)
{
if (!(pPlayer->gm&MODE_MENU))
CONTROL_GetInput(&info);
@ -3670,14 +3678,6 @@ void P_GetInputMotorcycle(int playerNum)
input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
pPlayer->crouch_toggle = 0;
@ -3885,7 +3885,15 @@ void P_GetInputBoat(int playerNum)
auto const pSprite = &sprite[pPlayer->i];
ControlInfo info;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || paused)
{
if (!(pPlayer->gm&MODE_MENU))
CONTROL_GetInput(&info);
@ -3924,14 +3932,6 @@ void P_GetInputBoat(int playerNum)
input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
pPlayer->crouch_toggle = 0;
@ -4134,7 +4134,15 @@ void P_DHGetInput(int const playerNum)
auto const pSprite = &sprite[pPlayer->i];
ControlInfo info;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || paused)
{
if (!(pPlayer->gm&MODE_MENU))
CONTROL_GetInput(&info);
@ -4189,14 +4197,6 @@ void P_DHGetInput(int const playerNum)
input.svel -= info.dx * keyMove / analogExtent;
input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks)
return;
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
if (buttonMap.ButtonDown(gamefunc_Strafe))

View file

@ -1150,7 +1150,7 @@ static void resetprestat(int playerNum, int gameMode)
g_animateCnt = 0;
parallaxtype = 0;
randomseed = 17;
ud.pause_on = 0;
paused = 0;
ud.camerasprite = -1;
ud.eog = 0;
tempwallptr = 0;
@ -2289,7 +2289,7 @@ int G_EnterLevel(int gameMode)
//if (g_networkMode != NET_DEDICATED_SERVER)
{
S_PauseSounds(false);
S_ResumeSound(false);
FX_StopAllSounds();
S_ClearSoundLocks();
FX_SetReverb(0);

View file

@ -183,7 +183,7 @@ int32_t G_LoadPlayer(const char *path)
// some setup first
ud.multimode = h.numplayers;
S_PauseSounds(true);
S_PauseSound(true, false);
if (numplayers > 1)
{
@ -834,7 +834,7 @@ static const dataspec_t svgm_udnetw[] =
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
{ DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 },
{ 0, &ud.pause_on, sizeof(ud.pause_on), 1 },
{ 0, &paused, sizeof(paused), 1 },
{ 0, connectpoint2, sizeof(connectpoint2), 1 },
{ 0, &randomseed, sizeof(randomseed), 1 },
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },

View file

@ -765,7 +765,7 @@ void G_DisplayRest(int32_t smoothratio)
if (ud.scrollmode == 0)
{
if (pp->newowner == -1 && !ud.pause_on)
if (pp->newowner == -1 && !paused)
{
if (screenpeek == myconnectindex && numplayers > 1)
{
@ -789,7 +789,7 @@ void G_DisplayRest(int32_t smoothratio)
}
else
{
if (!ud.pause_on)
if (!paused)
{
ud.fola += ud.folavel>>3;
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
@ -869,10 +869,10 @@ void G_DisplayRest(int32_t smoothratio)
}
*/
if (ud.pause_on==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
if (paused==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
menutext_center(100, GStrings("Game Paused"));
mdpause = (ud.pause_on || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2));
mdpause = (paused || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2));
// JBF 20040124: display level stats in screen corner
if (ud.overhead_on != 2 && hud_stats) // && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0)

View file

@ -3649,29 +3649,7 @@ void P_HandleSharedKeys(int playerNum)
{
pPlayer->interface_toggle_flag = 1;
if (TEST_SYNC_KEY(playerBits, SK_PAUSE))
{
inputState.ClearKeyStatus(sc_Pause);
if (ud.pause_on)
ud.pause_on = 0;
else ud.pause_on = 1+SHIFTS_IS_PRESSED;
if (ud.pause_on)
{
Mus_SetPaused(true);
S_PauseSounds(true);
}
else
{
Mus_SetPaused(false);
S_PauseSounds(false);
pub = NUMPAGES;
pus = NUMPAGES;
}
}
if (ud.pause_on) return;
if (paused) return;
if (sprite[pPlayer->i].extra <= 0) return; // if dead...

View file

@ -79,17 +79,6 @@ TArray<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
//
//==========================================================================
void S_PauseSounds(bool paused)
{
soundEngine->SetPaused(paused);
}
//==========================================================================
//
//
//
//==========================================================================
void cacheAllSounds(void)
{
auto& sfx = soundEngine->GetSounds();

View file

@ -57,8 +57,6 @@ inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPl
inline void S_ClearSoundLocks(void) {}
void cacheAllSounds(void);
void S_MenuSound(void);
void S_PauseMusic(bool paused);
void S_PauseSounds(bool paused);
void S_PlayLevelMusicOrNothing(unsigned int);
int S_TryPlaySpecialMusic(unsigned int);
void S_PlaySpecialMusicOrNothing(unsigned int);

View file

@ -65,7 +65,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
static int OverlapDraw = FALSE;
extern SWBOOL QuitFlag, LocationInfo, ConPanel, SpriteInfo, PauseKeySet;
extern SWBOOL QuitFlag, LocationInfo, ConPanel, SpriteInfo;
extern SWBOOL Voxel;
extern char buffer[];
SWBOOL DrawScreen;
@ -1072,7 +1072,7 @@ static ClockTicks mapzoomclock;
void
ResizeView(PLAYERp pp)
{
if (M_Active() || PauseKeySet)
if (M_Active() || paused)
return;
if (dimensionmode == 2 || dimensionmode == 5 || dimensionmode == 6)
@ -2028,7 +2028,7 @@ drawscreen(PLAYERp pp)
smoothratio = CalcSmoothRatio(totalclock, ototalclock, 120 / synctics);
if (GamePaused && !ReloadPrompt) // The checks were brought over from domovethings
if (paused && !ReloadPrompt) // The checks were brought over from domovethings
smoothratio = 65536;
if (!ScreenSavePic)
@ -2328,6 +2328,26 @@ drawscreen(PLAYERp pp)
if (cl_sointerpolation)
so_restoreinterpolations(); // Stick at end of drawscreen
if (paused && !M_Active())
{
short w,h;
#define MSG_GAME_PAUSED "Game Paused"
MNU_MeasureString(MSG_GAME_PAUSED, &w, &h);
PutStringTimer(pp, TEXT_TEST_COL(w), 100, MSG_GAME_PAUSED, 999);
}
else
{
pClearTextLine(pp, 100);
}
if (!CommEnabled && TEST(pp->Flags, PF_DEAD))
{
if (ReloadPrompt)
{
ReloadPrompt = FALSE;
}
}
PostDraw();
DrawScreen = FALSE;
}

View file

@ -224,8 +224,6 @@ const GAME_SET gs_defaults =
GAME_SET gs;
SWBOOL PlayerTrackingMode = FALSE;
SWBOOL PauseMode = FALSE;
SWBOOL PauseKeySet = FALSE;
SWBOOL SlowMode = FALSE;
SWBOOL FrameAdvanceTics = 3;
SWBOOL ScrollMode2D = FALSE;
@ -2320,10 +2318,6 @@ void MoveLoop(void)
// demosync_record();
#endif
}
// Get input again to update q16ang/q16horiz.
if (!PedanticMode)
getinput(&loc, TRUE);
}
@ -2460,15 +2454,24 @@ void RunLevel(void)
return; // Stop the game loop if a savegame was loaded from the menu.
}
if (M_Active() || GUICapture || GamePaused)
updatePauseStatus();
if (paused)
{
ototalclock = (int)totalclock - (120 / synctics);
buttonMap.ResetButtonStates();
}
else
{
faketimerhandler();
MoveLoop();
while (ready2send && (totalclock >= ototalclock + synctics))
{
UpdateInputs();
MoveLoop();
}
// Get input again to update q16ang/q16horiz.
if (!PedanticMode)
getinput(&loc, TRUE);
}
drawscreen(Player + screenpeek);
@ -2483,8 +2486,6 @@ void RunLevel(void)
}
timerUpdateClock();
while (ready2send && (totalclock >= ototalclock + synctics))
UpdateInputs();
}
ready2send = 0;
@ -2873,53 +2874,6 @@ FunctionKeys(PLAYERp pp)
}
}
void PauseKey(PLAYERp pp)
{
extern SWBOOL CheatInputMode;
if (inputState.GetKeyStatus(sc_Pause) && !CommEnabled && !InputMode && !M_Active() && !CheatInputMode && !ConPanel)
{
inputState.ClearKeyStatus(sc_Pause);
PauseKeySet ^= 1;
if (PauseKeySet)
GamePaused = TRUE;
else
GamePaused = FALSE;
if (GamePaused)
{
short w,h;
#define MSG_GAME_PAUSED "Game Paused"
MNU_MeasureString(MSG_GAME_PAUSED, &w, &h);
PutStringTimer(pp, TEXT_TEST_COL(w), 100, MSG_GAME_PAUSED, 999);
Mus_SetPaused(true);
}
else
{
pClearTextLine(pp, 100);
Mus_SetPaused(false);
}
}
if (!CommEnabled && TEST(pp->Flags, PF_DEAD))
{
if (ReloadPrompt)
{
ReloadPrompt = FALSE;
/*
}
else
{
inputState.SetKeyStatus(sc_Escape);
ControlPanelType = ct_quickloadmenu;
}
*/
}
}
}
short MirrorDelay;
double elapsedInputTicks;
@ -2988,9 +2942,7 @@ getinput(SW_PACKET *loc, SWBOOL tied)
ControlInfo info;
CONTROL_GetInput(&info);
PauseKey(pp);
if (PauseKeySet)
if (paused)
return;
// MAP KEY

View file

@ -2392,7 +2392,6 @@ void sendlogoff(void);
extern int ototalclock, save_totalclock, gotlastpacketclock,smoothratio;
extern SWBOOL ready2send;
extern SWBOOL GamePaused;
// local copy of variables updated by faketimerhandler
extern int locselectedgun;

View file

@ -29,6 +29,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "baselayer.h"
#include "mmulti.h"
#include "gamecontrol.h"
#include "keys.h"
#include "game.h"
#include "tags.h"
@ -70,7 +72,6 @@ SYNC BUG NOTES:
//#define MAXSYNCBYTES 16
static uint8_t tempbuf[576], packbuf[576];
int PlayClock;
extern SWBOOL PauseKeySet;
gNET gNet;
extern short PlayerQuitMenuLevel;
@ -128,7 +129,6 @@ int save_totalclock;
// must start out as 0
SWBOOL GamePaused = FALSE;
SWBOOL NetBroadcastMode = TRUE;
SWBOOL NetModeOverride = FALSE;
@ -385,33 +385,17 @@ int DecodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
return buf - base_ptr;
}
void
PauseGame(void)
{
if (PauseKeySet)
return;
if (DemoPlaying || DemoRecording)
return;
if (GamePaused)
return;
if (numplayers < 2)
GamePaused = TRUE;
}
void
ResumeGame(void)
{
if (PauseKeySet)
if (paused)
return;
if (DemoPlaying || DemoRecording)
return;
if (numplayers < 2)
GamePaused = FALSE;
paused = 0;
}
void

View file

@ -186,7 +186,6 @@ void SendVersion(int version);
void InitNetPlayerOptions(void);
void CheckVersion(int GameVersion);
void SW_SendMessage(short pnum,const char *text);
void PauseGame(void);
void ResumeGame(void);
END_SW_NS

View file

@ -6229,7 +6229,7 @@ pChopsShake(PANEL_SPRITEp psp)
void
pChopsWait(PANEL_SPRITEp psp)
{
//if (!GamePaused && RANDOM_P2(1024) < 10)
//if (!paused && RANDOM_P2(1024) < 10)
if (RANDOM_P2(1024) < 10)
{
// random x position

View file

@ -7846,9 +7846,9 @@ void PauseMultiPlay(void)
{
FLAG_KEY_RELEASE(pp, SK_PAUSE);
GamePaused ^= 1;
paused ^= 1;
if (GamePaused)
if (paused)
{
short w,h;
auto m = GStrings("Game Paused");
@ -7859,14 +7859,12 @@ void PauseMultiPlay(void)
SavePrediction = PredictionOn;
PredictionOn = FALSE;
Mus_SetPaused(true);
}
else
{
PredictionOn = SavePrediction;
TRAVERSE_CONNECT(p)
pClearTextLine(Player + p, 100);
Mus_SetPaused(false);
}
}
}
@ -7962,8 +7960,7 @@ domovethings(void)
#if 0
{
extern SWBOOL PauseKeySet;
if (inputState.GetKeyStatus(KEYSC_F5) && !(inputState.GetKeyStatus(KEYSC_ALT) || inputState.GetKeyStatus(KEYSC_RALT)) && !PauseKeySet)
if (inputState.GetKeyStatus(KEYSC_F5) && !(inputState.GetKeyStatus(KEYSC_ALT) || inputState.GetKeyStatus(KEYSC_RALT)) && !paused)
{
inputState.GetKeyStatus(KEYSC_F5) = 0;
ResChange();
@ -7991,7 +7988,7 @@ domovethings(void)
DoPlayerMenuKeys(pp);
}
if (GamePaused)
if (paused)
{
if (!ReloadPrompt)
return;

View file

@ -28,6 +28,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "build.h"
#include "common.h"
#include "gamecontrol.h"
#include "names2.h"
#include "game.h"
#include "tags.h"
@ -190,7 +192,7 @@ void QuakeViewChange(PLAYERp pp, int *z_diff, int *x_diff, int *y_diff, short *a
*y_diff = 0;
*ang_diff = 0;
if (GamePaused)
if (paused)
return;
// find the closest quake - should be a strength value

View file

@ -26,6 +26,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "gamecontrol.h"
#include "names2.h"
#include "game.h"
#include "tags.h"
@ -91,7 +93,7 @@ void VisViewChange(PLAYERp pp, int *vis)
int x,y,z;
short sectnum;
if (GamePaused)
if (paused)
return;
// find the closest quake - should be a strength value