diff options
author | Benjamin Haisch | 2008-08-13 11:38:31 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-20 22:43:05 +0100 |
commit | 98ac7885acb82ae77b6eccbf2380d4326f758f28 (patch) | |
tree | 58a47149cc94de0a87da613407d06a409267ccdd /engines/toltecs | |
parent | f0c9e489feeed8df564e5eadb32a730ec21e35ba (diff) | |
download | scummvm-rg350-98ac7885acb82ae77b6eccbf2380d4326f758f28.tar.gz scummvm-rg350-98ac7885acb82ae77b6eccbf2380d4326f758f28.tar.bz2 scummvm-rg350-98ac7885acb82ae77b6eccbf2380d4326f758f28.zip |
TOLTECS: Merged drawChar and drawChar2
Diffstat (limited to 'engines/toltecs')
-rw-r--r-- | engines/toltecs/screen.cpp | 46 | ||||
-rw-r--r-- | engines/toltecs/screen.h | 4 |
2 files changed, 9 insertions, 41 deletions
diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp index 2ef4040fe8..7bee7da02f 100644 --- a/engines/toltecs/screen.cpp +++ b/engines/toltecs/screen.cpp @@ -799,7 +799,8 @@ void Screen::drawTalkTextItems() { if (ch == 0x20) { x += font.getWidth(); } else { - drawChar2(font, _frontScreen, x, item->rects[j].y, ch, item->color); + //drawChar2(font, _frontScreen, x, item->rects[j].y, ch, item->color); + drawChar(font, _frontScreen, x, item->rects[j].y, ch, item->color, true); x += font.getCharWidth(ch) + font.getSpacing() - 1; } } @@ -891,7 +892,8 @@ void Screen::drawString(int16 x, int16 y, byte fontColor1, byte fontColor2, uint if (ch <= 0x20) { x += font.getWidth(); } else { - drawChar(font, _frontScreen, x + 1, y + _vm->_cameraHeight - yadd, ch, color); + //drawChar(font, _frontScreen, x + 1, y + _vm->_cameraHeight - yadd, ch, color); + drawChar(font, _frontScreen, x + 1, y + _vm->_cameraHeight - yadd, ch, color, false); x += font.getCharWidth(ch) + font.getSpacing() - 1; yadd = -yadd; } @@ -899,9 +901,7 @@ void Screen::drawString(int16 x, int16 y, byte fontColor1, byte fontColor2, uint } -// TODO: Merge drawChar and drawChar2 - -void Screen::drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color) { +void Screen::drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color, bool outline) { int16 charWidth, charHeight; byte *charData; @@ -919,43 +919,13 @@ void Screen::drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, b byte flags = charData[0] & 0xF0; charData++; lineWidth -= count; - if (!(flags & 0x80) && (flags & 0x10)) { - memset(dest, color, count); - } - dest += count; - } - dest += 640 - charWidth; - } - -} - -void Screen::drawChar2(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color) { - - int16 charWidth, charHeight; - byte *charData; - - dest += x + (y * 640); - - charWidth = font.getCharWidth(ch); - charHeight = font.getHeight() - 2; - charData = font.getCharData(ch); - - while (charHeight--) { - byte lineWidth = charWidth; - while (lineWidth > 0) { - byte count = charData[0] & 0x0F; - byte flags = charData[0] & 0xF0; - charData++; - lineWidth -= count; - if ((flags & 0x80) == 0) { - if ((flags & 0x10) == 0) { - memset(dest, 0, count); - } else { + if (flags & 0x10) { memset(dest, color, count); + } else if (outline) { + memset(dest, 0, count); } } - dest += count; } dest += 640 - charWidth; diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h index c34f44dfa8..9ee5b862d9 100644 --- a/engines/toltecs/screen.h +++ b/engines/toltecs/screen.h @@ -324,9 +324,7 @@ public: void printText(byte *textData); void preprocessText(uint fontResIndex, int maxWidth, int &width, byte *&sourceString, byte *&destString, byte &len); void drawString(int16 x, int16 y, byte fontColor1, byte fontColor2, uint fontResIndex); - void drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color); - void drawChar2(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color); - + void drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, byte color, bool outline); void saveState(Common::WriteStream *out); void loadState(Common::ReadStream *in); |