aboutsummaryrefslogtreecommitdiff
path: root/graphics/font.cpp
diff options
context:
space:
mode:
authorMax Horn2005-01-08 18:11:29 +0000
committerMax Horn2005-01-08 18:11:29 +0000
commitc257460bc5474da6ce87da2191ed77f4de76a764 (patch)
tree17fd8e1c19396d143b9776bef45b74de700e5ef0 /graphics/font.cpp
parent123b4772eff2d5e75709e82f26a2aaa66a71aac8 (diff)
downloadscummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.tar.gz
scummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.tar.bz2
scummvm-rg350-c257460bc5474da6ce87da2191ed77f4de76a764.zip
Fix bug #1098115 (GUI: Broken console font)
svn-id: r16488
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r--graphics/font.cpp12
1 files changed, 4 insertions, 8 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)