diff options
author | Martin Kiewitz | 2010-09-26 18:23:53 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-09-26 18:23:53 +0000 |
commit | cd6aa62702461eb9a7907431f86fa3fd66435a18 (patch) | |
tree | b38cd8eda8b00944d651b35c546863d6fa13fbf0 /engines | |
parent | 432b7b25d9702544a119f9f6d432ea6950027f49 (diff) | |
download | scummvm-rg350-cd6aa62702461eb9a7907431f86fa3fd66435a18.tar.gz scummvm-rg350-cd6aa62702461eb9a7907431f86fa3fd66435a18.tar.bz2 scummvm-rg350-cd6aa62702461eb9a7907431f86fa3fd66435a18.zip |
SCI: adding separate status drawing code
now also draws "IV" in KQ4 correctly. This wasn't the case before because we reused the regular drawing code, which would see the 0xA ("IV") as linebreak
save for backport
svn-id: r52913
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/menu.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/text16.cpp | 26 | ||||
-rw-r--r-- | engines/sci/graphics/text16.h | 1 |
3 files changed, 28 insertions, 1 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 630626c128..06470bc560 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -905,7 +905,7 @@ void GfxMenu::kernelDrawStatus(const char *text, int16 colorPen, int16 colorBack _paint16->fillRect(_ports->_menuBarRect, 1, colorBack); _ports->penColor(colorPen); _ports->moveTo(0, 1); - _text16->Draw_String(text); + _text16->Draw_Status(text); _paint16->bitsShow(_ports->_menuBarRect); _ports->setPort(oldPort); } diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index c2c2a3fc46..3fba3006c7 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -491,6 +491,32 @@ void GfxText16::Draw_String(const char *text) { _ports->penColor(previousPenColor); } +// we need to have a separate status drawing code +// In KQ4 the IV char is actually 0xA, which would otherwise get considered as linebreak and not printed +void GfxText16::Draw_Status(const char *text) { + uint16 curChar, charWidth; + uint16 textLen = strlen(text); + Common::Rect rect; + + GetFont(); + if (!_font) + return; + + rect.top = _ports->_curPort->curTop; + rect.bottom = rect.top + _ports->_curPort->fontHeight; + while (textLen--) { + curChar = (*(const byte *)text++); + switch (curChar) { + case 0: + break; + default: + charWidth = _font->getCharWidth(curChar); + _font->draw(curChar, _ports->_curPort->top + _ports->_curPort->curTop, _ports->_curPort->left + _ports->_curPort->curLeft, _ports->_curPort->penClr, _ports->_curPort->greyedOutput); + _ports->_curPort->curLeft += charWidth; + } + } +} + // Sierra did this in their PC98 interpreter only, they identify a text as being // sjis and then switch to font 900 bool GfxText16::SwitchToFont900OnSjis(const char *text) { diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index d84468ced2..dc3ed2f62b 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -64,6 +64,7 @@ public: void Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor); void Box(const char *text, int16 bshow, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId); void Draw_String(const char *text); + void Draw_Status(const char *text); GfxFont *_font; |