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

Function PrintPlrMsg

Source/plrmsg.cpp:113–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void PrintPlrMsg(DWORD x, DWORD y, DWORD width, const char *str, BYTE col)
114{
115 int line = 0;
116
117 while (*str) {
118 BYTE c;
119 int sx = x;
120 DWORD len = 0;
121 const char *sstr = str;
122 const char *endstr = sstr;
123
124 while (1) {
125 if (*sstr) {
126 c = gbFontTransTbl[(BYTE)*sstr++];
127 c = fontframe[c];
128 len += fontkern[c] + 1;
129 if (!c) // allow wordwrap on blank glyph
130 endstr = sstr;
131 else if (len >= width)
132 break;
133 } else {
134 endstr = sstr;
135 break;
136 }
137 }
138
139 while (str < endstr) {
140 c = gbFontTransTbl[(BYTE)*str++];
141 c = fontframe[c];
142 if (c)
143 PrintChar(sx, y, c, col);
144 sx += fontkern[c] + 1;
145 }
146
147 y += 10;
148 line++;
149 if (line == 3)
150 break;
151 }
152}
153
154DEVILUTION_END_NAMESPACE

Callers 1

DrawPlrMsgFunction · 0.85

Calls 1

PrintCharFunction · 0.85

Tested by

no test coverage detected