diff options
| author | Max Horn | 2005-01-08 18:11:29 +0000 |
|---|---|---|
| committer | Max Horn | 2005-01-08 18:11:29 +0000 |
| commit | c257460bc5474da6ce87da2191ed77f4de76a764 (patch) | |
| tree | 17fd8e1c19396d143b9776bef45b74de700e5ef0 | |
| parent | 123b4772eff2d5e75709e82f26a2aaa66a71aac8 (diff) | |
| download | scummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.tar.gz scummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.tar.bz2 scummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.zip | |
Fix bug #1098115 (GUI: Broken console font)
svn-id: r16488
| -rw-r--r-- | graphics/font.cpp | 12 | ||||
| -rw-r--r-- | graphics/scummfont.cpp | 10 |
2 files changed, 7 insertions, 15 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp index f5a6135dff..1abaf4ac5d 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -38,7 +38,6 @@ int NewFont::getCharWidth(byte chr) const { void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const { assert(dst != 0); - byte *ptr = (byte *)dst->getBasePtr(tx, ty); assert(desc.bits != 0 && desc.maxwidth <= 16); @@ -56,18 +55,15 @@ void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 colo const bitmap_t *tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.height)); for (int y = 0; y < desc.height; y++, ptr += dst->pitch) { - const bitmap_t *buffer = 0; - buffer = tmp++; + const bitmap_t buffer = *tmp++; bitmap_t mask = 0x8000; if (ty + y < 0 || ty + y >= dst->h) continue; - - for (int x = 0; x < w; x++) { - mask >>= 1; - + + for (int x = 0; x < w; x++, mask >>= 1) { if (tx + x < 0 || tx + x >= dst->w) continue; - if ((*buffer & mask) != 0) { + if ((buffer & mask) != 0) { if (dst->bytesPerPixel == 1) ptr[x] = color; else if (dst->bytesPerPixel == 2) diff --git a/graphics/scummfont.cpp b/graphics/scummfont.cpp index 32935be6f8..5a004a7b37 100644 --- a/graphics/scummfont.cpp +++ b/graphics/scummfont.cpp @@ -20,7 +20,6 @@ #include "stdafx.h" #include "graphics/font.h" -#include "gui/newgui.h" namespace Graphics { @@ -65,7 +64,6 @@ int ScummFont::getCharWidth(byte chr) const { //void ScummFont::drawChar(byte chr, int xx, int yy, OverlayColor color) { void ScummFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const { assert(dst != 0); - byte *ptr = (byte *)dst->getBasePtr(tx, ty); const byte *tmp = guifont + 6 + guifont[4] + chr * 8; @@ -76,17 +74,15 @@ void ScummFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 co if (ty + y < 0 || ty + y >= dst->h) continue; for (int x = 0; x < 8; x++) { - mask >>= 1; - if (tx + x < 0 || tx + x >= dst->w) continue; - - + unsigned char c; + mask >>= 1; if (mask == 0) { buffer = *tmp++; mask = 0x80; } - const byte c = ((buffer & mask) != 0); + c = ((buffer & mask) != 0); if (c) { if (dst->bytesPerPixel == 1) ptr[x] = color; |
