mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(gfx/drivers_font) Style nits
This commit is contained in:
parent
b2ad5274b3
commit
52ad8fb125
@ -77,11 +77,10 @@ static const struct font_glyph *caca_font_get_glyph(
|
|||||||
static void caca_render_msg(void *data, const char *msg,
|
static void caca_render_msg(void *data, const char *msg,
|
||||||
const void *userdata)
|
const void *userdata)
|
||||||
{
|
{
|
||||||
caca_raster_t *font = (caca_raster_t*)data;
|
|
||||||
float x, y;
|
float x, y;
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
unsigned newX, newY;
|
unsigned newX, newY;
|
||||||
settings_t *settings = config_get_ptr();
|
caca_raster_t *font = (caca_raster_t*)data;
|
||||||
const struct font_params *params = (const struct font_params*)userdata;
|
const struct font_params *params = (const struct font_params*)userdata;
|
||||||
|
|
||||||
if (!font || string_is_empty(msg))
|
if (!font || string_is_empty(msg))
|
||||||
@ -94,6 +93,8 @@ static void caca_render_msg(void *data, const char *msg,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
x = settings->video.msg_pos_x;
|
x = settings->video.msg_pos_x;
|
||||||
y = settings->video.msg_pos_y;
|
y = settings->video.msg_pos_y;
|
||||||
}
|
}
|
||||||
@ -102,11 +103,11 @@ static void caca_render_msg(void *data, const char *msg,
|
|||||||
!*font->caca->caca_cv || !*font->caca->caca_display)
|
!*font->caca->caca_cv || !*font->caca->caca_display)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
width = caca_get_canvas_width(*font->caca->caca_cv);
|
width = caca_get_canvas_width(*font->caca->caca_cv);
|
||||||
height = caca_get_canvas_height(*font->caca->caca_cv);
|
height = caca_get_canvas_height(*font->caca->caca_cv);
|
||||||
|
|
||||||
newX = x * width;
|
newX = x * width;
|
||||||
newY = height - (y * height);
|
newY = height - (y * height);
|
||||||
|
|
||||||
if (strlen(msg) + newX > width)
|
if (strlen(msg) + newX > width)
|
||||||
newX -= strlen(msg) + newX - width;
|
newX -= strlen(msg) + newX - width;
|
||||||
|
@ -341,13 +341,12 @@ static void ctr_font_render_msg(void* data, const char* msg,
|
|||||||
const void* userdata)
|
const void* userdata)
|
||||||
{
|
{
|
||||||
float x, y, scale, drop_mod, drop_alpha;
|
float x, y, scale, drop_mod, drop_alpha;
|
||||||
unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark;
|
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
int drop_x, drop_y;
|
int drop_x, drop_y;
|
||||||
unsigned max_glyphs;
|
unsigned max_glyphs;
|
||||||
enum text_alignment text_align;
|
enum text_alignment text_align;
|
||||||
settings_t* settings = config_get_ptr();
|
unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark;
|
||||||
ctr_font_t* font = (ctr_font_t*)data;
|
ctr_font_t * font = (ctr_font_t*)data;
|
||||||
const struct font_params* params = (const struct font_params*)userdata;
|
const struct font_params* params = (const struct font_params*)userdata;
|
||||||
|
|
||||||
if (!font || !msg || !*msg)
|
if (!font || !msg || !*msg)
|
||||||
@ -357,53 +356,53 @@ static void ctr_font_render_msg(void* data, const char* msg,
|
|||||||
|
|
||||||
if (params)
|
if (params)
|
||||||
{
|
{
|
||||||
// printf("%s\n", msg);
|
x = params->x;
|
||||||
x = params->x;
|
y = params->y;
|
||||||
y = params->y;
|
scale = params->scale;
|
||||||
scale = params->scale;
|
text_align = params->text_align;
|
||||||
text_align = params->text_align;
|
drop_x = params->drop_x;
|
||||||
drop_x = params->drop_x;
|
drop_y = params->drop_y;
|
||||||
drop_y = params->drop_y;
|
drop_mod = params->drop_mod;
|
||||||
drop_mod = params->drop_mod;
|
drop_alpha = params->drop_alpha;
|
||||||
drop_alpha = params->drop_alpha;
|
|
||||||
r = FONT_COLOR_GET_RED(params->color);
|
r = FONT_COLOR_GET_RED(params->color);
|
||||||
g = FONT_COLOR_GET_GREEN(params->color);
|
g = FONT_COLOR_GET_GREEN(params->color);
|
||||||
b = FONT_COLOR_GET_BLUE(params->color);
|
b = FONT_COLOR_GET_BLUE(params->color);
|
||||||
alpha = FONT_COLOR_GET_ALPHA(params->color);
|
alpha = FONT_COLOR_GET_ALPHA(params->color);
|
||||||
color = params->color;
|
color = params->color;
|
||||||
// color = COLOR_ABGR(r, g, b, alpha);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = settings->video.msg_pos_x;
|
settings_t* settings = config_get_ptr();
|
||||||
y = settings->video.msg_pos_y;
|
|
||||||
scale = 1.0f;
|
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
|
||||||
|
|
||||||
r = (settings->video.msg_color_r * 255);
|
x = settings->video.msg_pos_x;
|
||||||
g = (settings->video.msg_color_g * 255);
|
y = settings->video.msg_pos_y;
|
||||||
b = (settings->video.msg_color_b * 255);
|
scale = 1.0f;
|
||||||
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
|
|
||||||
|
r = (settings->video.msg_color_r * 255);
|
||||||
|
g = (settings->video.msg_color_g * 255);
|
||||||
|
b = (settings->video.msg_color_b * 255);
|
||||||
alpha = 255;
|
alpha = 255;
|
||||||
color = COLOR_ABGR(r, g, b, alpha);
|
color = COLOR_ABGR(r, g, b, alpha);
|
||||||
|
|
||||||
drop_x = -2;
|
drop_x = -2;
|
||||||
drop_y = -2;
|
drop_y = -2;
|
||||||
drop_mod = 0.3f;
|
drop_mod = 0.3f;
|
||||||
drop_alpha = 1.0f;
|
drop_alpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_glyphs = strlen(msg);
|
max_glyphs = strlen(msg);
|
||||||
|
|
||||||
if (drop_x || drop_y)
|
if (drop_x || drop_y)
|
||||||
max_glyphs *= 2;
|
max_glyphs *= 2;
|
||||||
|
|
||||||
if (drop_x || drop_y)
|
if (drop_x || drop_y)
|
||||||
{
|
{
|
||||||
r_dark = r * drop_mod;
|
r_dark = r * drop_mod;
|
||||||
g_dark = g * drop_mod;
|
g_dark = g * drop_mod;
|
||||||
b_dark = b * drop_mod;
|
b_dark = b * drop_mod;
|
||||||
alpha_dark = alpha * drop_alpha;
|
alpha_dark = alpha * drop_alpha;
|
||||||
color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark);
|
color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark);
|
||||||
|
|
||||||
ctr_font_render_message(font, msg, scale, color_dark,
|
ctr_font_render_message(font, msg, scale, color_dark,
|
||||||
x + scale * drop_x / width, y +
|
x + scale * drop_x / width, y +
|
||||||
|
@ -68,7 +68,6 @@ static void libdbg_font_render_msg(void *data, const char *msg,
|
|||||||
{
|
{
|
||||||
float x, y, scale;
|
float x, y, scale;
|
||||||
unsigned color;
|
unsigned color;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const struct font_params *params = (const struct font_params*)userdata;
|
const struct font_params *params = (const struct font_params*)userdata;
|
||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
@ -82,10 +81,11 @@ static void libdbg_font_render_msg(void *data, const char *msg,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = settings->video.msg_pos_x;
|
settings_t *settings = config_get_ptr();
|
||||||
y = 0.90f;
|
x = settings->video.msg_pos_x;
|
||||||
scale = 1.04f;
|
y = 0.90f;
|
||||||
color = SILVER;
|
scale = 1.04f;
|
||||||
|
color = SILVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgFontPrint(x, y, scale, color, msg);
|
DbgFontPrint(x, y, scale, color, msg);
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
|
|
||||||
|
#include "../../configuration.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
vita_video_t *vita;
|
vita_video_t *vita;
|
||||||
@ -27,17 +29,15 @@ typedef struct
|
|||||||
const font_renderer_driver_t *font_driver;
|
const font_renderer_driver_t *font_driver;
|
||||||
void *font_data;
|
void *font_data;
|
||||||
struct font_atlas *atlas;
|
struct font_atlas *atlas;
|
||||||
|
|
||||||
} vita_font_t;
|
} vita_font_t;
|
||||||
|
|
||||||
|
|
||||||
static void *vita2d_font_init_font(void *data, const char *font_path, float font_size)
|
static void *vita2d_font_init_font(void *data, const char *font_path, float font_size)
|
||||||
{
|
{
|
||||||
unsigned int stride, pitch, j, k;
|
unsigned int stride, pitch, j, k;
|
||||||
const uint8_t *frame32 = NULL;
|
const uint8_t *frame32 = NULL;
|
||||||
uint8_t *tex32 = NULL;
|
uint8_t *tex32 = NULL;
|
||||||
const struct font_atlas *atlas = NULL;
|
const struct font_atlas *atlas = NULL;
|
||||||
vita_font_t *font = (vita_font_t*)calloc(1, sizeof(*font));
|
vita_font_t *font = (vita_font_t*)calloc(1, sizeof(*font));
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -48,8 +48,8 @@ static void *vita2d_font_init_font(void *data, const char *font_path, float font
|
|||||||
&font->font_data, font_path, font_size))
|
&font->font_data, font_path, font_size))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
font->atlas = font->font_driver->get_atlas(font->font_data);
|
font->atlas = font->font_driver->get_atlas(font->font_data);
|
||||||
atlas = font->atlas;
|
atlas = font->atlas;
|
||||||
|
|
||||||
if (!atlas)
|
if (!atlas)
|
||||||
goto error;
|
goto error;
|
||||||
@ -114,6 +114,7 @@ static int vita2d_font_get_message_width(void *data, const char *msg,
|
|||||||
|
|
||||||
for (i = 0; i < msg_len; i++)
|
for (i = 0; i < msg_len; i++)
|
||||||
{
|
{
|
||||||
|
const struct font_glyph *glyph = NULL;
|
||||||
const char *msg_tmp = &msg[i];
|
const char *msg_tmp = &msg[i];
|
||||||
unsigned code = utf8_walk(&msg_tmp);
|
unsigned code = utf8_walk(&msg_tmp);
|
||||||
unsigned skip = msg_tmp - &msg[i];
|
unsigned skip = msg_tmp - &msg[i];
|
||||||
@ -121,8 +122,8 @@ static int vita2d_font_get_message_width(void *data, const char *msg,
|
|||||||
if (skip > 1)
|
if (skip > 1)
|
||||||
i += skip - 1;
|
i += skip - 1;
|
||||||
|
|
||||||
const struct font_glyph *glyph =
|
glyph = font->font_driver->get_glyph(font->font_data, code);
|
||||||
font->font_driver->get_glyph(font->font_data, code);
|
|
||||||
if (!glyph) /* Do something smarter here ... */
|
if (!glyph) /* Do something smarter here ... */
|
||||||
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
||||||
|
|
||||||
@ -165,6 +166,7 @@ static void vita2d_font_render_line(
|
|||||||
{
|
{
|
||||||
int off_x, off_y, tex_x, tex_y, width, height;
|
int off_x, off_y, tex_x, tex_y, width, height;
|
||||||
unsigned int stride, pitch, j, k;
|
unsigned int stride, pitch, j, k;
|
||||||
|
const struct font_glyph *glyph = NULL;
|
||||||
const uint8_t *frame32 = NULL;
|
const uint8_t *frame32 = NULL;
|
||||||
uint8_t *tex32 = NULL;
|
uint8_t *tex32 = NULL;
|
||||||
const char *msg_tmp = &msg[i];
|
const char *msg_tmp = &msg[i];
|
||||||
@ -174,11 +176,11 @@ static void vita2d_font_render_line(
|
|||||||
if (skip > 1)
|
if (skip > 1)
|
||||||
i += skip - 1;
|
i += skip - 1;
|
||||||
|
|
||||||
const struct font_glyph *glyph =
|
glyph = font->font_driver->get_glyph(font->font_data, code);
|
||||||
font->font_driver->get_glyph(font->font_data, code);
|
|
||||||
|
|
||||||
if (!glyph) /* Do something smarter here ... */
|
if (!glyph) /* Do something smarter here ... */
|
||||||
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
||||||
|
|
||||||
if (!glyph)
|
if (!glyph)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -221,8 +223,8 @@ static void vita2d_font_render_message(
|
|||||||
const unsigned int color, float pos_x, float pos_y,
|
const unsigned int color, float pos_x, float pos_y,
|
||||||
unsigned text_align)
|
unsigned text_align)
|
||||||
{
|
{
|
||||||
int lines = 0;
|
|
||||||
float line_height;
|
float line_height;
|
||||||
|
int lines = 0;
|
||||||
|
|
||||||
if (!msg || !*msg)
|
if (!msg || !*msg)
|
||||||
return;
|
return;
|
||||||
@ -241,25 +243,18 @@ static void vita2d_font_render_message(
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
const char *delim = strchr(msg, '\n');
|
const char *delim = strchr(msg, '\n');
|
||||||
|
unsigned msg_len = (delim) ? (delim - msg) : strlen(msg);
|
||||||
|
|
||||||
|
vita2d_font_render_line(font, msg, msg_len,
|
||||||
|
scale, color, pos_x, pos_y - (float)lines * line_height,
|
||||||
|
text_align);
|
||||||
|
|
||||||
/* Draw the line */
|
/* Draw the line */
|
||||||
if (delim)
|
if (!delim)
|
||||||
{
|
|
||||||
unsigned msg_len = delim - msg;
|
|
||||||
vita2d_font_render_line(font, msg, msg_len,
|
|
||||||
scale, color, pos_x, pos_y - (float)lines * line_height,
|
|
||||||
text_align);
|
|
||||||
msg += msg_len + 1;
|
|
||||||
lines++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned msg_len = strlen(msg);
|
|
||||||
vita2d_font_render_line(font, msg, msg_len,
|
|
||||||
scale, color, pos_x, pos_y - (float)lines * line_height,
|
|
||||||
text_align);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
msg += msg_len + 1;
|
||||||
|
lines++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,13 +262,12 @@ static void vita2d_font_render_msg(void *data, const char *msg,
|
|||||||
const void *userdata)
|
const void *userdata)
|
||||||
{
|
{
|
||||||
float x, y, scale, drop_mod, drop_alpha;
|
float x, y, scale, drop_mod, drop_alpha;
|
||||||
unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark;
|
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
int drop_x, drop_y;
|
int drop_x, drop_y;
|
||||||
unsigned max_glyphs;
|
unsigned max_glyphs;
|
||||||
enum text_alignment text_align;
|
enum text_alignment text_align;
|
||||||
settings_t *settings = config_get_ptr();
|
unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark;
|
||||||
vita_font_t *font = (vita_font_t *)data;
|
vita_font_t *font = (vita_font_t *)data;
|
||||||
const struct font_params *params = (const struct font_params*)userdata;
|
const struct font_params *params = (const struct font_params*)userdata;
|
||||||
|
|
||||||
if (!font || !msg || !*msg)
|
if (!font || !msg || !*msg)
|
||||||
@ -283,14 +277,14 @@ static void vita2d_font_render_msg(void *data, const char *msg,
|
|||||||
|
|
||||||
if (params)
|
if (params)
|
||||||
{
|
{
|
||||||
x = params->x;
|
x = params->x;
|
||||||
y = params->y;
|
y = params->y;
|
||||||
scale = params->scale;
|
scale = params->scale;
|
||||||
text_align = params->text_align;
|
text_align = params->text_align;
|
||||||
drop_x = params->drop_x;
|
drop_x = params->drop_x;
|
||||||
drop_y = params->drop_y;
|
drop_y = params->drop_y;
|
||||||
drop_mod = params->drop_mod;
|
drop_mod = params->drop_mod;
|
||||||
drop_alpha = params->drop_alpha;
|
drop_alpha = params->drop_alpha;
|
||||||
r = FONT_COLOR_GET_RED(params->color);
|
r = FONT_COLOR_GET_RED(params->color);
|
||||||
g = FONT_COLOR_GET_GREEN(params->color);
|
g = FONT_COLOR_GET_GREEN(params->color);
|
||||||
b = FONT_COLOR_GET_BLUE(params->color);
|
b = FONT_COLOR_GET_BLUE(params->color);
|
||||||
@ -299,34 +293,37 @@ static void vita2d_font_render_msg(void *data, const char *msg,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = settings->video.msg_pos_x;
|
settings_t *settings = config_get_ptr();
|
||||||
y = settings->video.msg_pos_y;
|
|
||||||
scale = 1.0f;
|
|
||||||
text_align = TEXT_ALIGN_LEFT;
|
|
||||||
|
|
||||||
r = (settings->video.msg_color_r * 255);
|
x = settings->video.msg_pos_x;
|
||||||
g = (settings->video.msg_color_g * 255);
|
y = settings->video.msg_pos_y;
|
||||||
b = (settings->video.msg_color_b * 255);
|
scale = 1.0f;
|
||||||
alpha = 255;
|
text_align = TEXT_ALIGN_LEFT;
|
||||||
color = RGBA8(r,g,b,alpha);
|
|
||||||
|
|
||||||
drop_x = -2;
|
r = (settings->video.msg_color_r * 255);
|
||||||
drop_y = -2;
|
g = (settings->video.msg_color_g * 255);
|
||||||
drop_mod = 0.3f;
|
b = (settings->video.msg_color_b * 255);
|
||||||
drop_alpha = 1.0f;
|
alpha = 255;
|
||||||
|
color = RGBA8(r,g,b,alpha);
|
||||||
|
|
||||||
|
drop_x = -2;
|
||||||
|
drop_y = -2;
|
||||||
|
drop_mod = 0.3f;
|
||||||
|
drop_alpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_glyphs = strlen(msg);
|
max_glyphs = strlen(msg);
|
||||||
|
|
||||||
if (drop_x || drop_y)
|
if (drop_x || drop_y)
|
||||||
max_glyphs *= 2;
|
max_glyphs *= 2;
|
||||||
|
|
||||||
if (drop_x || drop_y)
|
if (drop_x || drop_y)
|
||||||
{
|
{
|
||||||
r_dark = r * drop_mod;
|
r_dark = r * drop_mod;
|
||||||
g_dark = g * drop_mod;
|
g_dark = g * drop_mod;
|
||||||
b_dark = b * drop_mod;
|
b_dark = b * drop_mod;
|
||||||
alpha_dark = alpha * drop_alpha;
|
alpha_dark = alpha * drop_alpha;
|
||||||
color_dark = RGBA8(r_dark,g_dark,b_dark,alpha_dark);
|
color_dark = RGBA8(r_dark,g_dark,b_dark,alpha_dark);
|
||||||
|
|
||||||
vita2d_font_render_message(font, msg, scale, color_dark,
|
vita2d_font_render_message(font, msg, scale, color_dark,
|
||||||
x + scale * drop_x / width, y +
|
x + scale * drop_x / width, y +
|
||||||
|
@ -261,21 +261,20 @@ static void vulkan_raster_font_flush(vulkan_raster_t *font)
|
|||||||
static void vulkan_raster_font_render_msg(void *data, const char *msg,
|
static void vulkan_raster_font_render_msg(void *data, const char *msg,
|
||||||
const void *userdata)
|
const void *userdata)
|
||||||
{
|
{
|
||||||
float x, y, scale, drop_mod, drop_alpha;
|
|
||||||
float color[4], color_dark[4];
|
float color[4], color_dark[4];
|
||||||
int drop_x, drop_y;
|
int drop_x, drop_y;
|
||||||
bool full_screen;
|
bool full_screen;
|
||||||
unsigned max_glyphs;
|
unsigned max_glyphs;
|
||||||
enum text_alignment text_align;
|
enum text_alignment text_align;
|
||||||
|
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;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const struct font_params *params = (const struct font_params*)userdata;
|
const struct font_params *params = (const struct font_params*)userdata;
|
||||||
|
|
||||||
if (!font || !msg || !*msg)
|
if (!font || !msg || !*msg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vk = font->vk;
|
vk = font->vk;
|
||||||
|
|
||||||
if (params)
|
if (params)
|
||||||
{
|
{
|
||||||
@ -300,6 +299,8 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
x = settings->video.msg_pos_x;
|
x = settings->video.msg_pos_x;
|
||||||
y = settings->video.msg_pos_y;
|
y = settings->video.msg_pos_y;
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
@ -309,12 +310,12 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg,
|
|||||||
color[0] = settings->video.msg_color_r;
|
color[0] = settings->video.msg_color_r;
|
||||||
color[1] = settings->video.msg_color_g;
|
color[1] = settings->video.msg_color_g;
|
||||||
color[2] = settings->video.msg_color_b;
|
color[2] = settings->video.msg_color_b;
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
|
|
||||||
drop_x = -2;
|
drop_x = -2;
|
||||||
drop_y = -2;
|
drop_y = -2;
|
||||||
drop_mod = 0.3f;
|
drop_mod = 0.3f;
|
||||||
drop_alpha = 1.0f;
|
drop_alpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
vulkan_raster_font_setup_viewport(font, full_screen);
|
vulkan_raster_font_setup_viewport(font, full_screen);
|
||||||
@ -327,8 +328,8 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg,
|
|||||||
6 * sizeof(struct vk_vertex) * max_glyphs, &font->range))
|
6 * sizeof(struct vk_vertex) * max_glyphs, &font->range))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
font->vertices = 0;
|
font->vertices = 0;
|
||||||
font->pv = (struct vk_vertex*)font->range.data;
|
font->pv = (struct vk_vertex*)font->range.data;
|
||||||
|
|
||||||
if (drop_x || drop_y)
|
if (drop_x || drop_y)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,6 @@ static void xfonts_render_msg(void *data, const char *msg,
|
|||||||
{
|
{
|
||||||
wchar_t str[PATH_MAX_LENGTH];
|
wchar_t str[PATH_MAX_LENGTH];
|
||||||
float x, y;
|
float x, y;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const struct font_params *params = (const struct font_params*)userdata;
|
const struct font_params *params = (const struct font_params*)userdata;
|
||||||
xfonts_t *xfonts = (xfonts_t*)data;
|
xfonts_t *xfonts = (xfonts_t*)data;
|
||||||
|
|
||||||
@ -79,6 +78,8 @@ static void xfonts_render_msg(void *data, const char *msg,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
x = settings->video.msg_pos_x;
|
x = settings->video.msg_pos_x;
|
||||||
y = settings->video.msg_pos_y;
|
y = settings->video.msg_pos_y;
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,10 @@
|
|||||||
|
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
#include "../font_driver.h"
|
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
|
|
||||||
|
#include "../font_driver.h"
|
||||||
|
|
||||||
#define BMP_ATLAS_COLS 16
|
#define BMP_ATLAS_COLS 16
|
||||||
#define BMP_ATLAS_ROWS 16
|
#define BMP_ATLAS_ROWS 16
|
||||||
#define BMP_ATLAS_SIZE (BMP_ATLAS_COLS * BMP_ATLAS_ROWS)
|
#define BMP_ATLAS_SIZE (BMP_ATLAS_COLS * BMP_ATLAS_ROWS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user