diff options
-rw-r--r-- | graphics/font.cpp | 8 | ||||
-rw-r--r-- | graphics/font.h | 1 |
2 files changed, 9 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); diff --git a/graphics/font.h b/graphics/font.h index 62e71a8568..0478608708 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -142,6 +142,7 @@ public: * @param color The color of the character. */ virtual void drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) const = 0; + void drawChar(ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) const; // TODO: Add doxygen comments to this void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const; |