mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-16 20:39:15 +01:00
Throttle before encoding display, otherwise updates can be missed
This commit is contained in:
parent
8c73c900df
commit
a0a3097dec
@ -599,18 +599,18 @@ void C64::network_vblank()
|
||||
}
|
||||
remote->ResetNetworkUpdate();
|
||||
|
||||
/* Perhaps send updates to the other side (what is determinted by
|
||||
* if this is the master or not) */
|
||||
remote->EncodeJoystickUpdate(*js);
|
||||
remote->EncodeDisplay(master, remote->GetScreen());
|
||||
|
||||
if (this->network_connection_type == MASTER &&
|
||||
if (this->network_connection_type == MASTER &&
|
||||
remote->ThrottleTraffic()) {
|
||||
/* Skip this frame if the data rate is too high */
|
||||
has_throttled = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Perhaps send updates to the other side (what is determined by
|
||||
* if this is the master or not) */
|
||||
remote->EncodeJoystickUpdate(*js);
|
||||
remote->EncodeDisplay(master, remote->GetScreen());
|
||||
|
||||
if (remote->SendUpdate() == false)
|
||||
{
|
||||
/* Disconnect or broken data */
|
||||
|
@ -456,9 +456,12 @@ void Network::DrawTransferredBlocks(SDL_Surface *screen)
|
||||
bool Network::ReceiveUpdate()
|
||||
{
|
||||
struct timeval tv;
|
||||
bool out;
|
||||
|
||||
memset(&tv, 0, sizeof(tv));
|
||||
return this->ReceiveUpdate(this->ud, &tv);
|
||||
out = this->ReceiveUpdate(this->ud, &tv);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
bool Network::ReceiveUpdate(NetworkUpdate *dst, struct timeval *tv)
|
||||
@ -525,7 +528,6 @@ bool Network::SendUpdate()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Network::AddNetworkUpdate(NetworkUpdate *update)
|
||||
{
|
||||
size_t sz = update->size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user