From eb27307c12e476e7f765050bf002b0a01e5199d2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 13 Nov 2008 11:20:43 +0000 Subject: minor tweaks svn-id: r35036 --- graphics/font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'graphics/font.cpp') diff --git a/graphics/font.cpp b/graphics/font.cpp index 908c79c9a2..34b1b13581 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -51,11 +51,12 @@ int NewFont::getCharWidth(byte chr) const { template void drawCharIntern(byte *ptr, uint pitch, const bitmap_t *src, int h, int minX, int maxX, const PixelType color) { + const bitmap_t maxXMask = ~((1 << (16-maxX)) - 1); while (h-- > 0) { bitmap_t buffer = READ_UINT16(src); src++; - buffer &= ~((1 << (16-maxX)) - 1); + buffer &= maxXMask; buffer <<= minX; PixelType *tmp = (PixelType *)ptr; while (buffer != 0) { -- cgit v1.2.3