diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index 62c21cb0f..a6734d160 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -236,7 +236,7 @@ void ChangeLevel(MapRecord* map, int skill) { Net_WriteByte(DEM_CHANGEMAP); Net_WriteByte(skill); - Net_WriteString(map->labelName); + Net_WriteString(map? map->labelName : nullptr); } //--------------------------------------------------------------------------- diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 82a1ad3bd..e40bd95da 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -139,7 +139,9 @@ static void GameTicker() g_nextskill = -1; FX_StopAllSounds(); FX_SetReverb(0); - gi->NextLevel(currentLevel, -1); + gi->FreeLevelData(); + gamestate = GS_LEVEL; + gi->NextLevel(g_nextmap, -1); break; case ga_completed: @@ -149,7 +151,8 @@ static void GameTicker() { // if the same level is restarted, skip any progression stuff like summary screens or cutscenes. gi->FreeLevelData(); - gi->NextLevel(currentLevel, g_nextskill); + gamestate = GS_LEVEL; + gi->NextLevel(g_nextmap, g_nextskill); } else gi->LevelCompleted(g_nextmap, g_nextskill); @@ -157,13 +160,15 @@ static void GameTicker() case ga_nextlevel: gi->FreeLevelData(); - gi->NextLevel(currentLevel, g_nextskill); + gamestate = GS_LEVEL; + gi->NextLevel(g_nextmap, g_nextskill); break; case ga_newgame: FX_StopAllSounds(); FX_SetReverb(0); gi->FreeLevelData(); + gamestate = GS_LEVEL; gi->NewGame(g_nextmap, g_nextskill); break; @@ -289,6 +294,7 @@ void Display() switch (gamestate) { case GS_MENUSCREEN: + case GS_FULLCONSOLE: gi->DrawBackground(); break; @@ -314,6 +320,7 @@ void Display() break; default: + twod->ClearScreen(); break; } @@ -392,7 +399,7 @@ void TryRunTics (void) bool doWait = cl_capfps || pauseext || (r_NoInterpolate && !M_IsAnimated()); // get real tics - if (doWait && gamestate != GS_INTERMISSION) // GS_INTERMISSION needs uncapped frame rate. + if (doWait && gamestate != GS_INTERMISSION && gamestate != GS_INTRO) // GS_INTERMISSION needs uncapped frame rate. { entertic = I_WaitForTic (oldentertics); } diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index a821c070a..0aaf49785 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -415,8 +415,8 @@ class ScreenJobRunner int index = -1; float screenfade; bool clearbefore; - uint64_t startTime = -1; - uint64_t lastTime = -1; + int64_t startTime = -1; + int64_t lastTime = -1; int actionState; int terminateState; @@ -474,7 +474,7 @@ public: auto now = I_nsTime(); bool processed = job.job->ProcessInput(); bool skiprequest = inputState.CheckAllInput() && !processed; - if (startTime == -1) startTime = now; + if (startTime == -1) lastTime = startTime = now; if (M_Active()) { diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 3f2d38697..8ba7adad0 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -879,6 +879,7 @@ public: int Frame(uint64_t clock, bool skiprequest) { + Printf("Clock = %llu\n", clock); if (clock == 0) S_PlayBonusMusic(); twod->ClearScreen(); int currentclock = int(clock * 120 / 1'000'000'000); diff --git a/source/games/duke/src/gameloop.cpp b/source/games/duke/src/gameloop.cpp index 808259c13..96f37eac4 100644 --- a/source/games/duke/src/gameloop.cpp +++ b/source/games/duke/src/gameloop.cpp @@ -166,7 +166,7 @@ void GameInterface::NextLevel(MapRecord* map, int skill) { ud.m_player_skill = skill + 1; int res = enterlevel(map, 0); - if (!res) gameaction = ga_startup; + if (res) gameaction = ga_startup; } //---------------------------------------------------------------------------