Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.ruhr-uni-bochum.de!news.rwth-aachen.de!uni-paderborn.de!golden-gate.owl.de!fu-berlin.de!news.belwue.de!swidir.switch.ch!surfnet.nl!howland.erols.net!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Re: [z-machine] Redrawing the upper window?
Message-ID: <erkyrathDzzv5L.C2L@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <552fsu$e4a@news.kth.se>
Date: Mon, 28 Oct 1996 16:29:45 GMT
Lines: 54
Sender: erkyrath@netcom.netcom.com

Anders Ekelund (t91_eks@t.kth.se) wrote:
> If I have understood the specifiction of the z-machine correctly, it is 
> legal for an interpreter to change the screen dimensions whenever it 
> likes to, as long as it writes the new size to the appropriate places in 
> the header.

I don't think it's the best idea, though. While standard library Inform 
games *do* notice the change, and redraw the upper window differently, 
they can't notice it until a turn is passed. (Because DrawStatusWindow is 
called just before a line of text is input, not *while* text is being 
input.)

This is the reason for the oft-complained-about setup of MaxZip, in two 
windows. The user can resize one but not the other.

> The results of this arent always pleasing, however. While most games 
> seems to notice this change and for example prints the time/score in a 
> new position, they dont redraw the entire upper window. This often 
> leaves trails of old information that doesnt look very pretty.
> So, is there a way for the interpreter to tell the V3-V5 game that it 
> should redraw the entire upper window, or can the problem be solved in 
> another way? (Or have I completely misunderstood the whole thing?)

You could improve the Inform library in the following way: store the old 
status window width in a variable, and check during DrawStatusLine to see 
if the current width has changed. If so, clear the status window before 
redrawing it.

This still leaves the window not being redrawn correctly until a turn has 
passed. 

You could also write the interpreter to clear the status window whenever 
it changes width, but then it'll actually be blank until a turn has 
passed. 

I don't believe there is any way to get the status line redrawn during a 
@read call. (Ok, unless you do a timed @read and check the width every 
tenth of a second. This is probably dumb.) There was a tentative proposal 
at one point to add an "interrupt" callback to the spec, which gets 
called whenever the screen changes size. I don't believe anyone tried 
mplementing it.

Frankly I think interpreters should not change the logical status window 
size. If the actual native window gets bigger, shift the status "window" 
over so that it's centered in the actual window. If the actual window 
gets smaller, clip the edges off the status window so that the user knows 
not to do that. :-) 

--Z

-- 

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
