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

Function CPrintString

Source/control.cpp:1243–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1241}
1242
1243void CPrintString(int y, char *str, BOOL center, int lines)
1244{
1245 BYTE c;
1246 char *tmp;
1247 int lineOffset, strWidth, sx, sy;
1248
1249 lineOffset = 0;
1250 sx = 177 + PANEL_X;
1251 sy = lineOffsets[lines][y] + PANEL_Y;
1252 if (center == 1) {
1253 strWidth = 0;
1254 tmp = str;
1255 while (*tmp) {
1256 c = gbFontTransTbl[(BYTE)*tmp++];
1257 strWidth += fontkern[fontframe[c]] + 2;
1258 }
1259 if (strWidth < 288)
1260 lineOffset = (288 - strWidth) >> 1;
1261 sx += lineOffset;
1262 }
1263 while (*str) {
1264 c = gbFontTransTbl[(BYTE)*str++];
1265 c = fontframe[c];
1266 lineOffset += fontkern[c] + 2;
1267 if (c) {
1268 if (lineOffset < 288) {
1269 PrintChar(sx, sy, c, infoclr);
1270 }
1271 }
1272 sx += fontkern[c] + 2;
1273 }
1274}
1275
1276void PrintGameStr(int x, int y, const char *str, int color)
1277{

Callers 1

PrintInfoFunction · 0.85

Calls 1

PrintCharFunction · 0.85

Tested by

no test coverage detected