From 3d4aa7ea327979804851e612c416f0ca037e4684 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Mon, 5 Dec 2011 00:37:19 +0100 Subject: DREAMWEB: Cleanup in 'getNumber' --- engines/dreamweb/print.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'engines/dreamweb/print.cpp') 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; -- cgit v1.2.3