diff options
author | Bertrand Augereau | 2011-07-23 18:22:37 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-07-23 18:23:40 +0200 |
commit | 08e407bbe5823110d6d821520bb883a7bb5f9e31 (patch) | |
tree | c3d276d2b1cb054e16f2e6f2bfc4d0dbaec8f074 | |
parent | 402e41dd676dc33e147afa03a95e6aecb1c82bbe (diff) | |
download | scummvm-rg350-08e407bbe5823110d6d821520bb883a7bb5f9e31.tar.gz scummvm-rg350-08e407bbe5823110d6d821520bb883a7bb5f9e31.tar.bz2 scummvm-rg350-08e407bbe5823110d6d821520bb883a7bb5f9e31.zip |
DREAMWEB: 'printdirect' has a C++ signature
-rw-r--r-- | engines/dreamweb/stubs.cpp | 53 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
2 files changed, 22 insertions, 32 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1a14319e7a..45bc7b2bfa 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -393,37 +393,33 @@ uint8 DreamGenContext::printslow(uint16 x, uint16 y, uint8 maxWidth, bool center } void DreamGenContext::printdirect() { - data.word(kLastxpos) = di; + uint16 y = bx; + printdirect(di, &y, dl, (bool)(dl & 1)); + bx = y; +} + +void DreamGenContext::printdirect(uint16 x, uint16 *y, uint8 maxWidth, bool centered) { + data.word(kLastxpos) = x; ds = data.word(kCurrentset); while (true) { - push(bx); - push(di); - push(dx); - uint16 offset; - uint8 charCount = getnumber(si, dl, (bool)(dl & 1), &offset); - di = offset; - uint16 x = di; + uint16 offset = x; + uint8 charCount = getnumber(si, maxWidth, centered, &offset); + uint16 i = offset; do { - ax = es.word(si); + uint8 c = es.byte(si); ++si; - if ((al == 0) || (al == ':')) { - dx = pop(); - di = pop(); - bx = pop(); + if ((c == 0) || (c == ':')) { return; } - push(es); - al = engine->modifyChar(al); + c = engine->modifyChar(c); uint8 width, height; - printchar(es, ds, &x, bx, al, &width, &height); - data.word(kLastxpos) = x; + push(es); + printchar(es, ds, &i, *y, c, &width, &height); es = pop(); + data.word(kLastxpos) = i; --charCount; } while(charCount); - dx = pop(); - di = pop(); - bx = pop(); - bx += data.word(kLinespacing); + *y += data.word(kLinespacing); } } @@ -436,13 +432,10 @@ void DreamGenContext::getnumber() { uint8 DreamGenContext::getnumber(uint16 index, uint16 maxWidth, bool centered, uint16* offset) { uint8 totalWidth = 0; uint8 charCount = 0; - push(di); - di = index; - *offset = index; while (true) { uint8 wordTotalWidth, wordCharCount; - uint8 done = getnextword(es.ptr(di, 0), &wordTotalWidth, &wordCharCount); - di += wordCharCount; + uint8 done = getnextword(es.ptr(index, 0), &wordTotalWidth, &wordCharCount); + index += wordCharCount; if (done == 1) { //endoftext ax = totalWidth + wordTotalWidth - 10; @@ -457,9 +450,7 @@ uint8 DreamGenContext::getnumber(uint16 index, uint16 maxWidth, bool centered, u } else { ax = 0; } - di = pop(); - di += ax; - *offset = di; + *offset += ax; return charCount; } ax = totalWidth + wordTotalWidth - 10; @@ -470,9 +461,7 @@ uint8 DreamGenContext::getnumber(uint16 index, uint16 maxWidth, bool centered, u } else { ax = 0; } - di = pop(); - di += ax; - *offset = di; + *offset += ax; return charCount; } totalWidth += wordTotalWidth; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 9cbd3f33a6..64bcd2259c 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -44,6 +44,7 @@ void printchar(); void printchar(uint16 dst, uint16 src, uint16 *x, uint16 y, uint8 c, uint8 *width, uint8 *height); void printdirect(); + void printdirect(uint16 x, uint16 *y, uint8 maxWidth, bool centered); uint8 printslow(uint16 x, uint16 y, uint8 maxWidth, bool centered); void printslow(); void dumptextline(); |