[Scummvm-cvs-logs] scummvm master -> ce1be463c2dfea61e74a816d6590a1a4506483d2

lordhoto lordhoto at gmail.com
Mon Mar 21 02:11:48 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ce1be463c2 GRAPHICS: Implement convenience Font::drawChar taking ManagedSurface.


Commit: ce1be463c2dfea61e74a816d6590a1a4506483d2
    https://github.com/scummvm/scummvm/commit/ce1be463c2dfea61e74a816d6590a1a4506483d2
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-03-21T02:03:12+01:00

Commit Message:
GRAPHICS: Implement convenience Font::drawChar taking ManagedSurface.

Changed paths:
    graphics/font.cpp
    graphics/font.h



diff --git a/graphics/font.cpp b/graphics/font.cpp
index abc9519..97662dc 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 62e71a8..0478608 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;






More information about the Scummvm-git-logs mailing list