Mercurial > mm7
annotate GUIFont.cpp @ 174:4ae88cd19c30
Обращённый набор изменений: e6db0995ac4b
author | Ritor1 |
---|---|
date | Fri, 15 Feb 2013 10:26:57 +0600 |
parents | 91fa025e6ca6 |
children | 05682713195c |
rev | line source |
---|---|
0 | 1 #include <string> |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
2 #include "LOD.h" |
0 | 3 #include "GUIFont.h" |
4 #include "GUIWindow.h" | |
5 #include "Render.h" | |
6 | |
7 #include "mm7_data.h" | |
8 | |
9 | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
10 extern LODFile_IconsBitmaps *pIcons_LOD; |
0 | 11 |
12 | |
13 struct GUIFont *pAutonoteFont; | |
14 struct GUIFont *pSpellFont; | |
15 struct GUIFont *pFontArrus; | |
16 struct GUIFont *pFontLucida; | |
17 struct GUIFont *pBook2Font; | |
18 struct GUIFont *pBookFont; | |
19 struct GUIFont *pFontCreate; | |
20 struct GUIFont *pFontCChar; | |
21 struct GUIFont *pFontComic; | |
22 struct GUIFont *pFontSmallnum; | |
23 | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
24 //----- (0044C448) -------------------------------------------------------- |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
25 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
26 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
27 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
28 int pallete_index; // eax@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
29 GUIFont *pFont; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
30 unsigned int palletes_count =0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
31 va_list palettes_ptr; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
32 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
33 pFont = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
34 va_start(palettes_ptr, pFontFile); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
35 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
36 while (NULL!=(pFontPalette=va_arg(palettes_ptr, const char *))) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
37 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
38 pallete_index =pIcons_LOD->LoadTexture(pFontPalette, TEXTURE_16BIT_PALETTE); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
39 if (pallete_index == -1) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
40 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
41 wsprintfA(pTmpBuf, "Unable to open %s", pFontPalette); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
42 Abortf(pTmpBuf); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
43 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
44 pFont->pFontPalettes[palletes_count] = pIcons_LOD->pTextures[pallete_index].pPalette16; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
45 ++palletes_count; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
46 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
47 va_end(palettes_ptr); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
48 pFont->palletes_count = palletes_count; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
49 return pFont; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
50 } |
0 | 51 |
52 | |
53 | |
54 //----- (0044D2FD) -------------------------------------------------------- | |
55 void GUIFont::_44D2FD_prolly_draw_credits_entry(GUIFont *pFont, int Str, int a4, unsigned int w, unsigned int h, unsigned __int16 a7, unsigned __int16 a8, const char *pString, unsigned __int16 *pPixels, unsigned int uPixelsWidth) | |
56 { | |
57 int v11; // ebx@1 | |
58 int v12; // edi@1 | |
59 char *v13; // eax@1 | |
60 char *v14; // eax@1 | |
61 unsigned __int16 *v15; // esi@1 | |
62 GUIFont *v16; // edi@4 | |
63 signed int v17; // ecx@4 | |
64 signed int v18; // eax@6 | |
65 int v19; // [sp+Ch] [bp-5Ch]@1 | |
66 int v20; // [sp+10h] [bp-58h]@1 | |
67 unsigned int v21; // [sp+14h] [bp-54h]@1 | |
68 unsigned int v22; // [sp+18h] [bp-50h]@1 | |
69 unsigned int v23; // [sp+1Ch] [bp-4Ch]@1 | |
70 unsigned int v24; // [sp+20h] [bp-48h]@1 | |
71 GUIFont *v25; // [sp+60h] [bp-8h]@1 | |
72 GUIFont *v26; // [sp+64h] [bp-4h]@1 | |
73 char *Stra; // [sp+70h] [bp+8h]@1 | |
74 int a4a; // [sp+74h] [bp+Ch]@4 | |
75 int a7a; // [sp+80h] [bp+18h]@2 | |
76 | |
77 v11 = a7; | |
78 v22 = h; | |
79 v12 = Str; | |
80 v26 = this; | |
81 v24 = a4 + h - 1; | |
82 v21 = w; | |
83 v25 = pFont; | |
84 v23 = Str + w - 1; | |
85 ui_current_text_color = a7; | |
86 v19 = Str; | |
87 v20 = a4; | |
88 v13 = GUIFont::_44C933(pString, this, pFont, (int)&v19, 0, 1); | |
89 v14 = strtok(v13, "\n"); | |
90 Stra = v14; | |
91 v15 = &pPixels[uPixelsWidth * a4]; | |
92 if ( v14 ) | |
93 { | |
94 a7a = v12 >> 1; | |
95 while ( 1 ) | |
96 { | |
97 v16 = v26; | |
98 ui_current_text_color = v11; | |
99 v17 = 0; | |
100 a4a = v11; | |
101 if ( *v14 == '_' ) | |
102 { | |
103 v16 = v25; | |
104 a4a = a8; | |
105 ui_current_text_color = a8; | |
106 v17 = 1; | |
107 } | |
108 v18 = (signed int)(w - v16->GetLineWidth(&v14[v17])) >> 1; | |
109 if ( v18 < 0 ) | |
110 v18 = 0; | |
111 v16->_44D0B5(a4a, a8, (int)&v15[v18 + a7a], Stra, uPixelsWidth); | |
112 v15 += uPixelsWidth * (LOBYTE(v16->uFontHeight) - 3); | |
113 Stra = strtok(0, "\n"); | |
114 if ( !Stra ) | |
115 break; | |
116 v14 = Stra; | |
117 } | |
118 } | |
119 } | |
120 // 5C6DB4: using guessed type int ui_current_text_color; | |
121 | |
122 | |
123 //----- (0044D1E7) -------------------------------------------------------- | |
124 void GUIFont::DrawTextLine(unsigned int uDefaultColor, signed int uX, signed int uY, const char *Str, int a6) | |
125 { | |
126 size_t v6; // ebx@1 | |
47 | 127 GUIFont *pFont; // esi@1 |
0 | 128 signed int v8; // edi@3 |
129 unsigned __int8 v9; // cl@4 | |
130 int v10; // eax@5 | |
131 int v11; // ecx@5 | |
132 int v12; // ecx@6 | |
133 int v13; // ecx@7 | |
134 int v14; // ecx@9 | |
135 unsigned int v15; // edx@9 | |
136 unsigned __int16 v16; // cx@12 | |
137 unsigned __int8 *v17; // eax@12 | |
71 | 138 char Dest[20]; // [sp+Ch] [bp-1Ch]@16 |
139 //char v19; // [sp+11h] [bp-17h]@16 | |
0 | 140 size_t v20; // [sp+20h] [bp-8h]@2 |
141 int v21; // [sp+24h] [bp-4h]@1 | |
142 int uXa; // [sp+30h] [bp+8h]@9 | |
143 | |
144 v6 = 0; | |
145 v21 = uDefaultColor; | |
47 | 146 pFont = this; |
0 | 147 if ( Str ) |
148 { | |
149 v21 = ui_current_text_color; | |
150 v20 = strlen(Str); | |
151 if ( (signed int)v20 > 0 ) | |
152 { | |
153 v8 = uX; | |
154 do | |
155 { | |
47 | 156 if ( pFont->IsCharValid(v9 = Str[v6]) ) |
0 | 157 { |
158 v10 = v9; | |
159 v11 = v9 - 9; | |
160 if ( v11 ) | |
161 { | |
162 v12 = v11 - 1; | |
163 if ( !v12 ) | |
164 return; | |
165 v13 = v12 - 2; | |
166 if ( v13 ) | |
167 { | |
168 if ( v13 != 1 ) | |
169 { | |
170 v14 = 3 * v10 + 9; | |
47 | 171 v15 = *((int *)&pFont->cFirstChar + v14); |
172 uXa = *((int *)&pFont->cFirstChar + v14); | |
0 | 173 if ( v15 ) |
174 { | |
175 if ( (signed int)v6 > 0 ) | |
47 | 176 v8 += pFont->pMetrics[v10].uLeftSpacing; |
0 | 177 v16 = v21; |
47 | 178 v17 = (unsigned __int8 *)((char *)&pFont[1] + pFont->field_C20[v10]); |
0 | 179 if ( !v21 ) |
180 v16 = -1; | |
47 | 181 pRenderer->DrawText(v8, uY, v17, v15, pFont->uFontHeight, pFont->pFontPalettes[0], v16, 0); |
0 | 182 v8 += uXa; |
183 if ( (signed int)v6 < (signed int)v20 ) | |
47 | 184 v8 += pFont->pMetrics[(unsigned __int8)Str[v6]].uRightSpacing; |
0 | 185 } |
186 } | |
187 } | |
188 else | |
189 { | |
71 | 190 strncpy(Dest, &Str[v6 + 1], 5u); |
191 Dest[5] = 0; | |
192 v21 = atoi(Dest); | |
0 | 193 ui_current_text_color = v21; |
194 v6 += 5; | |
195 } | |
196 } | |
197 } | |
198 ++v6; | |
199 } | |
200 while ( (signed int)v6 < (signed int)v20 ); | |
201 } | |
202 } | |
203 } | |
204 // 5C6DB4: using guessed type int ui_current_text_color; | |
205 | |
206 | |
207 //----- (0044D0B5) -------------------------------------------------------- | |
208 void GUIFont::_44D0B5(int a2, int a3, int a4, const char *pString, int a6) | |
209 { | |
210 int v6; // ebx@1 | |
211 GUIFont *v7; // esi@1 | |
212 int v8; // edi@3 | |
213 unsigned __int8 v9; // cl@4 | |
214 int v10; // eax@5 | |
215 int v11; // ecx@5 | |
216 int v12; // ecx@6 | |
217 int v13; // ecx@7 | |
218 int v14; // ecx@8 | |
219 int v15; // ebx@10 | |
220 int v16; // edx@13 | |
221 __int16 v17; // ax@13 | |
222 char Dest; // [sp+Ch] [bp-20h]@17 | |
223 char v19; // [sp+11h] [bp-1Bh]@17 | |
224 size_t v20; // [sp+20h] [bp-Ch]@2 | |
225 int v21; // [sp+24h] [bp-8h]@1 | |
226 int v22; // [sp+28h] [bp-4h]@2 | |
227 const char *v23; // [sp+38h] [bp+Ch]@4 | |
228 | |
229 v6 = 0; | |
230 v21 = a2; | |
231 v7 = this; | |
232 if ( pString ) | |
233 { | |
234 v21 = ui_current_text_color; | |
235 v20 = strlen(pString); | |
236 v22 = 0; | |
237 if ( (signed int)v20 > 0 ) | |
238 { | |
239 v8 = a4; | |
240 do | |
241 { | |
242 v23 = &pString[v6]; | |
243 if ( v7->IsCharValid(v9 = pString[v6]) ) | |
244 { | |
245 v10 = v9; | |
246 v11 = v9 - 9; | |
247 if ( v11 ) | |
248 { | |
249 v12 = v11 - 1; | |
250 if ( !v12 ) | |
251 return; | |
252 v13 = v12 - 2; | |
253 if ( v13 ) | |
254 { | |
255 v14 = v13 - 1; | |
256 if ( v14 ) | |
257 { | |
258 if ( v14 != 82 ) | |
259 { | |
260 v15 = *((int *)&v7->cFirstChar + 3 * v10 + 9); | |
261 if ( v15 ) | |
262 { | |
263 if ( v22 > 0 ) | |
264 v8 += 2 * v7->pMetrics[v10].uLeftSpacing; | |
265 v16 = (int)((char *)&v7[1] + v7->field_C20[v10]); | |
266 v17 = v21; | |
267 if ( !v21 ) | |
268 v17 = -1; | |
269 sub_40F845(v8, v16, v15, LOBYTE(v7->uFontHeight), (int)v7->pFontPalettes[0], v17, 2 * a6); | |
270 v8 += 2 * v15; | |
271 if ( v22 < (signed int)v20 ) | |
272 v8 += 2 * v7->pMetrics[(unsigned __int8)*v23].uRightSpacing; | |
273 } | |
274 } | |
275 } | |
276 } | |
277 else | |
278 { | |
279 strncpy(&Dest, &pString[v6 + 1], 5u); | |
280 v19 = 0; | |
281 v21 = atoi(&Dest); | |
282 ui_current_text_color = v21; | |
283 v22 = v6 + 5; | |
284 } | |
285 } | |
286 } | |
287 v6 = v22++ + 1; | |
288 } | |
289 while ( v22 < (signed int)v20 ); | |
290 } | |
291 } | |
292 } | |
293 // 5C6DB4: using guessed type int ui_current_text_color; | |
294 | |
295 | |
296 //----- (0044C933) -------------------------------------------------------- | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
297 char * GUIFont::_44C933(const char *pString, GUIFont *pFont, GUIFont *a3, int a4, int a5, int a6) |
0 | 298 { |
299 const char *v6; // esi@1 | |
300 size_t v8; // eax@3 | |
301 size_t v9; // edi@3 | |
302 int v10; // eax@3 | |
303 GUIFont *v11; // esi@3 | |
304 int v12; // ebx@3 | |
305 char v13; // cl@5 | |
306 int v14; // edx@11 | |
307 int v15; // ecx@11 | |
308 int v16; // edx@12 | |
309 int v17; // edx@13 | |
310 int v18; // edx@14 | |
311 int v19; // edx@15 | |
312 int v20; // edi@17 | |
313 int v21; // edx@17 | |
314 int v22; // ecx@17 | |
315 int v23; // edi@18 | |
316 char v24; // zf@18 | |
317 int v25; // ecx@19 | |
318 int v26; // eax@19 | |
319 char v27; // dl@24 | |
320 int v28; // eax@46 | |
321 std::string v29; // [sp-18h] [bp-48h]@2 | |
322 const char *v30; // [sp-8h] [bp-38h]@2 | |
323 int v31; // [sp-4h] [bp-34h]@2 | |
324 const char *v32; // [sp+Ch] [bp-24h]@1 | |
325 char Str; // [sp+10h] [bp-20h]@46 | |
326 char v34; // [sp+13h] [bp-1Dh]@46 | |
327 GUIFont *v35; // [sp+14h] [bp-1Ch]@1 | |
328 int v36; // [sp+18h] [bp-18h]@3 | |
329 int v37; // [sp+1Ch] [bp-14h]@3 | |
330 int v38; // [sp+20h] [bp-10h]@4 | |
331 int v39; // [sp+24h] [bp-Ch]@3 | |
332 int v40; // [sp+28h] [bp-8h]@3 | |
333 int i; // [sp+2Ch] [bp-4h]@17 | |
334 std::string *v42; // [sp+38h] [bp+8h]@2 | |
335 | |
336 v6 = pString; | |
337 v35 = pFont; | |
338 v32 = pString; | |
339 if ( !pString ) | |
340 { | |
341 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:558", 0); | |
342 return 0; | |
343 } | |
344 v8 = strlen(pString); | |
345 v9 = v8; | |
346 v39 = v8; | |
347 strcpy(pTmpBuf3, v6); | |
348 v10 = a5; | |
349 v11 = v35; | |
350 v12 = 0; | |
351 v40 = 0; | |
352 v37 = a5; | |
353 v36 = 0; | |
354 if ( (signed int)v9 > 0 ) | |
355 { | |
356 v38 = v9 - 1; | |
357 do | |
358 { | |
359 v13 = pTmpBuf3[v12]; | |
360 if ( (unsigned __int8)v13 >= v11->cFirstChar && (unsigned __int8)v13 <= v11->cLastChar | |
361 || v13 == '\f' | |
362 || v13 == '\r' | |
363 || v13 == '\t' | |
364 || v13 == '\n' ) | |
365 { | |
366 v14 = (unsigned __int8)v13 - 9; | |
367 v15 = (int)&v11->pMetrics[(unsigned __int8)v13]; | |
368 if ( v14 ) | |
369 { | |
370 v16 = v14 - 1; | |
371 if ( v16 ) | |
372 { | |
373 v17 = v16 - 2; | |
374 if ( v17 ) | |
375 { | |
376 v18 = v17 - 1; | |
377 if ( v18 ) | |
378 { | |
379 v19 = v18 - 19; | |
380 if ( v19 ) | |
381 { | |
382 if ( v19 == 63 ) | |
383 { | |
384 v11 = a3; | |
385 } | |
386 else | |
387 { | |
388 v20 = *(int *)(v15 + 8); | |
389 v21 = *(int *)(v15 + 4); | |
390 v22 = *(int *)v15; | |
391 i = v20; | |
392 if ( (unsigned int)(v10 + v20 + v22 + v21) < *(int *)(a4 + 8) ) | |
393 { | |
394 v12 = v36; | |
395 if ( v36 > v40 ) | |
396 v10 += v22; | |
397 v10 += v21; | |
398 if ( v36 < v39 ) | |
399 v10 += i; | |
400 } | |
401 else | |
402 { | |
403 v23 = v40; | |
404 v24 = v11 == a3; | |
405 pTmpBuf3[v40] = 10; | |
406 if ( v24 ) | |
407 { | |
408 v25 = v38; | |
409 v26 = v23 + 1; | |
410 while ( v25 >= v26 ) | |
411 { | |
412 pTmpBuf3[v25] = byte_5C45AF[v25]; | |
413 --v25; | |
414 } | |
415 ++v39; | |
416 ++v38; | |
417 pTmpBuf3[v23++ + 1] = 95; | |
418 v40 = v26; | |
419 } | |
420 v12 = v36; | |
421 v10 = v37; | |
422 for ( i = v23; i <= v36; ++i ) | |
423 { | |
424 v27 = pTmpBuf3[i]; | |
425 if ( (unsigned __int8)v27 >= v11->cFirstChar && (unsigned __int8)v27 <= v11->cLastChar | |
426 || v27 == 12 | |
427 || v27 == 13 | |
428 || v27 == 9 | |
429 || v27 == 10 ) | |
430 { | |
431 if ( i > v23 ) | |
432 v10 += v11->pMetrics[(unsigned __int8)v27].uLeftSpacing; | |
433 v10 += *((int *)&v11->cFirstChar + 3 * (unsigned __int8)v27 + 9); | |
434 if ( i < v36 ) | |
435 v10 += v11->pMetrics[(unsigned __int8)v27].uRightSpacing; | |
436 } | |
437 } | |
438 } | |
439 } | |
440 } | |
441 else | |
442 { | |
443 v10 += *(int *)(v15 + 4); | |
444 v40 = v12; | |
445 } | |
446 } | |
447 else | |
448 { | |
449 if ( !a6 ) | |
450 return (char *)v32; | |
451 } | |
452 } | |
453 else | |
454 { | |
455 v12 += 5; | |
456 } | |
457 } | |
458 else | |
459 { | |
460 v10 = v37; | |
461 v11 = v35; | |
462 v40 = v12; | |
463 } | |
464 } | |
465 else | |
466 { | |
467 strncpy(&Str, &pTmpBuf3[v12 + 1], 3u); | |
468 v34 = 0; | |
469 v28 = atoi(&Str); | |
470 v10 = a5 + v28; | |
471 v12 += 3; | |
472 v37 = v10; | |
473 } | |
474 } | |
475 ++v12; | |
476 v36 = v12; | |
477 } | |
478 while ( v12 < v39 ); | |
479 } | |
480 return pTmpBuf3; | |
481 } | |
482 | |
483 | |
484 //----- (0044C6C2) -------------------------------------------------------- | |
485 int GUIFont::_44C6C2(const char *pInString, GUIWindow *pWindow, unsigned int uX, int a5) | |
486 { | |
487 const char *v5; // esi@1 | |
488 int v6; // edi@1 | |
489 unsigned __int8 *v8; // ebx@3 | |
490 size_t v9; // eax@3 | |
491 signed int v10; // esi@3 | |
492 int v11; // edx@4 | |
92 | 493 unsigned int v12; // cl@4 |
0 | 494 GUIFont *v13; // [sp+Ch] [bp-4h]@1 |
495 size_t uXa; // [sp+1Ch] [bp+Ch]@3 | |
496 | |
497 auto pFont = this; | |
498 v5 = pInString; | |
499 v6 = 0; | |
500 v13 = pFont; | |
501 if ( !pInString ) | |
502 return 0; | |
503 v8 = (unsigned __int8 *)FitTextInAWindow(pInString, pFont, pWindow, uX, 0); | |
504 v9 = strlen(v5); | |
505 v10 = 0; | |
506 uXa = v9; | |
507 if ( (signed int)v9 > 0 ) | |
508 { | |
93 | 509 while ( v10 < (signed int)uXa ) |
0 | 510 { |
93 | 511 if(IsCharValid(*v8)) |
512 { | |
513 v12=(unsigned int)v8; | |
514 if ( v12 != 9 ) | |
515 { | |
516 if ( v12 == 10 ) | |
517 { | |
518 v6 = v6 + *(char *)(v11 + 5) - 3; | |
519 if ( v6 >= (signed int)(a5 * pWindow->uFrameHeight) ) | |
520 return (int)(v8 + 1); | |
521 if ( v6 >= (signed int)(a5 * pWindow->uFrameHeight) ) | |
522 return (int)v8; | |
523 } | |
524 else if ( v12 == 12 ) | |
525 { | |
526 v8 += 5; | |
527 v10 += 5; | |
528 if ( v6 >= (signed int)(a5 * pWindow->uFrameHeight) ) | |
529 return (int)v8; | |
530 } | |
531 else if ( v12 != 13 ) | |
532 { | |
533 if ( v6 >= (signed int)(a5 * pWindow->uFrameHeight) ) | |
534 return (int)v8; | |
535 } | |
536 } | |
537 if(v12 == 13 || v12 == 9) | |
538 { | |
539 v8 += 3; | |
540 v10 += 3; | |
541 } | |
542 if ( v6 >= (signed int)(a5 * pWindow->uFrameHeight) ) | |
543 return (int)v8; | |
544 } | |
0 | 545 ++v10; |
546 ++v8; | |
547 } | |
548 } | |
549 return (int)v8; | |
550 } | |
551 | |
552 | |
553 | |
554 //----- (0044C62E) -------------------------------------------------------- | |
555 int GUIFont::GetStringHeight2(GUIFont *a2, const char *Str, int a4, int a5, int a6) | |
556 { | |
557 GUIFont *v6; // edi@1 | |
558 int v8; // esi@3 | |
559 unsigned __int8 *v9; // ebx@3 | |
560 size_t v10; // eax@3 | |
561 unsigned __int8 v11; // cl@4 | |
562 signed int Stra; // [sp+Ch] [bp+8h]@3 | |
563 size_t v13; // [sp+14h] [bp+10h]@3 | |
564 | |
565 auto a1 = this; | |
566 v6 = a1; | |
567 if ( !Str ) | |
568 return 0; | |
569 v8 = LOBYTE(a1->uFontHeight) - 3; | |
570 v9 = (unsigned __int8 *)GUIFont::_44C933(Str, a1, a2, a4, a5, 0); | |
571 v10 = strlen(Str); | |
572 Stra = 0; | |
573 v13 = v10; | |
574 while ( Stra < (signed int)v13 ) | |
575 { | |
576 if ( GUIFont::IsCharValid(v11 = *v9) ) | |
577 { | |
578 if ( v11 == 9 ) | |
579 goto LABEL_9; | |
580 switch ( v11 ) | |
581 { | |
582 case 0xAu: | |
583 v8 = v8 + LOBYTE(v6->uFontHeight) - 3; | |
584 break; | |
585 case 0xCu: | |
586 v9 += 5; | |
587 Stra += 5; | |
588 break; | |
589 case 0xDu: | |
590 LABEL_9: | |
591 if ( a6 != 1 ) | |
592 { | |
593 v9 += 3; | |
594 Stra += 3; | |
595 } | |
596 break; | |
597 } | |
598 } | |
599 ++Stra; | |
600 ++v9; | |
601 } | |
602 return v8; | |
603 } | |
604 | |
605 //----- (0044C59D) -------------------------------------------------------- | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
606 int GUIFont::CalcTextHeight(const char *pString, GUIWindow *pWindow, int uXOffset, int a5) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
607 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
608 int uAllHeght; // esi@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
609 unsigned int uStringLen; // eax@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
610 char c; // cl@4 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
611 char *test_string; // [sp+14h] [bp+Ch]@3 |
0 | 612 |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
613 if (!pString) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
614 return 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
615 uAllHeght = this->uFontHeight - 3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
616 test_string = FitTextInAWindow(pString, this, pWindow, uXOffset, 0); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
617 uStringLen = strlen(pString); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
618 for (int i = 0; i < uStringLen; ++i) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
619 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
620 c = test_string[i]; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
621 if (IsCharValid(c)) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
622 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
623 switch (c) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
624 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
625 case '\n': //Line Feed 0A 10: |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
626 uAllHeght+= this->uFontHeight - 3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
627 break; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
628 case '\f': //Form Feed, page eject 0C 12 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
629 i += 5; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
630 break; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
631 case '\t': // Horizontal tab 09 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
632 case '\r': //Carriage Return 0D 13 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
633 if (a5 != 1) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
634 i += 3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
635 break; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
636 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
637 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
638 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
639 return uAllHeght; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
640 } |
0 | 641 |
642 | |
643 //----- (0044C51E) -------------------------------------------------------- | |
644 int GUIFont::GetLineWidth(const char *pString) | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
645 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
646 unsigned int str_len; // ebp@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
647 int string_line_width; // esi@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
648 unsigned char c; |
0 | 649 |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
650 if (!pString) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
651 return 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
652 str_len = strlen(pString); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
653 string_line_width = 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
654 for ( int i = 0; i < str_len; ++i ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
655 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
656 c = pString[i]; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
657 if (IsCharValid(c)) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
658 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
659 switch (c) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
660 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
661 case '\t': |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
662 case '\n': |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
663 case '\r': |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
664 return string_line_width; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
665 case '\f': |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
666 i += 5; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
667 break; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
668 default: |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
669 if (i > 0) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
670 string_line_width += this->pMetrics[c].uLeftSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
671 string_line_width += this->pMetrics[c].uWidth; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
672 if (i < str_len) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
673 string_line_width +=this->pMetrics[c].uRightSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
674 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
675 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
676 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
677 return string_line_width; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
678 } |
0 | 679 |
680 | |
681 //----- (0044C502) -------------------------------------------------------- | |
682 int GUIFont::AlignText_Center(unsigned int uCenterX, const char *pString) | |
683 { | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
684 signed int position; // esi@1 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
685 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
686 position = (signed int)(uCenterX - GetLineWidth(pString)) >> 1; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
687 if ( position >= 0 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
688 return position; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
689 else |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
690 return 0; |
0 | 691 |
692 } | |
693 | |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
694 //----- (0044C768) -------------------------------------------------------- |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
695 char * FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
696 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
697 const char *v5; // edi@1 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
698 GUIFont *v6; // esi@1 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
699 unsigned int v8; // eax@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
700 int v9; // edi@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
701 unsigned __int8 v10; // cl@4 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
702 int v11; // edx@10 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
703 GUICharMetric *v12; // ecx@10 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
704 int v13; // edx@11 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
705 int v14; // edx@12 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
706 int v15; // edx@13 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
707 unsigned int v16; // esi@15 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
708 unsigned int v17; // edx@15 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
709 unsigned int v18; // ecx@15 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
710 int v19; // ebx@16 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
711 unsigned __int8 v20; // zf@16 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
712 char v21; // sf@16 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
713 unsigned __int8 v22; // of@16 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
714 int v23; // edi@16 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
715 unsigned __int8 v24; // dl@17 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
716 int v25; // edi@39 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
717 int v26; // eax@42 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
718 std::string v27; // [sp-18h] [bp-40h]@2 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
719 const char *v28; // [sp-8h] [bp-30h]@2 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
720 int v29; // [sp-4h] [bp-2Ch]@2 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
721 const char *v30; // [sp+Ch] [bp-1Ch]@1 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
722 char Str[3]; // [sp+10h] [bp-18h]@42 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
723 char v32; // [sp+13h] [bp-15h]@42 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
724 size_t v33; // [sp+14h] [bp-14h]@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
725 unsigned int v34; // [sp+18h] [bp-10h]@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
726 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
727 int v36; // [sp+20h] [bp-8h]@3 |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
728 int v37; // [sp+24h] [bp-4h]@3 |
0 | 729 |
170
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
730 v5 = pInString; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
731 v6 = pFont; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
732 v30 = pInString; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
733 v35 = pFont; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
734 if ( !pInString ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
735 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
736 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
737 return 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
738 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
739 v33 = strlen(pInString); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
740 strcpy(pTmpBuf3, v5); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
741 v8 = uX; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
742 v9 = 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
743 v36 = 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
744 v34 = uX; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
745 v37 = 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
746 if ( (signed int)v33 > 0 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
747 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
748 while ( 1 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
749 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
750 v10 = pTmpBuf3[v9]; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
751 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
752 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
753 goto LABEL_34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
754 v11 = v10 - 9; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
755 v12 = &v6->pMetrics[v10]; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
756 if ( !v11 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
757 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
758 strncpy(Str, &pTmpBuf3[v9 + 1], 3u); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
759 v32 = 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
760 v26 = atoi(Str); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
761 v8 = uX + v26; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
762 v25 = v9 + 3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
763 v34 = v8; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
764 goto LABEL_43; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
765 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
766 v13 = v11 - 1; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
767 if ( !v13 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
768 break; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
769 v14 = v13 - 2; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
770 if ( !v14 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
771 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
772 v25 = v9 + 5; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
773 LABEL_43: |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
774 v37 = v25; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
775 goto LABEL_34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
776 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
777 v15 = v14 - 1; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
778 if ( v15 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
779 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
780 if ( v15 != 19 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
781 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
782 v16 = v12->uRightSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
783 v17 = v12->uWidth; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
784 v18 = v12->uLeftSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
785 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
786 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
787 if ( v37 > v36 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
788 v8 += v18; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
789 v8 += v17; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
790 if ( v37 < (signed int)v33 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
791 v8 += v16; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
792 v6 = v35; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
793 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
794 else |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
795 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
796 v19 = v36; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
797 v8 = v34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
798 v22 = v36 > v37; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
799 v20 = v36 == v37; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
800 v21 = v36 - v37 < 0; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
801 v6 = v35; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
802 pTmpBuf3[v36] = 10; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
803 v23 = v19; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
804 if ( (unsigned __int8)(v21 ^ v22) | v20 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
805 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
806 do |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
807 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
808 v24 = pTmpBuf3[v23]; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
809 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
810 { |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
811 if ( v23 > v19 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
812 v8 += v6->pMetrics[v24].uLeftSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
813 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
814 if ( v23 < v37 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
815 v8 += v6->pMetrics[v24].uRightSpacing; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
816 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
817 ++v23; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
818 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
819 while ( v23 <= v37 ); |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
820 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
821 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
822 goto LABEL_34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
823 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
824 v8 += v12->uWidth; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
825 goto LABEL_41; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
826 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
827 if ( !a5 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
828 return (char *)v30; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
829 LABEL_34: |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
830 v9 = v37++ + 1; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
831 if ( v37 >= (signed int)v33 ) |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
832 return pTmpBuf3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
833 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
834 v8 = v34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
835 LABEL_41: |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
836 v36 = v9; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
837 goto LABEL_34; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
838 } |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
839 return pTmpBuf3; |
91fa025e6ca6
font cleaning code
C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat!
parents:
93
diff
changeset
|
840 } |