MCPcopy Create free account
hub / github.com/diasurgical/devilution / GetArtStrWidth

Function GetArtStrWidth

SourceX/DiabloUI/text.cpp:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace dvl {
4
5std::size_t GetArtStrWidth(const char *str, std::size_t size)
6{
7 int strWidth = 0;
8
9 for (size_t i = 0, n = strlen(str); i < n; i++) {
10 BYTE w = FontTables[size][*(BYTE *)&str[i] + 2];
11 if (w)
12 strWidth += w;
13 else
14 strWidth += FontTables[size][0];
15 }
16
17 return strWidth;
18}
19
20void WordWrapArtStr(char *text, std::size_t width)
21{

Callers 2

WordWrapArtStrFunction · 0.85
DrawArtStrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected