ifrotz / iosfrotz

Frotz for iOS source (formerly at code.google.com/p/iphonefrotz)
Other
49 stars 17 forks source link

Real time (timed) text output does not get printed #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[Created from email correspondence with esteb...@gmail.com

I'm developping a real-time piece of interactive fiction. I've only developed 
libraries so far :(. A real-time piece of IF implies that text can get printed 
on the screen without the player pressing the enter key. I wrote a test gblorb 
and ran it with both zoom and gargoyle, under glulxe and git. It works in zoom 
(with both interpreters), but not in gargoyle. Text gets autonomously printed 
on the screen (or not) via the handleGlkEvent routine. Is it possible to fix 
this ? I tried running my game with ifrotz, and if i remember well, text 
wouldn't get printed (like in gargoyle).

[See gblorb attached to ifrotz email message entitled "issue 146: 1st gen 
iphone with 3.1.3 iOS."]

@EM: I'll attach the file here if you give me permission, but that would make 
it publicly visible so I thought I should ask.

Original issue reported on code.google.com by ifr...@gmail.com on 3 Apr 2011 at 8:53

GoogleCodeExporter commented 9 years ago
yes of course, go ahead.

Original comment by esteban....@gmail.com on 4 Apr 2011 at 3:05

GoogleCodeExporter commented 9 years ago

Original comment by ifr...@gmail.com on 4 Apr 2011 at 3:15

Attachments:

GoogleCodeExporter commented 9 years ago
It is illegal according to the glk spec to print to a window which has a 
pending line or character input request.  You should cancel the request before 
printing output, and then re-request after.
This is I believe why the text isn't getting printed.
The spec doesn't say what an interpreter should do when a game tries to print 
anyway, and Gargoyle and glkterm (which is what I initially based Frotz's glk 
support on) ignore the output.  I may go ahead and make it print anyway, 
because yours isn't the only game I've run into to make this mistake.

If you get a chance to try out the cancel suggestion, please let me know if it 
works.

Original comment by spath...@gmail.com on 24 May 2011 at 6:41

GoogleCodeExporter commented 9 years ago
I've made Frotz print anyway and auto-cancel the input request when this 
happens.
This makes the game work, although you still should fix the source.

Original comment by spath...@gmail.com on 9 Jun 2011 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by spath...@gmail.com on 9 Jun 2011 at 11:42

GoogleCodeExporter commented 9 years ago
To re-request line event in main window:
   (-  glk_request_line_event(gg_mainwin, buffer + WORDSIZE, INPUT_BUFFER_LEN - WORDSIZE, buffer-->0); -)

To cancel line input in the/-- main-window:
   (- glk_cancel_line_event(gg_mainwin, gg_event); buffer-->0 = gg_event-->2; -)

source:http://www.intfiction.org/forum/viewtopic.php?p=8116#p8116

it works well although there is some problem with Gargoyle about it : each time 
i cancel/re-request the line input, a newline char gets printed. (other terps 
are fine). mmhh ...
Anyway thanks for getting involved in that particular problem.

Original comment by esteban....@gmail.com on 10 Jun 2011 at 11:55