(Netplay) Backport - [PATCH] Should fix few issues with netplay.

One perf fix and 3/4 player fix.
This commit is contained in:
twinaphex 2016-01-30 00:23:22 +01:00
parent 92251dcecb
commit 8e435a66eb
2 changed files with 8 additions and 1 deletions

View File

@ -568,8 +568,15 @@ int16_t input_state_net(unsigned port, unsigned device,
unsigned idx, unsigned id) unsigned idx, unsigned id)
{ {
netplay_t *netplay = (netplay_t*)netplay_data; netplay_t *netplay = (netplay_t*)netplay_data;
if (netplay_is_alive(netplay)) if (netplay_is_alive(netplay))
{
/* Only two players for now. */
if (port > 1)
return 0;
return netplay_input_state(netplay, port, device, idx, id); return netplay_input_state(netplay, port, device, idx, id);
}
return netplay->cbs.state_cb(port, device, idx, id); return netplay->cbs.state_cb(port, device, idx, id);
} }

View File

@ -56,7 +56,7 @@ static void netplay_net_post_frame(netplay_t *netplay)
{ {
const struct delta_frame *ptr = &netplay->buffer[netplay->other_ptr]; const struct delta_frame *ptr = &netplay->buffer[netplay->other_ptr];
if ((ptr->simulated_input_state != ptr->real_input_state) if (memcmp(ptr->simulated_input_state, ptr->real_input_state, sizeof(ptr->real_input_state)) != 0
&& !ptr->used_real) && !ptr->used_real)
break; break;
netplay->other_ptr = NEXT_PTR(netplay->other_ptr); netplay->other_ptr = NEXT_PTR(netplay->other_ptr);