当前位置: 首页>>代码示例>>C++>>正文


C++ rarch_main_msg_queue_push函数代码示例

本文整理汇总了C++中rarch_main_msg_queue_push函数的典型用法代码示例。如果您正苦于以下问题:C++ rarch_main_msg_queue_push函数的具体用法?C++ rarch_main_msg_queue_push怎么用?C++ rarch_main_msg_queue_push使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rarch_main_msg_queue_push函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: action_ok_remap_file_save_game

static int action_ok_remap_file_save_game(const char *path,
      const char *label, unsigned type, size_t idx)
{
   global_t *global = global_get_ptr();
   settings_t *settings = config_get_ptr();

   const char *core_name;
   core_name = global->system.info.library_name;

   const char *game_name;
   game_name = path_basename(global->basename);

   char directory[PATH_MAX_LENGTH];
   char file[PATH_MAX_LENGTH];

   fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
   fill_pathname_join(file,core_name,game_name,PATH_MAX_LENGTH);

   if(!path_file_exists(directory))
       path_mkdir(directory);

   if(input_remapping_save_file(file))
      rarch_main_msg_queue_push("Remap file saved successfully", 1, 100, true);
   else
      rarch_main_msg_queue_push("Error saving remap file", 1, 100, true);

   return 0;
}
开发者ID:beshio,项目名称:RetroArch,代码行数:28,代码来源:menu_entries_cbs_ok.c

示例2: input_autoconfigure_joypad_add

static void input_autoconfigure_joypad_add(
      config_file_t *conf,
      autoconfig_params_t *params)
{
   bool block_osd_spam;
   char msg[PATH_MAX_LENGTH] = {0};
   char display_name[PATH_MAX_LENGTH] = {0};
   char device_type[PATH_MAX_LENGTH] = {0};
   settings_t      *settings = config_get_ptr();

   config_get_array(conf, "input_device_display_name", display_name, sizeof(display_name));
   config_get_array(conf, "input_device_type", device_type, sizeof(device_type));

   if (!settings)
      return;

   /* This will be the case if input driver is reinitialized.
    * No reason to spam autoconfigure messages every time. */
   block_osd_spam = settings->input.autoconfigured[params->idx]
      && *params->name;

   settings->input.autoconfigured[params->idx] = true;
   input_autoconfigure_joypad_conf(conf,
         settings->input.autoconf_binds[params->idx]);

   if (!strcmp(device_type,"remote"))
   {
      if (display_name[0] != '\0' || strcmp(display_name, ""))
         snprintf(msg, sizeof(msg), "%s configured",
            display_name);
      else
         snprintf(msg, sizeof(msg), "%s configured",
            params->name);

      if(!remote_is_bound)
         rarch_main_msg_queue_push(msg, 0, 60, false);
      remote_is_bound = true;
   }
   else
   {
      if (display_name[0] != '\0' || strcmp(display_name, ""))
         snprintf(msg, sizeof(msg), "%s configured in port #%u.",
               display_name, params->idx);
      else
         snprintf(msg, sizeof(msg), "%s configured in port #%u.",
               params->name, params->idx);
      if (!block_osd_spam)
          rarch_main_msg_queue_push(msg, 0, 60, false);
   }

#if 0
   RARCH_LOG("Autodetect: %s\n", msg);
#endif
}
开发者ID:ioev,项目名称:RetroArch,代码行数:54,代码来源:input_autodetect.c

示例3: netplay_command

/**
 * netplay_command:
 * @netplay                : pointer to netplay object
 * @cmd                    : command to send
 * @data                   : data to send as argument
 * @sz                     : size of data
 * @flags                  : flags of CMD_OPT_*
 * @command_str            : name of action
 * @success_msg            : message to display upon success
 * 
 * Sends a single netplay command and waits for response.
 */
bool netplay_command(netplay_t* netplay, enum netplay_cmd cmd,
                     void* data, size_t sz,
                     uint32_t flags,
                     const char* command_str,
                     const char* success_msg)
{
   char m[256];
   const char* msg         = NULL;
   bool allowed_spectate   = !!(flags & CMD_OPT_ALLOWED_IN_SPECTATE_MODE);
   bool host_only          = !!(flags & CMD_OPT_HOST_ONLY);
   bool require_sync       = !!(flags & CMD_OPT_REQUIRE_SYNC);

   assert(netplay);

   if (netplay->spectate.enabled && !allowed_spectate)
   {
      msg = "Cannot %s in spectate mode.";
      goto error; 
   }

   if (host_only && netplay->port == 0)
   {
      msg = "Cannot %s as a client.";
      goto error;
   }

   if(require_sync && check_netplay_synched(netplay))
   {
      msg = "Cannot %s while host and client are not in sync.";
      goto error;
   }

   if(netplay_send_raw_cmd(netplay, cmd, data, sz)) {
      if(netplay_get_response(netplay))
         rarch_main_msg_queue_push(success_msg, 1, 180, false);
      else
      {
         msg = "Failed to send command \"%s\"";
         goto error;
      }
   }
   return true;

error:
   snprintf(m, sizeof(m), msg, command_str);
   RARCH_WARN("%s\n", m);
   rarch_main_msg_queue_push(m, 1, 180, false);
   return false;
}
开发者ID:flaviommedeiros,项目名称:cprojects,代码行数:61,代码来源:netplay-4.c

