diff options
author | Eugene Sandulenko | 2017-02-06 08:41:09 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-06 08:41:09 +0100 |
commit | 6ea020d5f1cdc8adfb0bfbe23906d0727a78c558 (patch) | |
tree | 157d5fadb32bd6244b2e7b3661128adb94e520dc /graphics/macgui | |
parent | e13806148bac0038c0879e4dcd4145d5558f5b99 (diff) | |
download | scummvm-rg350-6ea020d5f1cdc8adfb0bfbe23906d0727a78c558.tar.gz scummvm-rg350-6ea020d5f1cdc8adfb0bfbe23906d0727a78c558.tar.bz2 scummvm-rg350-6ea020d5f1cdc8adfb0bfbe23906d0727a78c558.zip |
GRAPHICS: Cleanup MacText code
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 18 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 4 |
2 files changed, 7 insertions, 15 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 4042088761..e15c8f8da6 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -140,8 +140,6 @@ void MacText::splitString(Common::String &str) { if (text.size()) { for (uint i = 0; i < text.size(); i++) { - _text.push_back(text[i]); - _textLines[curLine].chunks[curChunk].text = text[i]; if ((text.size() > 1 || !nextChunk) && !(i == text.size() - 1 && nextChunk)) { @@ -189,12 +187,8 @@ void MacText::splitString(Common::String &str) { _textLines[curLine].chunks[curChunk].text = text[0]; - _text.push_back(text[0]); - if (text.size() > 1) { for (uint i = 1; i < text.size(); i++) { - _text.push_back(text[i]); - curLine++; _textLines.resize(curLine + 1); _textLines[curLine].chunks.push_back(_currentFormatting); @@ -331,28 +325,28 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int } void MacText::appendText(Common::String str) { - int oldLen = _text.size(); + int oldLen = _textLines.size(); // TODO: Recalc length splitString(str); recalcDims(); - render(oldLen + 1, _text.size()); + render(oldLen + 1, _textLines.size()); } void MacText::replaceLastLine(Common::String str) { - int oldLen = MAX<int>(0, _text.size() - 1); + int oldLen = MAX<int>(0, _textLines.size() - 1); // TODO: Recalc length, adapt to _textLines - if (_text.size()) - _text.pop_back(); + if (_textLines.size()) + _textLines.pop_back(); splitString(str); recalcDims(); - render(oldLen, _text.size()); + render(oldLen, _textLines.size()); } } // End of namespace Graphics diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 08fa9eb7b2..4df4f1c3aa 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -96,7 +96,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); - int getLineCount() { return _text.size(); } + int getLineCount() { return _textLines.size(); } void render(); Graphics::ManagedSurface *getSurface() { return _surface; } @@ -119,8 +119,6 @@ private: int _maxWidth; int _interLinear; - Common::Array<Common::String> _text; - int _textMaxWidth; int _textMaxHeight; |