Create video_driver_get_status

This commit is contained in:
twinaphex 2017-01-25 04:39:21 +01:00
parent be617c530b
commit a151c24117
3 changed files with 13 additions and 1 deletions

View File

@ -2386,3 +2386,9 @@ void video_driver_get_window_title(char *buf, unsigned len)
video_driver_window_title_update = false;
}
}
void video_driver_get_status(uint64_t *frame_count, bool * is_alive)
{
*frame_count = video_driver_get_frame_count();
*is_alive = video_driver_is_alive();
}

View File

@ -558,6 +558,8 @@ void video_driver_reinit(void);
void video_driver_get_window_title(char *buf, unsigned len);
void video_driver_get_status(uint64_t *frame_count, bool * is_alive);
extern video_driver_t video_gl;
extern video_driver_t video_vulkan;
extern video_driver_t video_psp1;

View File

@ -678,7 +678,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
* d) Video driver no longer alive.
* e) End of BSV movie and BSV EOF exit is true. (TODO/FIXME - explain better)
*/
#define time_to_exit(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !video_driver_is_alive() || bsv_movie_ctl(BSV_MOVIE_CTL_END_EOF, NULL) || (runloop_max_frames && (video_driver_get_frame_count() >= runloop_max_frames)) || runloop_exec)
#define time_to_exit(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !is_alive || bsv_movie_ctl(BSV_MOVIE_CTL_END_EOF, NULL) || (runloop_max_frames && (frame_count >= runloop_max_frames)) || runloop_exec)
#define runloop_check_cheevos() (settings->cheevos.enable && cheevos_loaded && (!cheats_are_enabled && !cheats_were_enabled))
@ -697,9 +697,13 @@ static enum runloop_state runloop_check_state(
#ifdef HAVE_NETWORKING
bool tmp = false;
#endif
bool is_alive = false;
uint64_t frame_count = 0;
bool focused = true;
bool pause_pressed = runloop_cmd_triggered(trigger_input, RARCH_PAUSE_TOGGLE);
video_driver_get_status(&frame_count, &is_alive);
if (runloop_cmd_triggered(trigger_input, RARCH_OVERLAY_NEXT))
command_event(CMD_EVENT_OVERLAY_NEXT, NULL);