mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 20:13:56 -07:00
Buffer rewinds from backward skips in replays (#5141)
* split event processing to own method * implement rewind throttling * don't throttle backward skips from clicks * use the term 'buffering' instead * remove initial backup logic; just always buffer shortcut backward skips * prevent segfault * turns out you can just reuse the same one-shot timer * try scaling timeout based on event count * rewrite timeout calculation code * fix linker error
This commit is contained in:
parent
6652012f4c
commit
e43a21866c
2 changed files with 69 additions and 13 deletions
|
|
@ -18,6 +18,9 @@ signals:
|
|||
|
||||
private:
|
||||
QTimer *replayTimer;
|
||||
static constexpr int BASE_REWIND_BUFFERING_TIMEOUT_MS = 180;
|
||||
static constexpr int MAX_REWIND_BUFFERING_TIMEOUT_MS = 280;
|
||||
QTimer *rewindBufferingTimer;
|
||||
QList<int> replayTimeline;
|
||||
QList<int> histogram;
|
||||
static const int binLength;
|
||||
|
|
@ -26,7 +29,11 @@ private:
|
|||
int currentTime;
|
||||
int currentEvent;
|
||||
|
||||
void skipToTime(int newTime);
|
||||
void skipToTime(int newTime, bool doRewindBuffering);
|
||||
void handleBackwardsSkip(bool doRewindBuffering);
|
||||
int calcRewindBufferingTimeout() const;
|
||||
void processRewind();
|
||||
void processNewEvents();
|
||||
private slots:
|
||||
void replayTimerTimeout();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue