aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/exe.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-28 21:36:24 -0700
committerPaul Gilbert2019-07-06 15:27:08 -0700
commitae6ae33bed6ce27603c9f4d952010fb63498ea66 (patch)
tree8163ed5918fe0fb72d686b7c8b0b5c0dff479ede /engines/glk/alan3/exe.cpp
parentb8a737a8a4d0ec723f04da39649548d4ded807ed (diff)
downloadscummvm-rg350-ae6ae33bed6ce27603c9f4d952010fb63498ea66.tar.gz
scummvm-rg350-ae6ae33bed6ce27603c9f4d952010fb63498ea66.tar.bz2
scummvm-rg350-ae6ae33bed6ce27603c9f4d952010fb63498ea66.zip
GLK: ALAN3: Fix setup and outputing of text data
Diffstat (limited to 'engines/glk/alan3/exe.cpp')
-rw-r--r--engines/glk/alan3/exe.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp
index 34c9c615d9..5c6f09b2b7 100644
--- a/engines/glk/alan3/exe.cpp
+++ b/engines/glk/alan3/exe.cpp
@@ -50,10 +50,12 @@
namespace Glk {
namespace Alan3 {
-/* PUBLIC DATA */
-
+// PUBLIC DATA
Common::SeekableReadStream *textFile;
+// PUBLIC DATA - formerly method statics
+bool printFlag; // Printing already?
+
/* Long jump buffers */
// TODO move to longjump.c? or error.c, and abstract them into functions?
//jmp_buf restartLabel; /* Restart long jump return point */
@@ -94,7 +96,6 @@ void print(Aword fpos, Aword len) {
int ch = 0;
int i;
long savfp = 0; /* Temporary saved text file position */
- static bool printFlag = FALSE; /* Printing already? */
bool savedPrintFlag = printFlag;
void *info = NULL; /* Saved decoding info */
@@ -126,9 +127,10 @@ void print(Aword fpos, Aword len) {
else
ch = textFile->readByte();
+ if (ch == EOFChar)
+ break; // Or end of text?
+
str[i] = ch;
- if (textFile->pos() >= textFile->size()) /* Or end of text? */
- break;
}
str[i] = '\0';