• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ rarch_main_msg_queue_push函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: input_autoconfigure_joypad_add

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

   config_get_array(conf, "input_display_name", buf, sizeof(buf));

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

   if (!settings)
      return;

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

   if (buf[0] != '\0' || strcmp(buf, ""))
      snprintf(msg, sizeof(msg), "%s configured in port #%u.",
            buf, 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);

   RARCH_LOG("%s\n", msg);
}
开发者ID:PS3emulators,项目名称:RetroArch,代码行数:34,代码来源:input_autodetect.c


示例17: input_try_autoconfigure_joypad_from_conf

static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf,
      unsigned idx, const char *name, const char *drv,
      int32_t vid, int32_t pid, bool block_osd_spam)
{
   char ident[PATH_MAX_LENGTH], ident_idx[PATH_MAX_LENGTH];
   char input_driver[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
   int input_vid = 0, input_pid = 0;
   bool cond_found_idx, cond_found_general,
        cond_found_vid = false, cond_found_pid = false;

   if (!conf)
      return false;

   *ident = *input_driver = '\0';

   config_get_array(conf, "input_device", ident, sizeof(ident));
   config_get_array(conf, "input_driver", input_driver, sizeof(input_driver));
   config_get_int(conf, "input_vendor_id", &input_vid);
   config_get_int(conf, "input_product_id", &input_pid);

   snprintf(ident_idx, sizeof(ident_idx), "%s_p%u", ident, idx);

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

   cond_found_idx     = !strcmp(ident_idx, name);
   cond_found_general = !strcmp(ident, name) && !strcmp(drv, input_driver);
   if ((vid != 0) && (input_vid != 0))
      cond_found_vid     = (vid == input_vid);
   if ((pid != 0) && (input_pid != 0))
      cond_found_pid     = (pid == input_pid);

   /* If Vendor ID and Product ID matches, we've found our
    * entry. */
   if (cond_found_vid && cond_found_pid)
      goto found;

   /* Check for name match. */
   if (cond_found_idx)
      goto found;
   else if (cond_found_general)
      goto found;

   return false;

found:
   g_settings.input.autoconfigured[idx] = true;
   input_autoconfigure_joypad_conf(conf, g_settings.input.autoconf_binds[idx]);

   snprintf(msg, sizeof(msg), "Joypad port #%u (%s) configured.",
         idx, name);

   if (!block_osd_spam)
      rarch_main_msg_queue_push(msg, 0, 60, false);
   RARCH_LOG("%s\n", msg);

   return true;
}
开发者ID:CautiousAlbino,项目名称:RetroArch,代码行数:59,代码来源:input_autodetect.c


示例18: input_config_autoconfigure_disconnect

void input_config_autoconfigure_disconnect(unsigned i, const char *ident)
{
   char msg[PATH_MAX_LENGTH] = {0};

   snprintf(msg, sizeof(msg), "Device #%u (%s) disconnected.", i, ident);
   rarch_main_msg_queue_push(msg, 0, 60, false);
   RARCH_LOG("Autodetect: %s\n", msg);
}
开发者ID:Joonie86,项目名称:RetroArch,代码行数:8,代码来源:input_autodetect.c


示例19: get_info_spectate

static bool get_info_spectate(netplay_t *netplay)
{
   size_t save_state_size, size;
   void *buf          = NULL;
   uint32_t header[4] = {0};
   char msg[512]      = {0};
   bool ret           = true;

   if (!send_nickname(netplay, netplay->fd))
   {
      RARCH_ERR("Failed to send nickname to host.\n");
      return false;
   }

   if (!get_nickname(netplay, netplay->fd))
   {
      RARCH_ERR("Failed to receive nickname from host.\n");
      return false;
   }

   snprintf(msg, sizeof(msg), "Connected to \"%s\"", netplay->other_nick);
   rarch_main_msg_queue_push(msg, 1, 180, false);
   RARCH_LOG("%s\n", msg);


   if (!socket_receive_all_blocking(netplay->fd, header, sizeof(header)))
   {
      RARCH_ERR("Cannot get header from host.\n");
      return false;
   }

   save_state_size = core.retro_serialize_size();
   if (!bsv_parse_header(header, implementation_magic_value()))
   {
      RARCH_ERR("Received invalid BSV header from host.\n");
      return false;
   }

   buf = malloc(save_state_size);
   if (!buf)
      return false;

   size = save_state_size;

   if (!socket_receive_all_blocking(netplay->fd, buf, size))
   {
      RARCH_ERR("Failed to receive save state from host.\n");
      free(buf);
      return false;
   }

   if (save_state_size)
      ret = core.retro_unserialize(buf, save_state_size);

   free(buf);
   return ret;
}
开发者ID:ssangkong,项目名称:RetroArch,代码行数:57,代码来源:netplay.c


示例20: check_shader_dir

/**
 * check_shader_dir:
 * @pressed_next         : was next shader key pressed?
 * @pressed_previous     : was previous shader key pressed?
 *
 * Checks if any one of the shader keys has been pressed for this frame:
 * a) Next shader index.
 * b) Previous shader index.
 *
 * Will also immediately apply the shader.
 **/
static void check_shader_dir(global_t *global,
      bool pressed_next, bool pressed_prev)
{
   uint32_t ext_hash;
   char msg[PATH_MAX_LENGTH];
   const char *shader          = NULL;
   const char *ext             = NULL;
   enum rarch_shader_type type = RARCH_SHADER_NONE;

   if (!global || !global->shader_dir.list)
      return;

   if (pressed_next)
   {
      global->shader_dir.ptr = (global->shader_dir.ptr + 1) %
         global->shader_dir.list->size;
   }
   else if (pressed_prev)
   {
      if (global->shader_dir.ptr == 0)
         global->shader_dir.ptr = global->shader_dir.list->size - 1;
      else
         global->shader_dir.ptr--;
   }
   else
      return;

   shader   = global->shader_dir.list->elems[global->shader_dir.ptr].data;
   ext      = path_get_extension(shader);
   ext_hash = msg_hash_calculate(ext);

   switch (ext_hash)
   {
      case SHADER_EXT_GLSL:
      case SHADER_EXT_GLSLP:
         type = RARCH_SHADER_GLSL;
         break;
      case SHADER_EXT_CG:
      case SHADER_EXT_CGP:
         type = RARCH_SHADER_CG;
         break;
      default:
         return;
   }

   snprintf(msg, sizeof(msg), "%s #%u: \"%s\".",
         msg_hash_to_str(MSG_SHADER),
         (unsigned)global->shader_dir.ptr, shader);
   rarch_main_msg_queue_push(msg, 1, 120, true);
   RARCH_LOG("%s \"%s\".\n",
         msg_hash_to_str(MSG_APPLYING_SHADER),
         shader);

   if (!video_driver_set_shader(type, shader))
      RARCH_WARN("%s\n", msg_hash_to_str(MSG_FAILED_TO_APPLY_SHADER));
}
开发者ID:Gruncher,项目名称:RetroArch,代码行数:67,代码来源:runloop.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rarch_system_info_get_ptr函数代码示例发布时间:2022-05-30
下一篇:
C++ rarch_fail函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap