From 9cf25dcb67ca57d5f4f082839b23b07410ece2b1 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 23 Jan 2011 03:16:14 +0100 Subject: [PATCH] A slight cleanup. --- general.h | 4 ++-- ssnes.c | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/general.h b/general.h index b4d013a4ea..4c7b3e50cc 100644 --- a/general.h +++ b/general.h @@ -54,12 +54,12 @@ struct settings char cg_shader_path[256]; char bsnes_shader_path[256]; unsigned filter; -#ifdef HAVE_FREETYPE + char font_path[256]; unsigned font_size; float msg_pos_x; float msg_pos_y; -#endif + } video; struct diff --git a/ssnes.c b/ssnes.c index 547d22780f..dbefd7bce3 100644 --- a/ssnes.c +++ b/ssnes.c @@ -104,39 +104,41 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height) if (g_settings.video.filter != FILTER_NONE) process_frame(output, data, width, height); + const char *msg = msg_queue_pull(g_extern.msg_queue); + switch (g_settings.video.filter) { case FILTER_HQ2X: ProcessHQ2x(output, output_filter); - if (!driver.video->frame(driver.video_data, output_filter, width << 1, height << 1, width << 2, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, output_filter, width << 1, height << 1, width << 2, msg)) g_extern.video_active = false; break; case FILTER_HQ4X: ProcessHQ4x(output, output_filter); - if (!driver.video->frame(driver.video_data, output_filter, width << 2, height << 2, width << 3, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, output_filter, width << 2, height << 2, width << 3, msg)) g_extern.video_active = false; break; case FILTER_GRAYSCALE: grayscale_filter(output, width, height); - if (!driver.video->frame(driver.video_data, output, width, height, width << 1, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, output, width, height, width << 1, msg)) g_extern.video_active = false; break; case FILTER_BLEED: bleed_filter(output, width, height); - if (!driver.video->frame(driver.video_data, output, width, height, width << 1, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, output, width, height, width << 1, msg)) g_extern.video_active = false; break; case FILTER_NTSC: ntsc_filter(output_filter, output, width, height); - if (!driver.video->frame(driver.video_data, output_filter, SNES_NTSC_OUT_WIDTH(width), height, SNES_NTSC_OUT_WIDTH(width) << 1, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, output_filter, SNES_NTSC_OUT_WIDTH(width), height, SNES_NTSC_OUT_WIDTH(width) << 1, msg)) g_extern.video_active = false; break; default: - if (!driver.video->frame(driver.video_data, data, width, height, (height == 448 || height == 478) ? 1024 : 2048, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, data, width, height, (height == 448 || height == 478) ? 1024 : 2048, msg)) g_extern.video_active = false; } #else - if (!driver.video->frame(driver.video_data, data, width, height, (height == 448 || height == 478) ? 1024 : 2048, msg_queue_pull(g_extern.msg_queue))) + if (!driver.video->frame(driver.video_data, data, width, height, (height == 448 || height == 478) ? 1024 : 2048, msg)) g_extern.video_active = false; #endif }