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

Function DrawDiabloMsg

Source/error.cpp:87–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void DrawDiabloMsg()
88{
89 int i, len, width, sx, sy;
90 BYTE c;
91
92 CelDraw(PANEL_X + 101, DIALOG_Y, pSTextSlidCels, 1, 12);
93 CelDraw(PANEL_X + 527, DIALOG_Y, pSTextSlidCels, 4, 12);
94 CelDraw(PANEL_X + 101, DIALOG_Y + 48, pSTextSlidCels, 2, 12);
95 CelDraw(PANEL_X + 527, DIALOG_Y + 48, pSTextSlidCels, 3, 12);
96
97 sx = PANEL_X + 109;
98 for (i = 0; i < 35; i++) {
99 CelDraw(sx, DIALOG_Y, pSTextSlidCels, 5, 12);
100 CelDraw(sx, DIALOG_Y + 48, pSTextSlidCels, 7, 12);
101 sx += 12;
102 }
103 sy = DIALOG_Y + 12;
104 for (i = 0; i < 3; i++) {
105 CelDraw(PANEL_X + 101, sy, pSTextSlidCels, 6, 12);
106 CelDraw(PANEL_X + 527, sy, pSTextSlidCels, 8, 12);
107 sy += 12;
108 }
109
110 /// ASSERT: assert(gpBuffer);
111
112 trans_rect(PANEL_LEFT + 104, DIALOG_TOP - 8, 432, 54);
113
114 strcpy(tempstr, MsgStrings[msgflag]);
115 sx = PANEL_X + 101;
116 sy = DIALOG_Y + 24;
117 len = strlen(tempstr);
118 width = 0;
119
120 for (i = 0; i < len; i++) {
121 width += fontkern[fontframe[gbFontTransTbl[(BYTE)tempstr[i]]]] + 1;
122 }
123
124 if (width < 442) {
125 sx += (442 - width) >> 1;
126 }
127
128 for (i = 0; i < len; i++) {
129 c = fontframe[gbFontTransTbl[(BYTE)tempstr[i]]];
130 if (c != '\0') {
131 PrintChar(sx, sy, c, COL_GOLD);
132 }
133 sx += fontkern[c] + 1;
134 }
135
136 if (msgdelay > 0 && msgdelay <= SDL_GetTicks() - 3500) {
137 msgdelay = 0;
138 }
139 if (msgdelay == 0) {
140 msgcnt--;
141 if (msgcnt == 0) {
142 msgflag = 0;
143 } else {
144 msgflag = msgtable[msgcnt];

Callers 1

DrawViewFunction · 0.85

Calls 3

CelDrawFunction · 0.85
trans_rectFunction · 0.85
PrintCharFunction · 0.85

Tested by

no test coverage detected