const_iterator operator++() { if (m_dots) { m_dots = m_dots->tail(); if (m_dots) return *this; } m_arg = m_arg->tail(); if (m_arg && m_arg->car() == DotsSymbol) { handleDots(); } return *this; }
void CCreditText::setup() { Common::SeekableReadStream *stream = g_vm->_filesManager->getResource( CString::format("TEXT/155")); int oldFontNumber = _screenManagerP->setFontNumber(3); _fontHeight = _screenManagerP->getFontHeight(); while (stream->pos() < stream->size()) { // Read in the line CString srcLine = readLine(stream); // Create a new group and line within it CCreditLineGroup *group = new CCreditLineGroup(); CCreditLine *line = new CCreditLine(srcLine, _screenManagerP->stringWidth(srcLine)); group->_lines.push_back(line); // Loop to add more lines to the group bool hasDots = false; while (stream->pos() < stream->size()) { srcLine = readLine(stream); if (srcLine.empty()) break; line = new CCreditLine(srcLine, _screenManagerP->stringWidth(srcLine)); group->_lines.push_back(line); if (srcLine.contains("....")) hasDots = true; } _groups.push_back(group); if (hasDots) handleDots(group); } _screenManagerP->setFontNumber(oldFontNumber); _groupIt = _groups.begin(); _lineIt = (*_groupIt)->_lines.begin(); _totalHeight = _objectP->getBounds().height() + _fontHeight * 2; }
const_iterator(ConsCell* arg, Environment* env) : m_arg(arg), m_dots(nullptr), m_env(env) { if (arg && env && arg->car() == DotsSymbol) handleDots(); }