diff options
author | Eugene Sandulenko | 2016-12-22 18:15:43 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-22 18:16:54 +0100 |
commit | 57864f5e6c44bdecaeecfba8e0754e1d19f3cb96 (patch) | |
tree | 2ff1d5528dcde5c0911151218bb8850194cc2cee | |
parent | a1236d57820e53b07180adcf78ba7af844ca51b1 (diff) | |
download | scummvm-rg350-57864f5e6c44bdecaeecfba8e0754e1d19f3cb96.tar.gz scummvm-rg350-57864f5e6c44bdecaeecfba8e0754e1d19f3cb96.tar.bz2 scummvm-rg350-57864f5e6c44bdecaeecfba8e0754e1d19f3cb96.zip |
GRAPHICS: Implemented MacText::replaceLastLine()
-rw-r--r-- | graphics/macgui/mactext.cpp | 11 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 2af31a9efd..06354457f2 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -144,4 +144,15 @@ void MacText::appendText(Common::String str) { render(oldLen + 1, _text.size()); } +void MacText::replaceLastLine(Common::String str) { + int oldLen = MAX<int>(0, _text.size() - 1); + + if (_text.size()) + _text.pop_back(); + + splitString(str); + + render(oldLen, _text.size()); +} + } // End of namespace Graphics diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 37fc125d4d..e035eb123f 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -36,7 +36,7 @@ public: void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff); void appendText(Common::String str); - + void replaceLastLine(Common::String str); private: void splitString(Common::String &s); |