mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-19 01:12:33 +00:00
Create video_driver_cached_frame_set
This commit is contained in:
parent
cf2c0f6930
commit
ac8d58b7bb
@ -617,10 +617,7 @@ void init_video(void)
|
||||
event_command(EVENT_CMD_OVERLAY_DEINIT);
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
|
||||
global->frame_cache.width = 4;
|
||||
global->frame_cache.height = 4;
|
||||
global->frame_cache.pitch = 8;
|
||||
global->frame_cache.data = &dummy_pixels;
|
||||
video_driver_cached_frame_set(&dummy_pixels, 4, 4, 8);
|
||||
|
||||
#if defined(PSP)
|
||||
video_driver_set_texture_frame(&dummy_pixels, false, 1, 1, 1.0f);
|
||||
@ -898,6 +895,20 @@ void video_driver_cached_frame(void)
|
||||
driver->recording_data = recording;
|
||||
}
|
||||
|
||||
void video_driver_cached_frame_set(const void *data, unsigned width,
|
||||
unsigned height, size_t pitch)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
return;
|
||||
|
||||
global->frame_cache.data = data;
|
||||
global->frame_cache.width = width;
|
||||
global->frame_cache.height = height;
|
||||
global->frame_cache.pitch = pitch;
|
||||
}
|
||||
|
||||
void video_driver_get_size(unsigned *width, unsigned *height)
|
||||
{
|
||||
if (width)
|
||||
|
@ -381,6 +381,9 @@ void video_driver_set_pixel_format(enum retro_pixel_format fmt);
|
||||
**/
|
||||
void video_driver_cached_frame(void);
|
||||
|
||||
void video_driver_cached_frame_set(const void *data, unsigned width,
|
||||
unsigned height, size_t pitch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -94,10 +94,7 @@ static void video_frame(const void *data, unsigned width,
|
||||
if (!driver->video_active)
|
||||
return;
|
||||
|
||||
global->frame_cache.data = data;
|
||||
global->frame_cache.width = width;
|
||||
global->frame_cache.height = height;
|
||||
global->frame_cache.pitch = pitch;
|
||||
video_driver_cached_frame_set(data, width, height, pitch);
|
||||
|
||||
if (video_frame_scale(data, width, height, pitch))
|
||||
{
|
||||
|
@ -307,10 +307,8 @@ bool take_screenshot(void)
|
||||
else
|
||||
ret = false;
|
||||
|
||||
global->frame_cache.data = old_data;
|
||||
global->frame_cache.width = old_width;
|
||||
global->frame_cache.height = old_height;
|
||||
global->frame_cache.pitch = old_pitch;
|
||||
video_driver_cached_frame_set(old_data,
|
||||
old_width, old_height, old_pitch);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user