about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-13 18:39:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-13 18:39:41 -0700
commit6f4ce8654319ec2d5099d5d01a63d8e2e5ea0c6f (patch)
tree0ddcc5cc5fa366942c97fd123b4efc9a8cd08866
parent05a22c024d0ffe3382f94ccacec6718cb10ef78f (diff)
downloadmu-6f4ce8654319ec2d5099d5d01a63d8e2e5ea0c6f.tar.gz
3857
-rw-r--r--080display.cc15
-rw-r--r--081print.mu7
-rw-r--r--edit/004-programming-environment.mu12
-rw-r--r--sandbox/004-programming-environment.mu12
-rw-r--r--termbox/termbox.c14
-rw-r--r--termbox/termbox.h3
6 files changed, 2 insertions, 61 deletions
diff --git a/080display.cc b/080display.cc
index 847d114c..5de87688 100644
--- a/080display.cc
+++ b/080display.cc
@@ -84,21 +84,6 @@ case CLEAR_DISPLAY: {
 }
 
 :(before "End Primitive Recipe Declarations")
-SYNC_DISPLAY,
-:(before "End Primitive Recipe Numbers")
-put(Recipe_ordinal, "sync-display", SYNC_DISPLAY);
-:(before "End Primitive Recipe Checks")
-case SYNC_DISPLAY: {
-  break;
-}
-:(before "End Primitive Recipe Implementations")
-case SYNC_DISPLAY: {
-  CHECK_SCREEN;
-  tb_sync();
-  break;
-}
-
-:(before "End Primitive Recipe Declarations")
 PRINT_CHARACTER_TO_DISPLAY,
 :(before "End Primitive Recipe Numbers")
 put(Recipe_ordinal, "print-character-to-display", PRINT_CHARACTER_TO_DISPLAY);
diff --git a/081print.mu b/081print.mu
index 487696c5..f1c8c8bb 100644
--- a/081print.mu
+++ b/081print.mu
@@ -50,13 +50,6 @@ def clear-screen screen:&:screen -> screen:&:screen [
   *screen <- put *screen, cursor-column:offset, 0
 ]
 
-def sync-screen screen:&:screen -> screen:&:screen [
-  local-scope
-  load-ingredients
-  return-if screen  # do nothing for fake screens
-  sync-display
-]
-
 def fake-screen-is-empty? screen:&:screen -> result:bool [
   local-scope
   load-ingredients
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index 1ab2f814..0d4e907d 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -475,18 +475,6 @@ def update-cursor screen:&:screen, recipes:&:editor, current-sandbox:&:editor, s
   screen <- move-cursor screen, cursor-row, cursor-column
 ]
 
-# ctrl-l - redraw screen (just in case it printed junk somehow)
-
-after <global-type> [
-  {
-    redraw-screen?:bool <- equal c, 12/ctrl-l
-    break-unless redraw-screen?
-    screen <- render-all screen, env:&:environment, render
-    sync-screen screen
-    loop +next-event
-  }
-]
-
 # ctrl-n - switch focus
 # todo: test this
 
diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu
index 29db733b..0f1280e3 100644
--- a/sandbox/004-programming-environment.mu
+++ b/sandbox/004-programming-environment.mu
@@ -243,15 +243,3 @@ def update-cursor screen:&:screen, current-sandbox:&:editor, env:&:environment -
   cursor-column:num <- get *current-sandbox, cursor-column:offset
   screen <- move-cursor screen, cursor-row, cursor-column
 ]
-
-# ctrl-l - redraw screen (just in case it printed junk somehow)
-
-after <global-type> [
-  {
-    redraw-screen?:bool <- equal c, 12/ctrl-l
-    break-unless redraw-screen?
-    screen <- render-all screen, env:&:environment, render
-    sync-screen screen
-    loop +next-event
-  }
-]
diff --git a/termbox/termbox.c b/termbox/termbox.c
index 36c9496a..0e0669ad 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -158,7 +158,7 @@ int tb_is_active(void)
   return termw != -1;
 }
 
-static void tb_repaint(bool force) {
+void tb_present() {
   int x,y,w,i;
   struct tb_cell *back, *front;
 
@@ -179,7 +179,7 @@ static void tb_repaint(bool force) {
       front = &CELL(&front_buffer, x, y);
       w = wcwidth(back->ch);
       if (w < 1) w = 1;
-      if (!force && memcmp(back, front, sizeof(struct tb_cell)) == 0) {
+      if (memcmp(back, front, sizeof(struct tb_cell)) == 0) {
         x += w;
         continue;
       }
@@ -207,16 +207,6 @@ static void tb_repaint(bool force) {
   bytebuffer_flush(&output_buffer, inout);
 }
 
-void tb_present(void)
-{
-  tb_repaint(false);
-}
-
-void tb_sync(void)
-{
-  tb_repaint(true);
-}
-
 void tb_set_cursor(int cx, int cy)
 {
   assert(termw != -1);
diff --git a/termbox/termbox.h b/termbox/termbox.h
index c6cda6e1..4c5d327a 100644
--- a/termbox/termbox.h
+++ b/termbox/termbox.h
@@ -49,9 +49,6 @@ int tb_height(void);
  * tb_present(). */
 void tb_present(void);
 
-/* Variant of tb_present() that always refreshes the entire screen. */
-void tb_sync(void);
-
 /* Returns a pointer to the internal screen state: a 1D array of cells in
  * raster order. You'll need to call tb_width() and tb_height() for the
  * array's dimensions. The array stays valid until tb_clear() or tb_present()