diff options
author | Max Horn | 2005-01-06 21:15:52 +0000 |
---|---|---|
committer | Max Horn | 2005-01-06 21:15:52 +0000 |
commit | c6e0d31e76134fbdd3a1626aad9ed3e38f25afb3 (patch) | |
tree | 913925590e558d57670e21479d4853e6bb15447c /graphics/font.cpp | |
parent | f3b7c27cbdeb7f1801fa5ed34d2aa0b65454b72f (diff) | |
download | scummvm-rg350-c6e0d31e76134fbdd3a1626aad9ed3e38f25afb3.tar.gz scummvm-rg350-c6e0d31e76134fbdd3a1626aad9ed3e38f25afb3.tar.bz2 scummvm-rg350-c6e0d31e76134fbdd3a1626aad9ed3e38f25afb3.zip |
Added a font manager (work in progress)
svn-id: r16460
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r-- | graphics/font.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp index 387fb8f3bf..aac9813bca 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -20,7 +20,6 @@ #include "common/stdafx.h" #include "graphics/font.h" -#include "gui/newgui.h" namespace Graphics { @@ -37,9 +36,8 @@ int NewFont::getCharWidth(byte chr) const { return desc.width[chr - desc.firstchar]; } -void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color, bool scale) const { +void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color, int scaleFactor) const { assert(dst != 0); - const int scaleFactor = scale ? g_gui.getScaleFactor() : 1; tx *= scaleFactor; ty *= scaleFactor; byte *ptr = (byte *)dst->getBasePtr(tx, ty); @@ -103,7 +101,7 @@ int Font::getStringWidth(const Common::String &str) const { return space; } -void Font::drawString(const Surface *dst, const Common::String &s, int x, int y, int w, uint32 color, TextAlignment align, int deltax, bool useEllipsis, bool scale) const { +void Font::drawString(const Surface *dst, const Common::String &s, int x, int y, int w, uint32 color, TextAlignment align, int deltax, bool useEllipsis, int scaleFactor) const { assert(dst != 0); const int leftX = x, rightX = x + w; uint i; @@ -168,7 +166,7 @@ void Font::drawString(const Surface *dst, const Common::String &s, int x, int y, if (x+w > rightX) break; if (x >= leftX) - drawChar(dst, str[i], x, y, color, scale); + drawChar(dst, str[i], x, y, color, scaleFactor); x += w; } } |