diff options
author | Eugene Sandulenko | 2019-10-20 20:08:37 +0500 |
---|---|---|
committer | Eugene Sandulenko | 2019-10-20 20:09:28 +0500 |
commit | 694ed6e7bc2638e0bef340369feb5f2715085e6d (patch) | |
tree | ab3c69e054e66cfc37d83ca95907560fd898a90d /graphics/macgui | |
parent | c71fa02bf5c6a154d4d3a029664769e870d3394f (diff) | |
download | scummvm-rg350-694ed6e7bc2638e0bef340369feb5f2715085e6d.tar.gz scummvm-rg350-694ed6e7bc2638e0bef340369feb5f2715085e6d.tar.bz2 scummvm-rg350-694ed6e7bc2638e0bef340369feb5f2715085e6d.zip |
GRAPHICS: MACGUI: Added possibility to render MacText at any desired place
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 23 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 6dfdee39f1..9a5de39dd2 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -401,6 +401,29 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int Common::Point(xoff, yoff)); } +void MacText::drawToPoint(ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint) { + if (_textLines.empty()) + return; + + render(); + + srcRect.clip(_surface->getBounds()); + + if (srcRect.isEmpty()) + return; + + g->blitFrom(*_surface, srcRect, dstPoint); +} + +void MacText::drawToPoint(ManagedSurface *g, Common::Point dstPoint) { + if (_textLines.empty()) + return; + + render(); + + g->blitFrom(*_surface, dstPoint); +} + // Count newline characters in String uint getNewlinesInString(const Common::U32String &str) { Common::U32String::const_iterator p = str.begin(); diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index e66a394c0d..a9528c2aad 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -104,6 +104,8 @@ public: } void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff); + void drawToPoint(ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint); + void drawToPoint(ManagedSurface *g, Common::Point dstPoint); void appendText(Common::U32String str, int fontId = kMacFontChicago, int fontSize = 12, int fontSlant = kMacFontRegular, bool skipAdd = false); void appendText(const Common::String &str, int fontId = kMacFontChicago, int fontSize = 12, int fontSlant = kMacFontRegular, bool skipAdd = false); void appendTextDefault(Common::U32String str, bool skipAdd = false); |