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

Function MY_PlrStringXY

Source/control.cpp:1505–1534  ·  view source on GitHub ↗

* @brief Render text string to back buffer * @param x Screen coordinate * @param y Screen coordinate * @param endX End of line in screen coordinate * @param pszStr String to print, in Windows-1252 encoding * @param col text_color color value * @param base Letter spacing */

Source from the content-addressed store, hash-verified

1503 * @param base Letter spacing
1504 */
1505void MY_PlrStringXY(int x, int y, int endX, char *pszStr, char col, int base)
1506{
1507 BYTE c;
1508 char *tmp;
1509 int sx, sy, screen_x, line, widthOffset;
1510
1511 sx = x + SCREEN_X;
1512 sy = y + SCREEN_Y;
1513 widthOffset = endX - x + 1;
1514 line = 0;
1515 screen_x = 0;
1516 tmp = pszStr;
1517 while (*tmp) {
1518 c = gbFontTransTbl[(BYTE)*tmp++];
1519 screen_x += fontkern[fontframe[c]] + base;
1520 }
1521 if (screen_x < widthOffset)
1522 line = (widthOffset - screen_x) >> 1;
1523 sx += line;
1524 while (*pszStr) {
1525 c = gbFontTransTbl[(BYTE)*pszStr++];
1526 c = fontframe[c];
1527 line += fontkern[c] + base;
1528 if (c) {
1529 if (line < widthOffset)
1530 PrintChar(sx, sy, c, col);
1531 }
1532 sx += fontkern[c] + base;
1533 }
1534}
1535
1536void CheckLvlBtn()
1537{

Callers 1

DrawChrFunction · 0.85

Calls 1

PrintCharFunction · 0.85

Tested by

no test coverage detected