about summary refs log tree commit diff stats
path: root/termbox
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-26 01:21:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-26 01:21:41 -0700
commit81b1975fc540a4db7af5c747ba26c63a3002d708 (patch)
tree6eb85e25b5951a1cec6094c8b434e1150b8715f3 /termbox
parent2bc88549761475bb58b07c2e5b54782ac5bbe213 (diff)
downloadmu-81b1975fc540a4db7af5c747ba26c63a3002d708.tar.gz
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..
Diffstat (limited to 'termbox')
-rw-r--r--termbox/termbox.c4
1 files changed, 0 insertions, 4 deletions
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)) {