mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
Rewrite netplay checks
This commit is contained in:
parent
759b963c2f
commit
aeddb18e31
@ -1311,11 +1311,8 @@ bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data)
|
||||
ret = netplay_pre_frame(netplay_data);
|
||||
goto done;
|
||||
case RARCH_NETPLAY_CTL_FLIP_PLAYERS:
|
||||
{
|
||||
bool *state = (bool*)data;
|
||||
if (netplay_data->is_server && *state)
|
||||
netplay_flip_users(netplay_data);
|
||||
}
|
||||
if (netplay_data->is_server)
|
||||
netplay_flip_users(netplay_data);
|
||||
break;
|
||||
case RARCH_NETPLAY_CTL_GAME_WATCH:
|
||||
netplay_toggle_play_spectate(netplay_data);
|
||||
|
19
retroarch.c
19
retroarch.c
@ -2502,12 +2502,23 @@ static enum runloop_state runloop_check_state(
|
||||
command_event(CMD_EVENT_VOLUME_DOWN, NULL);
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
/* Check Netplay */
|
||||
{
|
||||
bool tmp = runloop_cmd_triggered(trigger_input, RARCH_NETPLAY_FLIP);
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_FLIP_PLAYERS, &tmp);
|
||||
tmp = runloop_cmd_triggered(trigger_input, RARCH_NETPLAY_GAME_WATCH);
|
||||
if (tmp)
|
||||
static bool old_netplay_flip = false;
|
||||
static bool old_netplay_watch = false;
|
||||
bool netplay_flip = runloop_cmd_press(
|
||||
current_input, RARCH_NETPLAY_FLIP);
|
||||
bool netplay_watch = runloop_cmd_press(
|
||||
current_input, RARCH_NETPLAY_GAME_WATCH);
|
||||
|
||||
if (netplay_flip && !old_netplay_flip)
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_FLIP_PLAYERS, NULL);
|
||||
|
||||
if (netplay_watch && !old_netplay_watch)
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_GAME_WATCH, NULL);
|
||||
|
||||
old_netplay_flip = netplay_flip;
|
||||
old_netplay_watch = netplay_watch;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user