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

Function InitNextLines

Source/error.cpp:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34const int LineWidth = 418;
35
36void 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

Callers 3

InitDiabloMsgFunction · 0.85
CancelCurrentDiabloMsgFunction · 0.85
DrawDiabloMsgFunction · 0.85

Calls 3

WordWrapStringFunction · 0.85
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected