aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/file.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2010-08-18 16:14:38 +0000
committerArnaud Boutonné2010-08-18 16:14:38 +0000
commitfa41f9ffd05a97c90a59fb629a7b6e61abf231fa (patch)
tree023165eae292ff3bc78ae87bcdde45d54a17e494 /engines/hugo/file.cpp
parentfc94562c771a528ba6be57504c9bc097cac9d426 (diff)
downloadscummvm-rg350-fa41f9ffd05a97c90a59fb629a7b6e61abf231fa.tar.gz
scummvm-rg350-fa41f9ffd05a97c90a59fb629a7b6e61abf231fa.tar.bz2
scummvm-rg350-fa41f9ffd05a97c90a59fb629a7b6e61abf231fa.zip
Hugo - Check double F1, display properly the content of help.dat if present
svn-id: r52189
Diffstat (limited to 'engines/hugo/file.cpp')
-rw-r--r--engines/hugo/file.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 487f331039..f4838e7320 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -908,25 +908,27 @@ void FileManager::readUIFItem(int16 id, byte *buf) {
void FileManager::instructions() {
// Simple instructions given when F1 pressed twice in a row
// Only in DOS versions
-#define HELPFILE "help.dat"
-#define EOP '#' /* Marks end of a page in help file */
Common::File f;
char line[1024], *wrkLine;
char readBuf[2];
wrkLine = line;
- if (!f.open(UIF_FILE))
- Utils::Error(FILE_ERR, HELPFILE);
+ if (!f.open(HELPFILE)) {
+ warning("help.dat not found");
+ return;
+ }
while (f.read(readBuf, 1)) {
wrkLine[0] = readBuf[0];
+ wrkLine++;
do {
f.read(wrkLine, 1);
} while (*wrkLine++ != EOP);
wrkLine[-2] = '\0'; /* Remove EOP and previous CR */
Utils::Box(BOX_ANY, line);
- f.read(wrkLine, 1); /* Remove CR after EOP */
+ wrkLine = line;
+ f.read(readBuf, 2); /* Remove CRLF after EOP */
}
f.close();
}