mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 13:00:43 +00:00
- Duke: Do not reset the global ticker.
The new main loop code cannot handle that. Instead set a start value for gameclock so that gameclock can be based on an arbitrary time value instead of directly representing global time.
This commit is contained in:
parent
34510ae9b3
commit
49106c5b5e
3 changed files with 5 additions and 4 deletions
|
@ -95,7 +95,7 @@ GameInterface* gi;
|
||||||
int myconnectindex, numplayers;
|
int myconnectindex, numplayers;
|
||||||
int connecthead, connectpoint2[MAXMULTIPLAYERS];
|
int connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||||
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
|
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
|
||||||
int gameclock;
|
int gameclock, gameclockstart;
|
||||||
int lastTic;
|
int lastTic;
|
||||||
|
|
||||||
int automapMode;
|
int automapMode;
|
||||||
|
|
|
@ -219,4 +219,5 @@ extern int automapMode;
|
||||||
extern bool automapFollow;
|
extern bool automapFollow;
|
||||||
extern bool sendPause;
|
extern bool sendPause;
|
||||||
extern int gameclock;
|
extern int gameclock;
|
||||||
|
extern int gameclockstart;
|
||||||
extern int lastTic;
|
extern int lastTic;
|
||||||
|
|
|
@ -294,7 +294,7 @@ void GameTicker()
|
||||||
gameupdatetime.Clock();
|
gameupdatetime.Clock();
|
||||||
|
|
||||||
int const currentTic = I_GetTime();
|
int const currentTic = I_GetTime();
|
||||||
gameclock = I_GetBuildTime();
|
gameclock = I_GetBuildTime() - gameclockstart;
|
||||||
|
|
||||||
while (playrunning() && currentTic - lastTic >= 1)
|
while (playrunning() && currentTic - lastTic >= 1)
|
||||||
{
|
{
|
||||||
|
@ -361,8 +361,8 @@ void startmainmenu()
|
||||||
|
|
||||||
void resetGameClock()
|
void resetGameClock()
|
||||||
{
|
{
|
||||||
I_ResetTime();
|
I_SetFrameTime();
|
||||||
lastTic = -1;
|
gameclockstart = I_GetTime();
|
||||||
gameclock = 0;
|
gameclock = 0;
|
||||||
cloudclock = 0;
|
cloudclock = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue