mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Fix multiplayer desync after the change to q16 angle and horiz.
Note that this includes non-portable unaligned accesses, but this already applies to surrounding code. Just add comments for now.
This commit is contained in:
parent
536ed3827d
commit
3bc46078b8
1 changed files with 6 additions and 4 deletions
|
@ -282,6 +282,7 @@ int EncodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
|||
*buf = 0;
|
||||
buf++;
|
||||
|
||||
// TODO: Properly copy the values in a cross-platform manner
|
||||
if (pak->vel != old_pak->vel)
|
||||
{
|
||||
*((short *)buf) = pak->vel;
|
||||
|
@ -298,14 +299,14 @@ int EncodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
|||
|
||||
if (pak->q16avel != old_pak->q16avel)
|
||||
{
|
||||
*((char *)buf) = pak->q16avel;
|
||||
*((fix16_t *)buf) = pak->q16avel;
|
||||
buf += sizeof(pak->q16avel);
|
||||
SET(*base_ptr, BIT(2));
|
||||
}
|
||||
|
||||
if (pak->q16horz != old_pak->q16horz)
|
||||
{
|
||||
*((char *)buf) = pak->q16horz;
|
||||
*((fix16_t *)buf) = pak->q16horz;
|
||||
buf += sizeof(pak->q16horz);
|
||||
SET(*base_ptr, BIT(3));
|
||||
}
|
||||
|
@ -334,6 +335,7 @@ int DecodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
|||
|
||||
*pak = *old_pak;
|
||||
|
||||
// TODO: Properly copy the values in a cross-platform manner
|
||||
if (TEST(*base_ptr, BIT(0)))
|
||||
{
|
||||
pak->vel = *(short *)buf;
|
||||
|
@ -348,13 +350,13 @@ int DecodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
|||
|
||||
if (TEST(*base_ptr, BIT(2)))
|
||||
{
|
||||
pak->q16avel = *(char *)buf;
|
||||
pak->q16avel = *(fix16_t *)buf;
|
||||
buf += sizeof(pak->q16avel);
|
||||
}
|
||||
|
||||
if (TEST(*base_ptr, BIT(3)))
|
||||
{
|
||||
pak->q16horz = *(char *)buf;
|
||||
pak->q16horz = *(fix16_t *)buf;
|
||||
buf += sizeof(pak->q16horz);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue