aboutsummaryrefslogtreecommitdiff
path: root/graphics/font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r--graphics/font.cpp3
1 files changed, 2 insertions, 1 deletions
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 <typename PixelType>
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) {