From 4c5f4b244a214438bba7bc476ee8517b9c4ff591 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 9 Jul 2020 15:07:06 +0200 Subject: [PATCH] (Sixel) Buildfixes --- gfx/drivers/sixel_gfx.c | 14 +++++--------- gfx/drivers_font/sixel_font.c | 10 +++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gfx/drivers/sixel_gfx.c b/gfx/drivers/sixel_gfx.c index df115658c1..7e9f27f160 100644 --- a/gfx/drivers/sixel_gfx.c +++ b/gfx/drivers/sixel_gfx.c @@ -190,10 +190,13 @@ static void *sixel_gfx_init(const video_info_t *video, input_driver_t **input, void **input_data) { void *ctx_data = NULL; + const char *scale_str = NULL; settings_t *settings = config_get_ptr(); bool video_font_enable = settings->bools.video_font_enable; sixel_t *sixel = (sixel_t*)calloc(1, sizeof(*sixel)); - const char *scale_str = NULL; + + if (!sixel) + return NULL; *input = NULL; *input_data = NULL; @@ -218,7 +221,7 @@ static void *sixel_gfx_init(const video_info_t *video, } #ifdef HAVE_UDEV - *input_data = input_udev.init(joypad_name); + *input_data = input_udev.init(settings->arrays.input_driver); if (*input_data) *input = &input_udev; @@ -236,14 +239,7 @@ static void *sixel_gfx_init(const video_info_t *video, video->is_threaded, FONT_DRIVER_RENDER_SIXEL); - RARCH_LOG("[SIXEL]: Init complete.\n"); - return sixel; - -error: - if (sixel) - free(sixel); - return NULL; } static bool sixel_gfx_frame(void *data, const void *frame, diff --git a/gfx/drivers_font/sixel_font.c b/gfx/drivers_font/sixel_font.c index 884be5f2bd..8dbdc77926 100644 --- a/gfx/drivers_font/sixel_font.c +++ b/gfx/drivers_font/sixel_font.c @@ -83,7 +83,7 @@ static void sixel_render_msg( { float x, y, scale; unsigned width, height; - unsigned newX, newY; + unsigned new_x, new_y; unsigned align; sixel_raster_t *font = (sixel_raster_t*)data; const struct font_params *params = (const struct font_params*)_params; @@ -114,19 +114,19 @@ static void sixel_render_msg( width = font->sixel->screen_width; height = font->sixel->screen_height; - newY = height - (y * height * scale); + new_y = height - (y * height * scale); switch (align) { case TEXT_ALIGN_RIGHT: - newX = (x * width * scale) - strlen(msg); + new_x = (x * width * scale) - strlen(msg); break; case TEXT_ALIGN_CENTER: - newX = (x * width * scale) - (strlen(msg) / 2); + new_x = (x * width * scale) - (strlen(msg) / 2); break; case TEXT_ALIGN_LEFT: default: - newX = x * width * scale; + new_x = x * width * scale; break; }