- Added two new net commands: DEM_WIPEON and DEM_WIPEOFF. They keep track of

when a player is going through a screen wipe and act like a pause, so the
  game doesn't run several tics afterward to catch up with it.


SVN r485 (trunk)
This commit is contained in:
Randy Heit 2007-02-15 00:01:21 +00:00
parent 01cd91fd9e
commit ecc45d5d6e
8 changed files with 34 additions and 11 deletions

View file

@ -1,4 +1,7 @@
February 14, 2007
- Added two new net commands: DEM_WIPEON and DEM_WIPEOFF. They keep track of
when a player is going through a screen wipe and act like a pause, so the
game doesn't run several tics afterward to catch up with it.
- Fixed: EV_Teleport() did not set players to their idle state, so if they
were running when the teleported, they would still be running afterward
even though they weren't moving anywhere. Normally, P_XYMovement() does

View file

@ -584,10 +584,9 @@ void D_Display (bool screenshot)
NoWipe = 10;
}
NetUpdate (); // send out any new accumulation
if (!wipe || screenshot || NoWipe < 0)
{
NetUpdate (); // send out any new accumulation
// normal update
C_DrawConsole (); // draw console
M_Drawer (); // menu is drawn even on top of everything
@ -604,22 +603,25 @@ void D_Display (bool screenshot)
wipe_EndScreen ();
screen->Unlock ();
wipestart = I_GetTime (false) - 1;
wipestart = I_GetTime (false);
Net_WriteByte (DEM_WIPEON);
NetUpdate (); // send out any new accumulation
do
{
do
{
nowtime = I_GetTime (false);
tics = nowtime - wipestart;
} while (!tics);
nowtime = I_WaitForTic (wipestart);
tics = nowtime - wipestart;
wipestart = nowtime;
screen->Lock (true);
done = wipe_ScreenWipe (tics);
C_DrawConsole ();
M_Drawer (); // menu is drawn even on top of wipes
screen->Update (); // page flip or blit buffer
NetUpdate ();
} while (!done);
Net_WriteByte (DEM_WIPEOFF);
}
unclock (cycles);
@ -2363,6 +2365,8 @@ void D_DoomMain (void)
{
if (autostart || netgame)
{
// Do not do any screenwipes when autostarting a game.
NoWipe = 35;
CheckWarpTransMap (startmap, true);
if (demorecording)
G_BeginRecording (startmap);

View file

@ -602,6 +602,7 @@ void PlayerIsGone (int netnode, int netconsole)
nodeingame[netnode] = false;
playeringame[netconsole] = false;
nodejustleft[netnode] = false;
playerswiping &= ~(1 << netconsole);
if (deathmatch)
{
@ -2293,6 +2294,14 @@ void Net_DoCommand (int type, BYTE **stream, int player)
}
break;
case DEM_WIPEON:
playerswiping |= 1 << player;
break;
case DEM_WIPEOFF:
playerswiping &= ~(1 << player);
break;
default:
I_Error ("Unknown net command: %d", type);
break;

View file

@ -339,6 +339,7 @@ typedef player_s player_t;
// Bookkeeping on players - state.
extern player_s players[MAXPLAYERS];
extern DWORD playerswiping;
inline FArchive &operator<< (FArchive &arc, player_s *&p)
{

View file

@ -144,6 +144,8 @@ enum EDemoCommand
DEM_DOAUTOSAVE, // 42 An autosave should be made
DEM_MORPHEX, // 43 String: The class to morph to.
DEM_SUMMONFOE, // 44 String: Thing to fabricate
DEM_WIPEON, // 45 Player started a screen wipe
DEM_WIPEOFF, // 46 Player finished a screen wipe
};
// The following are implemented by cht_DoCheat in m_cheat.cpp

View file

@ -125,6 +125,7 @@ bool netgame; // only true if packets are broadcast
bool multiplayer;
player_t players[MAXPLAYERS];
bool playeringame[MAXPLAYERS];
DWORD playerswiping;
int consoleplayer; // player taking events
int gametic;
@ -2116,7 +2117,10 @@ void G_ReadDemoTiccmd (ticcmd_t *cmd, int player)
{
BYTE i = ReadByte (&demo_p);
if (i < MAXPLAYERS)
{
playeringame[i] = false;
playerswiping &= ~(1 << i);
}
}
break;

View file

@ -72,7 +72,7 @@ void P_Ticker (void)
r_NoInterpolate = true;
// run the tic
if (paused || P_CheckTickerPaused())
if (paused || playerswiping || P_CheckTickerPaused())
return;
S_ResumeSound ();

View file

@ -54,7 +54,7 @@
// Version identifier for network games.
// Bump it every time you do a release unless you're certain you
// didn't change anything that will affect sync.
#define NETGAMEVERSION 212
#define NETGAMEVERSION 213
// Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to
@ -64,7 +64,7 @@
// Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones.
// Otherwise, it should be safe to leave it alone.
#define DEMOGAMEVERSION 0x208
#define DEMOGAMEVERSION 0x209
// Minimum demo version we can play.
// Bump it whenever you change or remove existing DEM_ commands.