mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-19 22:02:41 +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();
|
remote->ResetNetworkUpdate();
|
||||||
|
|
||||||
/* Perhaps send updates to the other side (what is determinted by
|
if (this->network_connection_type == MASTER &&
|
||||||
* if this is the master or not) */
|
|
||||||
remote->EncodeJoystickUpdate(*js);
|
|
||||||
remote->EncodeDisplay(master, remote->GetScreen());
|
|
||||||
|
|
||||||
if (this->network_connection_type == MASTER &&
|
|
||||||
remote->ThrottleTraffic()) {
|
remote->ThrottleTraffic()) {
|
||||||
/* Skip this frame if the data rate is too high */
|
/* Skip this frame if the data rate is too high */
|
||||||
has_throttled = true;
|
has_throttled = true;
|
||||||
continue;
|
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)
|
if (remote->SendUpdate() == false)
|
||||||
{
|
{
|
||||||
/* Disconnect or broken data */
|
/* Disconnect or broken data */
|
||||||
|
@ -456,9 +456,12 @@ void Network::DrawTransferredBlocks(SDL_Surface *screen)
|
|||||||
bool Network::ReceiveUpdate()
|
bool Network::ReceiveUpdate()
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
bool out;
|
||||||
|
|
||||||
memset(&tv, 0, sizeof(tv));
|
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)
|
bool Network::ReceiveUpdate(NetworkUpdate *dst, struct timeval *tv)
|
||||||
@ -525,7 +528,6 @@ bool Network::SendUpdate()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Network::AddNetworkUpdate(NetworkUpdate *update)
|
void Network::AddNetworkUpdate(NetworkUpdate *update)
|
||||||
{
|
{
|
||||||
size_t sz = update->size;
|
size_t sz = update->size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user