From ece8b7fb65402238ab7df896361a9cefe28b8897 Mon Sep 17 00:00:00 2001 From: Narek Mailian Date: Sun, 7 Jul 2013 18:58:25 +0200 Subject: GRAPHICS: Fix fonts/bdf.cpp to allow for 32bpp to be used --- graphics/fonts/bdf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'graphics/fonts/bdf.cpp') 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(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color); else if (dst->format.bytesPerPixel == 2) drawCharIntern(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color); + else if (dst->format.bytesPerPixel == 4) + drawCharIntern(ptr, dst->pitch, src, height, originalWidth, xStart, xEnd, color); } namespace { -- cgit v1.2.3