From ce1be463c2dfea61e74a816d6590a1a4506483d2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 20 Mar 2016 21:38:26 +0100 Subject: GRAPHICS: Implement convenience Font::drawChar taking ManagedSurface. --- graphics/font.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'graphics/font.cpp') 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); -- cgit v1.2.3