From 7bdc1da6760fb8c07b9d8087472754f7cc6f7670 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 9 Dec 2015 10:13:48 +0100 Subject: [PATCH] Create RARCH_DISPLAY_CTL_CACHED_FRAME_SET_PTR --- gfx/video_driver.c | 13 +++++-------- gfx/video_driver.h | 3 +-- screenshot.c | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 1873e738f7..f6035c7bfb 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -872,14 +872,6 @@ void video_driver_set_filtering(unsigned index, bool smooth) video_driver_poke->set_filtering(video_driver_data, index, smooth); } -void video_driver_cached_frame_set_ptr(const void *data) -{ - if (!data) - return; - - video_driver_state.frame_cache.data = data; -} - void video_driver_cached_frame_set(const void *data, unsigned width, unsigned height, size_t pitch) { @@ -1403,6 +1395,11 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) video_driver_record_gpu_buffer = NULL; current_video = NULL; break; + case RARCH_DISPLAY_CTL_CACHED_FRAME_SET_PTR: + if (!data) + return false; + video_driver_state.frame_cache.data = (const void*)data; + return true; case RARCH_DISPLAY_CTL_SET_STUB_FRAME: frame_bak = current_video->frame; current_video->frame = video_null.frame; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index bcbf1727aa..ead60b4855 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -134,6 +134,7 @@ enum rarch_display_ctl_state /* Renders the current video frame. */ RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER, RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB, + RARCH_DISPLAY_CTL_CACHED_FRAME_SET_PTR, RARCH_DISPLAY_CTL_SHOW_MOUSE, RARCH_DISPLAY_CTL_GET_FRAME_COUNT, RARCH_DISPLAY_CTL_SET_OWN_DRIVER, @@ -428,8 +429,6 @@ void video_driver_set_pixel_format(enum retro_pixel_format fmt); void video_driver_cached_frame_set(const void *data, unsigned width, unsigned height, size_t pitch); -void video_driver_cached_frame_set_ptr(const void *data); - void video_driver_cached_frame_get(const void **data, unsigned *width, unsigned *height, size_t *pitch); diff --git a/screenshot.c b/screenshot.c index 51b283cd05..3dd02ae694 100644 --- a/screenshot.c +++ b/screenshot.c @@ -243,7 +243,7 @@ bool take_screenshot(void) if (frame_data) { - video_driver_cached_frame_set_ptr(frame_data); + video_driver_ctl(RARCH_DISPLAY_CTL_CACHED_FRAME_SET_PTR, (void*)frame_data); ret = take_screenshot_raw(); free(frame_data); }