diff --git a/config.def.h b/config.def.h index e6bb603411..6839d6427e 100644 --- a/config.def.h +++ b/config.def.h @@ -156,6 +156,9 @@ static const bool hires_record = false; // Record post-filtered (CPU filter) video rather than raw SNES output. static const bool post_filter_record = false; +// OSD-messages +static const bool font_enable = true; + //////////////// // Audio //////////////// diff --git a/general.h b/general.h index 15fc760e9e..746ff98de8 100644 --- a/general.h +++ b/general.h @@ -96,6 +96,7 @@ struct settings char font_path[MAXPATHLEN]; unsigned font_size; + bool font_enable; float msg_pos_x; float msg_pos_y; float msg_color_r; diff --git a/gfx/ext.c b/gfx/ext.c index c88cefa7e4..5bc1fb5301 100644 --- a/gfx/ext.c +++ b/gfx/ext.c @@ -246,15 +246,18 @@ static bool setup_video(ext_t *ext, const video_info_t *video, const input_drive font_color_b = font_color_b > 255 ? 255 : (font_color_b < 0 ? 0 : font_color_b); const char *font = NULL; + if (g_settings.video.font_enable) + { #ifdef HAVE_FREETYPE - if (*g_settings.video.font_path) - font = g_settings.video.font_path; - else - font = font_renderer_get_default_font(); + 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; + font = *g_settings.video.font_path ? + g_settings.video.font_path : NULL; #endif + } char title_buf[128]; gfx_window_title_reset(); diff --git a/gfx/gl.c b/gfx/gl.c index ff7989b0d8..aad319e6a8 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -337,6 +337,9 @@ static void gl_shader_scale(unsigned index, struct gl_fbo_scale *scale) static inline void gl_init_font(gl_t *gl, const char *font_path, unsigned font_size) { #ifdef HAVE_FREETYPE + if (!g_settings.video.font_enable) + return; + const char *path = font_path; if (!*path) path = font_renderer_get_default_font(); diff --git a/gfx/sdl.c b/gfx/sdl.c index 3d2381de45..b242c3c980 100644 --- a/gfx/sdl.c +++ b/gfx/sdl.c @@ -80,6 +80,9 @@ static void sdl_gfx_free(void *data) static void sdl_init_font(sdl_video_t *vid, const char *font_path, unsigned font_size) { #ifdef HAVE_FREETYPE + if (!g_settings.video.font_enable) + return; + const char *path = font_path; if (!*path) path = font_renderer_get_default_font(); diff --git a/gfx/xvideo.c b/gfx/xvideo.c index 6d52e1273d..4c6b2f7cf4 100644 --- a/gfx/xvideo.c +++ b/gfx/xvideo.c @@ -184,6 +184,9 @@ static void set_fullscreen(xv_t *xv) static void xv_init_font(xv_t *xv, const char *font_path, unsigned font_size) { #ifdef HAVE_FREETYPE + if (!g_settings.video.font_enable) + return; + const char *path = font_path; if (!*path) path = font_renderer_get_default_font(); diff --git a/settings.c b/settings.c index ca55fe3eb7..63509f7e43 100644 --- a/settings.c +++ b/settings.c @@ -131,6 +131,7 @@ static void set_defaults(void) g_settings.video.crop_overscan = crop_overscan; g_settings.video.aspect_ratio = -1.0f; // Automatic g_settings.video.shader_type = SSNES_SHADER_AUTO; + g_settings.video.font_enable = font_enable; #ifdef HAVE_FREETYPE g_settings.video.font_size = font_size; @@ -328,6 +329,7 @@ static void parse_config_file(void) #ifdef HAVE_FREETYPE CONFIG_GET_STRING(video.font_path, "video_font_path"); CONFIG_GET_INT(video.font_size, "video_font_size"); + CONFIG_GET_BOOL(video.font_enable, "video_font_enable"); CONFIG_GET_DOUBLE(video.msg_pos_x, "video_message_pos_x"); CONFIG_GET_DOUBLE(video.msg_pos_y, "video_message_pos_y"); diff --git a/ssnes.cfg b/ssnes.cfg index c44d25adc8..c6f9956a03 100644 --- a/ssnes.cfg +++ b/ssnes.cfg @@ -89,6 +89,9 @@ # Size of the TTF font rendered. # video_font_size = 48 +# Enable usage of OSD messages. +# video_font_enable = true + # Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. # [0.0, 0.0] maps to the lower left corner of the screen. # video_message_pos_x = 0.05