diff options
author | Bertrand Augereau | 2011-12-05 00:11:52 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-12-05 00:14:39 +0100 |
commit | 2b2f4a90a6ec9421acd3d6dd96ccca1f4100c627 (patch) | |
tree | 38e38c78f080ae4c7a8aa3b486820b2bea685b51 /engines/dreamweb/print.cpp | |
parent | 07633d0c8b49d194291cfbd0a6256e92e8a592ae (diff) | |
download | scummvm-rg350-2b2f4a90a6ec9421acd3d6dd96ccca1f4100c627.tar.gz scummvm-rg350-2b2f4a90a6ec9421acd3d6dd96ccca1f4100c627.tar.bz2 scummvm-rg350-2b2f4a90a6ec9421acd3d6dd96ccca1f4100c627.zip |
Revert "DREAMWEB: Cleanup"
This reverts commit 5871a6943fa0a07bae81482ed96448cd3763af08.
Diffstat (limited to 'engines/dreamweb/print.cpp')
-rw-r--r-- | engines/dreamweb/print.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 528b897b60..dce5fc76be 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -171,6 +171,12 @@ uint8 DreamGenContext::printDirect(const uint8** string, uint16 x, uint16 *y, ui } } +void DreamGenContext::getNumber() { + uint16 offset = di; + cl = getNumber((Frame *)ds.ptr(0, 0), es.ptr(si, 0), dl, (bool)(dl & 1), &offset); + di = offset; +} + uint8 DreamGenContext::getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16* offset) { uint8 totalWidth = 0; uint8 charCount = 0; @@ -179,30 +185,31 @@ uint8 DreamGenContext::getNumber(const Frame *charSet, const uint8 *string, uint uint8 done = getNextWord(charSet, string, &wordTotalWidth, &wordCharCount); string += wordCharCount; - uint16 tmp = totalWidth + wordTotalWidth - 10; if (done == 1) { //endoftext - if (tmp < maxWidth) { + ax = totalWidth + wordTotalWidth - 10; + if (ax < maxWidth) { totalWidth += wordTotalWidth; charCount += wordCharCount; } if (centered) { - tmp = (maxWidth & 0xfe) + 2 + 20 - totalWidth; - tmp /= 2; + ax = (maxWidth & 0xfe) + 2 + 20 - totalWidth; + ax /= 2; } else { - tmp = 0; + ax = 0; } *offset += ax; return charCount; } - if (tmp >= maxWidth) { //gotoverend + ax = totalWidth + wordTotalWidth - 10; + if (ax >= maxWidth) { //gotoverend if (centered) { - tmp = (maxWidth & 0xfe) - totalWidth + 20; - tmp /= 2; + ax = (maxWidth & 0xfe) - totalWidth + 20; + ax /= 2; } else { - tmp = 0; + ax = 0; } - *offset += tmp; + *offset += ax; return charCount; } totalWidth += wordTotalWidth; |