From 81b1975fc540a4db7af5c747ba26c63a3002d708 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 26 Aug 2015 01:21:41 -0700 Subject: 2078 - update entire screen on tb_present() Termbox had been taking shortcuts when it thinks the screen hasn't changed, which doesn't work if some other process messes up the screen. The Go version has a Sync method in addition to Flush/tb_present for precisely this eventuality. But it feels like an unnecessary optimization given C's general speed. Just drop it altogether. --- This took me a long time to track down, and interestingly I found myself writing a new tracing primitive before I remembered how to selectively trace just certain layers during manual tests. I'm scared of generating traces not because of performance but because of the visual noise. Be aware of this. I'm going to clean up $log now. Maybe I should also stop using $print.. --- termbox/termbox.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'termbox') diff --git a/termbox/termbox.c b/termbox/termbox.c index d8cc4514..c9ea6012 100644 --- a/termbox/termbox.c +++ b/termbox/termbox.c @@ -181,10 +181,6 @@ void tb_present(void) front = &CELL(&front_buffer, x, y); w = wcwidth(back->ch); if (w < 1) w = 1; - if (memcmp(back, front, sizeof(struct tb_cell)) == 0) { - x += w; - continue; - } memcpy(front, back, sizeof(struct tb_cell)); send_attr(back->fg, back->bg); if (w > 1 && x >= front_buffer.width - (w - 1)) { -- cgit 1.4.1-2-gfad0