| 41 | std::vector<std::string> TextLines; |
| 42 | |
| 43 | void LoadText(string_view text) |
| 44 | { |
| 45 | TextLines.clear(); |
| 46 | |
| 47 | const std::string paragraphs = WordWrapString(text, 543, GameFont30); |
| 48 | |
| 49 | size_t previous = 0; |
| 50 | while (true) { |
| 51 | size_t next = paragraphs.find('\n', previous); |
| 52 | TextLines.emplace_back(paragraphs.substr(previous, next - previous)); |
| 53 | if (next == std::string::npos) |
| 54 | break; |
| 55 | previous = next + 1; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @brief Calculate the speed the current text should scroll to match the given audio |
no test coverage detected