mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-01 14:11:01 +00:00
- removed the packet averaging code.
This is also part of the backend code and won't be needed here anymore.
This commit is contained in:
parent
e19923ce4b
commit
621a1e0b3d
2 changed files with 2 additions and 54 deletions
|
@ -227,12 +227,6 @@ extern int gameclock;
|
||||||
extern uint64_t gameclockstart;
|
extern uint64_t gameclockstart;
|
||||||
extern int lastTic;
|
extern int lastTic;
|
||||||
|
|
||||||
inline void setGameClockStart()
|
|
||||||
{
|
|
||||||
gameclockstart = I_GetTimeNS();
|
|
||||||
gameclock = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void updateGameClock()
|
inline void updateGameClock()
|
||||||
{
|
{
|
||||||
gameclock = static_cast<int>((I_GetTimeNS() - gameclockstart) * 120 / 1'000'000'000);
|
gameclock = static_cast<int>((I_GetTimeNS() - gameclockstart) * 120 / 1'000'000'000);
|
||||||
|
|
|
@ -71,23 +71,6 @@ int mymaxlag, otherminlag, bufferjitter = 1;
|
||||||
extern char sync_first[MAXSYNCBYTES][60];
|
extern char sync_first[MAXSYNCBYTES][60];
|
||||||
extern int sync_found;
|
extern int sync_found;
|
||||||
|
|
||||||
//
|
|
||||||
// Tic Duplication - so you can move multiple times per packet. This is InputPacket with the 16 bit values extended to 32 bit.
|
|
||||||
//
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int32_t fvel;
|
|
||||||
int32_t svel;
|
|
||||||
fixed_t q16avel;
|
|
||||||
fixed_t q16horz;
|
|
||||||
fixed_t q16ang;
|
|
||||||
fixed_t q16horiz;
|
|
||||||
ESyncBits actions;
|
|
||||||
} SW_AVERAGE_PACKET;
|
|
||||||
|
|
||||||
int MovesPerPacket = 1;
|
|
||||||
SW_AVERAGE_PACKET AveragePacket;
|
|
||||||
|
|
||||||
// GAME.C sync state variables
|
// GAME.C sync state variables
|
||||||
uint8_t syncstat[MAXSYNCBYTES];
|
uint8_t syncstat[MAXSYNCBYTES];
|
||||||
//int syncvalhead[MAX_SW_PLAYERS];
|
//int syncvalhead[MAX_SW_PLAYERS];
|
||||||
|
@ -193,40 +176,11 @@ UpdateInputs(void)
|
||||||
|
|
||||||
getinput(&loc, FALSE);
|
getinput(&loc, FALSE);
|
||||||
|
|
||||||
AveragePacket.fvel += loc.fvel;
|
|
||||||
AveragePacket.svel += loc.svel;
|
|
||||||
AveragePacket.q16avel += loc.q16avel;
|
|
||||||
AveragePacket.q16horz += loc.q16horz;
|
|
||||||
AveragePacket.q16ang = Player[myconnectindex].camq16ang;
|
|
||||||
AveragePacket.q16horiz = Player[myconnectindex].camq16horiz;
|
|
||||||
SET(AveragePacket.actions, loc.actions);
|
|
||||||
// The above would or the weapon numbers together. Undo that now. The last one should win.
|
|
||||||
AveragePacket.actions &= ~SB_WEAPONMASK_BITS;
|
|
||||||
AveragePacket.actions |= ESyncBits::FromInt(loc.getNewWeapon()) & SB_WEAPONMASK_BITS;
|
|
||||||
|
|
||||||
memset(&loc, 0, sizeof(loc));
|
|
||||||
|
|
||||||
pp = Player + myconnectindex;
|
pp = Player + myconnectindex;
|
||||||
|
|
||||||
if (pp->movefifoend & (MovesPerPacket-1))
|
loc.q16ang = pp->camq16ang;
|
||||||
{
|
loc.q16horiz = pp->camq16horiz;
|
||||||
memcpy(&pp->inputfifo[pp->movefifoend & (MOVEFIFOSIZ - 1)],
|
|
||||||
&pp->inputfifo[(pp->movefifoend-1) & (MOVEFIFOSIZ - 1)],
|
|
||||||
sizeof(InputPacket));
|
|
||||||
|
|
||||||
pp->movefifoend++;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
loc.fvel = AveragePacket.fvel / MovesPerPacket;
|
|
||||||
loc.svel = AveragePacket.svel / MovesPerPacket;
|
|
||||||
loc.q16avel = AveragePacket.q16avel / MovesPerPacket;
|
|
||||||
loc.q16horz = AveragePacket.q16horz / MovesPerPacket;
|
|
||||||
loc.q16ang = AveragePacket.q16ang;
|
|
||||||
loc.q16horiz = AveragePacket.q16horiz;
|
|
||||||
loc.actions = AveragePacket.actions;
|
|
||||||
|
|
||||||
memset(&AveragePacket, 0, sizeof(AveragePacket));
|
|
||||||
|
|
||||||
pp->inputfifo[Player[myconnectindex].movefifoend & (MOVEFIFOSIZ - 1)] = loc;
|
pp->inputfifo[Player[myconnectindex].movefifoend & (MOVEFIFOSIZ - 1)] = loc;
|
||||||
pp->movefifoend++;
|
pp->movefifoend++;
|
||||||
|
|
Loading…
Reference in a new issue