Create bsv_movie_end_of_file

This commit is contained in:
twinaphex 2017-05-06 18:11:18 +02:00
parent 7c9736bae8
commit d349ea61cf
3 changed files with 8 additions and 4 deletions

View File

@ -390,6 +390,11 @@ bool bsv_movie_is_playback_off(void)
return bsv_movie_state_handle && !bsv_movie_state.movie_playback;
}
bool bsv_movie_is_end_of_file(void)
{
return bsv_movie_state.movie_end && bsv_movie_state.eof_exit;
}
bool bsv_movie_ctl(enum bsv_ctl_state state, void *data)
{
switch (state)
@ -415,8 +420,6 @@ bool bsv_movie_ctl(enum bsv_ctl_state state, void *data)
case BSV_MOVIE_CTL_SET_END_EOF:
bsv_movie_state.eof_exit = true;
break;
case BSV_MOVIE_CTL_END_EOF:
return bsv_movie_state.movie_end && bsv_movie_state.eof_exit;
case BSV_MOVIE_CTL_SET_END:
bsv_movie_state.movie_end = true;
break;

View File

@ -55,7 +55,6 @@ enum bsv_ctl_state
BSV_MOVIE_CTL_FRAME_REWIND,
BSV_MOVIE_CTL_DEINIT,
BSV_MOVIE_CTL_INIT,
BSV_MOVIE_CTL_END_EOF,
BSV_MOVIE_CTL_SET_END_EOF,
BSV_MOVIE_CTL_SET_END,
BSV_MOVIE_CTL_UNSET_END
@ -75,6 +74,8 @@ void bsv_movie_set_frame_end(void);
bool bsv_movie_get_input(int16_t *bsv_data);
bool bsv_movie_is_end_of_file(void);
bool bsv_movie_ctl(enum bsv_ctl_state state, void *data);
bool bsv_movie_check(void);

View File

@ -672,7 +672,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 || !is_alive || bsv_movie_ctl(BSV_MOVIE_CTL_END_EOF, NULL) || (runloop_max_frames && (frame_count >= runloop_max_frames)) || runloop_exec)
#define time_to_exit(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !is_alive || bsv_movie_is_end_of_file() || (runloop_max_frames && (frame_count >= runloop_max_frames)) || runloop_exec)
#define runloop_check_cheevos() (settings->bools.cheevos_enable && cheevos_loaded && (!cheats_are_enabled && !cheats_were_enabled))