mirror of
https://github.com/holub/mame
synced 2025-05-19 12:18:56 +03:00
Fix most-likely-to-fail SDL_TTF version check. Added a warning if strikethrough is specified but not supported. [Couriersud]
This commit is contained in:
parent
7ae0a6898e
commit
8bc7fc5f76
@ -627,10 +627,12 @@ static render_primitive_list &drawsdl_window_get_primitives(sdl_window_info *win
|
|||||||
{
|
{
|
||||||
sdlwindow_blit_surface_size(window, window->monitor->center_width, window->monitor->center_height);
|
sdlwindow_blit_surface_size(window, window->monitor->center_width, window->monitor->center_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sdl->scale_mode->is_scale)
|
if (!sdl->scale_mode->is_scale)
|
||||||
window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor));
|
window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor));
|
||||||
else
|
else
|
||||||
window->target->set_bounds(sdl->hw_scale_width, sdl->hw_scale_height);
|
window->target->set_bounds(sdl->hw_scale_width, sdl->hw_scale_height);
|
||||||
|
|
||||||
return window->target->get_primitives();
|
return window->target->get_primitives();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,11 +904,7 @@ osd_font sdl_osd_interface::font_open(const char *_name, int &height)
|
|||||||
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
||||||
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
||||||
bool underline = (name.replace(0, "[U]", "") + name.replace(0, "[u]", "") > 0);
|
bool underline = (name.replace(0, "[U]", "") + name.replace(0, "[u]", "") > 0);
|
||||||
#if TTF_MAJOR_VERSION >= 2
|
|
||||||
#if TTF_PATCHLEVEL >= 10 // SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH
|
|
||||||
bool strike = (name.replace(0, "[S]", "") + name.replace(0, "[s]", "") > 0);
|
bool strike = (name.replace(0, "[S]", "") + name.replace(0, "[s]", "") > 0);
|
||||||
#endif // MAJOR_VERSION
|
|
||||||
#endif // PATCHLEVEL
|
|
||||||
|
|
||||||
// first up, try it as a filename
|
// first up, try it as a filename
|
||||||
font = TTF_OpenFont(name.cstr(), POINT_SIZE);
|
font = TTF_OpenFont(name.cstr(), POINT_SIZE);
|
||||||
@ -949,10 +945,12 @@ osd_font sdl_osd_interface::font_open(const char *_name, int &height)
|
|||||||
style |= italic ? TTF_STYLE_ITALIC : 0;
|
style |= italic ? TTF_STYLE_ITALIC : 0;
|
||||||
}
|
}
|
||||||
style |= underline ? TTF_STYLE_UNDERLINE : 0;
|
style |= underline ? TTF_STYLE_UNDERLINE : 0;
|
||||||
#if TTF_MAJOR_VERSION >= 2
|
// SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH
|
||||||
#if TTF_PATCHLEVEL >= 10
|
#if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9)
|
||||||
style |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
|
style |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
|
||||||
#endif // MAJOR_VERSION
|
#else
|
||||||
|
if (strike)
|
||||||
|
mame_printf_warning("Ignoring strikethrough for SDL_TTF with version less 2.0.10\n");
|
||||||
#endif // PATCHLEVEL
|
#endif // PATCHLEVEL
|
||||||
TTF_SetFontStyle(font, style);
|
TTF_SetFontStyle(font, style);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user