(drivers_font) More untangling of video_info

This commit is contained in:
twinaphex 2020-03-07 05:48:21 +01:00
parent f3c6799b4e
commit e8ff0fddca
3 changed files with 33 additions and 21 deletions

View File

@ -32,6 +32,7 @@
#include "../common/win32_common.h"
#include "../font_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
@ -99,6 +100,12 @@ static void gdi_render_msg(
unsigned height = video_info->height;
SIZE textSize = {0};
struct string_list *msg_list = NULL;
settings_t *settings = config_get_ptr();
float video_msg_pos_x = settings->floats.video_msg_pos_x;
float video_msg_pos_y = settings->floats.video_msg_pos_y;
float video_msg_color_r = settings->floats.video_msg_color_r;
float video_msg_color_g = settings->floats.video_msg_color_g;
float video_msg_color_b = settings->floats.video_msg_color_b;
if (!font || string_is_empty(msg) || !font->gdi)
return;
@ -120,17 +127,17 @@ static void gdi_render_msg(
}
else
{
x = video_info->font_msg_pos_x;
y = video_info->font_msg_pos_y;
x = video_msg_pos_x;
y = video_msg_pos_y;
drop_x = -2;
drop_y = -2;
drop_mod = 0.3f;
drop_alpha = 1.0f;
scale = 1.0f;
align = TEXT_ALIGN_LEFT;
red = video_info->font_msg_color_r * 255.0f;
green = video_info->font_msg_color_g * 255.0f;
blue = video_info->font_msg_color_b * 255.0f;
red = video_msg_color_r * 255.0f;
green = video_msg_color_g * 255.0f;
blue = video_msg_color_b * 255.0f;
}
msg_strlen = strlen(msg);

View File

@ -24,6 +24,7 @@
#endif
#include "../font_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
#include "../common/sixel_common.h"
@ -84,9 +85,9 @@ static void sixel_render_msg(video_frame_info_t *video_info,
unsigned align;
sixel_raster_t *font = (sixel_raster_t*)data;
const struct font_params *params = (const struct font_params*)userdata;
(void)newX;
(void)newY;
settings_t *settings = config_get_ptr();
float video_msg_pos_x = settings->floats.video_msg_pos_x;
float video_msg_pos_y = settings->floats.video_msg_pos_y;
if (!font || string_is_empty(msg))
return;
@ -100,8 +101,8 @@ static void sixel_render_msg(video_frame_info_t *video_info,
}
else
{
x = video_info->font_msg_pos_x;
y = video_info->font_msg_pos_y;
x = video_msg_pos_x;
y = video_msg_pos_y;
scale = 1.0f;
align = TEXT_ALIGN_LEFT;
}

View File

@ -23,6 +23,7 @@
#endif
#include "../font_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
#include "../common/vga_common.h"
@ -84,6 +85,9 @@ static void vga_render_msg(video_frame_info_t *video_info,
unsigned newX, newY;
unsigned align;
vga_raster_t *font = (vga_raster_t*)data;
settings_t *settings = config_get_ptr();
float video_msg_pos_x = settings->floats.video_msg_pos_x;
float video_msg_pos_y = settings->floats.video_msg_pos_y;
if (!font || string_is_empty(msg))
return;
@ -97,8 +101,8 @@ static void vga_render_msg(video_frame_info_t *video_info,
}
else
{
x = video_info->font_msg_pos_x;
y = video_info->font_msg_pos_y;
x = video_msg_pos_x;
y = video_msg_pos_y;
scale = 1.0f;
align = TEXT_ALIGN_LEFT;
}