mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
(Style nit) Rename 'init' to 'initialize' in comments
(Filter) Get rid of questionable ifdef for HAVE_FILTERS_BUILTIN for filter init
This commit is contained in:
parent
35363148b2
commit
d267f27130
24
driver.c
24
driver.c
@ -298,7 +298,7 @@ static void find_video_driver(void)
|
||||
|
||||
void find_prev_video_driver(void)
|
||||
{
|
||||
// No need to enforce GL if HW render. This is done at driver init anyways.
|
||||
// No need to enforce GL if HW render. This is done at driver initialize anyways.
|
||||
int i = find_video_driver_index(g_settings.video.driver);
|
||||
if (i > 0)
|
||||
strlcpy(g_settings.video.driver, video_drivers[i - 1]->ident, sizeof(g_settings.video.driver));
|
||||
@ -308,7 +308,7 @@ void find_prev_video_driver(void)
|
||||
|
||||
void find_next_video_driver(void)
|
||||
{
|
||||
// No need to enforce GL if HW render. This is done at driver init anyways.
|
||||
// No need to enforce GL if HW render. This is done at driver initialize anyways.
|
||||
int i = find_video_driver_index(g_settings.video.driver);
|
||||
if (i >= 0 && video_drivers[i + 1])
|
||||
strlcpy(g_settings.video.driver, video_drivers[i + 1]->ident, sizeof(g_settings.video.driver));
|
||||
@ -550,13 +550,13 @@ void init_drivers(void)
|
||||
init_audio();
|
||||
|
||||
#ifdef HAVE_CAMERA
|
||||
// Only init camera driver if we're ever going to use it.
|
||||
// Only initialize camera driver if we're ever going to use it.
|
||||
if (g_extern.camera_active)
|
||||
init_camera();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCATION
|
||||
// Only init location driver if we're ever going to use it.
|
||||
// Only initialize location driver if we're ever going to use it.
|
||||
if (g_extern.location_active)
|
||||
init_location();
|
||||
#endif
|
||||
@ -683,7 +683,7 @@ void rarch_init_dsp_filter(void)
|
||||
|
||||
g_extern.audio_data.dsp = rarch_dsp_filter_new(g_settings.audio.dsp_plugin, g_settings.audio.in_rate);
|
||||
if (!g_extern.audio_data.dsp)
|
||||
RARCH_ERR("[DSP]: Failed to init DSP filter \"%s\".\n", g_settings.audio.dsp_plugin);
|
||||
RARCH_ERR("[DSP]: Failed to initialize DSP filter \"%s\".\n", g_settings.audio.dsp_plugin);
|
||||
}
|
||||
|
||||
void rarch_deinit_dsp_filter(void)
|
||||
@ -915,12 +915,10 @@ void uninit_audio(void)
|
||||
void rarch_init_filter(enum retro_pixel_format colfmt)
|
||||
{
|
||||
rarch_deinit_filter();
|
||||
#ifdef HAVE_FILTERS_BUILTIN
|
||||
if (!g_settings.video.filter_idx)
|
||||
#else
|
||||
#ifndef HAVE_FILTERS_BUILTIN
|
||||
if (!*g_settings.video.filter_path)
|
||||
#endif
|
||||
return;
|
||||
#endif
|
||||
|
||||
// Deprecated format. Gets pre-converted.
|
||||
if (colfmt == RETRO_PIXEL_FORMAT_0RGB1555)
|
||||
@ -939,9 +937,7 @@ void rarch_init_filter(enum retro_pixel_format colfmt)
|
||||
unsigned pow2_y = 0;
|
||||
unsigned maxsize = 0;
|
||||
|
||||
#ifdef HAVE_FILTERS_BUILTIN
|
||||
RARCH_LOG("Loading softfilter %d\n", g_settings.video.filter_idx);
|
||||
#else
|
||||
#ifndef HAVE_FILTERS_BUILTIN
|
||||
RARCH_LOG("Loading softfilter from \"%s\"\n", g_settings.video.filter_path);
|
||||
#endif
|
||||
g_extern.filter.filter = rarch_softfilter_new(g_settings.video.filter_path,
|
||||
@ -1083,7 +1079,7 @@ void init_video_input(void)
|
||||
|
||||
if (!init_video_pixel_converter(RARCH_SCALE_BASE * scale))
|
||||
{
|
||||
RARCH_ERR("Failed to init pixel converter.\n");
|
||||
RARCH_ERR("Failed to initialize pixel converter.\n");
|
||||
rarch_fail(1, "init_video_input()");
|
||||
}
|
||||
|
||||
@ -1155,7 +1151,7 @@ void init_video_input(void)
|
||||
driver.input_data = input_init_func();
|
||||
if (driver.input_data == NULL)
|
||||
{
|
||||
RARCH_ERR("Cannot init input driver. Exiting ...\n");
|
||||
RARCH_ERR("Cannot initialize input driver. Exiting ...\n");
|
||||
rarch_fail(1, "init_video_input()");
|
||||
}
|
||||
}
|
||||
|
4
driver.h
4
driver.h
@ -294,7 +294,7 @@ typedef struct input_osk_driver
|
||||
|
||||
typedef struct camera_driver
|
||||
{
|
||||
// FIXME: params for init - queries for resolution, framerate, color format
|
||||
// FIXME: params for initialization - queries for resolution, framerate, color format
|
||||
// which might or might not be honored
|
||||
void *(*init)(const char *device, uint64_t buffer_types, unsigned width, unsigned height);
|
||||
void (*free)(void *data);
|
||||
@ -366,7 +366,7 @@ typedef struct video_driver
|
||||
{
|
||||
void *(*init)(const video_info_t *video, const input_driver_t **input, void **input_data);
|
||||
// Should the video driver act as an input driver as well? :)
|
||||
// The video init might preinitialize an input driver to override the settings in case the video driver relies on input driver for event handling, e.g.
|
||||
// The video initialization might preinitialize an input driver to override the settings in case the video driver relies on input driver for event handling, e.g.
|
||||
bool (*frame)(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg); // msg is for showing a message on the screen along with the video frame.
|
||||
void (*set_nonblock_state)(void *data, bool toggle); // Should we care about syncing to vblank? Fast forwarding.
|
||||
// Is the window still active?
|
||||
|
@ -682,7 +682,7 @@ static int menu_settings_iterate(void *data, unsigned action)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_toggle)
|
||||
if (rgui && driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_toggle)
|
||||
ret = driver.menu_ctx->backend->setting_toggle(rgui, type, action, menu_type);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -704,7 +704,7 @@ static int menu_settings_iterate(void *data, unsigned action)
|
||||
|
||||
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
|
||||
|
||||
if (rgui->need_refresh && !(menu_type == RGUI_FILE_DIRECTORY ||
|
||||
if (rgui && rgui->need_refresh && !(menu_type == RGUI_FILE_DIRECTORY ||
|
||||
menu_common_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS ||
|
||||
menu_common_type_is(menu_type) == RGUI_FILE_DIRECTORY ||
|
||||
menu_type == RGUI_SETTINGS_VIDEO_SOFTFILTER ||
|
||||
@ -740,14 +740,17 @@ static int menu_settings_iterate(void *data, unsigned action)
|
||||
menu_common_entries_init(rgui, RGUI_SETTINGS);
|
||||
}
|
||||
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
|
||||
driver.menu_ctx->render(rgui);
|
||||
|
||||
// Have to defer it so we let settings refresh.
|
||||
if (rgui->push_start_screen)
|
||||
if (rgui)
|
||||
{
|
||||
rgui->push_start_screen = false;
|
||||
file_list_push(rgui->menu_stack, "", RGUI_START_SCREEN, 0);
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
|
||||
driver.menu_ctx->render(rgui);
|
||||
|
||||
// Have to defer it so we let settings refresh.
|
||||
if (rgui->push_start_screen)
|
||||
{
|
||||
rgui->push_start_screen = false;
|
||||
file_list_push(rgui->menu_stack, "", RGUI_START_SCREEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -2679,9 +2682,8 @@ static int menu_common_setting_set(void *data, unsigned setting, unsigned action
|
||||
break;
|
||||
#endif
|
||||
case RGUI_ACTION_OK:
|
||||
#if defined(HAVE_FILTERS_BUILTIN)
|
||||
rarch_set_fullscreen(g_settings.video.fullscreen);
|
||||
#elif defined(HAVE_DYLIB)
|
||||
#if defined(HAVE_DYLIB)
|
||||
file_list_push(rgui->menu_stack, g_settings.video.filter_dir, setting, rgui->selection_ptr);
|
||||
menu_clear_navigation(rgui);
|
||||
#endif
|
||||
|
@ -584,7 +584,7 @@ enum retro_mod
|
||||
// This should *only* be used if the core is completely altering the internal resolutions, aspect ratios, timings, sampling rate, etc.
|
||||
// Calling this can require a full reinitialization of video/audio drivers in the frontend,
|
||||
// so it is important to call it very sparingly, and usually only with the users explicit consent.
|
||||
// An eventual driver reinit will happen so that video and audio callbacks
|
||||
// An eventual driver reinitialize will happen so that video and audio callbacks
|
||||
// happening after this call within the same retro_run() call will target the newly initialized driver.
|
||||
//
|
||||
// This callback makes it possible to support configurable resolutions in games, which can be useful to
|
||||
@ -982,7 +982,7 @@ struct retro_frame_time_callback
|
||||
// it should implement context_destroy callback.
|
||||
// If called, all GPU resources must be reinitialized.
|
||||
// Usually called when frontend reinits video driver.
|
||||
// Also called first time video driver is initialized, allowing libretro core to init resources.
|
||||
// Also called first time video driver is initialized, allowing libretro core to initialize resources.
|
||||
typedef void (*retro_hw_context_reset_t)(void);
|
||||
// Gets current framebuffer which is to be rendered to. Could change every frame potentially.
|
||||
typedef uintptr_t (*retro_hw_get_current_framebuffer_t)(void);
|
||||
|
@ -375,7 +375,7 @@ static bool init_udp_socket(netplay_t *handle, const char *server, uint16_t port
|
||||
handle->udp_fd = socket(handle->addr->ai_family, handle->addr->ai_socktype, handle->addr->ai_protocol);
|
||||
if (handle->udp_fd < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to init socket...\n");
|
||||
RARCH_ERR("Failed to initialize socket.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ void rarch_init_rewind(void)
|
||||
g_extern.state_manager = state_manager_new(g_extern.state_size, g_settings.rewind_buffer_size);
|
||||
|
||||
if (!g_extern.state_manager)
|
||||
RARCH_WARN("Failed to init rewind buffer. Rewinding will be disabled.\n");
|
||||
RARCH_WARN("Failed to initialize rewind buffer. Rewinding will be disabled.\n");
|
||||
|
||||
void *state;
|
||||
state_manager_push_where(g_extern.state_manager, &state);
|
||||
@ -1584,12 +1584,12 @@ static void init_netplay(void)
|
||||
if (!g_extern.netplay)
|
||||
{
|
||||
g_extern.netplay_is_client = false;
|
||||
RARCH_WARN("Failed to init netplay ...\n");
|
||||
RARCH_WARN("Failed to initialize netplay ...\n");
|
||||
|
||||
if (g_extern.msg_queue)
|
||||
{
|
||||
msg_queue_push(g_extern.msg_queue,
|
||||
"Failed to init netplay ...",
|
||||
"Failed to initialize netplay ...",
|
||||
0, 180);
|
||||
}
|
||||
}
|
||||
@ -1981,7 +1981,7 @@ void rarch_set_fullscreen(bool fullscreen)
|
||||
|
||||
bool rarch_check_fullscreen(void)
|
||||
{
|
||||
// If we go fullscreen we drop all drivers and reinit to be safe.
|
||||
// If we go fullscreen we drop all drivers and reinitialize to be safe.
|
||||
static bool was_pressed = false;
|
||||
bool pressed = input_key_pressed_func(RARCH_FULLSCREEN_TOGGLE_KEY);
|
||||
bool toggle = pressed && !was_pressed;
|
||||
|
Loading…
Reference in New Issue
Block a user