diff options
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index e7abcc6d01..ed3cddb513 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -119,21 +119,19 @@ void MacText::splitString(Common::String &str) { Common::Array<Common::String> text; _textMaxWidth = MAX(_font->wordWrapText(tmp, _maxWidth, text), _textMaxWidth); + tmp.clear(); if (text.size()) { - (_textLines[curLine])[curChunk].text = text[0]; - if (nextChunk) { + (_textLines[curLine])[curChunk].text += text[0]; curChunk++; _text[curLine] += text[0]; - } else { - _text.push_back(text[0]); + + continue; } - } - if (text.size() > 1) { - for (uint i = 1; i < text.size(); i++) { + for (uint i = 0; i < text.size(); i++) { _text.push_back(text[i]); curLine++; @@ -144,8 +142,6 @@ void MacText::splitString(Common::String &str) { } } - tmp.clear(); - if (!nextChunk) // Don't skip next character s++; @@ -236,6 +232,14 @@ void MacText::render(int from, int to) { y += _font->getFontHeight() + _interLinear; } + for (uint i = 0; i < _textLines.size(); i++) { + debugN(4, "%2d ", i); + + for (uint j = 0; j < _textLines[i].size(); j++) + debugN(4, "[%d] \"%s\"", (_textLines[i])[j].fontId, (_textLines[i])[j].text.c_str()); + + debug(4, ""); + } } void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) { |