From 24dc890b7891498106f2c60a3adbf453bf0af81f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 12 Jan 2017 10:52:04 +0100 Subject: [PATCH] (gfx) Cleanups/style nit --- gfx/video_context_driver.c | 5 ++--- gfx/video_driver.c | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index 60311d2feb..d62949419c 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -181,11 +181,10 @@ static const gfx_ctx_driver_t *video_context_driver_init( enum gfx_ctx_api api, unsigned major, unsigned minor, bool hw_render_ctx) { - settings_t *settings = config_get_ptr(); - if (ctx->bind_api(data, api, major, minor)) { - void *ctx_data = ctx->init(data); + settings_t *settings = config_get_ptr(); + void *ctx_data = ctx->init(data); if (!ctx_data) return NULL; diff --git a/gfx/video_driver.c b/gfx/video_driver.c index c12e40c1d5..10133906bb 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -384,17 +385,12 @@ static void deinit_video_filter(void) static void init_video_filter(enum retro_pixel_format colfmt) { unsigned width, height, pow2_x, pow2_y, maxsize; - void *buf = NULL; - struct retro_game_geometry *geom = NULL; - settings_t *settings = config_get_ptr(); + void *buf = NULL; + struct retro_game_geometry *geom = NULL; + settings_t *settings = config_get_ptr(); struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); - deinit_video_filter(); - - if (!*settings->path.softfilter_plugin) - return; - /* Deprecated format. Gets pre-converted. */ if (colfmt == RETRO_PIXEL_FORMAT_0RGB1555) colfmt = RETRO_PIXEL_FORMAT_RGB565; @@ -411,8 +407,8 @@ static void init_video_filter(enum retro_pixel_format colfmt) if (!geom) return; - width = geom->max_width; - height = geom->max_height; + width = geom->max_width; + height = geom->max_height; video_driver_state_filter = rarch_softfilter_new( settings->path.softfilter_plugin, @@ -432,11 +428,12 @@ static void init_video_filter(enum retro_pixel_format colfmt) maxsize = MAX(pow2_x, pow2_y); video_driver_state_scale = maxsize / RARCH_SCALE_BASE; video_driver_state_out_rgb32 = rarch_softfilter_get_output_format( - video_driver_state_filter) == RETRO_PIXEL_FORMAT_XRGB8888; + video_driver_state_filter) == + RETRO_PIXEL_FORMAT_XRGB8888; - video_driver_state_out_bpp = - video_driver_state_out_rgb32 ? - sizeof(uint32_t) : sizeof(uint16_t); + video_driver_state_out_bpp = video_driver_state_out_rgb32 ? + sizeof(uint32_t) : + sizeof(uint16_t); /* TODO: Aligned output. */ #ifdef _3DS @@ -639,7 +636,11 @@ static bool init_video(void) runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system); - init_video_filter(video_driver_pix_fmt); + deinit_video_filter(); + + if (!string_is_empty(settings->path.softfilter_plugin)) + init_video_filter(video_driver_pix_fmt); + command_event(CMD_EVENT_SHADER_DIR_INIT, NULL); if (av_info)