about summary refs log tree commit diff stats
path: root/sandbox
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-06 14:54:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-06 14:54:26 -0700
commitdc0e767cf5130461a6aa58774d1016ec3934396b (patch)
treecd4522ac4fb08a2679f663b813dd2e62f7332fb4 /sandbox
parent71d4ce1800b5df555aa7786b30f4d5d7fcd30352 (diff)
downloadmu-dc0e767cf5130461a6aa58774d1016ec3934396b.tar.gz
3844
Once I start optimizing most events to not repaint everything there's no
need to be smart about queued-up events.
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/004-programming-environment.mu47
1 files changed, 4 insertions, 43 deletions
diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu
index 796bee36..1ebb696d 100644
--- a/sandbox/004-programming-environment.mu
+++ b/sandbox/004-programming-environment.mu
@@ -28,10 +28,6 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources:
   local-scope
   load-ingredients
   current-sandbox:&:editor <- get *env, current-sandbox:offset
-  # if we fall behind we'll stop updating the screen, but then we have to
-  # render the entire screen when we catch up.
-  # todo: test this
-  render-all-on-no-more-events?:bool <- copy 0/false
   {
     # looping over each (keyboard or touch) event as it occurs
     +next-event
@@ -73,50 +69,15 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources:
     {
       r:resize-event, is-resize?:bool <- maybe-convert e:event, resize:variant
       break-unless is-resize?
-      # if more events, we're still resizing; wait until we stop
-      more-events?:bool <- has-more-events? console
-      {
-        break-unless more-events?
-        render-all-on-no-more-events? <- copy 1/true  # no rendering now, full rendering on some future event
-      }
-      {
-        break-if more-events?
-        env, screen <- resize screen, env
-        screen <- render-all screen, env, render-without-moving-cursor
-        render-all-on-no-more-events? <- copy 0/false  # full render done
-      }
+      env, screen <- resize screen, env
+      screen <- render-all screen, env, render-without-moving-cursor
       loop +next-event
     }
     # if it's not global and not a touch event, send to appropriate editor
     {
       render?:bool <- handle-keyboard-event screen, current-sandbox, e:event
-      # refresh screen only if no more events
-      # if there are more events to process, wait for them to clear up, then make sure you render-all afterward.
-      more-events?:bool <- has-more-events? console
-      {
-        break-unless more-events?
-        render-all-on-no-more-events? <- copy 1/true  # no rendering now, full rendering on some future event
-        screen <- update-cursor screen, current-sandbox, env
-        loop +next-event
-      }
-      {
-        break-if more-events?
-        {
-          break-unless render-all-on-no-more-events?
-          # no more events, and we have to force render
-          screen <- render-all screen, env, render
-          render-all-on-no-more-events? <- copy 0/false
-          loop +next-event
-        }
-        # no more events, no force render
-        {
-          break-unless render?
-          screen <- render-sandbox-side screen, env, render
-          screen <- update-cursor screen, current-sandbox, env
-          loop +next-event
-        }
-        screen <- update-cursor screen, current-sandbox, env
-      }
+      break-unless render?
+      screen <- render-all screen, env, render
     }
     loop
   }