mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-28 09:50:42 +00:00
Merge branch 'master' of https://github.com/coelckers/Raze
# 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:
commit
68c97e3c25
43 changed files with 277 additions and 346 deletions
|
@ -104,7 +104,6 @@ double g_gameUpdateAvgTime = 0.001;
|
||||||
|
|
||||||
bool gQuitGame;
|
bool gQuitGame;
|
||||||
int gQuitRequest;
|
int gQuitRequest;
|
||||||
bool gPaused;
|
|
||||||
|
|
||||||
enum gametokens
|
enum gametokens
|
||||||
{
|
{
|
||||||
|
@ -663,7 +662,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
|
||||||
gGameMessageMgr.SetCoordinates(gViewX0S+1,gViewY0S+15);
|
gGameMessageMgr.SetCoordinates(gViewX0S+1,gViewY0S+15);
|
||||||
netWaitForEveryone(0);
|
netWaitForEveryone(0);
|
||||||
totalclock = 0;
|
totalclock = 0;
|
||||||
gPaused = 0;
|
paused = 0;
|
||||||
gGameStarted = 1;
|
gGameStarted = 1;
|
||||||
ready2send = 1;
|
ready2send = 1;
|
||||||
}
|
}
|
||||||
|
@ -823,8 +822,7 @@ void ProcessFrame(void)
|
||||||
if (gPlayer[i].input.keyFlags.pause)
|
if (gPlayer[i].input.keyFlags.pause)
|
||||||
{
|
{
|
||||||
gPlayer[i].input.keyFlags.pause = 0;
|
gPlayer[i].input.keyFlags.pause = 0;
|
||||||
gPaused = !gPaused;
|
if (paused && gGameOptions.nGameType > 0 && numplayers > 1)
|
||||||
if (gPaused && gGameOptions.nGameType > 0 && numplayers > 1)
|
|
||||||
{
|
{
|
||||||
sprintf(buffer,"%s paused the game",gProfile[i].name);
|
sprintf(buffer,"%s paused the game",gProfile[i].name);
|
||||||
viewSetMessage(buffer);
|
viewSetMessage(buffer);
|
||||||
|
@ -834,7 +832,7 @@ void ProcessFrame(void)
|
||||||
viewClearInterpolations();
|
viewClearInterpolations();
|
||||||
if (!gDemo.at1)
|
if (!gDemo.at1)
|
||||||
{
|
{
|
||||||
if (gPaused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && M_Active()))
|
if (paused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && M_Active()))
|
||||||
return;
|
return;
|
||||||
if (gDemo.at0)
|
if (gDemo.at0)
|
||||||
gDemo.Write(gFifoInput[(gNetFifoTail-1)&255]);
|
gDemo.Write(gFifoInput[(gNetFifoTail-1)&255]);
|
||||||
|
@ -1214,7 +1212,7 @@ RESTART:
|
||||||
{
|
{
|
||||||
char gameUpdate = false;
|
char gameUpdate = false;
|
||||||
double const gameUpdateStartTime = timerGetHiTicks();
|
double const gameUpdateStartTime = timerGetHiTicks();
|
||||||
while (gPredictTail < gNetFifoHead[myconnectindex] && !gPaused)
|
while (gPredictTail < gNetFifoHead[myconnectindex] && !paused)
|
||||||
{
|
{
|
||||||
viewUpdatePrediction(&gFifoInput[gPredictTail&255][myconnectindex]);
|
viewUpdatePrediction(&gFifoInput[gPredictTail&255][myconnectindex]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,6 @@ extern double g_gameUpdateTime, g_gameUpdateAndDrawTime;
|
||||||
extern double g_gameUpdateAvgTime;
|
extern double g_gameUpdateAvgTime;
|
||||||
extern int blood_globalflags;
|
extern int blood_globalflags;
|
||||||
|
|
||||||
extern bool gPaused;
|
|
||||||
extern bool gSavingGame;
|
extern bool gSavingGame;
|
||||||
extern bool gQuitGame;
|
extern bool gQuitGame;
|
||||||
extern int gQuitRequest;
|
extern int gQuitRequest;
|
||||||
|
|
|
@ -78,8 +78,17 @@ int gViewLookRecenter;
|
||||||
|
|
||||||
void ctrlGetInput(void)
|
void ctrlGetInput(void)
|
||||||
{
|
{
|
||||||
|
int prevPauseState = paused;
|
||||||
ControlInfo info;
|
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)
|
if (!gGameStarted || gInputMode != kInputGame)
|
||||||
{
|
{
|
||||||
gInput = {};
|
gInput = {};
|
||||||
|
@ -87,14 +96,16 @@ void ctrlGetInput(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePauseStatus();
|
||||||
|
if (paused != prevPauseState)
|
||||||
|
{
|
||||||
|
gInput.keyFlags.pause = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paused)
|
||||||
|
return;
|
||||||
|
|
||||||
GINPUT input = {};
|
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();
|
D_ProcessEvents();
|
||||||
|
|
||||||
|
@ -366,12 +377,6 @@ void ctrlGetInput(void)
|
||||||
if (!in_mouseflip)
|
if (!in_mouseflip)
|
||||||
input.q16mlook = -input.q16mlook;
|
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)
|
if (!gViewMap.bFollowMode && gViewMode == 4)
|
||||||
{
|
{
|
||||||
gViewMap.turn += input.q16turn<<2;
|
gViewMap.turn += input.q16turn<<2;
|
||||||
|
@ -385,7 +390,7 @@ void ctrlGetInput(void)
|
||||||
gInput.strafe = clamp(gInput.strafe + input.strafe, -2048, 2048);
|
gInput.strafe = clamp(gInput.strafe + input.strafe, -2048, 2048);
|
||||||
gInput.q16turn = fix16_sadd(gInput.q16turn, input.q16turn);
|
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);
|
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 upAngle = 289;
|
||||||
int downAngle = -347;
|
int downAngle = -347;
|
||||||
|
|
|
@ -561,7 +561,7 @@ bool GameInterface::LoadGame(FSaveGameNode* node)
|
||||||
gFrame = 0;
|
gFrame = 0;
|
||||||
gFrameRate = 0;
|
gFrameRate = 0;
|
||||||
totalclock = 0;
|
totalclock = 0;
|
||||||
gPaused = 0;
|
paused = 0;
|
||||||
gGameStarted = 1;
|
gGameStarted = 1;
|
||||||
bVanilla = false;
|
bVanilla = false;
|
||||||
|
|
||||||
|
@ -662,7 +662,7 @@ void MyLoadSave::Load(void)
|
||||||
Read(&totalclock, sizeof(totalclock));
|
Read(&totalclock, sizeof(totalclock));
|
||||||
totalclock = nGameClock;
|
totalclock = nGameClock;
|
||||||
Read(&gLevelTime, sizeof(gLevelTime));
|
Read(&gLevelTime, sizeof(gLevelTime));
|
||||||
Read(&gPaused, sizeof(gPaused));
|
Read(&paused, sizeof(paused));
|
||||||
Read(baseWall, sizeof(baseWall[0])*numwalls);
|
Read(baseWall, sizeof(baseWall[0])*numwalls);
|
||||||
Read(baseSprite, sizeof(baseSprite[0])*nNumSprites);
|
Read(baseSprite, sizeof(baseSprite[0])*nNumSprites);
|
||||||
Read(baseFloor, sizeof(baseFloor[0])*numsectors);
|
Read(baseFloor, sizeof(baseFloor[0])*numsectors);
|
||||||
|
@ -755,7 +755,7 @@ void MyLoadSave::Save(void)
|
||||||
ClockTicks nGameClock = totalclock;
|
ClockTicks nGameClock = totalclock;
|
||||||
Write(&nGameClock, sizeof(nGameClock));
|
Write(&nGameClock, sizeof(nGameClock));
|
||||||
Write(&gLevelTime, sizeof(gLevelTime));
|
Write(&gLevelTime, sizeof(gLevelTime));
|
||||||
Write(&gPaused, sizeof(gPaused));
|
Write(&paused, sizeof(paused));
|
||||||
Write(baseWall, sizeof(baseWall[0])*numwalls);
|
Write(baseWall, sizeof(baseWall[0])*numwalls);
|
||||||
Write(baseSprite, sizeof(baseSprite[0])*nNumSprites);
|
Write(baseSprite, sizeof(baseSprite[0])*nNumSprites);
|
||||||
Write(baseFloor, sizeof(baseFloor[0])*numsectors);
|
Write(baseFloor, sizeof(baseFloor[0])*numsectors);
|
||||||
|
|
|
@ -3089,7 +3089,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
if (delta < 0)
|
if (delta < 0)
|
||||||
delta = 0;
|
delta = 0;
|
||||||
lastUpdate = totalclock;
|
lastUpdate = totalclock;
|
||||||
if (!gPaused && (!M_Active() || gGameOptions.nGameType != 0))
|
if (!paused && (!M_Active() || gGameOptions.nGameType != 0))
|
||||||
{
|
{
|
||||||
gInterpolate = ((totalclock-gNetFifoClock)+4).toScale16()/4;
|
gInterpolate = ((totalclock-gNetFifoClock)+4).toScale16()/4;
|
||||||
}
|
}
|
||||||
|
@ -3559,7 +3559,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
|
|
||||||
viewDrawMapTitle();
|
viewDrawMapTitle();
|
||||||
viewDrawAimedPlayerName();
|
viewDrawAimedPlayerName();
|
||||||
if (gPaused)
|
if (paused)
|
||||||
{
|
{
|
||||||
viewDrawText(1, GStrings("TXTB_PAUSED"), 160, 10, 0, 0, 1, 0);
|
viewDrawText(1, GStrings("TXTB_PAUSED"), 160, 10, 0, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 ()
|
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 ()
|
void S_ResumeMusic ()
|
||||||
|
|
|
@ -135,6 +135,9 @@ CVAR(Bool, disableautoload, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALC
|
||||||
|
|
||||||
extern int hud_size_max;
|
extern int hud_size_max;
|
||||||
|
|
||||||
|
int paused;
|
||||||
|
bool pausedWithKey;
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, cl_gender, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CUSTOM_CVAR(Int, cl_gender, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
{
|
{
|
||||||
if (self < 0 || self > 3) self = 0;
|
if (self < 0 || self > 3) self = 0;
|
||||||
|
@ -937,6 +940,45 @@ CCMD(snd_reset)
|
||||||
Mus_ResumeSaved();
|
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
|
// S_SetSoundPaused
|
||||||
|
@ -947,7 +989,6 @@ CCMD(snd_reset)
|
||||||
|
|
||||||
void S_SetSoundPaused(int state)
|
void S_SetSoundPaused(int state)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
if (paused == 0)
|
if (paused == 0)
|
||||||
|
@ -966,21 +1007,10 @@ void S_SetSoundPaused(int state)
|
||||||
S_PauseSound(false, true);
|
S_PauseSound(false, true);
|
||||||
if (GSnd != nullptr)
|
if (GSnd != nullptr)
|
||||||
{
|
{
|
||||||
GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ?
|
GSnd->SetInactive(SoundRenderer::INACTIVE_Complete);
|
||||||
SoundRenderer::INACTIVE_Complete :
|
|
||||||
SoundRenderer::INACTIVE_Mute);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!netgame
|
|
||||||
#ifdef _DEBUG
|
|
||||||
&& !demoplayback
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
|
||||||
pauseext = !state;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int realgameticspersec)
|
int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int realgameticspersec)
|
||||||
|
@ -1051,3 +1081,32 @@ bool CheckCheatmode(bool printmsg)
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -149,6 +149,9 @@ const char* G_DefaultConFile(void);
|
||||||
const char* G_ConFile(void);
|
const char* G_ConFile(void);
|
||||||
|
|
||||||
TArray<GrpEntry> GrpScan();
|
TArray<GrpEntry> GrpScan();
|
||||||
|
void S_PauseSound(bool notmusic, bool notsfx);
|
||||||
|
void S_ResumeSound(bool notsfx);
|
||||||
|
void S_SetSoundPaused(int state);
|
||||||
|
|
||||||
void G_FatalEngineError(void);
|
void G_FatalEngineError(void);
|
||||||
int CalcSmoothRatio(const ClockTicks& totalclk, const ClockTicks& ototalclk, int realgameticspersec);
|
int CalcSmoothRatio(const ClockTicks& totalclk, const ClockTicks& ototalclk, int realgameticspersec);
|
||||||
|
@ -161,3 +164,5 @@ enum
|
||||||
PAUSESFX_CONSOLE = 2
|
PAUSESFX_CONSOLE = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void updatePauseStatus();
|
||||||
|
extern int paused;
|
||||||
|
|
|
@ -425,7 +425,7 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
|
||||||
|
|
||||||
void GameInterface::MenuOpened()
|
void GameInterface::MenuOpened()
|
||||||
{
|
{
|
||||||
S_PauseSounds(true);
|
S_PauseSound(true, false);
|
||||||
if ((!g_netServer && ud.multimode < 2))
|
if ((!g_netServer && ud.multimode < 2))
|
||||||
{
|
{
|
||||||
ready2send = 0;
|
ready2send = 0;
|
||||||
|
@ -491,7 +491,7 @@ void GameInterface::MenuClosed()
|
||||||
}
|
}
|
||||||
|
|
||||||
G_UpdateScreenArea();
|
G_UpdateScreenArea();
|
||||||
S_PauseSounds(false);
|
S_ResumeSound(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
|
||||||
ud.reccnt = 0;
|
ud.reccnt = 0;
|
||||||
|
|
||||||
ud.god = ud.cashman = ud.eog = gFullMap = 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;
|
totalclock = ototalclock = lockclock = 0;
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ RECHECK:
|
||||||
Demo_FinishProfile();
|
Demo_FinishProfile();
|
||||||
|
|
||||||
while (totalclock >= (lockclock+TICSPERFRAME)
|
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))
|
|| (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt))
|
||||||
{
|
{
|
||||||
if (ud.reccnt<=0)
|
if (ud.reccnt<=0)
|
||||||
|
|
|
@ -3746,7 +3746,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
|
||||||
spritesortcnt++;
|
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];
|
auto const playerTyping = &tsprite[spritesortcnt];
|
||||||
|
|
||||||
|
@ -5913,7 +5913,9 @@ MAIN_LOOP_RESTART:
|
||||||
bool gameUpdate = false;
|
bool gameUpdate = false;
|
||||||
double gameUpdateStartTime = timerGetHiTicks();
|
double gameUpdateStartTime = timerGetHiTicks();
|
||||||
|
|
||||||
if (M_Active() || GUICapture || ud.pause_on != 0)
|
updatePauseStatus();
|
||||||
|
|
||||||
|
if (paused)
|
||||||
{
|
{
|
||||||
ototalclock = totalclock - TICSPERFRAME;
|
ototalclock = totalclock - TICSPERFRAME;
|
||||||
buttonMap.ResetButtonStates();
|
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)
|
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);
|
P_GetInput(myconnectindex);
|
||||||
|
|
||||||
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
|
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
|
||||||
|
@ -5944,8 +5946,11 @@ MAIN_LOOP_RESTART:
|
||||||
}
|
}
|
||||||
|
|
||||||
localInput = {};
|
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))
|
&& (myplayer.gm & MODE_GAME))
|
||||||
{
|
{
|
||||||
Net_GetPackets();
|
Net_GetPackets();
|
||||||
|
@ -6120,11 +6125,8 @@ int G_DoMoveThings(void)
|
||||||
everyothertime++;
|
everyothertime++;
|
||||||
if (g_earthquakeTime > 0) g_earthquakeTime--;
|
if (g_earthquakeTime > 0) g_earthquakeTime--;
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
{
|
|
||||||
g_globalRandom = krand();
|
g_globalRandom = krand();
|
||||||
A_MoveDummyPlayers();//ST 13
|
A_MoveDummyPlayers();//ST 13
|
||||||
}
|
|
||||||
|
|
||||||
for (bssize_t TRAVERSE_CONNECT(i))
|
for (bssize_t TRAVERSE_CONNECT(i))
|
||||||
{
|
{
|
||||||
|
@ -6143,14 +6145,10 @@ int G_DoMoveThings(void)
|
||||||
|
|
||||||
P_HandleSharedKeys(i);
|
P_HandleSharedKeys(i);
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
{
|
|
||||||
P_ProcessInput(i);
|
P_ProcessInput(i);
|
||||||
P_CheckSectors(i);
|
P_CheckSectors(i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
G_MoveWorld();
|
G_MoveWorld();
|
||||||
|
|
||||||
// Net_CorrectPrediction();
|
// Net_CorrectPrediction();
|
||||||
|
|
|
@ -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)) ||
|
if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
|
||||||
(g_netServer || ud.multimode > 1) ||
|
(g_netServer || ud.multimode > 1) ||
|
||||||
ud.recstat == 2) ||
|
ud.recstat == 2) ||
|
||||||
ud.pause_on)
|
paused)
|
||||||
{
|
{
|
||||||
return 65536;
|
return 65536;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_OVERHEAD_ON: labelNum = ud.overhead_on; break;
|
||||||
case USERDEFS_LAST_OVERHEAD: labelNum = ud.last_overhead; break;
|
case USERDEFS_LAST_OVERHEAD: labelNum = ud.last_overhead; break;
|
||||||
case USERDEFS_SHOWWEAPONS: labelNum = ud.showweapons; 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_FROM_BONUS: labelNum = ud.from_bonus; break;
|
||||||
case USERDEFS_CAMERASPRITE: labelNum = ud.camerasprite; break;
|
case USERDEFS_CAMERASPRITE: labelNum = ud.camerasprite; break;
|
||||||
case USERDEFS_LAST_CAMSPRITE: labelNum = ud.last_camsprite; 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_OVERHEAD_ON: ud.overhead_on = iSet; break;
|
||||||
case USERDEFS_LAST_OVERHEAD: ud.last_overhead = iSet; break;
|
case USERDEFS_LAST_OVERHEAD: ud.last_overhead = iSet; break;
|
||||||
case USERDEFS_SHOWWEAPONS: ud.showweapons = 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_FROM_BONUS: ud.from_bonus = iSet; break;
|
||||||
case USERDEFS_CAMERASPRITE: ud.camerasprite = iSet; break;
|
case USERDEFS_CAMERASPRITE: ud.camerasprite = iSet; break;
|
||||||
case USERDEFS_LAST_CAMSPRITE: ud.last_camsprite = iSet; break;
|
case USERDEFS_LAST_CAMSPRITE: ud.last_camsprite = iSet; break;
|
||||||
|
|
|
@ -2275,7 +2275,7 @@ static void Net_ReceiveServerUpdate(ENetEvent *event)
|
||||||
Bmemcpy(&serverupdate, updatebuf, sizeof(serverupdate_t));
|
Bmemcpy(&serverupdate, updatebuf, sizeof(serverupdate_t));
|
||||||
updatebuf += sizeof(serverupdate_t);
|
updatebuf += sizeof(serverupdate_t);
|
||||||
inputfifo[0][0] = serverupdate.nsyn;
|
inputfifo[0][0] = serverupdate.nsyn;
|
||||||
ud.pause_on = serverupdate.pause_on;
|
paused = serverupdate.pause_on;
|
||||||
|
|
||||||
ticrandomseed = serverupdate.seed;
|
ticrandomseed = serverupdate.seed;
|
||||||
|
|
||||||
|
@ -4945,7 +4945,7 @@ void Net_SendServerUpdates(void)
|
||||||
serverupdate.header = PACKET_MASTER_TO_SLAVE;
|
serverupdate.header = PACKET_MASTER_TO_SLAVE;
|
||||||
serverupdate.seed = ticrandomseed;
|
serverupdate.seed = ticrandomseed;
|
||||||
serverupdate.nsyn = *nsyn;
|
serverupdate.nsyn = *nsyn;
|
||||||
serverupdate.pause_on = ud.pause_on;
|
serverupdate.pause_on = paused;
|
||||||
|
|
||||||
serverupdate.numplayers = 0;
|
serverupdate.numplayers = 0;
|
||||||
updatebuf = tempnetbuf.Data() + sizeof(serverupdate_t);
|
updatebuf = tempnetbuf.Data() + sizeof(serverupdate_t);
|
||||||
|
|
|
@ -2364,7 +2364,7 @@ void P_DisplayWeapon(void)
|
||||||
goto enddisplayweapon;
|
goto enddisplayweapon;
|
||||||
|
|
||||||
#ifndef EDUKE32_STANDALONE
|
#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 halfLookAng = fix16_to_int(pPlayer->q16look_ang) >> 1;
|
||||||
|
|
||||||
int const weaponPal = P_GetHudPal(pPlayer);
|
int const weaponPal = P_GetHudPal(pPlayer);
|
||||||
|
@ -3073,7 +3073,15 @@ void P_GetInput(int const playerNum)
|
||||||
auto const pSprite = &sprite[pPlayer->i];
|
auto const pSprite = &sprite[pPlayer->i];
|
||||||
ControlInfo info;
|
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))
|
if (!(pPlayer->gm&MODE_MENU))
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
@ -3134,14 +3142,6 @@ void P_GetInput(int const playerNum)
|
||||||
input.svel -= info.dx * keyMove / analogExtent;
|
input.svel -= info.dx * keyMove / analogExtent;
|
||||||
input.fvel -= info.dz * 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); };
|
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
||||||
|
@ -3274,7 +3274,6 @@ void P_GetInput(int const playerNum)
|
||||||
|
|
||||||
localInput.bits |= (mouseaim << SK_AIMMODE);
|
localInput.bits |= (mouseaim << SK_AIMMODE);
|
||||||
localInput.bits |= (g_gameQuit << SK_GAMEQUIT);
|
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
|
//localInput.bits |= ((uint32_t)inputState.GetKeyStatus(sc_Escape)) << SK_ESCAPE; fixme.This needs to be done differently
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Dpad_Select))
|
if (buttonMap.ButtonDown(gamefunc_Dpad_Select))
|
||||||
|
|
|
@ -871,7 +871,7 @@ static void P_PrepForNewLevel(int playerNum, int gameMode)
|
||||||
|
|
||||||
ud.camerasprite = -1;
|
ud.camerasprite = -1;
|
||||||
ud.eog = 0;
|
ud.eog = 0;
|
||||||
ud.pause_on = 0;
|
paused = 0;
|
||||||
|
|
||||||
if (((gameMode & MODE_EOL) != MODE_EOL && numplayers < 2 && !g_netServer)
|
if (((gameMode & MODE_EOL) != MODE_EOL && numplayers < 2 && !g_netServer)
|
||||||
|| (!(g_gametypeFlags[ud.coop] & GAMETYPE_PRESERVEINVENTORYDEATH) && numplayers > 1))
|
|| (!(g_gametypeFlags[ud.coop] & GAMETYPE_PRESERVEINVENTORYDEATH) && numplayers > 1))
|
||||||
|
@ -1728,7 +1728,7 @@ int G_EnterLevel(int gameMode)
|
||||||
|
|
||||||
if (g_networkMode != NET_DEDICATED_SERVER)
|
if (g_networkMode != NET_DEDICATED_SERVER)
|
||||||
{
|
{
|
||||||
S_PauseSounds(false);
|
S_ResumeSound(false);
|
||||||
FX_StopAllSounds();
|
FX_StopAllSounds();
|
||||||
S_ClearSoundLocks();
|
S_ClearSoundLocks();
|
||||||
FX_SetReverb(0);
|
FX_SetReverb(0);
|
||||||
|
|
|
@ -1093,7 +1093,7 @@ static const dataspec_t svgm_udnetw[] =
|
||||||
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
|
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
|
||||||
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
|
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
|
||||||
{ DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 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, connectpoint2, sizeof(connectpoint2), 1 },
|
||||||
{ 0, &randomseed, sizeof(randomseed), 1 },
|
{ 0, &randomseed, sizeof(randomseed), 1 },
|
||||||
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },
|
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },
|
||||||
|
|
|
@ -784,7 +784,7 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
|
|
||||||
if (ud.scrollmode == 0)
|
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);
|
cposx = pp->opos.x + mulscale16(pp->pos.x-pp->opos.x, smoothratio);
|
||||||
cposy = pp->opos.y + mulscale16(pp->pos.y-pp->opos.y, smoothratio);
|
cposy = pp->opos.y + mulscale16(pp->pos.y-pp->opos.y, smoothratio);
|
||||||
|
@ -799,7 +799,7 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ud.pause_on)
|
if (!paused)
|
||||||
{
|
{
|
||||||
ud.fola += ud.folavel>>3;
|
ud.fola += ud.folavel>>3;
|
||||||
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
|
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
|
||||||
|
@ -898,10 +898,10 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
renderSetAspect(vr, asp);
|
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"));
|
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
|
// 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)
|
if (ud.overhead_on != 2 && hud_stats && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0)
|
||||||
|
|
|
@ -2651,28 +2651,7 @@ void P_HandleSharedKeys(int playerNum)
|
||||||
|
|
||||||
if (playerBits && TEST_SYNC_KEY(playerBits, SK_MULTIFLAG) == 0)
|
if (playerBits && TEST_SYNC_KEY(playerBits, SK_MULTIFLAG) == 0)
|
||||||
{
|
{
|
||||||
if (TEST_SYNC_KEY(playerBits, SK_PAUSE))
|
if (paused) return;
|
||||||
{
|
|
||||||
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 (sprite[pPlayer->i].extra <= 0) return; // if dead...
|
if (sprite[pPlayer->i].extra <= 0) return; // if dead...
|
||||||
|
|
||||||
|
|
|
@ -80,17 +80,6 @@ TArray<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void S_PauseSounds(bool paused)
|
|
||||||
{
|
|
||||||
soundEngine->SetPaused(paused);
|
|
||||||
}
|
|
||||||
|
|
||||||
//==========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==========================================================================
|
|
||||||
|
|
||||||
void cacheAllSounds(void)
|
void cacheAllSounds(void)
|
||||||
{
|
{
|
||||||
auto& sfx = soundEngine->GetSounds();
|
auto& sfx = soundEngine->GetSounds();
|
||||||
|
|
|
@ -58,7 +58,6 @@ inline void S_ClearSoundLocks(void) {}
|
||||||
void cacheAllSounds(void);
|
void cacheAllSounds(void);
|
||||||
void S_MenuSound(void);
|
void S_MenuSound(void);
|
||||||
void S_PauseMusic(bool paused);
|
void S_PauseMusic(bool paused);
|
||||||
void S_PauseSounds(bool paused);
|
|
||||||
void S_PlayLevelMusicOrNothing(unsigned int);
|
void S_PlayLevelMusicOrNothing(unsigned int);
|
||||||
int S_TryPlaySpecialMusic(unsigned int);
|
int S_TryPlaySpecialMusic(unsigned int);
|
||||||
void S_PlaySpecialMusicOrNothing(unsigned int);
|
void S_PlaySpecialMusicOrNothing(unsigned int);
|
||||||
|
|
|
@ -730,7 +730,6 @@ short screensize;
|
||||||
short bSnakeCam = kFalse;
|
short bSnakeCam = kFalse;
|
||||||
short bRecord = kFalse;
|
short bRecord = kFalse;
|
||||||
short bPlayback = kFalse;
|
short bPlayback = kFalse;
|
||||||
short bPause = kFalse;
|
|
||||||
short bInDemo = kFalse;
|
short bInDemo = kFalse;
|
||||||
short bSlipMode = kFalse;
|
short bSlipMode = kFalse;
|
||||||
short bDoFlashes = kTrue;
|
short bDoFlashes = kTrue;
|
||||||
|
@ -1012,26 +1011,8 @@ void CheckKeys()
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1463,7 +1444,7 @@ void G_Polymer_UnInit(void) { }
|
||||||
|
|
||||||
static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk)
|
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 65536;
|
||||||
|
|
||||||
return CalcSmoothRatio(totalclk, ototalclk, 30);
|
return CalcSmoothRatio(totalclk, ototalclk, 30);
|
||||||
|
@ -1525,7 +1506,7 @@ static void GameDisplay(void)
|
||||||
|
|
||||||
DrawView(smoothRatio);
|
DrawView(smoothRatio);
|
||||||
|
|
||||||
if (bPause)
|
if (paused && !M_Active())
|
||||||
{
|
{
|
||||||
int nLen = MyGetStringWidth("PAUSED");
|
int nLen = MyGetStringWidth("PAUSED");
|
||||||
myprintext((320 - nLen) / 2, 100, "PAUSED", 0);
|
myprintext((320 - nLen) / 2, 100, "PAUSED", 0);
|
||||||
|
@ -2214,6 +2195,7 @@ GAMELOOP:
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO CONTROL_GetButtonInput();
|
// TODO CONTROL_GetButtonInput();
|
||||||
|
updatePauseStatus();
|
||||||
CheckKeys();
|
CheckKeys();
|
||||||
|
|
||||||
if (bRecord || bPlayback)
|
if (bRecord || bPlayback)
|
||||||
|
@ -2279,12 +2261,12 @@ GAMELOOP:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// loc_11FBC:
|
// loc_11FBC:
|
||||||
while (bPause)
|
while (paused)
|
||||||
{
|
{
|
||||||
inputState.ClearAllInput();
|
inputState.ClearAllInput();
|
||||||
if (WaitAnyKey(-1) != sc_Pause)
|
if (WaitAnyKey(-1) != sc_Pause)
|
||||||
{
|
{
|
||||||
bPause = kFalse;
|
paused = kFalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2332,7 +2314,7 @@ GAMELOOP:
|
||||||
{
|
{
|
||||||
bInMove = kTrue;
|
bInMove = kTrue;
|
||||||
|
|
||||||
if (System_WantGuiCapture() || bPause)
|
if (paused)
|
||||||
{
|
{
|
||||||
tclocks = totalclock - 4;
|
tclocks = totalclock - 4;
|
||||||
buttonMap.ResetButtonStates();
|
buttonMap.ResetButtonStates();
|
||||||
|
@ -3267,7 +3249,7 @@ int DoSpiritHead()
|
||||||
|
|
||||||
bool GameInterface::CanSave()
|
bool GameInterface::CanSave()
|
||||||
{
|
{
|
||||||
return !bRecord && !bPlayback && !bPause && !bInDemo && nTotalPlayers == 1;
|
return !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameInterface::UpdateScreenSize()
|
void GameInterface::UpdateScreenSize()
|
||||||
|
|
|
@ -159,6 +159,18 @@ void PlayerInterruptKeys()
|
||||||
ControlInfo info;
|
ControlInfo info;
|
||||||
memset(&info, 0, sizeof(ControlInfo)); // this is done within CONTROL_GetInput() anyway
|
memset(&info, 0, sizeof(ControlInfo)); // this is done within CONTROL_GetInput() anyway
|
||||||
CONTROL_GetInput(&info);
|
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();
|
D_ProcessEvents();
|
||||||
|
|
||||||
localInput = {};
|
localInput = {};
|
||||||
|
@ -207,14 +219,6 @@ void PlayerInterruptKeys()
|
||||||
input.xVel -= info.dx * keyMove / analogExtent;
|
input.xVel -= info.dx * keyMove / analogExtent;
|
||||||
input.yVel -= info.dz * 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_Strafe))
|
||||||
{
|
{
|
||||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left))
|
if (buttonMap.ButtonDown(gamefunc_Turn_Left))
|
||||||
|
|
|
@ -580,7 +580,7 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
|
||||||
|
|
||||||
void GameInterface::MenuOpened()
|
void GameInterface::MenuOpened()
|
||||||
{
|
{
|
||||||
S_PauseSounds(true);
|
S_PauseSound(true, false);
|
||||||
if ((!g_netServer && ud.multimode < 2))
|
if ((!g_netServer && ud.multimode < 2))
|
||||||
{
|
{
|
||||||
ready2send = 0;
|
ready2send = 0;
|
||||||
|
@ -646,7 +646,7 @@ void GameInterface::MenuClosed()
|
||||||
}
|
}
|
||||||
|
|
||||||
G_UpdateScreenArea();
|
G_UpdateScreenArea();
|
||||||
S_PauseSounds(false);
|
S_ResumeSound(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
|
||||||
|
|
||||||
gFullMap = false;
|
gFullMap = false;
|
||||||
ud.god = ud.cashman = ud.eog = 0;
|
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;
|
totalclock = ototalclock = lockclock = 0;
|
||||||
|
|
||||||
|
@ -591,7 +591,7 @@ RECHECK:
|
||||||
Demo_FinishProfile();
|
Demo_FinishProfile();
|
||||||
|
|
||||||
while (totalclock >= (lockclock+TICSPERFRAME)
|
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))
|
|| (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt))
|
||||||
{
|
{
|
||||||
if (ud.reccnt<=0)
|
if (ud.reccnt<=0)
|
||||||
|
|
|
@ -850,7 +850,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
||||||
videoSetCorrectedAspect();
|
videoSetCorrectedAspect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ud.pause_on || pPlayer->on_crane > -1)
|
if (paused || pPlayer->on_crane > -1)
|
||||||
smoothRatio = 65536;
|
smoothRatio = 65536;
|
||||||
else
|
else
|
||||||
smoothRatio = calc_smoothratio(totalclock, ototalclock);
|
smoothRatio = calc_smoothratio(totalclock, ototalclock);
|
||||||
|
@ -925,7 +925,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
||||||
|
|
||||||
if (RRRA && pPlayer->drug_mode > 0)
|
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;
|
int aspect;
|
||||||
if (pPlayer->drug_stat[0] == 0)
|
if (pPlayer->drug_stat[0] == 0)
|
||||||
|
@ -5028,7 +5028,7 @@ default_case1:
|
||||||
spritesortcnt++;
|
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;
|
tspritetype *const playerTyping = t;
|
||||||
|
|
||||||
|
@ -7303,7 +7303,9 @@ MAIN_LOOP_RESTART:
|
||||||
char gameUpdate = false;
|
char gameUpdate = false;
|
||||||
double const gameUpdateStartTime = timerGetHiTicks();
|
double const gameUpdateStartTime = timerGetHiTicks();
|
||||||
|
|
||||||
if (M_Active() || GUICapture || ud.pause_on != 0)
|
updatePauseStatus();
|
||||||
|
|
||||||
|
if (paused)
|
||||||
{
|
{
|
||||||
ototalclock = totalclock - TICSPERFRAME;
|
ototalclock = totalclock - TICSPERFRAME;
|
||||||
buttonMap.ResetButtonStates();
|
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)
|
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)
|
if (RRRA && g_player[myconnectindex].ps->on_motorcycle)
|
||||||
P_GetInputMotorcycle(myconnectindex);
|
P_GetInputMotorcycle(myconnectindex);
|
||||||
else if (RRRA && g_player[myconnectindex].ps->on_boat)
|
else if (RRRA && g_player[myconnectindex].ps->on_boat)
|
||||||
|
@ -7337,7 +7337,9 @@ MAIN_LOOP_RESTART:
|
||||||
|
|
||||||
g_player[myconnectindex].movefifoend++;
|
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_player[myconnectindex].ps->gm&MODE_GAME))
|
||||||
{
|
{
|
||||||
G_MoveLoop();
|
G_MoveLoop();
|
||||||
|
@ -7535,11 +7537,8 @@ int G_DoMoveThings(void)
|
||||||
everyothertime++;
|
everyothertime++;
|
||||||
if (g_earthquakeTime > 0) g_earthquakeTime--;
|
if (g_earthquakeTime > 0) g_earthquakeTime--;
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
{
|
|
||||||
g_globalRandom = krand2();
|
g_globalRandom = krand2();
|
||||||
A_MoveDummyPlayers();//ST 13
|
A_MoveDummyPlayers();//ST 13
|
||||||
}
|
|
||||||
|
|
||||||
for (bssize_t TRAVERSE_CONNECT(i))
|
for (bssize_t TRAVERSE_CONNECT(i))
|
||||||
{
|
{
|
||||||
|
@ -7561,15 +7560,11 @@ int G_DoMoveThings(void)
|
||||||
if (!DEER)
|
if (!DEER)
|
||||||
P_HandleSharedKeys(i);
|
P_HandleSharedKeys(i);
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
{
|
|
||||||
P_ProcessInput(i);
|
P_ProcessInput(i);
|
||||||
if (!DEER)
|
if (!DEER)
|
||||||
P_CheckSectors(i);
|
P_CheckSectors(i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
|
||||||
G_MoveWorld();
|
G_MoveWorld();
|
||||||
|
|
||||||
Net_CorrectPrediction();
|
Net_CorrectPrediction();
|
||||||
|
|
|
@ -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)) ||
|
if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
|
||||||
(g_netServer || ud.multimode > 1) ||
|
(g_netServer || ud.multimode > 1) ||
|
||||||
ud.recstat == 2) ||
|
ud.recstat == 2) ||
|
||||||
ud.pause_on)
|
paused)
|
||||||
{
|
{
|
||||||
return 65536;
|
return 65536;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2093,7 +2093,7 @@ void P_DisplayWeapon(void)
|
||||||
if (!RR && currentWeapon == KNEE_WEAPON && *weaponFrame == 0)
|
if (!RR && currentWeapon == KNEE_WEAPON && *weaponFrame == 0)
|
||||||
goto enddisplayweapon;
|
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 halfLookAng = fix16_to_int(pPlayer->q16look_ang) >> 1;
|
||||||
|
|
||||||
int const weaponPal = P_GetHudPal(pPlayer);
|
int const weaponPal = P_GetHudPal(pPlayer);
|
||||||
|
@ -3209,7 +3209,15 @@ void P_GetInput(int const playerNum)
|
||||||
auto const pSprite = &sprite[pPlayer->i];
|
auto const pSprite = &sprite[pPlayer->i];
|
||||||
ControlInfo info;
|
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))
|
if (!(pPlayer->gm&MODE_MENU))
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
@ -3272,14 +3280,6 @@ void P_GetInput(int const playerNum)
|
||||||
input.svel -= info.dx * keyMove / analogExtent;
|
input.svel -= info.dx * keyMove / analogExtent;
|
||||||
input.fvel -= info.dz * 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); };
|
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
||||||
|
@ -3631,7 +3631,15 @@ void P_GetInputMotorcycle(int playerNum)
|
||||||
auto const pSprite = &sprite[pPlayer->i];
|
auto const pSprite = &sprite[pPlayer->i];
|
||||||
ControlInfo info;
|
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))
|
if (!(pPlayer->gm&MODE_MENU))
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
@ -3670,14 +3678,6 @@ void P_GetInputMotorcycle(int playerNum)
|
||||||
input.svel -= info.dx * keyMove / analogExtent;
|
input.svel -= info.dx * keyMove / analogExtent;
|
||||||
input.fvel -= info.dz * 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); };
|
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||||
|
|
||||||
pPlayer->crouch_toggle = 0;
|
pPlayer->crouch_toggle = 0;
|
||||||
|
@ -3885,7 +3885,15 @@ void P_GetInputBoat(int playerNum)
|
||||||
auto const pSprite = &sprite[pPlayer->i];
|
auto const pSprite = &sprite[pPlayer->i];
|
||||||
ControlInfo info;
|
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))
|
if (!(pPlayer->gm&MODE_MENU))
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
@ -3924,14 +3932,6 @@ void P_GetInputBoat(int playerNum)
|
||||||
input.svel -= info.dx * keyMove / analogExtent;
|
input.svel -= info.dx * keyMove / analogExtent;
|
||||||
input.fvel -= info.dz * 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); };
|
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||||
|
|
||||||
pPlayer->crouch_toggle = 0;
|
pPlayer->crouch_toggle = 0;
|
||||||
|
@ -4134,7 +4134,15 @@ void P_DHGetInput(int const playerNum)
|
||||||
auto const pSprite = &sprite[pPlayer->i];
|
auto const pSprite = &sprite[pPlayer->i];
|
||||||
ControlInfo info;
|
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))
|
if (!(pPlayer->gm&MODE_MENU))
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
@ -4189,14 +4197,6 @@ void P_DHGetInput(int const playerNum)
|
||||||
input.svel -= info.dx * keyMove / analogExtent;
|
input.svel -= info.dx * keyMove / analogExtent;
|
||||||
input.fvel -= info.dz * 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); };
|
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ static void resetprestat(int playerNum, int gameMode)
|
||||||
g_animateCnt = 0;
|
g_animateCnt = 0;
|
||||||
parallaxtype = 0;
|
parallaxtype = 0;
|
||||||
randomseed = 17;
|
randomseed = 17;
|
||||||
ud.pause_on = 0;
|
paused = 0;
|
||||||
ud.camerasprite = -1;
|
ud.camerasprite = -1;
|
||||||
ud.eog = 0;
|
ud.eog = 0;
|
||||||
tempwallptr = 0;
|
tempwallptr = 0;
|
||||||
|
@ -2289,7 +2289,7 @@ int G_EnterLevel(int gameMode)
|
||||||
|
|
||||||
//if (g_networkMode != NET_DEDICATED_SERVER)
|
//if (g_networkMode != NET_DEDICATED_SERVER)
|
||||||
{
|
{
|
||||||
S_PauseSounds(false);
|
S_ResumeSound(false);
|
||||||
FX_StopAllSounds();
|
FX_StopAllSounds();
|
||||||
S_ClearSoundLocks();
|
S_ClearSoundLocks();
|
||||||
FX_SetReverb(0);
|
FX_SetReverb(0);
|
||||||
|
|
|
@ -183,7 +183,7 @@ int32_t G_LoadPlayer(const char *path)
|
||||||
|
|
||||||
// some setup first
|
// some setup first
|
||||||
ud.multimode = h.numplayers;
|
ud.multimode = h.numplayers;
|
||||||
S_PauseSounds(true);
|
S_PauseSound(true, false);
|
||||||
|
|
||||||
if (numplayers > 1)
|
if (numplayers > 1)
|
||||||
{
|
{
|
||||||
|
@ -834,7 +834,7 @@ static const dataspec_t svgm_udnetw[] =
|
||||||
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
|
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
|
||||||
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
|
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
|
||||||
{ DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 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, connectpoint2, sizeof(connectpoint2), 1 },
|
||||||
{ 0, &randomseed, sizeof(randomseed), 1 },
|
{ 0, &randomseed, sizeof(randomseed), 1 },
|
||||||
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },
|
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 },
|
||||||
|
|
|
@ -765,7 +765,7 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
|
|
||||||
if (ud.scrollmode == 0)
|
if (ud.scrollmode == 0)
|
||||||
{
|
{
|
||||||
if (pp->newowner == -1 && !ud.pause_on)
|
if (pp->newowner == -1 && !paused)
|
||||||
{
|
{
|
||||||
if (screenpeek == myconnectindex && numplayers > 1)
|
if (screenpeek == myconnectindex && numplayers > 1)
|
||||||
{
|
{
|
||||||
|
@ -789,7 +789,7 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ud.pause_on)
|
if (!paused)
|
||||||
{
|
{
|
||||||
ud.fola += ud.folavel>>3;
|
ud.fola += ud.folavel>>3;
|
||||||
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
|
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"));
|
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
|
// 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)
|
if (ud.overhead_on != 2 && hud_stats) // && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0)
|
||||||
|
|
|
@ -3649,29 +3649,7 @@ void P_HandleSharedKeys(int playerNum)
|
||||||
{
|
{
|
||||||
pPlayer->interface_toggle_flag = 1;
|
pPlayer->interface_toggle_flag = 1;
|
||||||
|
|
||||||
if (TEST_SYNC_KEY(playerBits, SK_PAUSE))
|
if (paused) return;
|
||||||
{
|
|
||||||
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 (sprite[pPlayer->i].extra <= 0) return; // if dead...
|
if (sprite[pPlayer->i].extra <= 0) return; // if dead...
|
||||||
|
|
||||||
|
|
|
@ -79,17 +79,6 @@ TArray<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void S_PauseSounds(bool paused)
|
|
||||||
{
|
|
||||||
soundEngine->SetPaused(paused);
|
|
||||||
}
|
|
||||||
|
|
||||||
//==========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==========================================================================
|
|
||||||
|
|
||||||
void cacheAllSounds(void)
|
void cacheAllSounds(void)
|
||||||
{
|
{
|
||||||
auto& sfx = soundEngine->GetSounds();
|
auto& sfx = soundEngine->GetSounds();
|
||||||
|
|
|
@ -57,8 +57,6 @@ inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPl
|
||||||
inline void S_ClearSoundLocks(void) {}
|
inline void S_ClearSoundLocks(void) {}
|
||||||
void cacheAllSounds(void);
|
void cacheAllSounds(void);
|
||||||
void S_MenuSound(void);
|
void S_MenuSound(void);
|
||||||
void S_PauseMusic(bool paused);
|
|
||||||
void S_PauseSounds(bool paused);
|
|
||||||
void S_PlayLevelMusicOrNothing(unsigned int);
|
void S_PlayLevelMusicOrNothing(unsigned int);
|
||||||
int S_TryPlaySpecialMusic(unsigned int);
|
int S_TryPlaySpecialMusic(unsigned int);
|
||||||
void S_PlaySpecialMusicOrNothing(unsigned int);
|
void S_PlaySpecialMusicOrNothing(unsigned int);
|
||||||
|
|
|
@ -65,7 +65,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
static int OverlapDraw = FALSE;
|
static int OverlapDraw = FALSE;
|
||||||
extern SWBOOL QuitFlag, LocationInfo, ConPanel, SpriteInfo, PauseKeySet;
|
extern SWBOOL QuitFlag, LocationInfo, ConPanel, SpriteInfo;
|
||||||
extern SWBOOL Voxel;
|
extern SWBOOL Voxel;
|
||||||
extern char buffer[];
|
extern char buffer[];
|
||||||
SWBOOL DrawScreen;
|
SWBOOL DrawScreen;
|
||||||
|
@ -1072,7 +1072,7 @@ static ClockTicks mapzoomclock;
|
||||||
void
|
void
|
||||||
ResizeView(PLAYERp pp)
|
ResizeView(PLAYERp pp)
|
||||||
{
|
{
|
||||||
if (M_Active() || PauseKeySet)
|
if (M_Active() || paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (dimensionmode == 2 || dimensionmode == 5 || dimensionmode == 6)
|
if (dimensionmode == 2 || dimensionmode == 5 || dimensionmode == 6)
|
||||||
|
@ -2028,7 +2028,7 @@ drawscreen(PLAYERp pp)
|
||||||
|
|
||||||
|
|
||||||
smoothratio = CalcSmoothRatio(totalclock, ototalclock, 120 / synctics);
|
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;
|
smoothratio = 65536;
|
||||||
|
|
||||||
if (!ScreenSavePic)
|
if (!ScreenSavePic)
|
||||||
|
@ -2328,6 +2328,26 @@ drawscreen(PLAYERp pp)
|
||||||
if (cl_sointerpolation)
|
if (cl_sointerpolation)
|
||||||
so_restoreinterpolations(); // Stick at end of drawscreen
|
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();
|
PostDraw();
|
||||||
DrawScreen = FALSE;
|
DrawScreen = FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,8 +224,6 @@ const GAME_SET gs_defaults =
|
||||||
GAME_SET gs;
|
GAME_SET gs;
|
||||||
|
|
||||||
SWBOOL PlayerTrackingMode = FALSE;
|
SWBOOL PlayerTrackingMode = FALSE;
|
||||||
SWBOOL PauseMode = FALSE;
|
|
||||||
SWBOOL PauseKeySet = FALSE;
|
|
||||||
SWBOOL SlowMode = FALSE;
|
SWBOOL SlowMode = FALSE;
|
||||||
SWBOOL FrameAdvanceTics = 3;
|
SWBOOL FrameAdvanceTics = 3;
|
||||||
SWBOOL ScrollMode2D = FALSE;
|
SWBOOL ScrollMode2D = FALSE;
|
||||||
|
@ -2320,10 +2318,6 @@ void MoveLoop(void)
|
||||||
// demosync_record();
|
// demosync_record();
|
||||||
#endif
|
#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.
|
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);
|
ototalclock = (int)totalclock - (120 / synctics);
|
||||||
buttonMap.ResetButtonStates();
|
buttonMap.ResetButtonStates();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
faketimerhandler();
|
while (ready2send && (totalclock >= ototalclock + synctics))
|
||||||
MoveLoop();
|
{
|
||||||
|
UpdateInputs();
|
||||||
|
MoveLoop();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get input again to update q16ang/q16horiz.
|
||||||
|
if (!PedanticMode)
|
||||||
|
getinput(&loc, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawscreen(Player + screenpeek);
|
drawscreen(Player + screenpeek);
|
||||||
|
@ -2483,8 +2486,6 @@ void RunLevel(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
timerUpdateClock();
|
timerUpdateClock();
|
||||||
while (ready2send && (totalclock >= ototalclock + synctics))
|
|
||||||
UpdateInputs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ready2send = 0;
|
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;
|
short MirrorDelay;
|
||||||
|
|
||||||
double elapsedInputTicks;
|
double elapsedInputTicks;
|
||||||
|
@ -2988,9 +2942,7 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
ControlInfo info;
|
ControlInfo info;
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
|
||||||
PauseKey(pp);
|
if (paused)
|
||||||
|
|
||||||
if (PauseKeySet)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MAP KEY
|
// MAP KEY
|
||||||
|
|
|
@ -2392,7 +2392,6 @@ void sendlogoff(void);
|
||||||
|
|
||||||
extern int ototalclock, save_totalclock, gotlastpacketclock,smoothratio;
|
extern int ototalclock, save_totalclock, gotlastpacketclock,smoothratio;
|
||||||
extern SWBOOL ready2send;
|
extern SWBOOL ready2send;
|
||||||
extern SWBOOL GamePaused;
|
|
||||||
|
|
||||||
// local copy of variables updated by faketimerhandler
|
// local copy of variables updated by faketimerhandler
|
||||||
extern int locselectedgun;
|
extern int locselectedgun;
|
||||||
|
|
|
@ -29,6 +29,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
#include "mmulti.h"
|
#include "mmulti.h"
|
||||||
|
|
||||||
|
#include "gamecontrol.h"
|
||||||
|
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "tags.h"
|
#include "tags.h"
|
||||||
|
@ -70,7 +72,6 @@ SYNC BUG NOTES:
|
||||||
//#define MAXSYNCBYTES 16
|
//#define MAXSYNCBYTES 16
|
||||||
static uint8_t tempbuf[576], packbuf[576];
|
static uint8_t tempbuf[576], packbuf[576];
|
||||||
int PlayClock;
|
int PlayClock;
|
||||||
extern SWBOOL PauseKeySet;
|
|
||||||
|
|
||||||
gNET gNet;
|
gNET gNet;
|
||||||
extern short PlayerQuitMenuLevel;
|
extern short PlayerQuitMenuLevel;
|
||||||
|
@ -128,7 +129,6 @@ int save_totalclock;
|
||||||
|
|
||||||
// must start out as 0
|
// must start out as 0
|
||||||
|
|
||||||
SWBOOL GamePaused = FALSE;
|
|
||||||
SWBOOL NetBroadcastMode = TRUE;
|
SWBOOL NetBroadcastMode = TRUE;
|
||||||
SWBOOL NetModeOverride = FALSE;
|
SWBOOL NetModeOverride = FALSE;
|
||||||
|
|
||||||
|
@ -385,33 +385,17 @@ int DecodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
||||||
return buf - base_ptr;
|
return buf - base_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
PauseGame(void)
|
|
||||||
{
|
|
||||||
if (PauseKeySet)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (DemoPlaying || DemoRecording)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (GamePaused)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (numplayers < 2)
|
|
||||||
GamePaused = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ResumeGame(void)
|
ResumeGame(void)
|
||||||
{
|
{
|
||||||
if (PauseKeySet)
|
if (paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DemoPlaying || DemoRecording)
|
if (DemoPlaying || DemoRecording)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (numplayers < 2)
|
if (numplayers < 2)
|
||||||
GamePaused = FALSE;
|
paused = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -186,7 +186,6 @@ void SendVersion(int version);
|
||||||
void InitNetPlayerOptions(void);
|
void InitNetPlayerOptions(void);
|
||||||
void CheckVersion(int GameVersion);
|
void CheckVersion(int GameVersion);
|
||||||
void SW_SendMessage(short pnum,const char *text);
|
void SW_SendMessage(short pnum,const char *text);
|
||||||
void PauseGame(void);
|
|
||||||
void ResumeGame(void);
|
void ResumeGame(void);
|
||||||
|
|
||||||
END_SW_NS
|
END_SW_NS
|
||||||
|
|
|
@ -6229,7 +6229,7 @@ pChopsShake(PANEL_SPRITEp psp)
|
||||||
void
|
void
|
||||||
pChopsWait(PANEL_SPRITEp psp)
|
pChopsWait(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
//if (!GamePaused && RANDOM_P2(1024) < 10)
|
//if (!paused && RANDOM_P2(1024) < 10)
|
||||||
if (RANDOM_P2(1024) < 10)
|
if (RANDOM_P2(1024) < 10)
|
||||||
{
|
{
|
||||||
// random x position
|
// random x position
|
||||||
|
|
|
@ -7846,9 +7846,9 @@ void PauseMultiPlay(void)
|
||||||
{
|
{
|
||||||
FLAG_KEY_RELEASE(pp, SK_PAUSE);
|
FLAG_KEY_RELEASE(pp, SK_PAUSE);
|
||||||
|
|
||||||
GamePaused ^= 1;
|
paused ^= 1;
|
||||||
|
|
||||||
if (GamePaused)
|
if (paused)
|
||||||
{
|
{
|
||||||
short w,h;
|
short w,h;
|
||||||
auto m = GStrings("Game Paused");
|
auto m = GStrings("Game Paused");
|
||||||
|
@ -7859,14 +7859,12 @@ void PauseMultiPlay(void)
|
||||||
|
|
||||||
SavePrediction = PredictionOn;
|
SavePrediction = PredictionOn;
|
||||||
PredictionOn = FALSE;
|
PredictionOn = FALSE;
|
||||||
Mus_SetPaused(true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PredictionOn = SavePrediction;
|
PredictionOn = SavePrediction;
|
||||||
TRAVERSE_CONNECT(p)
|
TRAVERSE_CONNECT(p)
|
||||||
pClearTextLine(Player + p, 100);
|
pClearTextLine(Player + p, 100);
|
||||||
Mus_SetPaused(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7962,8 +7960,7 @@ domovethings(void)
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
extern SWBOOL PauseKeySet;
|
if (inputState.GetKeyStatus(KEYSC_F5) && !(inputState.GetKeyStatus(KEYSC_ALT) || inputState.GetKeyStatus(KEYSC_RALT)) && !paused)
|
||||||
if (inputState.GetKeyStatus(KEYSC_F5) && !(inputState.GetKeyStatus(KEYSC_ALT) || inputState.GetKeyStatus(KEYSC_RALT)) && !PauseKeySet)
|
|
||||||
{
|
{
|
||||||
inputState.GetKeyStatus(KEYSC_F5) = 0;
|
inputState.GetKeyStatus(KEYSC_F5) = 0;
|
||||||
ResChange();
|
ResChange();
|
||||||
|
@ -7991,7 +7988,7 @@ domovethings(void)
|
||||||
DoPlayerMenuKeys(pp);
|
DoPlayerMenuKeys(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GamePaused)
|
if (paused)
|
||||||
{
|
{
|
||||||
if (!ReloadPrompt)
|
if (!ReloadPrompt)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -28,6 +28,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "gamecontrol.h"
|
||||||
|
|
||||||
#include "names2.h"
|
#include "names2.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "tags.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;
|
*y_diff = 0;
|
||||||
*ang_diff = 0;
|
*ang_diff = 0;
|
||||||
|
|
||||||
if (GamePaused)
|
if (paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// find the closest quake - should be a strength value
|
// find the closest quake - should be a strength value
|
||||||
|
|
|
@ -26,6 +26,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
#include "ns.h"
|
#include "ns.h"
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
|
#include "gamecontrol.h"
|
||||||
|
|
||||||
#include "names2.h"
|
#include "names2.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "tags.h"
|
#include "tags.h"
|
||||||
|
@ -91,7 +93,7 @@ void VisViewChange(PLAYERp pp, int *vis)
|
||||||
int x,y,z;
|
int x,y,z;
|
||||||
short sectnum;
|
short sectnum;
|
||||||
|
|
||||||
if (GamePaused)
|
if (paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// find the closest quake - should be a strength value
|
// find the closest quake - should be a strength value
|
||||||
|
|
Loading…
Reference in a new issue