diff options
author | Kamil Zbróg | 2013-10-28 00:06:21 +0000 |
---|---|---|
committer | Kamil Zbróg | 2013-10-28 00:06:21 +0000 |
commit | 84784add6811aa1b285b70e139d0bdf9738c858c (patch) | |
tree | a957560ff8dd49d1826cfa8e01fd835270423324 /engines/prince/font.cpp | |
parent | 5357724657bff809b10b1f2bfe8547d1b53d6dcb (diff) | |
download | scummvm-rg350-84784add6811aa1b285b70e139d0bdf9738c858c.tar.gz scummvm-rg350-84784add6811aa1b285b70e139d0bdf9738c858c.tar.bz2 scummvm-rg350-84784add6811aa1b285b70e139d0bdf9738c858c.zip |
PRINCE: midi music player added. mob and object lists added
Diffstat (limited to 'engines/prince/font.cpp')
-rw-r--r-- | engines/prince/font.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/prince/font.cpp b/engines/prince/font.cpp index 8c72f1b912..aac790dfe0 100644 --- a/engines/prince/font.cpp +++ b/engines/prince/font.cpp @@ -46,7 +46,6 @@ bool Font::load(Common::SeekableReadStream &stream) { } int Font::getFontHeight() const { - debug("Font::getFontHeight %d", _fontData[5]); return _fontData[5]; } @@ -70,15 +69,20 @@ int Font::getCharWidth(byte chr) const { return getChrData(chr)._width; } -void Font::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const { +void Font::drawChar(Graphics::Surface *dst, byte chr, int posX, int posY, uint32 color) const { const ChrData chrData = getChrData(chr); - const byte *src = chrData._pixels; - byte *target = (byte *)dst->getBasePtr(x, y); - for (int i = 0; i < chrData._height; i++) { - memcpy(target, src, chrData._width); - src += chrData._width; - target += dst->pitch; + for (int y = 0; y < chrData._height; ++y) { + for (int x = 0; x < chrData._width; ++x) { + byte d = chrData._pixels[x + (chrData._width * y)]; + if (d == 0) d = 255; + else if (d == 1) d = 0; + else if (d == 2) d = color; + else if (d == 3) d = 0; + if (d != 255) { + *(byte*)dst->getBasePtr(posX + x, posY + y) = d; + } + } } } |