(gfx) Cleanups/style nit

This commit is contained in:
twinaphex 2017-01-12 10:52:04 +01:00
parent 1d59bc3452
commit 24dc890b78
2 changed files with 18 additions and 18 deletions

View File

@ -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;

View File

@ -22,6 +22,7 @@
#include <file/config_file.h>
#include <features/features_cpu.h>
#include <file/file_path.h>
#include <string/stdstring.h>
#include <retro_assert.h>
#include <gfx/scaler/pixconv.h>
@ -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)