Ejemplo n.º 1
0
input_remote_t *input_remote_new(uint16_t port)
{
   unsigned user;
#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY)
   settings_t   *settings = config_get_ptr();
#endif
   input_remote_t *handle = (input_remote_t*)
      calloc(1, sizeof(*handle));

   if (!handle)
      return NULL;

   (void)port;

#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY)
   for(user = 0; user < settings->input.max_users; user ++)
   {
      handle->net_fd[user] = -1;
      if(settings->network_remote_enable_user[user])
         if (!input_remote_init_network(handle, port, user))
            goto error;
   }
#endif

   return handle;

#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY)
error:
   input_remote_free(handle);
   return NULL;
#endif
}
Ejemplo n.º 2
0
void input_driver_deinit_remote(void)
{
#ifdef HAVE_NETWORKGAMEPAD
   if (input_driver_remote)
      input_remote_free(input_driver_remote);
   input_driver_remote = NULL;
#endif
}