summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/platform_sdl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/platform_sdl.c b/src/platform_sdl.c
index c7bfbb3..22168e6 100644
--- a/src/platform_sdl.c
+++ b/src/platform_sdl.c
@@ -392,6 +392,17 @@ int main(int argc, char *argv[])
{
lag = 0;
}
+ else if (input_record.state == RECORDING || input_record.state == PLAYING_BACK)
+ {
+ // TODO: Make up your mind about what kind of time step and game loop this game needs.
+
+ // When recording or playing back, we do exactly one update
+ // per frame. This is so that recorded input played back
+ // over the initial state always results in the same
+ // sequence of states.
+ game_code.game_update(&game_state, controller_input, buffer.width, buffer.height);
+ lag -= MS_PER_UPDATE;
+ }
else
{
while (lag >= MS_PER_UPDATE)