MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / LoadText

Function LoadText

Source/minitext.cpp:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41std::vector<std::string> TextLines;
42
43void 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

Callers 1

InitQTextMsgFunction · 0.85

Calls 2

WordWrapStringFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected