diff --git a/griffin/griffin.c b/griffin/griffin.c index 23b3c16b26..cc614186ee 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -744,7 +744,10 @@ THREAD NETPLAY ============================================================ */ #ifdef HAVE_NETPLAY -#include "../netplay.c" +#include "../netplay/netplay.c" +#include "../netplay/netplay_net.c" +#include "../netplay/netplay_spectate.c" +#include "../netplay/netplay_common.c" #include "../libretro-common/net/net_compat.c" #include "../libretro-common/net/net_http.c" #include "../tasks/task_http.c" diff --git a/netplay/netplay.c b/netplay/netplay.c index 452fb89ec5..935aaa39e4 100644 --- a/netplay/netplay.c +++ b/netplay/netplay.c @@ -59,7 +59,7 @@ bool check_netplay_synched(netplay_t* netplay) return netplay->frame_count < (netplay->flip_frame + 2 * UDP_FRAME_PACKETS); } -static bool info_cb(netplay_t* netplay, unsigned frames) { +static bool netplay_info_cb(netplay_t* netplay, unsigned frames) { return netplay->net_cbs->info_cb(netplay, frames); } @@ -791,7 +791,6 @@ netplay_t *netplay_new(const char *server, uint16_t port, bool spectate, const char *nick) { - unsigned i; netplay_t *netplay = NULL; if (frames > UDP_FRAME_PACKETS) @@ -820,7 +819,7 @@ netplay_t *netplay_new(const char *server, uint16_t port, return NULL; } - if(!info_cb(netplay, frames)) + if(!netplay_info_cb(netplay, frames)) goto error; return netplay; diff --git a/netplay/netplay.h b/netplay/netplay.h index 635052bac9..9d798626a3 100644 --- a/netplay/netplay.h +++ b/netplay/netplay.h @@ -23,8 +23,8 @@ #include -#include "libretro.h" -#include "libretro_version_1.h" +#include "../libretro.h" +#include "../libretro_version_1.h" typedef struct netplay netplay_t; diff --git a/netplay/netplay_net.c b/netplay/netplay_net.c index 5fafed64ad..79f59805f9 100644 --- a/netplay/netplay_net.c +++ b/netplay/netplay_net.c @@ -21,7 +21,7 @@ * * Pre-frame for Netplay (normal version). **/ -static void pre_frame(netplay_t *netplay) +static void netplay_net_pre_frame(netplay_t *netplay) { core.retro_serialize(netplay->buffer[netplay->self_ptr].state, netplay->state_size); @@ -37,7 +37,7 @@ static void pre_frame(netplay_t *netplay) * Post-frame for Netplay (normal version). * We check if we have new input and replay from recorded input. **/ -static void post_frame(netplay_t *netplay) +static void netplay_net_post_frame(netplay_t *netplay) { netplay->frame_count++; @@ -91,7 +91,7 @@ static void post_frame(netplay_t *netplay) netplay->is_replay = false; } } -static bool init_buffers(netplay_t *netplay) +static bool netplay_net_init_buffers(netplay_t *netplay) { unsigned i; @@ -119,7 +119,7 @@ static bool init_buffers(netplay_t *netplay) return true; } -static bool info_cb(netplay_t* netplay, unsigned frames) +static bool netplay_net_info_cb(netplay_t* netplay, unsigned frames) { if (np_is_server(netplay)) { @@ -134,7 +134,7 @@ static bool info_cb(netplay_t* netplay, unsigned frames) netplay->buffer_size = frames + 1; - if (!init_buffers(netplay)) + if (!netplay_net_init_buffers(netplay)) return false; netplay->has_connection = true; @@ -145,9 +145,9 @@ static bool info_cb(netplay_t* netplay, unsigned frames) struct netplay_callbacks* netplay_get_cbs_net(void) { static struct netplay_callbacks cbs = { - &pre_frame, - &post_frame, - &info_cb + &netplay_net_pre_frame, + &netplay_net_post_frame, + &netplay_net_info_cb }; return &cbs; } \ No newline at end of file diff --git a/netplay/netplay_spectate.c b/netplay/netplay_spectate.c index 82886e916c..ff8716af15 100644 --- a/netplay/netplay_spectate.c +++ b/netplay/netplay_spectate.c @@ -22,7 +22,7 @@ * * Pre-frame for Netplay (spectate mode version). **/ -static void pre_frame(netplay_t *netplay) +static void netplay_spectate_pre_frame(netplay_t *netplay) { unsigned i; uint32_t *header; @@ -121,7 +121,7 @@ static void pre_frame(netplay_t *netplay) * Post-frame for Netplay (spectate mode version). * We check if we have new input and replay from recorded input. **/ -static void post_frame(netplay_t *netplay) +static void netplay_spectate_post_frame(netplay_t *netplay) { unsigned i; @@ -153,7 +153,7 @@ static void post_frame(netplay_t *netplay) netplay->spectate.input_ptr = 0; } -static bool info_cb(netplay_t *netplay, unsigned frames) +static bool netplay_spectate_info_cb(netplay_t *netplay, unsigned frames) { unsigned i; if(np_is_server(netplay)) @@ -170,9 +170,9 @@ static bool info_cb(netplay_t *netplay, unsigned frames) struct netplay_callbacks* netplay_get_cbs_spectate(void) { static struct netplay_callbacks cbs = { - &pre_frame, - &post_frame, - &info_cb + &netplay_spectate_pre_frame, + &netplay_spectate_post_frame, + &netplay_spectate_info_cb }; return &cbs;