From 6e27c1e3b5c14a34c13edb0e553e624899ebc28e Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 9 Apr 2012 16:49:47 +0200 Subject: [PATCH] implement frame skipping as debug feature --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index 7a091df..cb71b2f 100644 --- a/src/main.c +++ b/src/main.c @@ -411,6 +411,14 @@ int main(int argc, char **argv){ if ((ev.type == ALLEGRO_EVENT_KEY_DOWN) && (ev.keyboard.keycode == ALLEGRO_KEY_TILDE)) { game.showconsole = !game.showconsole; } + if ((game.debug) && (ev.type == ALLEGRO_EVENT_KEY_DOWN) && (ev.keyboard.keycode == ALLEGRO_KEY_F1)) { + int i; + for (i=0; i<512; i++) { + DrawGameState(&game); + } + game.showconsole = true; + PrintConsole(&game, "DEBUG: 512 frames skipped..."); + } KEYDOWN_STATE(GAMESTATE_PAUSE, Pause) KEYDOWN_STATE(GAMESTATE_MENU, Menu) KEYDOWN_STATE(GAMESTATE_LOADING, Loading)