本文整理汇总了C++中rarch_fail函数的典型用法代码示例。如果您正苦于以下问题:C++ rarch_fail函数的具体用法?C++ rarch_fail怎么用?C++ rarch_fail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rarch_fail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()");
}
示例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()");
}
示例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);
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}
示例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);
}
示例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;
}
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}
示例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()");
}
}