You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 610e001
Browse filesBrowse the repository at this point in the historyBrowse files
Sint64 now = slowTick(); // must be signed to permit negative numbers
107
+
Game *game = state ? state->_game : 0; // this is used to make sure we stop calling *_state on *state in the loop once *state has been popped and deallocated
108
+
//assert(!game || game->isState(state));
109
+
99
110
if (_running)
100
111
{
101
-
if (getTime() >= _interval)
112
+
if ((now - _frameSkipStart) >= _interval)
102
113
{
103
-
if (state != 0&& _state != 0)
114
+
for (int i = 0; i < maxFrameSkip && isRunning() && (now - _frameSkipStart) >= _interval; ++i)
104
115
{
105
-
(state->*_state)();
116
+
if (state != 0 && _state != 0)
117
+
{
118
+
(state->*_state)();
119
+
}
120
+
_frameSkipStart += _interval;
121
+
// breaking here after one iteration effectively returns this function to its old functionality:
122
+
if (!game || !_frameSkipping || !game->isState(state)) break; // if game isn't set, we can't verify *state
106
123
}
107
-
if (surface != 0 && _surface != 0)
124
+
125
+
if (_running && surface != 0 && _surface != 0)
108
126
{
109
127
(surface->*_surface)();
110
128
}
111
129
_start = slowTick();
130
+
if (_start > _frameSkipStart) _frameSkipStart = _start; // don't play animations in ffwd to catch up :P
0 commit comments