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

Function DrawQText

Source/minitext.cpp:96–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void DrawQText()
97{
98 int i, l, w, tx, ty;
99 BYTE c;
100 char *p, *pnl, *s;
101 char tempstr[128];
102 BOOL doneflag;
103 DWORD currTime;
104
105 DrawQTextBack();
106
107 p = qtextptr;
108 pnl = NULL;
109 tx = 48 + PANEL_X;
110 ty = qtexty;
111
112 doneflag = FALSE;
113 while (!doneflag) {
114 w = 0;
115 s = p;
116 l = 0;
117 while (*s != '\n' && *s != '|' && w < 543) {
118 c = gbFontTransTbl[(BYTE)*s];
119 s++;
120 if (c != '\0') {
121 tempstr[l] = c;
122 w += mfontkern[mfontframe[c]] + 2;
123 } else {
124 l--;
125 }
126 l++;
127 }
128 tempstr[l] = '\0';
129 if (*s == '|') {
130 tempstr[l] = '\0';
131 doneflag = TRUE;
132 } else if (*s != '\n') {
133 while (tempstr[l] != ' ' && l > 0) {
134 tempstr[l] = '\0';
135 l--;
136 }
137 }
138 for (i = 0; tempstr[i]; i++) {
139 p++;
140 c = mfontframe[gbFontTransTbl[(BYTE)tempstr[i]]];
141 if (*p == '\n') {
142 p++;
143 }
144 if (c != 0) {
145 PrintQTextChr(tx, ty, pMedTextCels, c);
146 }
147 tx += mfontkern[c] + 2;
148 }
149 if (pnl == NULL) {
150 pnl = p;
151 }
152 tx = 48 + PANEL_X;
153 ty += 38;

Callers 1

DrawViewFunction · 0.85

Calls 2

DrawQTextBackFunction · 0.85
PrintQTextChrFunction · 0.85

Tested by

no test coverage detected