From 3efac2753f1c6359e508746d25ce70545dbe7443 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 2 Aug 2009 11:09:10 +0000 Subject: [PATCH] Make conio_refresh() play nicer with the resources when the machine is slow. --- caca/caca_conio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/caca/caca_conio.c b/caca/caca_conio.c index 8354bda..8ebbe91 100644 --- a/caca/caca_conio.c +++ b/caca/caca_conio.c @@ -64,7 +64,7 @@ void caca_conio_clreol(void) /* FIXME: must work within the currently active text window */ caca_fill_box(cv, caca_wherex(cv), caca_wherey(cv), - caca_get_width(cv), caca_wherey(cv), ' '); + caca_get_canvas_width(cv), caca_wherey(cv), ' '); conio_refresh(); } @@ -492,8 +492,9 @@ static void conio_refresh(void) refresh_ticks += _caca_getticks(&refresh_timer); if(refresh_ticks > 10000) { - refresh_ticks -= 10000; caca_refresh_display(dp); + _caca_getticks(&refresh_timer); + refresh_ticks = 0; } }