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

Function PrintUString

Source/items.cpp:2922–2948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2920}
2921
2922void PrintUString(int x, int y, BOOL cjustflag, char *str, int col)
2923{
2924 int len, width, sx, sy, i, k;
2925 BYTE c;
2926
2927 sx = x + 96;
2928 sy = y * 12 + 204;
2929 len = strlen(str);
2930 k = 0;
2931 if (cjustflag) {
2932 width = 0;
2933 for (i = 0; i < len; i++)
2934 width += fontkern[fontframe[gbFontTransTbl[(BYTE)str[i]]]] + 1;
2935 if (width < 257)
2936 k = (257 - width) >> 1;
2937 sx += k;
2938 }
2939
2940 for (i = 0; i < len; i++) {
2941 c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
2942 k += fontkern[c] + 1;
2943 if (c && k <= 257) {
2944 PrintChar(sx, sy, c, col);
2945 }
2946 sx += fontkern[c] + 1;
2947 }
2948}
2949
2950void DrawULine(int y)
2951{

Callers 1

DrawUniqueInfoFunction · 0.85

Calls 1

PrintCharFunction · 0.85

Tested by

no test coverage detected