aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts/bdf.cpp
diff options
context:
space:
mode:
authorNarek Mailian2013-07-07 18:58:25 +0200
committerNarek Mailian2013-08-08 08:27:11 +0200
commitece8b7fb65402238ab7df896361a9cefe28b8897 (patch)
tree6a5519ae874e7831d44604b1585bd2e86226aa17 /graphics/fonts/bdf.cpp
parent1d40dca7a0446aad81380c7c207461b18b79428d (diff)
downloadscummvm-rg350-ece8b7fb65402238ab7df896361a9cefe28b8897.tar.gz
scummvm-rg350-ece8b7fb65402238ab7df896361a9cefe28b8897.tar.bz2
scummvm-rg350-ece8b7fb65402238ab7df896361a9cefe28b8897.zip
GRAPHICS: Fix fonts/bdf.cpp to allow for 32bpp to be used
Diffstat (limited to 'graphics/fonts/bdf.cpp')
-rw-r--r--graphics/fonts/bdf.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index 6d4befa37c..e523a36ad5 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -102,7 +102,7 @@ void BdfFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const
// equal to 50 and the decision of the theme designer?
// asserting _data.maxAdvance <= 50: let the theme designer decide what looks best
assert(_data.maxAdvance <= 50);
- assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2);
+ assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4);
const int idx = mapToIndex(chr);
if (idx < 0)
@@ -165,6 +165,8 @@ void BdfFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const
drawCharIntern<byte>(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color);
else if (dst->format.bytesPerPixel == 2)
drawCharIntern<uint16>(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color);
+ else if (dst->format.bytesPerPixel == 4)
+ drawCharIntern<uint32>(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color);
}
namespace {