mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
In G_SavePlayer(), save timers at beginning and restore when finished.
This makes the game not process as many ticks as have elapsed during the saving afterwards. git-svn-id: https://svn.eduke32.com/eduke32@4450 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
184653fc25
commit
66b789376b
4 changed files with 32 additions and 4 deletions
|
@ -760,7 +760,9 @@ EXTERN int16_t headsectbunch[2][YAX_MAXBUNCHES], nextsectbunch[2][MAXSECTORS];
|
|||
EXTERN int32_t Numsprites;
|
||||
EXTERN int16_t numsectors, numwalls;
|
||||
EXTERN char display_mirror;
|
||||
EXTERN int32_t totalclock;
|
||||
// totalclocklock: the totalclock value that is backed up once on each
|
||||
// drawrooms() and is used for animateoffs().
|
||||
EXTERN int32_t totalclock, totalclocklock;
|
||||
EXTERN int32_t numframes, randomseed;
|
||||
EXTERN int16_t sintable[2048];
|
||||
EXTERN uint8_t palette[768];
|
||||
|
|
|
@ -62,7 +62,6 @@ static int32_t mousexsurp = 0, mouseysurp = 0;
|
|||
|
||||
int32_t grponlymode = 0;
|
||||
int32_t graphicsmode = 0;
|
||||
extern int32_t totalclocklock;
|
||||
|
||||
int32_t synctics = 0, lockclock = 0;
|
||||
|
||||
|
|
|
@ -2447,8 +2447,6 @@ static int32_t bakwindowx2[4], bakwindowy2[4];
|
|||
static int32_t bakrendmode,baktile;
|
||||
#endif
|
||||
|
||||
int32_t totalclocklock;
|
||||
|
||||
char apptitle[256] = "Build Engine";
|
||||
|
||||
static uint8_t basepalreset=1;
|
||||
|
|
|
@ -314,6 +314,32 @@ int32_t G_LoadPlayer(int32_t spot)
|
|||
return 0;
|
||||
}
|
||||
|
||||
////////// TIMER SAVING/RESTORING //////////
|
||||
|
||||
static struct {
|
||||
int32_t totalclock, totalclocklock; // engine
|
||||
int32_t ototalclock, lockclock; // game
|
||||
} g_timers;
|
||||
|
||||
static void G_SaveTimers(void)
|
||||
{
|
||||
g_timers.totalclock = totalclock;
|
||||
g_timers.totalclocklock = totalclocklock;
|
||||
g_timers.ototalclock = ototalclock;
|
||||
g_timers.lockclock = lockclock;
|
||||
}
|
||||
|
||||
static void G_RestoreTimers(void)
|
||||
{
|
||||
sampletimer();
|
||||
|
||||
totalclock = g_timers.totalclock;
|
||||
totalclocklock = g_timers.totalclocklock;
|
||||
ototalclock = g_timers.ototalclock;
|
||||
lockclock = g_timers.lockclock;
|
||||
}
|
||||
|
||||
//////////
|
||||
|
||||
int32_t G_SavePlayer(int32_t spot)
|
||||
{
|
||||
|
@ -321,6 +347,8 @@ int32_t G_SavePlayer(int32_t spot)
|
|||
// char mpfn[16];
|
||||
FILE *fil;
|
||||
|
||||
G_SaveTimers();
|
||||
|
||||
Bstrcpy(fn, "dukesav0.esv");
|
||||
fn[7] = spot + '0';
|
||||
|
||||
|
@ -374,6 +402,7 @@ int32_t G_SavePlayer(int32_t spot)
|
|||
ready2send = 1;
|
||||
Net_WaitForServer();
|
||||
|
||||
G_RestoreTimers();
|
||||
ototalclock = totalclock;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue