| 34 | const int LineWidth = 418; |
| 35 | |
| 36 | void InitNextLines() |
| 37 | { |
| 38 | TextLines.clear(); |
| 39 | |
| 40 | const std::string paragraphs = WordWrapString(DiabloMessages.front().text, LineWidth, GameFont12, 1); |
| 41 | |
| 42 | size_t previous = 0; |
| 43 | while (true) { |
| 44 | size_t next = paragraphs.find('\n', previous); |
| 45 | TextLines.emplace_back(paragraphs.substr(previous, next - previous)); |
| 46 | if (next == std::string::npos) |
| 47 | break; |
| 48 | previous = next + 1; |
| 49 | } |
| 50 | |
| 51 | ErrorWindowHeight = std::max(54, static_cast<int>((TextLines.size() * LineHeight) + 42)); |
| 52 | } |
| 53 | |
| 54 | } // namespace |
| 55 |
no test coverage detected