示例4: netplay_flip_users

/**
 * netplay_flip_users:
 * @netplay              : pointer to netplay object
 *
 * On regular netplay, flip who controls user 1 and 2.
 **/
void netplay_flip_users(netplay_t *netplay)
{
   uint32_t flip_frame     = netplay->frame_count + 2 * UDP_FRAME_PACKETS;
   uint32_t flip_frame_net = htonl(flip_frame);
   const char *msg         = NULL;

   if (netplay->spectate)
   {
      msg = "Cannot flip users in spectate mode.";
      goto error;
   }

   if (netplay->port == 0)
   {
      msg = "Cannot flip users if you're not the host.";
      goto error;
   }

   /* Make sure both clients are definitely synced up. */
   if (netplay->frame_count < (netplay->flip_frame + 2 * UDP_FRAME_PACKETS))
   {
      msg = "Cannot flip users yet. Wait a second or two before attempting flip.";
      goto error;
   }

   if (netplay_send_cmd(netplay, NETPLAY_CMD_FLIP_PLAYERS,
            &flip_frame_net, sizeof(flip_frame_net))
         && netplay_get_response(netplay))
   {
      RARCH_LOG("Netplay users are flipped.\n");
      rarch_main_msg_queue_push("Netplay users are flipped.", 1, 180, false);

      /* Queue up a flip well enough in the future. */
      netplay->flip ^= true;
      netplay->flip_frame = flip_frame;
   }
   else
   {
      msg = "Failed to flip users.";
      goto error;
   }

   return;

error:
   RARCH_WARN("%s\n", msg);
   rarch_main_msg_queue_push(msg, 1, 180, false);
}
开发者ID:ssangkong,项目名称:RetroArch,代码行数:54,代码来源:netplay.c

示例5: cmd_set_shader

static bool cmd_set_shader(const char *arg)
{
   char msg[PATH_MAX_LENGTH]   = {0};
   enum rarch_shader_type type = RARCH_SHADER_NONE;
   const char             *ext = path_get_extension(arg);
   uint32_t ext_hash           = msg_hash_calculate(ext);

   switch (ext_hash)
   {
      case COMMAND_EXT_GLSL:
      case COMMAND_EXT_GLSLP:
         type = RARCH_SHADER_GLSL;
         break;
      case COMMAND_EXT_CG:
      case COMMAND_EXT_CGP:
         type = RARCH_SHADER_CG;
         break;
      default:
         return false;
   }

   snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg);
   rarch_main_msg_queue_push(msg, 1, 120, true);
   RARCH_LOG("%s \"%s\".\n",
         msg_hash_to_str(MSG_APPLYING_SHADER),
         arg);

   return video_driver_set_shader(type, arg);
}
开发者ID:jeapostrophe,项目名称:RetroArch,代码行数:29,代码来源:command.c

示例6: gfx_ctx_d3d_update_title

