mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 00:39:53 +00:00
Get rid of double void argument
This commit is contained in:
parent
5ba2a621c0
commit
0d39701145
@ -104,8 +104,9 @@ static void sdl2_init_font(sdl2_video_t *vid, const char *font_path,
|
|||||||
if (!settings->bools.video_font_enable)
|
if (!settings->bools.video_font_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&vid->font_driver, &vid->font_data,
|
if (!font_renderer_create_default(
|
||||||
*font_path ? font_path : NULL, font_size))
|
&vid->font_driver, &vid->font_data,
|
||||||
|
*font_path ? font_path : NULL, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("[SDL]: Could not initialize fonts.\n");
|
RARCH_WARN("[SDL]: Could not initialize fonts.\n");
|
||||||
return;
|
return;
|
||||||
|
@ -96,7 +96,8 @@ static void sdl_init_font(sdl_video_t *vid, const char *font_path, unsigned font
|
|||||||
if (!settings->bools.video_font_enable)
|
if (!settings->bools.video_font_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&vid->font_driver, &vid->font,
|
if (!font_renderer_create_default(
|
||||||
|
&vid->font_driver, &vid->font,
|
||||||
*settings->paths.path_font ? settings->paths.path_font : NULL,
|
*settings->paths.path_font ? settings->paths.path_font : NULL,
|
||||||
settings->floats.video_font_size))
|
settings->floats.video_font_size))
|
||||||
{
|
{
|
||||||
|
@ -194,7 +194,8 @@ static void *vg_init(const video_info_t *video,
|
|||||||
video_context_driver_input_driver(&inp);
|
video_context_driver_input_driver(&inp);
|
||||||
|
|
||||||
if ( video->font_enable
|
if ( video->font_enable
|
||||||
&& font_renderer_create_default((const void**)&vg->font_driver, &vg->mFontRenderer,
|
&& font_renderer_create_default(
|
||||||
|
&vg->font_driver, &vg->mFontRenderer,
|
||||||
*settings->paths.path_font ? settings->paths.path_font : NULL, settings->floats.video_font_size))
|
*settings->paths.path_font ? settings->paths.path_font : NULL, settings->floats.video_font_size))
|
||||||
{
|
{
|
||||||
vg->mFont = vgCreateFont(0);
|
vg->mFont = vgCreateFont(0);
|
||||||
|
@ -139,7 +139,8 @@ static void xv_init_font(xv_t *xv, const char *font_path, unsigned font_size)
|
|||||||
if (!settings->bools.video_font_enable)
|
if (!settings->bools.video_font_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (font_renderer_create_default((const void**)&xv->font_driver,
|
if (font_renderer_create_default(
|
||||||
|
&xv->font_driver,
|
||||||
&xv->font, *settings->paths.path_font
|
&xv->font, *settings->paths.path_font
|
||||||
? settings->paths.path_font : NULL,
|
? settings->paths.path_font : NULL,
|
||||||
settings->floats.video_font_size))
|
settings->floats.video_font_size))
|
||||||
|
@ -45,7 +45,8 @@ static void *caca_init_font(void *data,
|
|||||||
|
|
||||||
font->caca = (caca_t*)data;
|
font->caca = (caca_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->caca_font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->caca_font_driver,
|
||||||
&font->caca_font_data, font_path, font_size))
|
&font->caca_font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -58,8 +58,9 @@ static void* ctr_font_init_font(void* data, const char* font_path,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
font_size = 10;
|
font_size = 10;
|
||||||
if (!font_renderer_create_default((const void**)&font->font_driver,
|
if (!font_renderer_create_default(
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_driver,
|
||||||
|
&font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
free(font);
|
free(font);
|
||||||
|
@ -46,7 +46,7 @@ d3d10_font_init_font(void* data, const char* font_path, float font_size, bool is
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!font_renderer_create_default(
|
if (!font_renderer_create_default(
|
||||||
(const void**)&font->font_driver, &font->font_data, font_path, font_size))
|
&font->font_driver, &font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
free(font);
|
free(font);
|
||||||
|
@ -45,7 +45,7 @@ d3d11_font_init_font(void* data, const char* font_path, float font_size, bool is
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!font_renderer_create_default(
|
if (!font_renderer_create_default(
|
||||||
(const void**)&font->font_driver, &font->font_data, font_path, font_size))
|
&font->font_driver, &font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
free(font);
|
free(font);
|
||||||
|
@ -46,7 +46,7 @@ d3d12_font_init_font(void* data, const char* font_path,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!font_renderer_create_default(
|
if (!font_renderer_create_default(
|
||||||
(const void**)&font->font_driver,
|
&font->font_driver,
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -51,7 +51,8 @@ static void *gdi_init_font(void *data,
|
|||||||
|
|
||||||
font->gdi = (gdi_t*)data;
|
font->gdi = (gdi_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->gdi_font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->gdi_font_driver,
|
||||||
&font->gdi_font_data, font_path, font_size))
|
&font->gdi_font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -178,7 +178,8 @@ static void *gl_raster_font_init_font(void *data,
|
|||||||
|
|
||||||
font->gl = (gl_t*)data;
|
font->gl = (gl_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->font_driver,
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -64,8 +64,9 @@
|
|||||||
|
|
||||||
_driver = driver;
|
_driver = driver;
|
||||||
_context = driver.context;
|
_context = driver.context;
|
||||||
if (!font_renderer_create_default((const void **)&_font_driver,
|
if (!font_renderer_create_default(
|
||||||
&_font_data, font_path, font_size))
|
&_font_driver,
|
||||||
|
&_font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -45,7 +45,8 @@ static void *sixel_init_font(void *data,
|
|||||||
|
|
||||||
font->sixel = (sixel_t*)data;
|
font->sixel = (sixel_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->sixel_font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->sixel_font_driver,
|
||||||
&font->sixel_font_data, font_path, font_size))
|
&font->sixel_font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -46,7 +46,8 @@ static void *vga_init_font(void *data,
|
|||||||
|
|
||||||
font_size = 1;
|
font_size = 1;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->vga_font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->vga_font_driver,
|
||||||
&font->vga_font_data, font_path, font_size))
|
&font->vga_font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -48,7 +48,8 @@ static void *vita2d_font_init_font(void *data,
|
|||||||
|
|
||||||
font->vita = (vita_video_t*)data;
|
font->vita = (vita_video_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->font_driver,
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_data, font_path, font_size))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ static void *vulkan_raster_font_init_font(void *data,
|
|||||||
|
|
||||||
font->vk = (vk_t*)data;
|
font->vk = (vk_t*)data;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->font_driver,
|
if (!font_renderer_create_default(
|
||||||
|
&font->font_driver,
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
|
@ -47,8 +47,9 @@ static void* wiiu_font_init_font(void* data, const char* font_path,
|
|||||||
if (!font)
|
if (!font)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!font_renderer_create_default((const void**)&font->font_driver,
|
if (!font_renderer_create_default(
|
||||||
&font->font_data, font_path, font_size))
|
&font->font_driver,
|
||||||
|
&font->font_data, font_path, font_size))
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||||
free(font);
|
free(font);
|
||||||
|
@ -84,13 +84,13 @@ static freetype_atlas_slot_t* font_renderer_get_slot(ft_font_renderer_t *handle)
|
|||||||
unsigned oldest = 0;
|
unsigned oldest = 0;
|
||||||
|
|
||||||
for (i = 1; i < FT_ATLAS_SIZE; i++)
|
for (i = 1; i < FT_ATLAS_SIZE; i++)
|
||||||
if((handle->usage_counter - handle->atlas_slots[i].last_used) >
|
if ((handle->usage_counter - handle->atlas_slots[i].last_used) >
|
||||||
(handle->usage_counter - handle->atlas_slots[oldest].last_used))
|
(handle->usage_counter - handle->atlas_slots[oldest].last_used))
|
||||||
oldest = i;
|
oldest = i;
|
||||||
|
|
||||||
/* remove from map */
|
/* remove from map */
|
||||||
map_id = handle->atlas_slots[oldest].charcode & 0xFF;
|
map_id = handle->atlas_slots[oldest].charcode & 0xFF;
|
||||||
if(handle->uc_map[map_id] == &handle->atlas_slots[oldest])
|
if (handle->uc_map[map_id] == &handle->atlas_slots[oldest])
|
||||||
handle->uc_map[map_id] = handle->atlas_slots[oldest].next;
|
handle->uc_map[map_id] = handle->atlas_slots[oldest].next;
|
||||||
else if (handle->uc_map[map_id])
|
else if (handle->uc_map[map_id])
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ static const struct font_glyph *font_renderer_ft_get_glyph(
|
|||||||
|
|
||||||
while(atlas_slot)
|
while(atlas_slot)
|
||||||
{
|
{
|
||||||
if(atlas_slot->charcode == charcode)
|
if (atlas_slot->charcode == charcode)
|
||||||
{
|
{
|
||||||
atlas_slot->last_used = handle->usage_counter++;
|
atlas_slot->last_used = handle->usage_counter++;
|
||||||
return &atlas_slot->glyph;
|
return &atlas_slot->glyph;
|
||||||
@ -203,7 +203,7 @@ static bool font_renderer_create_atlas(ft_font_renderer_t *handle, float font_si
|
|||||||
font_renderer_ft_get_glyph(handle, i);
|
font_renderer_ft_get_glyph(handle, i);
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
if(isalnum(i))
|
if (isalnum(i))
|
||||||
font_renderer_ft_get_glyph(handle, i);
|
font_renderer_ft_get_glyph(handle, i);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -227,12 +227,12 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
#ifdef WIIU
|
#ifdef WIIU
|
||||||
if(!*font_path)
|
if (!*font_path)
|
||||||
{
|
{
|
||||||
void* font_data = NULL;
|
void* font_data = NULL;
|
||||||
uint32_t font_size = 0;
|
uint32_t font_size = 0;
|
||||||
|
|
||||||
if(!OSGetSharedData(SHARED_FONT_DEFAULT, 0, &font_data, &font_size))
|
if (!OSGetSharedData(SHARED_FONT_DEFAULT, 0, &font_data, &font_size))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
err = FT_New_Memory_Face(handle->lib, font_data, font_size, 0, &handle->face);
|
err = FT_New_Memory_Face(handle->lib, font_data, font_size, 0, &handle->face);
|
||||||
@ -299,7 +299,6 @@ static const char *font_renderer_ft_get_default_font(void)
|
|||||||
#else
|
#else
|
||||||
size_t i;
|
size_t i;
|
||||||
#if 0
|
#if 0
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
char asset_path[PATH_MAX_LENGTH];
|
char asset_path[PATH_MAX_LENGTH];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -309,7 +308,9 @@ static const char *font_renderer_ft_get_default_font(void)
|
|||||||
/* Check if we are getting the font from the assets directory. */
|
/* Check if we are getting the font from the assets directory. */
|
||||||
if (string_is_equal(font_paths[i], "assets://pkg/osd-font.ttf"))
|
if (string_is_equal(font_paths[i], "assets://pkg/osd-font.ttf"))
|
||||||
{
|
{
|
||||||
fill_pathname_join(asset_path, settings->paths.directory_assets, "pkg/osd-font.ttf", PATH_MAX_LENGTH);
|
settings_t *settings = config_get_ptr();
|
||||||
|
fill_pathname_join(asset_path,
|
||||||
|
settings->paths.directory_assets, "pkg/osd-font.ttf", PATH_MAX_LENGTH);
|
||||||
font_paths[i] = asset_path;
|
font_paths[i] = asset_path;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,13 +46,12 @@ static const font_renderer_driver_t *font_backends[] = {
|
|||||||
|
|
||||||
static void *video_font_driver = NULL;
|
static void *video_font_driver = NULL;
|
||||||
|
|
||||||
int font_renderer_create_default(const void **data, void **handle,
|
int font_renderer_create_default(
|
||||||
|
const font_renderer_driver_t **drv,
|
||||||
|
void **handle,
|
||||||
const char *font_path, unsigned font_size)
|
const char *font_path, unsigned font_size)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
const font_renderer_driver_t **drv =
|
|
||||||
(const font_renderer_driver_t**)data;
|
|
||||||
|
|
||||||
for (i = 0; font_backends[i]; i++)
|
for (i = 0; font_backends[i]; i++)
|
||||||
{
|
{
|
||||||
@ -76,7 +75,7 @@ int font_renderer_create_default(const void **data, void **handle,
|
|||||||
font_backends[i]->ident);
|
font_backends[i]->ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
*drv = NULL;
|
*drv = NULL;
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -124,8 +124,10 @@ typedef struct
|
|||||||
} font_data_t;
|
} font_data_t;
|
||||||
|
|
||||||
/* font_path can be NULL for default font. */
|
/* font_path can be NULL for default font. */
|
||||||
int font_renderer_create_default(const void **driver,
|
int font_renderer_create_default(
|
||||||
void **handle, const char *font_path, unsigned font_size);
|
const font_renderer_driver_t **drv,
|
||||||
|
void **handle,
|
||||||
|
const char *font_path, unsigned font_size);
|
||||||
|
|
||||||
void font_driver_render_msg(video_frame_info_t *video_info,
|
void font_driver_render_msg(video_frame_info_t *video_info,
|
||||||
void *font_data, const char *msg, const struct font_params *params);
|
void *font_data, const char *msg, const struct font_params *params);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user