diff options
author | Paul Gilbert | 2016-03-20 14:49:30 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-20 14:49:30 -0400 |
commit | 509a00109e79156e91c062f145ac3aa86ec8584e (patch) | |
tree | e625fd93b3b21feabae1eff92e3efbf23a7d7a83 /graphics/font.cpp | |
parent | f6c3363cf54af1c01efc12a98ab27a8af52aad3e (diff) | |
parent | 390487aa43e5507d4d0fb4ae57e7cf726a94f4c1 (diff) | |
download | scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.tar.gz scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.tar.bz2 scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.zip |
Merge pull request #652 from dreammaster/screen
ALL: Removing code duplication via new managed surface & screen classes
Diffstat (limited to 'graphics/font.cpp')
-rw-r--r-- | graphics/font.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp index dba48249bc..d709758948 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -21,6 +21,7 @@ */ #include "graphics/font.h" +#include "graphics/managed_surface.h" #include "common/array.h" #include "common/util.h" @@ -273,6 +274,16 @@ void Font::drawString(Surface *dst, const Common::U32String &str, int x, int y, drawStringImpl(*this, dst, str, x, y, w, color, align, 0); } +void Font::drawString(ManagedSurface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align, int deltax, bool useEllipsis) const { + drawString(&dst->_innerSurface, str, x, y, w, color, align, deltax, useEllipsis); + dst->addDirtyRect(Common::Rect(x, y, x + w, y + getFontHeight())); +} + +void Font::drawString(ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align) const { + drawString(&dst->_innerSurface, str, x, y, w, color, align); + dst->addDirtyRect(Common::Rect(x, y, x + w, y + getFontHeight())); +} + int Font::wordWrapText(const Common::String &str, int maxWidth, Common::Array<Common::String> &lines) const { return wordWrapTextImpl(*this, str, maxWidth, lines); } |