Use HAVE_NETWORK_CMD

This commit is contained in:
Themaister 2012-05-27 14:23:30 +02:00
parent 20472ae36d
commit 65b78348f0
3 changed files with 16 additions and 5 deletions

View File

@ -28,7 +28,7 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef HAVE_NETPLAY #ifdef HAVE_NETWORK_CMD
#include "network_cmd.h" #include "network_cmd.h"
#endif #endif
@ -176,7 +176,7 @@ typedef struct driver
void *video_data; void *video_data;
void *input_data; void *input_data;
#ifdef HAVE_NETPLAY #ifdef HAVE_NETWORK_CMD
network_cmd_t *network_cmd; network_cmd_t *network_cmd;
#endif #endif
} driver_t; } driver_t;
@ -260,7 +260,7 @@ extern const input_driver_t input_xdk360;
static inline bool input_key_pressed_func(int key) static inline bool input_key_pressed_func(int key)
{ {
bool ret = driver.input->key_pressed(driver.input_data, key); bool ret = driver.input->key_pressed(driver.input_data, key);
#ifdef HAVE_NETPLAY #ifdef HAVE_NETWORK_CMD
if (!ret && driver.network_cmd) if (!ret && driver.network_cmd)
ret = network_cmd_get(driver.network_cmd, key); ret = network_cmd_get(driver.network_cmd, key);
#endif #endif

View File

@ -46,8 +46,12 @@ if [ $HAVE_NETPLAY = yes ]; then
else else
HAVE_SOCKET_LEGACY=yes HAVE_SOCKET_LEGACY=yes
fi fi
HAVE_NETWORK_CMD=yes
else
HAVE_NETWORK_CMD=no
fi fi
check_lib GETOPT_LONG -lc getopt_long check_lib GETOPT_LONG -lc getopt_long
if [ $HAVE_DYLIB = no ] && [ $HAVE_DYNAMIC = yes ]; then if [ $HAVE_DYLIB = no ] && [ $HAVE_DYNAMIC = yes ]; then
@ -140,7 +144,7 @@ check_pkgconf PYTHON python3
add_define_make OS $OS add_define_make OS $OS
# Creates config.mk and config.h. # Creates config.mk and config.h.
VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL DYLIB GETOPT_LONG THREADS CG XML SDL_IMAGE DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE CONFIGFILE FREETYPE XVIDEO X11 XEXT NETPLAY SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 X264RGB SINC BSV_MOVIE" VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL DYLIB GETOPT_LONG THREADS CG XML SDL_IMAGE DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE CONFIGFILE FREETYPE XVIDEO X11 XEXT NETPLAY NETWORK_CMD SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 X264RGB SINC BSV_MOVIE"
create_config_make config.mk $VARS create_config_make config.mk $VARS
create_config_header config.h $VARS create_config_header config.h $VARS

View File

@ -1337,7 +1337,9 @@ static void deinit_netplay(void)
if (g_extern.netplay) if (g_extern.netplay)
netplay_free(g_extern.netplay); netplay_free(g_extern.netplay);
} }
#endif
#ifdef HAVE_NETWORK_CMD
static void init_network_cmd(void) static void init_network_cmd(void)
{ {
if (!g_settings.network_cmd_enable) if (!g_settings.network_cmd_enable)
@ -2372,8 +2374,11 @@ int rarch_main_init(int argc, char *argv[])
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
init_netplay(); init_netplay();
#endif
#ifdef HAVE_NETWORK_CMD
init_network_cmd(); init_network_cmd();
#endif #endif
init_drivers(); init_drivers();
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
@ -2447,7 +2452,7 @@ bool rarch_main_iterate(void)
!video_alive_func()) !video_alive_func())
return false; return false;
#ifdef HAVE_NETPLAY #ifdef HAVE_NETWORK_CMD
if (driver.network_cmd) if (driver.network_cmd)
network_cmd_pre_frame(driver.network_cmd); network_cmd_pre_frame(driver.network_cmd);
#endif #endif
@ -2505,6 +2510,8 @@ void rarch_main_deinit(void)
{ {
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
deinit_netplay(); deinit_netplay();
#endif
#ifdef HAVE_NETWORK_CMD
deinit_network_cmd(); deinit_network_cmd();
#endif #endif