From b4ff622f32cfa621eeb6c130d4a51f94cdfdcc3e Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 15 Oct 2011 20:05:34 +0200 Subject: [PATCH] Title buf hints. Purge samplerate opts. --- gfx/ext.c | 23 ++++++++++++++++++++++- gfx/ext/ssnes_video.h | 7 +++++-- ssnes.cfg | 2 -- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gfx/ext.c b/gfx/ext.c index f40cd5f766..c76d216c81 100644 --- a/gfx/ext.c +++ b/gfx/ext.c @@ -25,6 +25,11 @@ #include "dynamic.h" #include "general.h" #include "sdlwrap.h" +#include "gfx_common.h" + +#ifdef HAVE_FREETYPE +#include "fonts.h" +#endif static bool g_input_dead = true; static bool g_video_dead = true; @@ -240,6 +245,21 @@ static bool setup_video(ext_t *ext, const video_info_t *video, const input_drive font_color_g = font_color_g > 255 ? 255 : (font_color_g < 0 ? 0 : font_color_g); font_color_b = font_color_b > 255 ? 255 : (font_color_b < 0 ? 0 : font_color_b); + const char *font = NULL; +#ifdef HAVE_FREETYPE + if (*g_settings.video.font_path) + font = g_settings.video.font_path; + else + font = font_renderer_get_default_font(); +#else + font = *g_settings.video.font_path ? + g_settings.video.font_path : NULL; +#endif + + char title_buf[128]; + gfx_window_title_reset(); + gfx_window_title(title_buf, sizeof(title_buf)); + ssnes_video_info_t info = { .width = video->width, .height = video->height, @@ -252,9 +272,10 @@ static bool setup_video(ext_t *ext, const video_info_t *video, const input_drive .color_format = video->rgb32 ? SSNES_COLOR_FORMAT_ARGB8888 : SSNES_COLOR_FORMAT_XRGB1555, .xml_shader = xml_shader, .cg_shader = cg_shader, - .ttf_font = *g_settings.video.font_path ? g_settings.video.font_path : NULL, + .ttf_font = font, .ttf_font_size = g_settings.video.font_size, .ttf_font_color = (font_color_r << 16) | (font_color_g << 8) | (font_color_b << 0), + .title_hint = title_buf, }; const ssnes_input_driver_t *input_driver = NULL; diff --git a/gfx/ext/ssnes_video.h b/gfx/ext/ssnes_video.h index 26ed026411..a5ff16c5f4 100644 --- a/gfx/ext/ssnes_video.h +++ b/gfx/ext/ssnes_video.h @@ -108,7 +108,10 @@ typedef struct ssnes_video_info // Can be disregarded. const char *ttf_font; unsigned ttf_font_size; - unsigned ttf_font_color; // Font color, in format RGB888. + unsigned ttf_font_color; // Font color, in format ARGB8888. Alpha should be disregarded. + + // A title that should be displayed in the title bar of the window. + const char *title_hint; } ssnes_video_info_t; // Some convenience macros. @@ -236,7 +239,7 @@ typedef struct ssnes_video_driver const char *ident; // Needs to be defined to SSNES_GRAPHICS_API_VERSION. - // This is used to detect API mismatches. + // This is used to detect API/ABI mismatches. int api_version; } ssnes_video_driver_t; diff --git a/ssnes.cfg b/ssnes.cfg index acfef1b0a0..5928b479e0 100644 --- a/ssnes.cfg +++ b/ssnes.cfg @@ -132,8 +132,6 @@ # Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. # audio_latency = 64 -# libsamplerate quality. Valid values are from 1 to 5. These values map to zero_order_hold, linear, sinc_fastest, sinc_medium and sinc_best respectively. -# audio_src_quality = ### Input