diff options
author | Willem Jan Palenstijn | 2011-11-19 19:17:04 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-19 19:17:04 +0100 |
commit | 90ecc195c1939a073d27c56fe27678764979650b (patch) | |
tree | 94eb5429b754178696e81ca80c7a0abc580dd886 /engines/dreamweb | |
parent | 049a0c25d73114f76bb2107c6211dd01306df131 (diff) | |
download | scummvm-rg350-90ecc195c1939a073d27c56fe27678764979650b.tar.gz scummvm-rg350-90ecc195c1939a073d27c56fe27678764979650b.tar.bz2 scummvm-rg350-90ecc195c1939a073d27c56fe27678764979650b.zip |
DREAMWEB: Clean up loop
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/print.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index f12d8ee311..3e305dccf3 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -246,18 +246,23 @@ const char *DreamGenContext::monprint(const char *string) { uint16 x = data.word(kMonadx); Frame *tempCharset = (Frame *)segRef(data.word(kTempcharset)).ptr(0, 0); const char *iterator = string; - while (true) { + bool done = false; + while (!done) { + uint16 count = getnumber(tempCharset, (const uint8 *)iterator, 166, false, &x); - do { + do { char c = *iterator++; if (c == ':') break; - if ((c == 0) || (c == 34) || (c == '=')) - goto finishmon; + if ((c == 0) || (c == '"') || (c == '=')) { + done = true; + break; + } if (c == '%') { data.byte(kLasttrigger) = *iterator; iterator += 2; - goto finishmon; + done = true; + break; } c = engine->modifyChar(c); printchar(tempCharset, &x, data.word(kMonady), c, 0, NULL, NULL); @@ -268,16 +273,13 @@ const char *DreamGenContext::monprint(const char *string) { vsync(); lockmon(); delcurs(); - --count; - } - while(count); + } while (--count); + x = data.word(kMonadx); scrollmonitor(); data.word(kCurslocx) = data.word(kMonadx); } -finishmon: - data.word(kCurslocx) = data.word(kMonadx); - scrollmonitor(); + data.byte(kKerning) = 0; return iterator; } |