diff options
author | Strangerke | 2013-07-20 10:51:42 +0200 |
---|---|---|
committer | Strangerke | 2013-07-20 18:59:46 +0200 |
commit | 7fbdf23dc812cfdc08cc9ef84675122847b91c44 (patch) | |
tree | f965c37d63610990d2dfb96af1246edb7d56e616 /engines | |
parent | d5b10f7dd405ecb9039e1d04a54bd935c1c44134 (diff) | |
download | scummvm-rg350-7fbdf23dc812cfdc08cc9ef84675122847b91c44.tar.gz scummvm-rg350-7fbdf23dc812cfdc08cc9ef84675122847b91c44.tar.bz2 scummvm-rg350-7fbdf23dc812cfdc08cc9ef84675122847b91c44.zip |
MORTEVIELLE: Simplify drawString code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mortevielle/graphics.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index e94e1ce7a3..cf15b07ccc 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -1079,43 +1079,38 @@ void ScreenSurface::drawString(const Common::String &l, int command) { _vm->_mouse.hideMouse(); Common::Point pt = _textPos; - int i; + int charWidth; if (_vm->_resolutionScaler == 2) - i = 6; + charWidth = 6; else - i = 10; + charWidth = 10; - int x = pt.x + i * l.size(); + int x = pt.x + charWidth * l.size(); int color = 0; switch (command) { + case 0: + case 2: + color = 15; + _vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7)); + break; case 1: - case 3: { - color = 0; + case 3: _vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7)); - } - break; - case 4: - color = 0; break; case 5: color = 15; break; - case 0: - case 2: { - color = 15; - _vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7)); - } - break; default: + // Default: Color set to zero (already done) break; } pt.x += 1; pt.y += 1; - for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) { + for (x = 1; (x <= l.size()) && (l[x - 1] != 0); ++x) { _vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), color); - pt.x += i; + pt.x += charWidth; } _vm->_mouse.showMouse(); } |