Create video_monitor_reset

This commit is contained in:
twinaphex 2015-05-20 03:02:00 +02:00
parent 684b9decb0
commit a0ba714239
4 changed files with 12 additions and 10 deletions

View File

@ -17,7 +17,6 @@
#include "driver.h"
#include "general.h"
#include "retroarch.h"
#include "runloop.h"
#include "compat/posix_string.h"
#include "gfx/video_monitor.h"
#include "audio/audio_monitor.h"
@ -362,7 +361,6 @@ void init_drivers(int flags)
{
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
runloop_t *runloop = rarch_main_get_ptr();
if (flags & DRIVER_VIDEO)
driver->video_data_own = false;
@ -385,7 +383,7 @@ void init_drivers(int flags)
if (flags & DRIVER_VIDEO)
{
runloop->measure_data.frame_time_samples_count = 0;
video_monitor_reset();
init_video();

View File

@ -235,3 +235,11 @@ bool video_monitor_get_fps(char *buf, size_t size,
return true;
}
void video_monitor_reset(void)
{
runloop_t *runloop = rarch_main_get_ptr();
if (runloop)
runloop->measure_data.frame_time_samples_count = 0;
}

View File

@ -75,6 +75,8 @@ bool video_monitor_fps_statistics(double *refresh_rate,
bool video_monitor_get_fps(char *buf, size_t size,
char *buf_fps, size_t size_fps);
void video_monitor_reset(void);
#ifdef __cplusplus
}
#endif

View File

@ -383,13 +383,7 @@ static int setting_action_start_libretro_device_type(void *data)
static int setting_action_start_video_refresh_rate_auto(
void *data)
{
rarch_setting_t *setting = (rarch_setting_t*)data;
runloop_t *runloop = rarch_main_get_ptr();
if (!setting)
return -1;
runloop->measure_data.frame_time_samples_count = 0;
video_monitor_reset();
return 0;
}