diff options
Diffstat (limited to 'graphics/fonts/winfont.cpp')
-rw-r--r-- | graphics/fonts/winfont.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 12509fd9e1..7db9a233f6 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -24,8 +24,11 @@ #include "common/file.h" #include "common/str.h" +#include "common/stream.h" +#include "common/textconsole.h" #include "common/winexe_ne.h" #include "common/winexe_pe.h" +#include "graphics/surface.h" #include "graphics/fonts/winfont.h" namespace Graphics { @@ -320,7 +323,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 +331,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; } } |