Create RARCH_DISPLAY_CTL_CACHED_FRAME_SET_PTR

This commit is contained in:
twinaphex 2015-12-09 10:13:48 +01:00
parent f0e11659c7
commit 7bdc1da676
3 changed files with 7 additions and 11 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);
}