aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-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;