Add RARCH_DISPLAY_CTL_MONITOR_RESET

This commit is contained in:
twinaphex 2015-11-20 19:04:00 +01:00
parent 21cabec759
commit e1ac9aed6b
5 changed files with 6 additions and 10 deletions

View File

@ -382,8 +382,7 @@ void init_drivers(int flags)
const struct retro_hw_render_callback *hw_render =
(const struct retro_hw_render_callback*)video_driver_callback();
video_monitor_reset();
video_driver_ctl(RARCH_DISPLAY_CTL_MONITOR_RESET, NULL);
video_driver_ctl(RARCH_DISPLAY_CTL_INIT, NULL);
if (!driver->video_cache_context_ack

View File

@ -1031,11 +1031,6 @@ bool video_monitor_get_fps(char *buf, size_t size,
return true;
}
void video_monitor_reset(void)
{
video_state.frame_time_samples_count = 0;
}
float video_driver_get_aspect_ratio(void)
{
return video_state.aspect_ratio;
@ -1154,6 +1149,9 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
return init_video();
case RARCH_DISPLAY_CTL_DEINIT:
return uninit_video_input();
case RARCH_DISPLAY_CTL_MONITOR_RESET:
video_state.frame_time_samples_count = 0;
return true;
case RARCH_DISPLAY_CTL_SET_ASPECT_RATIO:
if (!poke || !poke->set_aspect_ratio)
return false;

View File

@ -223,6 +223,7 @@ enum rarch_display_ctl_state
RARCH_DISPLAY_CTL_NONE = 0,
RARCH_DISPLAY_CTL_INIT,
RARCH_DISPLAY_CTL_DEINIT,
RARCH_DISPLAY_CTL_MONITOR_RESET,
RARCH_DISPLAY_CTL_APPLY_STATE_CHANGES,
RARCH_DISPLAY_CTL_FIND_DRIVER,
RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE,

View File

@ -75,8 +75,6 @@ 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

@ -880,7 +880,7 @@ static int setting_action_start_libretro_device_type(void *data)
static int setting_action_start_video_refresh_rate_auto(
void *data)
{
video_monitor_reset();
video_driver_ctl(RARCH_DISPLAY_CTL_MONITOR_RESET, NULL);
return 0;
}