aboutsummaryrefslogtreecommitdiff
path: root/graphics/font.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2016-03-20 21:38:26 +0100
committerJohannes Schickel2016-03-21 02:03:12 +0100
commitce1be463c2dfea61e74a816d6590a1a4506483d2 (patch)
treea9f1f70eacc783e818b6d7fa9e2c8431a60ed60d /graphics/font.cpp
parentc382e179084d52656de7379822d89a5fe97ca988 (diff)
downloadscummvm-rg350-ce1be463c2dfea61e74a816d6590a1a4506483d2.tar.gz
scummvm-rg350-ce1be463c2dfea61e74a816d6590a1a4506483d2.tar.bz2
scummvm-rg350-ce1be463c2dfea61e74a816d6590a1a4506483d2.zip
GRAPHICS: Implement convenience Font::drawChar taking ManagedSurface.
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r--graphics/font.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp
index abc9519fd9..97662dc15d 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -265,6 +265,14 @@ int Font::getStringWidth(const Common::U32String &str) const {
return getStringWidthImpl(*this, str);
}
+void Font::drawChar(ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) const {
+ drawChar(&dst->_innerSurface, chr, x, y, color);
+
+ Common::Rect charBox = getBoundingBox(chr);
+ charBox.translate(x, y);
+ dst->addDirtyRect(charBox);
+}
+
void Font::drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align, int deltax, bool useEllipsis) const {
Common::String renderStr = useEllipsis ? handleEllipsis(str, w) : str;
drawStringImpl(*this, dst, renderStr, x, y, w, color, align, deltax);