本文整理汇总了C++中rarch_fail函数的典型用法代码示例。如果您正苦于以下问题:C++ rarch_fail函数的具体用法?C++ rarch_fail怎么用?C++ rarch_fail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rarch_fail函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: init_video_input
static void init_video_input(const input_driver_t *tmp)
{
driver_t *driver = driver_get_ptr();
/* Video driver didn't provide an input driver,
* so we use configured one. */
RARCH_LOG("Graphics driver did not initialize an input driver. Attempting to pick a suitable driver.\n");
if (tmp)
driver->input = tmp;
else
find_input_driver();
if (!driver->input)
{
/* This should never really happen as tmp (driver.input) is always
* found before this in find_driver_input(), or we have aborted
* in a similar fashion anyways. */
rarch_fail(1, "init_video_input()");
}
driver->input_data = input_driver_init();
if (driver->input_data)
return;
RARCH_ERR("Cannot initialize input driver. Exiting ...\n");
rarch_fail(1, "init_video_input()");
}
开发者ID:lordixi,项目名称:RetroArch,代码行数:29,代码来源:video_driver.c
示例2: init_menu
void init_menu(void)
{
const char *video_driver;
driver_t *driver = driver_get_ptr();
if (driver->menu)
return;
find_menu_driver();
video_driver = menu_video_get_ident();
switch (driver->menu_ctx->type)
{
case MENU_VIDEO_DRIVER_GENERIC:
break;
case MENU_VIDEO_DRIVER_DIRECT3D:
if (video_driver && (strcmp(video_driver, "d3d") != 0))
init_menu_fallback();
break;
case MENU_VIDEO_DRIVER_OPENGL:
if (video_driver && (strcmp(video_driver, "gl") != 0))
init_menu_fallback();
break;
}
if (!(driver->menu = (menu_handle_t*)menu_init(driver->menu_ctx)))
rarch_fail(1, "init_menu()");
if (driver->menu_ctx->lists_init)
if (!driver->menu_ctx->lists_init(driver->menu))
rarch_fail(1, "init_menu()");
}
开发者ID:blakekohler,项目名称:RetroArch,代码行数:33,代码来源:menu_driver.c
示例3: init_libretro_sym
void init_libretro_sym(bool dummy)
{
// Guarantee that we can do "dirty" casting.
// Every OS that this program supports should pass this ...
rarch_assert(sizeof(void*) == sizeof(void (*)(void)));
if (!dummy)
{
#ifdef HAVE_DYNAMIC
// Try to verify that -lretro was not linked in from other modules
// since loading it dynamically and with -l will fail hard.
function_t sym = dylib_proc(NULL, "retro_init");
if (sym)
{
RARCH_ERR("Serious problem. RetroArch wants to load libretro dyamically, but it is already linked.\n");
RARCH_ERR("This could happen if other modules RetroArch depends on link against libretro directly.\n");
RARCH_ERR("Proceeding could cause a crash. Aborting ...\n");
rarch_fail(1, "init_libretro_sym()");
}
if (!*g_settings.libretro)
{
RARCH_ERR("RetroArch is built for dynamic libretro, but libretro_path is not set. Cannot continue.\n");
rarch_fail(1, "init_libretro_sym()");
}
#endif
}
load_symbols(dummy);
pretro_set_environment(environment_cb);
}
开发者ID:CatalystG,项目名称:RetroArch,代码行数:32,代码来源:dynamic.c
示例4: find_video_driver
static void find_video_driver(void)
{
#if defined(HAVE_OPENGL) && defined(HAVE_FBO)
if (g_extern.system.hw_render_callback.context_type)
{
RARCH_LOG("Using HW render, OpenGL driver forced.\n");
driver.video = &video_gl;
return;
}
#endif
int i = find_video_driver_index(g_settings.video.driver);
if (i >= 0)
driver.video = video_drivers[i];
else
{
unsigned d;
RARCH_ERR("Couldn't find any video driver named \"%s\"\n", g_settings.video.driver);
RARCH_LOG_OUTPUT("Available video drivers are:\n");
for (d = 0; video_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", video_drivers[d]->ident);
RARCH_WARN("Going to default to first video driver...\n");
driver.video = video_drivers[0];
if (!driver.video)
rarch_fail(1, "find_video_driver()");
}
}
开发者ID:dturner,项目名称:RetroArch,代码行数:29,代码来源:driver.c
示例5: find_audio_driver
void find_audio_driver(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
int i = find_driver_index("audio_driver", settings->audio.driver);
if (i >= 0)
driver->audio = (const audio_driver_t*)audio_driver_find_handle(i);
else
{
unsigned d;
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n",
settings->audio.driver);
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
for (d = 0; audio_driver_find_handle(d); d++)
RARCH_LOG_OUTPUT("\t%s\n", audio_driver_find_ident(d));
RARCH_WARN("Going to default to first audio driver...\n");
driver->audio = (const audio_driver_t*)audio_driver_find_handle(0);
if (!driver->audio)
rarch_fail(1, "find_audio_driver()");
}
}
开发者ID:SAKUJ0,项目名称:RetroArch,代码行数:25,代码来源:audio_driver.c
示例6: init_menu
void init_menu(void)
{
driver_t *driver = driver_get_ptr();
if (driver->menu)
return;
find_menu_driver();
if (!(driver->menu = (menu_handle_t*)menu_init(driver->menu_ctx)))
{
RARCH_ERR("Cannot initialize menu.\n");
rarch_fail(1, "init_menu()");
}
if (!(menu_entries_init(driver->menu)))
{
RARCH_ERR("Cannot initialize menu lists.\n");
rarch_fail(1, "init_menu()");
}
}
开发者ID:Miinky-Games,项目名称:RetroArch,代码行数:19,代码来源:menu_driver.c
示例7: init_menu
static void init_menu(void)
{
if (driver.menu)
return;
find_menu_driver();
if (!(driver.menu = (menu_handle_t*)menu_init(driver.menu_ctx)))
{
RARCH_ERR("Cannot initialize menu.\n");
rarch_fail(1, "init_menu()");
}
}
开发者ID:dturner,项目名称:RetroArch,代码行数:12,代码来源:driver.c
示例8: find_location_driver
static void find_location_driver(void)
{
int i = find_location_driver_index(g_settings.location.driver);
if (i >= 0)
driver.location = location_drivers[i];
else
{
unsigned d;
RARCH_ERR("Couldn't find any location driver named \"%s\"\n", g_settings.location.driver);
RARCH_LOG_OUTPUT("Available location drivers are:\n");
for (d = 0; location_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", location_drivers[d]->ident);
rarch_fail(1, "find_location_driver()");
}
}
开发者ID:isdom,项目名称:RetroArch,代码行数:16,代码来源:driver.c
示例9: find_input_driver
static void find_input_driver(void)
{
int i = find_input_driver_index(g_settings.input.driver);
if (i >= 0)
driver.input = input_drivers[i];
else
{
unsigned d;
RARCH_ERR("Couldn't find any input driver named \"%s\"\n", g_settings.input.driver);
RARCH_LOG_OUTPUT("Available input drivers are:\n");
for (d = 0; input_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", input_drivers[d]->ident);
rarch_fail(1, "find_input_driver()");
}
}
开发者ID:isdom,项目名称:RetroArch,代码行数:16,代码来源:driver.c
示例10: load_symbols
static void load_symbols(void)
{
#ifdef HAVE_DYNAMIC
RARCH_LOG("Loading dynamic libretro from: \"%s\"\n", g_settings.libretro);
lib_handle = dylib_load(g_settings.libretro);
if (!lib_handle)
{
RARCH_ERR("Failed to open dynamic library: \"%s\"\n", g_settings.libretro);
rarch_fail(1, "load_dynamic()");
}
#endif
SYM(retro_init);
SYM(retro_deinit);
SYM(retro_api_version);
SYM(retro_get_system_info);
SYM(retro_get_system_av_info);
SYM(retro_set_environment);
SYM(retro_set_video_refresh);
SYM(retro_set_audio_sample);
SYM(retro_set_audio_sample_batch);
SYM(retro_set_input_poll);
SYM(retro_set_input_state);
SYM(retro_set_controller_port_device);
SYM(retro_reset);
SYM(retro_run);
SYM(retro_serialize_size);
SYM(retro_serialize);
SYM(retro_unserialize);
SYM(retro_cheat_reset);
SYM(retro_cheat_set);
SYM(retro_load_game);
SYM(retro_load_game_special);
SYM(retro_unload_game);
SYM(retro_get_region);
SYM(retro_get_memory_data);
SYM(retro_get_memory_size);
}
开发者ID:mmodahl,项目名称:RetroArch,代码行数:46,代码来源:dynamic.c
示例11: event_init_movie
static void event_init_movie(void)
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
if (global->bsv.movie_start_playback)
{
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
RARCH_MOVIE_PLAYBACK)))
{
RARCH_ERR("%s: \"%s\".\n",
msg_hash_to_str(MSG_FAILED_TO_LOAD_MOVIE_FILE),
global->bsv.movie_start_path);
rarch_fail(1, "event_init_movie()");
}
global->bsv.movie_playback = true;
rarch_main_msg_queue_push_new(MSG_STARTING_MOVIE_PLAYBACK, 2, 180, false);
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK));
settings->rewind_granularity = 1;
}
else if (global->bsv.movie_start_recording)
{
char msg[PATH_MAX_LENGTH] = {0};
snprintf(msg, sizeof(msg),
"%s \"%s\".",
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
global->bsv.movie_start_path);
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
RARCH_MOVIE_RECORD)))
{
rarch_main_msg_queue_push_new(MSG_FAILED_TO_START_MOVIE_RECORD, 1, 180, true);
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD));
return;
}
rarch_main_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("%s \"%s\".\n",
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
global->bsv.movie_start_path);
settings->rewind_granularity = 1;
}
}
开发者ID:Gruncher,项目名称:RetroArch,代码行数:44,代码来源:command_event.c
示例12: find_video_driver
void find_video_driver(void)
{
int i;
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
#if defined(HAVE_OPENGL) && defined(HAVE_FBO)
if (video_state.hw_render_callback.context_type)
{
RARCH_LOG("Using HW render, OpenGL driver forced.\n");
driver->video = &video_gl;
return;
}
#endif
if (driver->frontend_ctx &&
driver->frontend_ctx->get_video_driver)
{
driver->video = driver->frontend_ctx->get_video_driver();
if (driver->video)
return;
RARCH_WARN("Frontend supports get_video_driver() but did not specify one.\n");
}
i = find_driver_index("video_driver", settings->video.driver);
if (i >= 0)
driver->video = (const video_driver_t*)video_driver_find_handle(i);
else
{
unsigned d;
RARCH_ERR("Couldn't find any video driver named \"%s\"\n",
settings->video.driver);
RARCH_LOG_OUTPUT("Available video drivers are:\n");
for (d = 0; video_driver_find_handle(d); d++)
RARCH_LOG_OUTPUT("\t%s\n", video_driver_find_ident(d));
RARCH_WARN("Going to default to first video driver...\n");
driver->video = (const video_driver_t*)video_driver_find_handle(0);
if (!driver->video)
rarch_fail(1, "find_video_driver()");
}
}
开发者ID:lordixi,项目名称:RetroArch,代码行数:44,代码来源:video_driver.c
示例13: find_menu_driver
void find_menu_driver(void)
{
int i = find_menu_driver_index(g_settings.menu.driver);
if (i >= 0)
driver.menu_ctx = menu_ctx_drivers[i];
else
{
unsigned d;
RARCH_WARN("Couldn't find any menu driver named \"%s\"\n", g_settings.menu.driver);
RARCH_LOG_OUTPUT("Available menu drivers are:\n");
for (d = 0; menu_ctx_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", menu_ctx_drivers[d]->ident);
RARCH_WARN("Going to default to first menu driver...\n");
driver.menu_ctx = menu_ctx_drivers[0];
if (!driver.menu_ctx)
rarch_fail(1, "find_menu_driver()");
}
}
开发者ID:dturner,项目名称:RetroArch,代码行数:20,代码来源:driver.c
示例14: find_audio_driver
static void find_audio_driver(void)
{
int i = find_audio_driver_index(g_settings.audio.driver);
if (i >= 0)
driver.audio = audio_drivers[i];
else
{
unsigned d;
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n", g_settings.audio.driver);
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
for (d = 0; audio_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", audio_drivers[d]->ident);
RARCH_WARN("Going to default to first audio driver...\n");
driver.audio = audio_drivers[0];
if (!driver.audio)
rarch_fail(1, "find_audio_driver()");
}
}
开发者ID:dturner,项目名称:RetroArch,代码行数:20,代码来源:driver.c
示例15: find_image_driver
void find_image_driver(void)
{
int i;
if (driver.image)
return;
i = find_image_driver_index(g_settings.image.driver);
if (i >= 0)
driver.image = image_ctx_drivers[i];
else
{
unsigned d;
RARCH_ERR("Couldn't find any image driver named \"%s\"\n", g_settings.image.driver);
RARCH_LOG_OUTPUT("Available image drivers are:\n");
for (d = 0; image_ctx_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", image_ctx_drivers[d]->ident);
rarch_fail(1, "find_image_driver()");
}
}
开发者ID:Rizora,项目名称:RetroArch,代码行数:20,代码来源:image_context.c
示例16: event_init_movie
static void event_init_movie(void)
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
if (global->bsv.movie_start_playback)
{
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
RARCH_MOVIE_PLAYBACK)))
{
RARCH_ERR("Failed to load movie file: \"%s\".\n",
global->bsv.movie_start_path);
rarch_fail(1, "event_init_movie()");
}
global->bsv.movie_playback = true;
rarch_main_msg_queue_push("Starting movie playback.", 2, 180, false);
RARCH_LOG("Starting movie playback.\n");
settings->rewind_granularity = 1;
}
else if (global->bsv.movie_start_recording)
{
char msg[PATH_MAX_LENGTH] = {0};
snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".",
global->bsv.movie_start_path);
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
RARCH_MOVIE_RECORD)))
{
rarch_main_msg_queue_push("Failed to start movie record.", 1, 180, true);
RARCH_ERR("Failed to start movie record.\n");
return;
}
rarch_main_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("Starting movie record to \"%s\".\n",
global->bsv.movie_start_path);
settings->rewind_granularity = 1;
}
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:40,代码来源:command_event.c
示例17: parse_config_file
static void parse_config_file(void)
{
bool ret;
if (*g_extern.config_path)
{
RARCH_LOG("Loading config from: %s.\n", g_extern.config_path);
ret = config_load_file(g_extern.config_path);
}
else
{
RARCH_LOG("Loading default config.\n");
ret = config_load_file(NULL);
}
if (!ret)
{
RARCH_ERR("Couldn't find config at path: \"%s\"\n", g_extern.config_path);
#ifndef RARCH_CONSOLE
rarch_fail(1, "parse_config_file()");
#endif
}
}
开发者ID:Jalle19,项目名称:RetroArch,代码行数:22,代码来源:settings.c
示例18: find_menu_driver
void find_menu_driver(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
int i = find_driver_index("menu_driver", settings->menu.driver);
if (i >= 0)
driver->menu_ctx = (const menu_ctx_driver_t*)menu_driver_find_handle(i);
else
{
unsigned d;
RARCH_WARN("Couldn't find any menu driver named \"%s\"\n",
settings->menu.driver);
RARCH_LOG_OUTPUT("Available menu drivers are:\n");
for (d = 0; menu_driver_find_handle(d); d++)
RARCH_LOG_OUTPUT("\t%s\n", menu_driver_find_ident(d));
RARCH_WARN("Going to default to first menu driver...\n");
driver->menu_ctx = (const menu_ctx_driver_t*)menu_driver_find_handle(0);
if (!driver->menu_ctx)
rarch_fail(1, "find_menu_driver()");
}
}
开发者ID:Miinky-Games,项目名称:RetroArch,代码行数:24,代码来源:menu_driver.c
示例19: init_video
void init_video(void)
{
unsigned max_dim, scale, width, height;
video_viewport_t *custom_vp = NULL;
const input_driver_t *tmp = NULL;
const struct retro_game_geometry *geom = NULL;
video_info_t video = {0};
static uint16_t dummy_pixels[32] = {0};
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
struct retro_system_av_info *av_info =
video_viewport_get_system_av_info();
init_video_filter(video_state.pix_fmt);
event_command(EVENT_CMD_SHADER_DIR_INIT);
if (av_info)
geom = (const struct retro_game_geometry*)&av_info->geometry;
max_dim = max(geom->max_width, geom->max_height);
scale = next_pow2(max_dim) / RARCH_SCALE_BASE;
scale = max(scale, 1);
if (video_state.filter.filter)
scale = video_state.filter.scale;
/* Update core-dependent aspect ratio values. */
video_viewport_set_square_pixel(geom->base_width, geom->base_height);
video_viewport_set_core();
video_viewport_set_config();
/* Update CUSTOM viewport. */
custom_vp = video_viewport_get_custom();
if (settings->video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
{
float default_aspect = aspectratio_lut[ASPECT_RATIO_CORE].value;
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
(custom_vp->width && custom_vp->height) ?
(float)custom_vp->width / custom_vp->height : default_aspect;
}
video_driver_set_aspect_ratio_value(
aspectratio_lut[settings->video.aspect_ratio_idx].value);
if (settings->video.fullscreen)
{
width = settings->video.fullscreen_x;
height = settings->video.fullscreen_y;
}
else
{
if (settings->video.force_aspect)
{
/* Do rounding here to simplify integer scale correctness. */
unsigned base_width =
roundf(geom->base_height * video_driver_get_aspect_ratio());
width = roundf(base_width * settings->video.scale);
}
else
width = roundf(geom->base_width * settings->video.scale);
height = roundf(geom->base_height * settings->video.scale);
}
if (width && height)
RARCH_LOG("Video @ %ux%u\n", width, height);
else
RARCH_LOG("Video @ fullscreen\n");
driver->display_type = RARCH_DISPLAY_NONE;
driver->video_display = 0;
driver->video_window = 0;
if (!init_video_pixel_converter(RARCH_SCALE_BASE * scale))
{
RARCH_ERR("Failed to initialize pixel converter.\n");
rarch_fail(1, "init_video()");
}
video.width = width;
video.height = height;
video.fullscreen = settings->video.fullscreen;
video.vsync = settings->video.vsync && !global->system.force_nonblock;
video.force_aspect = settings->video.force_aspect;
#ifdef GEKKO
video.viwidth = settings->video.viwidth;
video.vfilter = settings->video.vfilter;
#endif
video.smooth = settings->video.smooth;
video.input_scale = scale;
video.rgb32 = video_state.filter.filter ?
video_state.filter.out_rgb32 :
(video_state.pix_fmt == RETRO_PIXEL_FORMAT_XRGB8888);
tmp = (const input_driver_t*)driver->input;
/* Need to grab the "real" video driver interface on a reinit. */
find_video_driver();
#ifdef HAVE_THREADS
if (settings->video.threaded && !video_state.hw_render_callback.context_type)
//.........这里部分代码省略.........
开发者ID:lordixi,项目名称:RetroArch,代码行数:101,代码来源:video_driver.c
示例20: parse_input
//.........这里部分代码省略.........
int c = getopt_long(argc, argv, optstring, opts, NULL);
if (c == -1)
break;
switch (c)
{
case 'h':
print_help();
exit(0);
case 'Z':
strlcpy(global->subsystem, optarg, sizeof(global->subsystem));
break;
case 'd':
{
unsigned id = 0;
struct string_list *list = string_split(optarg, ":");
port = 0;
if (list && list->size == 2)
{
port = strtol(list->elems[0].data, NULL, 0);
id = strtoul(list->elems[1].data, NULL, 0);
}
string_list_free(list);
if (port < 1 || port > MAX_USERS)
{
RARCH_ERR("Connect device to a valid port.\n");
print_help();
rarch_fail(1, "parse_input()");
}
settings->input.libretro_device[port - 1] = id;
global->has_set_libretro_device[port - 1] = true;
break;
}
case 'A':
port = strtol(optarg, NULL, 0);
if (port < 1 || port > MAX_USERS)
{
RARCH_ERR("Connect dualanalog to a valid port.\n");
print_help();
rarch_fail(1, "parse_input()");
}
settings->input.libretro_device[port - 1] = RETRO_DEVICE_ANALOG;
global->has_set_libretro_device[port - 1] = true;
break;
case 's':
strlcpy(global->savefile_name, optarg,
sizeof(global->savefile_name));
global->has_set_save_path = true;
break;
case 'f':
global->force_fullscreen = true;
break;
case 'S':
strlcpy(global->savestate_name, optarg,
sizeof(global->savestate_name));
global->has_set_state_path = true;
开发者ID:PCGeekBrain,项目名称:RetroArch,代码行数:67,代码来源:retroarch.c
注:本文中的rarch_fail函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论