From 6be0404cdd46808a6fa3c2211aef795061bc2aa5 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Tue, 25 Dec 2012 00:24:29 +0100 Subject: [PATCH 1/2] Now 20% smoother! --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 75ab882..725b7eb 100644 --- a/src/main.c +++ b/src/main.c @@ -600,16 +600,19 @@ int main(int argc, char **argv){ break; } + bool draw=false; while(1) { ALLEGRO_EVENT ev; - if (al_is_event_queue_empty(game.event_queue)) { + if (draw && al_is_event_queue_empty(game.event_queue)) { DrawGameState(&game); DrawConsole(&game); al_flip_display(); + draw=false; } else { al_wait_for_event(game.event_queue, &ev); if ((ev.type == ALLEGRO_EVENT_TIMER) && (ev.timer.source == game.timer)) { LogicGameState(&game); + draw=true; } else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) { break;