diff options
| author | Johannes Schickel | 2011-04-17 17:30:44 +0200 |
|---|---|---|
| committer | Johannes Schickel | 2011-04-17 20:58:08 +0200 |
| commit | 3fd919060ca6bbf896680f3548bfaac020900d42 (patch) | |
| tree | b8d96772e727cb8932c54987d296a4baf93fe087 /graphics/fonts | |
| parent | 41586398abb45c6e0551da729471c4215299d131 (diff) | |
| download | scummvm-rg350-3fd919060ca6bbf896680f3548bfaac020900d42.tar.gz scummvm-rg350-3fd919060ca6bbf896680f3548bfaac020900d42.tar.bz2 scummvm-rg350-3fd919060ca6bbf896680f3548bfaac020900d42.zip | |
GRPAHICS: Do not access Surface::bytesPerPixel anymore.
Diffstat (limited to 'graphics/fonts')
| -rw-r--r-- | graphics/fonts/scummfont.cpp | 4 | ||||
| -rw-r--r-- | graphics/fonts/winfont.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp index 87078e1475..3b1d30d1a2 100644 --- a/graphics/fonts/scummfont.cpp +++ b/graphics/fonts/scummfont.cpp @@ -302,9 +302,9 @@ void ScummFont::drawChar(Surface *dst, byte chr, int tx, int ty, uint32 color) c } c = ((buffer & mask) != 0); if (c) { - if (dst->bytesPerPixel == 1) + if (dst->format.bytesPerPixel == 1) ptr[x] = color; - else if (dst->bytesPerPixel == 2) + else if (dst->format.bytesPerPixel == 2) ((uint16 *)ptr)[x] = color; } } diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 12509fd9e1..a01c93afac 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -320,7 +320,7 @@ bool WinFont::loadFromFNT(Common::SeekableReadStream &stream) { void WinFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const { assert(dst); - assert(dst->bytesPerPixel == 1 || dst->bytesPerPixel == 2 || dst->bytesPerPixel == 4); + assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4); assert(_glyphs); GlyphEntry &glyph = _glyphs[characterToIndex(chr)]; @@ -328,11 +328,11 @@ void WinFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const for (uint16 i = 0; i < _pixHeight; i++) { for (uint16 j = 0; j < glyph.charWidth; j++) { if (glyph.bitmap[j + i * glyph.charWidth]) { - if (dst->bytesPerPixel == 1) + if (dst->format.bytesPerPixel == 1) *((byte *)dst->getBasePtr(x + j, y + i)) = color; - else if (dst->bytesPerPixel == 2) + else if (dst->format.bytesPerPixel == 2) *((uint16 *)dst->getBasePtr(x + j, y + i)) = color; - else if (dst->bytesPerPixel == 4) + else if (dst->format.bytesPerPixel == 4) *((uint32 *)dst->getBasePtr(x + j, y + i)) = color; } } |
