replay/state: add skip_frames counter for playback

This commit is contained in:
Andrei Alexeyev 2023-06-13 04:07:41 +02:00
parent eede63333a
commit f272ec5911
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 6 additions and 0 deletions

View file

@ -21,6 +21,7 @@ void replay_state_init_play(ReplayState *rst, Replay *rpy, ReplayStage *rstage)
rst->mode = REPLAY_PLAY;
rst->play.desync_frame = -1;
rst->play.desync_check_frame = -1;
rst->play.skip_frames = rstage->skip_frames;
}
void replay_state_init_record(ReplayState *rst, Replay *rpy) {
@ -90,4 +91,8 @@ void replay_state_play_advance(ReplayState *rst, int frame, ReplayEventFunc even
}
rst->play.pos = i;
if(rst->play.skip_frames > 0) {
--rst->play.skip_frames;
}
}

View file

@ -29,6 +29,7 @@ typedef struct ReplayState {
uint16_t desync_check;
int desync_check_frame;
int desync_frame;
int skip_frames;
bool demo_mode;
} play;