* @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 */
| 1503 | * @param base Letter spacing |
| 1504 | */ |
| 1505 | void 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 | |
| 1536 | void CheckLvlBtn() |
| 1537 | { |