changeset 47:1effb310d6ee

Added stub implementation for setBufferMode().
author Atul Varma <varmaa@toolness.com>
date Fri, 16 May 2008 00:35:06 -0700
parents b427293b62e4
children f472fdcc4027
files engine-runner.js trivial-zui.js
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/engine-runner.js	Fri May 16 00:13:16 2008 -0700
+++ b/engine-runner.js	Fri May 16 00:35:06 2008 -0700
@@ -48,7 +48,12 @@
   },
   onSetCursor: function(x, y) {
   },
-  onSetBufferMode: function() {
+
+  // From the Z-Machine spec for buffer_mode: If set to 1, text output
+  // on the lower window in stream 1 is buffered up so that it can be
+  // word-wrapped properly. If set to 0, it isn't.
+
+  onSetBufferMode: function(flag) {
   },
   onSetInputStream: function() {
   },
@@ -186,6 +191,8 @@
                               engine.effect(1));
         break;
       case GNUSTO_EFFECT_SETBUFFERMODE:
+        self._zui.onSetBufferMode(engine.effect(1));
+        break;
       case GNUSTO_EFFECT_SETINPUTSTREAM:
       case GNUSTO_EFFECT_GETCURSOR:
       case GNUSTO_EFFECT_PRINTTABLE:
--- a/trivial-zui.js	Fri May 16 00:13:16 2008 -0700
+++ b/trivial-zui.js	Fri May 16 00:35:06 2008 -0700
@@ -143,6 +143,10 @@
       self._console.moveTo(x - 1, y - 1);
     },
 
+    onSetBufferMode: function(flag) {
+      // TODO: How to emulate non-word wrapping in HTML?
+    },
+
     onSplitWindow: function(numlines) {
       if (numlines == 0) {
         self._console.close();