static void gfx_ctx_d3d_update_title(void *data)
{
   char buf[128]        = {0};
   char buffer_fps[128] = {0};
   settings_t *settings = config_get_ptr();

   if (video_monitor_get_fps(buf, sizeof(buf),
            buffer_fps, sizeof(buffer_fps)))
   {
#ifndef _XBOX
      d3d_video_t *d3d     = (d3d_video_t*)data;

      SetWindowText(g_hwnd, buf);
#endif
   }

   if (settings->fps_show)
   {
#ifdef _XBOX
      MEMORYSTATUS stat;
      char mem[128] = {0};

      GlobalMemoryStatus(&stat);
      snprintf(mem, sizeof(mem), "|| MEM: %.2f/%.2fMB",
            stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
      strlcat(buffer_fps, mem, sizeof(buffer_fps));
#endif
      rarch_main_msg_queue_push(buffer_fps, 1, 1, false);
   }
}
开发者ID:bronnel,项目名称:RetroArch,代码行数:30,代码来源:d3d_ctx.cpp

示例7: event_load_auto_state

static void event_load_auto_state(void)
{
   bool ret;
   char msg[PATH_MAX_LENGTH]                 = {0};
   char savestate_name_auto[PATH_MAX_LENGTH] = {0};
   settings_t *settings = config_get_ptr();
   global_t   *global   = global_get_ptr();

#ifdef HAVE_NETPLAY
   if (global->netplay_enable && !global->netplay_is_spectate)
      return;
#endif

   if (!settings->savestate_auto_load)
      return;

   fill_pathname_noext(savestate_name_auto, global->savestate_name,
         ".auto", sizeof(savestate_name_auto));

   if (!path_file_exists(savestate_name_auto))
      return;

   ret = load_state(savestate_name_auto);

   RARCH_LOG("Found auto savestate in: %s\n", savestate_name_auto);

   snprintf(msg, sizeof(msg), "Auto-loading savestate from \"%s\" %s.",
         savestate_name_auto, ret ? "succeeded" : "failed");
   rarch_main_msg_queue_push(msg, 1, 180, false);
   RARCH_LOG("%s\n", msg);
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:31,代码来源:command_event.c

示例8: event_disk_control_set_eject

/**
 * event_disk_control_set_eject:
 * @new_state            : Eject or close the virtual drive tray.
 *                         false (0) : Close
 *                         true  (1) : Eject
 * @print_log            : Show message onscreen.
 *
 * Ejects/closes of the virtual drive tray.
 **/
static void event_disk_control_set_eject(bool new_state, bool print_log)
{
   char msg[PATH_MAX_LENGTH] = {0};
   bool error                = false;
   rarch_system_info_t *info = rarch_system_info_get_ptr();
   const struct retro_disk_control_callback *control = 
      info ? (const struct retro_disk_control_callback*)&info->disk_control : NULL;

   if (!control || !control->get_num_images)
      return;

   *msg = '\0';

   if (control->set_eject_state(new_state))
      snprintf(msg, sizeof(msg), "%s virtual disk tray.",
            new_state ? "Ejected" : "Closed");
   else
   {
      error = true;
      snprintf(msg, sizeof(msg), "Failed to %s virtual disk tray.",
            new_state ? "eject" : "close");
   }

   if (*msg)
   {
      if (error)
         RARCH_ERR("%s\n", msg);
      else
         RARCH_LOG("%s\n", msg);

      /* Only noise in menu. */
      if (print_log)
         rarch_main_msg_queue_push(msg, 1, 180, true);
   }
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:44,代码来源:command_event.c

示例9: event_main_state

static void event_main_state(unsigned cmd)
{
   char path[PATH_MAX_LENGTH] = {0};
   char msg[PATH_MAX_LENGTH]  = {0};
   global_t *global           = global_get_ptr();
   settings_t *settings       = config_get_ptr();

   if (settings->state_slot > 0)
      snprintf(path, sizeof(path), "%s%d",
            global->name.savestate, settings->state_slot);
   else if (settings->state_slot < 0)
      fill_pathname_join_delim(path,
            global->name.savestate, "auto", '.', sizeof(path));
   else
      strlcpy(path, global->name.savestate, sizeof(path));

   if (core.retro_serialize_size())
   {
      switch (cmd)
      {
         case EVENT_CMD_SAVE_STATE:
            event_save_state(path, msg, sizeof(msg));
            break;
         case EVENT_CMD_LOAD_STATE:
            event_load_state(path, msg, sizeof(msg));
            break;
      }
   }
   else
      strlcpy(msg, msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES), sizeof(msg));

   rarch_main_msg_queue_push(msg, 2, 180, true);
   RARCH_LOG("%s\n", msg);
}
开发者ID:Gruncher,项目名称:RetroArch,代码行数:34,代码来源:command_event.c

示例10: menu_push_to_history_playlist

static void menu_push_to_history_playlist(void)
{
   settings_t *settings = config_get_ptr();
   global_t *global     = global_get_ptr();

   if (!settings->history_list_enable)
      return;

   if (*global->fullpath)
   {
      char tmp[PATH_MAX_LENGTH] = {0};
      char str[PATH_MAX_LENGTH] = {0};

      fill_pathname_base(tmp, global->fullpath, sizeof(tmp));
      snprintf(str, sizeof(str), "INFO - Loading %s ...", tmp);
      rarch_main_msg_queue_push(str, 1, 1, false);
   }

   content_playlist_push(g_defaults.history,
         global->fullpath,
         NULL,
         settings->libretro,
         global->menu.info.library_name,
         NULL,
         NULL);
}
开发者ID:luiseduardohdbackup,项目名称:RetroArch,代码行数:26,代码来源:menu.c

示例11: event_main_state

static void event_main_state(unsigned cmd)
{
   char path[PATH_MAX_LENGTH] = {0};
   char msg[PATH_MAX_LENGTH]  = {0};
   global_t *global           = global_get_ptr();
   settings_t *settings       = config_get_ptr();

   if (settings->state_slot > 0)
      snprintf(path, sizeof(path), "%s%d",
            global->savestate_name, settings->state_slot);
   else if (settings->state_slot < 0)
      fill_pathname_join_delim(path, global->savestate_name, "auto", '.', sizeof(path));
   else
      strlcpy(path, global->savestate_name, sizeof(path));

   if (pretro_serialize_size())
   {
      if (cmd == EVENT_CMD_SAVE_STATE)
         event_save_state(path, msg, sizeof(msg));
      else if (cmd == EVENT_CMD_LOAD_STATE)
         event_load_state(path, msg, sizeof(msg));
   }
   else
      strlcpy(msg, "Core does not support save states.", sizeof(msg));

   rarch_main_msg_queue_push(msg, 2, 180, true);
   RARCH_LOG("%s\n", msg);
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:28,代码来源:command_event.c

示例12: action_start_video_resolution

static int action_start_video_resolution(
      unsigned type, const char *label)
{
   unsigned width = 0, height = 0;
   global_t *global = global_get_ptr();

   video_driver_set_video_mode(640, 480, true);

   if (!global)
      return -1;

   if (video_driver_get_video_output_size(&width, &height))
   {
      char msg[PATH_MAX_LENGTH] = {0};

      video_driver_set_video_mode(width, height, true);
      global->console.screen.resolutions.width = width;
      global->console.screen.resolutions.height = height;

      snprintf(msg, sizeof(msg),"Resetting to: %dx%d",width, height);
      rarch_main_msg_queue_push(msg, 1, 100, true);
   }

   return 0;
}
开发者ID:brianblakely,项目名称:RetroArch,代码行数:25,代码来源:menu_cbs_start.c

示例13: snprintf

static int database_info_iterate_start
(database_info_handle_t *db, const char *name)
{
   char msg[PATH_MAX_LENGTH] = {0};

   snprintf(msg, sizeof(msg),
#ifdef _WIN32
         "%Iu/%Iu: %s %s...\n",
#else
         "%zu/%zu: %s %s...\n",
#endif
         db->list_ptr,
         db->list->size,
         msg_hash_to_str(MSG_SCANNING),
         name);

   if (msg[0] != '\0')
      rarch_main_msg_queue_push(msg, 1, 180, true);

#if 0
   RARCH_LOG("msg: %s\n", msg);
#endif


   db->status = DATABASE_STATUS_ITERATE;

   return 0;
}
开发者ID:ioev,项目名称:RetroArch,代码行数:28,代码来源:task_database.c

示例14: netplay_post_frame_spectate

/**
 * netplay_post_frame_spectate:   
 * @netplay              : pointer to netplay object
 *
 * Post-frame for Netplay (spectate mode version).
 * We check if we have new input and replay from recorded input.
 **/
static void netplay_post_frame_spectate(netplay_t *netplay)
{
   unsigned i;

   if (netplay->spectate_client)
      return;

   for (i = 0; i < MAX_SPECTATORS; i++)
   {
      char msg[PATH_MAX_LENGTH] = {0};

      if (netplay->spectate_fds[i] == -1)
         continue;

      if (socket_send_all_blocking(netplay->spectate_fds[i],
               netplay->spectate_input,
               netplay->spectate_input_ptr * sizeof(int16_t)))
         continue;

      RARCH_LOG("Client (#%u) disconnected ...\n", i);

      snprintf(msg, sizeof(msg), "Client (#%u) disconnected.", i);
      rarch_main_msg_queue_push(msg, 1, 180, false);

      socket_close(netplay->spectate_fds[i]);
      netplay->spectate_fds[i] = -1;
      break;
   }

   netplay->spectate_input_ptr = 0;
}
开发者ID:ssangkong,项目名称:RetroArch,代码行数:38,代码来源:netplay.c

示例15: input_config_autoconfigure_joypad

bool input_config_autoconfigure_joypad(autoconfig_params_t *params)
{
   bool ret = false;

   if (!input_config_autoconfigure_joypad_init(params))
      return ret;

   if (!*params->name)
      return ret;

   if (!ret)
      ret = input_autoconfigure_joypad_from_conf_dir(params);

#if defined(HAVE_BUILTIN_AUTOCONFIG)
   if (!ret)
      ret = input_autoconfigure_joypad_from_conf_internal(params);
#endif
   if (!ret)
   {
      char msg[PATH_MAX_LENGTH];

      RARCH_LOG("Autodetect: no profiles found for %s (%d/%d)", params->name, params->vid, params->pid);
      snprintf(msg, sizeof(msg), "%s (%ld/%ld) not configured", params->name, (long)params->vid, (long)params->pid);
      rarch_main_msg_queue_push(msg, 0, 60, false);
   }
   return ret;
}
开发者ID:ioev,项目名称:RetroArch,代码行数:27,代码来源:input_autodetect.c


注:本文中的rarch_main_msg_queue_push函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。