(drivers font) Start making the code independent of video_frame_info
This commit is contained in:
parent
f588e7f646
commit
3e891c6237
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "../common/gl1_common.h"
|
#include "../common/gl1_common.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
||||||
|
@ -437,10 +438,16 @@ static void gl1_raster_font_render_msg(
|
||||||
int drop_x, drop_y;
|
int drop_x, drop_y;
|
||||||
GLfloat x, y, scale, drop_mod, drop_alpha;
|
GLfloat x, y, scale, drop_mod, drop_alpha;
|
||||||
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
||||||
bool full_screen = false ;
|
bool full_screen = false;
|
||||||
gl1_raster_t *font = (gl1_raster_t*)data;
|
gl1_raster_t *font = (gl1_raster_t*)data;
|
||||||
unsigned width = video_info->width;
|
unsigned width = font->gl->video_width;
|
||||||
unsigned height = video_info->height;
|
unsigned height = font->gl->video_height;
|
||||||
|
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))
|
if (!font || string_is_empty(msg))
|
||||||
return;
|
return;
|
||||||
|
@ -468,15 +475,15 @@ static void gl1_raster_font_render_msg(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = video_info->font_msg_pos_x;
|
x = video_msg_pos_x;
|
||||||
y = video_info->font_msg_pos_y;
|
y = video_msg_pos_y;
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
full_screen = true;
|
full_screen = true;
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
|
|
||||||
color[0] = video_info->font_msg_color_r;
|
color[0] = video_msg_color_r;
|
||||||
color[1] = video_info->font_msg_color_g;
|
color[1] = video_msg_color_g;
|
||||||
color[2] = video_info->font_msg_color_b;
|
color[2] = video_msg_color_b;
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
|
|
||||||
drop_x = -2;
|
drop_x = -2;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "../common/gl_core_common.h"
|
#include "../common/gl_core_common.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
||||||
|
@ -347,9 +348,15 @@ static void gl_core_raster_font_render_msg(
|
||||||
GLfloat x, y, scale, drop_mod, drop_alpha;
|
GLfloat x, y, scale, drop_mod, drop_alpha;
|
||||||
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
||||||
bool full_screen = false ;
|
bool full_screen = false ;
|
||||||
gl_core_raster_t *font = (gl_core_raster_t*)data;
|
gl_core_raster_t *font = (gl_core_raster_t*)data;
|
||||||
unsigned width = video_info->width;
|
unsigned width = font->gl->video_width;
|
||||||
unsigned height = video_info->height;
|
unsigned height = font->gl->video_height;
|
||||||
|
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))
|
if (!font || string_is_empty(msg))
|
||||||
return;
|
return;
|
||||||
|
@ -377,15 +384,15 @@ static void gl_core_raster_font_render_msg(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = video_info->font_msg_pos_x;
|
x = video_msg_pos_x;
|
||||||
y = video_info->font_msg_pos_y;
|
y = video_msg_pos_y;
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
full_screen = true;
|
full_screen = true;
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
|
|
||||||
color[0] = video_info->font_msg_color_r;
|
color[0] = video_msg_color_r;
|
||||||
color[1] = video_info->font_msg_color_g;
|
color[1] = video_msg_color_g;
|
||||||
color[2] = video_info->font_msg_color_b;
|
color[2] = video_msg_color_b;
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
|
|
||||||
drop_x = -2;
|
drop_x = -2;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "../common/gl_common.h"
|
#include "../common/gl_common.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
||||||
|
@ -422,8 +423,14 @@ static void gl_raster_font_render_msg(
|
||||||
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
enum text_alignment text_align = TEXT_ALIGN_LEFT;
|
||||||
bool full_screen = false ;
|
bool full_screen = false ;
|
||||||
gl_raster_t *font = (gl_raster_t*)data;
|
gl_raster_t *font = (gl_raster_t*)data;
|
||||||
unsigned width = video_info->width;
|
unsigned width = font->gl->video_width;
|
||||||
unsigned height = video_info->height;
|
unsigned height = font->gl->video_height;
|
||||||
|
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))
|
if (!font || string_is_empty(msg))
|
||||||
return;
|
return;
|
||||||
|
@ -451,15 +458,15 @@ static void gl_raster_font_render_msg(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = video_info->font_msg_pos_x;
|
x = video_msg_pos_x;
|
||||||
y = video_info->font_msg_pos_y;
|
y = video_msg_pos_y;
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
full_screen = true;
|
full_screen = true;
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
|
|
||||||
color[0] = video_info->font_msg_color_r;
|
color[0] = video_msg_color_r;
|
||||||
color[1] = video_info->font_msg_color_g;
|
color[1] = video_msg_color_g;
|
||||||
color[2] = video_info->font_msg_color_b;
|
color[2] = video_msg_color_b;
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
|
|
||||||
drop_x = -2;
|
drop_x = -2;
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
|
#include "../../configuration.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
vk_t *vk;
|
vk_t *vk;
|
||||||
|
@ -341,18 +343,26 @@ static void vulkan_raster_font_render_msg(
|
||||||
int drop_x, drop_y;
|
int drop_x, drop_y;
|
||||||
bool full_screen;
|
bool full_screen;
|
||||||
unsigned max_glyphs;
|
unsigned max_glyphs;
|
||||||
|
unsigned width, height;
|
||||||
enum text_alignment text_align;
|
enum text_alignment text_align;
|
||||||
float x, y, scale, drop_mod, drop_alpha;
|
float x, y, scale, drop_mod, drop_alpha;
|
||||||
vk_t *vk = NULL;
|
vk_t *vk = NULL;
|
||||||
vulkan_raster_t *font = (vulkan_raster_t*)data;
|
vulkan_raster_t *font = (vulkan_raster_t*)data;
|
||||||
unsigned width = video_info->width;
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned height = video_info->height;
|
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 || !msg || !*msg)
|
if (!font || !msg || !*msg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vk = font->vk;
|
vk = font->vk;
|
||||||
|
|
||||||
|
width = vk->video_width;
|
||||||
|
height = vk->video_height;
|
||||||
|
|
||||||
if (params)
|
if (params)
|
||||||
{
|
{
|
||||||
x = params->x;
|
x = params->x;
|
||||||
|
@ -376,8 +386,8 @@ static void vulkan_raster_font_render_msg(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = video_info->font_msg_pos_x;
|
x = video_msg_pos_x;
|
||||||
y = video_info->font_msg_pos_y;
|
y = video_msg_pos_y;
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
full_screen = true;
|
full_screen = true;
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
|
@ -386,9 +396,9 @@ static void vulkan_raster_font_render_msg(
|
||||||
drop_mod = 0.3f;
|
drop_mod = 0.3f;
|
||||||
drop_alpha = 1.0f;
|
drop_alpha = 1.0f;
|
||||||
|
|
||||||
color[0] = video_info->font_msg_color_r;
|
color[0] = video_msg_color_r;
|
||||||
color[1] = video_info->font_msg_color_g;
|
color[1] = video_msg_color_g;
|
||||||
color[2] = video_info->font_msg_color_b;
|
color[2] = video_msg_color_b;
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,10 @@ static void xfonts_render_msg(
|
||||||
{
|
{
|
||||||
float x, y;
|
float x, y;
|
||||||
wchar_t str[PATH_MAX_LENGTH];
|
wchar_t str[PATH_MAX_LENGTH];
|
||||||
xfonts_t *xfonts = (xfonts_t*)data;
|
xfonts_t *xfonts = (xfonts_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 (params)
|
if (params)
|
||||||
{
|
{
|
||||||
|
@ -89,8 +92,8 @@ static void xfonts_render_msg(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = video_info->font_msg_pos_x;
|
x = video_msg_pos_x;
|
||||||
y = video_info->font_msg_pos_y;
|
y = video_msg_pos_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
d3d8_device_get_backbuffer(xfonts->d3d->dev,
|
d3d8_device_get_backbuffer(xfonts->d3d->dev,
|
||||||
|
|
Loading…
Reference in New Issue