(Sixel) Buildfixes

This commit is contained in:
twinaphex 2020-07-09 15:07:06 +02:00
parent 4e951ee79c
commit 4c5f4b244a
2 changed files with 10 additions and 14 deletions

View File

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

View File

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