Start isolating usage of driver->netplay_data to netplay.c

This commit is contained in:
twinaphex 2015-12-05 16:27:00 +01:00
parent d4d07f674f
commit 67e8647acb
3 changed files with 11 additions and 5 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -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)