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

Function PrintQLString

Source/quests.cpp:700–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700void PrintQLString(int x, int y, BOOL cjustflag, char *str, int col)
701{
702 int len, width, i, k, sx, sy;
703 BYTE c;
704
705 sx = x + 96;
706 sy = y * 12 + 204;
707 len = strlen(str);
708 k = 0;
709 if (cjustflag) {
710 width = 0;
711 for (i = 0; i < len; i++)
712 width += fontkern[fontframe[gbFontTransTbl[(BYTE)str[i]]]] + 1;
713 if (width < 257)
714 k = (257 - width) >> 1;
715 sx += k;
716 }
717 if (qline == y) {
718 CelDraw(cjustflag ? x + k + 76 : x + 76, sy + 1, pSPentSpn2Cels, PentSpn2Frame, 12);
719 }
720 for (i = 0; i < len; i++) {
721 c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
722 k += fontkern[c] + 1;
723 if (c && k <= 257) {
724 PrintChar(sx, sy, c, col);
725 }
726 sx += fontkern[c] + 1;
727 }
728 if (qline == y) {
729 CelDraw(cjustflag ? x + k + 100 : 340 - x, sy + 1, pSPentSpn2Cels, PentSpn2Frame, 12);
730 }
731}
732
733void DrawQuestLog()
734{

Callers 1

DrawQuestLogFunction · 0.85

Calls 2

CelDrawFunction · 0.85
PrintCharFunction · 0.85

Tested by

no test coverage detected