aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/print.cpp
diff options
context:
space:
mode:
authorBertrand Augereau2011-12-05 00:37:19 +0100
committerBertrand Augereau2011-12-05 00:37:19 +0100
commit3d4aa7ea327979804851e612c416f0ca037e4684 (patch)
treecc5c1afa187cd4fe1698d98aa9c7dd5a350597e4 /engines/dreamweb/print.cpp
parent65b2bfe8a138aa3aa3cc7f7a805ff2806a063b93 (diff)
downloadscummvm-rg350-3d4aa7ea327979804851e612c416f0ca037e4684.tar.gz
scummvm-rg350-3d4aa7ea327979804851e612c416f0ca037e4684.tar.bz2
scummvm-rg350-3d4aa7ea327979804851e612c416f0ca037e4684.zip
DREAMWEB: Cleanup in 'getNumber'
Diffstat (limited to 'engines/dreamweb/print.cpp')
-rw-r--r--engines/dreamweb/print.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index 0127161e91..3a6b69d2e8 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -179,31 +179,30 @@ 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
- ax = totalWidth + wordTotalWidth - 10;
- if (ax < maxWidth) {
+ if (tmp < maxWidth) {
totalWidth += wordTotalWidth;
charCount += wordCharCount;
}
if (centered) {
- ax = (maxWidth & 0xfe) + 2 + 20 - totalWidth;
- ax /= 2;
+ tmp = (maxWidth & 0xfe) + 2 + 20 - totalWidth;
+ tmp /= 2;
} else {
- ax = 0;
+ tmp = 0;
}
- *offset += ax;
+ *offset += tmp;
return charCount;
}
- ax = totalWidth + wordTotalWidth - 10;
- if (ax >= maxWidth) { //gotoverend
+ if (tmp >= maxWidth) { //gotoverend
if (centered) {
- ax = (maxWidth & 0xfe) - totalWidth + 20;
- ax /= 2;
+ tmp = (maxWidth & 0xfe) - totalWidth + 20;
+ tmp /= 2;
} else {
- ax = 0;
+ tmp = 0;
}
- *offset += ax;
+ *offset += tmp;
return charCount;
}
totalWidth += wordTotalWidth;