From e09e65e348a15362ecb89ad130cf1b8808a7d368 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 20 Nov 2015 21:20:12 +0100 Subject: [PATCH] Add RARCH_DISPLAY_CTL_GET_NEXT_VIDEO_OUT --- gfx/video_context_driver.c | 2 +- gfx/video_driver.c | 34 +++++++++++----------------------- gfx/video_driver.h | 6 ++---- menu/cbs/menu_cbs_left.c | 2 +- menu/cbs/menu_cbs_right.c | 2 +- 5 files changed, 16 insertions(+), 30 deletions(-) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index 82cb6a296e..86b4845a65 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -243,7 +243,7 @@ bool gfx_ctx_check_window(void *data, bool *quit, bool *resize, if (!data) return false; - ctx->check_window(data, quit, resize, width, height, *frame_count); + ctx->check_window(data, quit, resize, width, height, (unsigned int)*frame_count); return true; } diff --git a/gfx/video_driver.c b/gfx/video_driver.c index dd002dd076..b9e526982e 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -776,27 +776,6 @@ void video_driver_set_filtering(unsigned index, bool smooth) poke->set_filtering(driver->video_data, index, smooth); } - -void video_driver_get_video_output_next(void) -{ - driver_t *driver = driver_get_ptr(); - const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver); - - if (poke && poke->get_video_output_next) - poke->get_video_output_next(driver->video_data); -} - -void video_driver_get_video_output_prev(void) -{ - driver_t *driver = driver_get_ptr(); - const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver); - - if (poke && poke->get_video_output_prev) - poke->get_video_output_prev(driver->video_data); -} - - - void video_driver_cached_frame_set_ptr(const void *data) { if (!data) @@ -1144,6 +1123,16 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) switch (state) { + case RARCH_DISPLAY_CTL_GET_NEXT_VIDEO_OUT: + if (!poke || !poke->get_video_output_next) + return false; + poke->get_video_output_next(driver->video_data); + return true; + case RARCH_DISPLAY_CTL_GET_PREV_VIDEO_OUT: + if (!poke || !poke->get_video_output_prev) + return false; + poke->get_video_output_prev(driver->video_data); + return true; case RARCH_DISPLAY_CTL_INIT: return init_video(); case RARCH_DISPLAY_CTL_DEINIT: @@ -1205,9 +1194,8 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) if (!ptr) return false; *ptr = &video_frame_count; - return true; } - break; + return true; case RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE: if (video_state.filter.filter) return true; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 3c0fae0c87..19207b4341 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -229,6 +229,8 @@ enum rarch_display_ctl_state RARCH_DISPLAY_CTL_FIND_DRIVER, RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE, RARCH_DISPLAY_CTL_FRAME_FILTER_IS_32BIT, + RARCH_DISPLAY_CTL_GET_PREV_VIDEO_OUT, + RARCH_DISPLAY_CTL_GET_NEXT_VIDEO_OUT, RARCH_DISPLAY_CTL_HAS_WINDOWED, RARCH_DISPLAY_CTL_IS_FOCUSED, RARCH_DISPLAY_CTL_SET_ASPECT_RATIO, @@ -325,10 +327,6 @@ void * video_driver_read_frame_raw(unsigned *width, void video_driver_set_filtering(unsigned index, bool smooth); -void video_driver_get_video_output_next(void); - -void video_driver_get_video_output_prev(void); - bool video_driver_suppress_screensaver(bool enable); const char *video_driver_get_ident(void); diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index dbf8a7e533..20192783e1 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -293,7 +293,7 @@ static int action_left_video_resolution(unsigned type, const char *label, [global->console.screen.resolutions.current.idx]; } #else - video_driver_get_video_output_prev(); + video_driver_ctl(RARCH_DISPLAY_CTL_GET_VIDEO_OUT_PREV, NULL); #endif return 0; diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 0cbcb53023..706012ec13 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -318,7 +318,7 @@ static int action_right_video_resolution(unsigned type, const char *label, [global->console.screen.resolutions.current.idx]; } #else - video_driver_get_video_output_next(); + video_driver_ctl(RARCH_DISPLAY_CTL_GET_VIDEO_OUT_NEXT, NULL); #endif return 0;