diff --git a/netplay.c b/netplay.c index 486f56adfb..fadd9364ac 100644 --- a/netplay.c +++ b/netplay.c @@ -1805,6 +1805,12 @@ bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data) switch (state) { + case RARCH_NETPLAY_CTL_POST_FRAME: + netplay_post_frame((netplay_t*)driver->netplay_data); + break; + case RARCH_NETPLAY_CTL_PRE_FRAME: + netplay_pre_frame((netplay_t*)driver->netplay_data); + break; case RARCH_NETPLAY_CTL_FLIP_PLAYERS: { bool *state = (bool*)data; diff --git a/netplay.h b/netplay.h index 6544b75969..9845173bf7 100644 --- a/netplay.h +++ b/netplay.h @@ -32,7 +32,9 @@ enum rarch_netplay_ctl_state { RARCH_NETPLAY_CTL_NONE = 0, RARCH_NETPLAY_CTL_FLIP_PLAYERS, - RARCH_NETPLAY_CTL_FULLSCREEN_TOGGLE + RARCH_NETPLAY_CTL_FULLSCREEN_TOGGLE, + RARCH_NETPLAY_CTL_POST_FRAME, + RARCH_NETPLAY_CTL_PRE_FRAME }; /* TODO: most of this, actually */ diff --git a/runloop.c b/runloop.c index 055a6f07d8..2edf8c75f0 100644 --- a/runloop.c +++ b/runloop.c @@ -1167,8 +1167,7 @@ int rarch_main_iterate(unsigned *sleep_ms) #endif #ifdef HAVE_NETPLAY - if (driver->netplay_data) - netplay_pre_frame((netplay_t*)driver->netplay_data); + netplay_driver_ctl(RARCH_NETPLAY_CTL_PRE_FRAME, NULL); #endif if (bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL)) @@ -1214,8 +1213,7 @@ int rarch_main_iterate(unsigned *sleep_ms) bsv_movie_ctl(BSV_MOVIE_CTL_SET_FRAME_END, NULL); #ifdef HAVE_NETPLAY - if (driver->netplay_data) - netplay_post_frame((netplay_t*)driver->netplay_data); + netplay_driver_ctl(RARCH_NETPLAY_CTL_POST_FRAME, NULL); #endif #if defined(HAVE_THREADS)