changeset 35:be2a410b8518

Added docs for onEraseWindow(), changed implementation to match.
author Atul Varma <varmaa@toolness.com>
date Tue, 13 May 2008 22:33:20 -0700
parents cf2303c41d8c
children afa332a44721
files engine-runner.js trivial-zui.js
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/engine-runner.js	Tue May 13 22:18:32 2008 -0700
+++ b/engine-runner.js	Tue May 13 22:33:20 2008 -0700
@@ -20,6 +20,12 @@
     },
     onSetStyle: function(textStyle, foreground, background) {
     },
+
+    // From the Z-Machine spec for erase_window: Erases window with
+    // given number (to background colour); or if -1 it unsplits the
+    // screen and clears the lot; or if -2 it clears the screen
+    // without unsplitting it.
+
     onSplitWindow: function(window) {
     },
     onSetWindow: function(window) {
--- a/trivial-zui.js	Tue May 13 22:18:32 2008 -0700
+++ b/trivial-zui.js	Tue May 13 22:33:20 2008 -0700
@@ -102,7 +102,7 @@
         },
 
         onEraseWindow: function(window) {
-            if (window == 0) {
+            if (window <= 0) {
                 // TODO: Implement this better.
                 self.onPrint("\n\n\n\n\n\n\n\n\n\n");
             }