| 1241 | } |
| 1242 | |
| 1243 | void 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 | |
| 1276 | void PrintGameStr(int x, int y, const char *str, int color) |
| 1277 | { |