Mercurial > mm7
comparison mm7_3.cpp @ 176:05682713195c
Обращённый набор изменений: 91fa025e6ca6
author | Ritor1 |
---|---|
date | Fri, 15 Feb 2013 10:32:09 +0600 |
parents | 4ae88cd19c30 |
children | c10509e439f1 |
comparison
equal
deleted
inserted
replaced
175:304d7afce43f | 176:05682713195c |
---|---|
20387 v13 = v8 * v7 * 65536.0; | 20387 v13 = v8 * v7 * 65536.0; |
20388 v14 = v13 + 6.7553994e15; | 20388 v14 = v13 + 6.7553994e15; |
20389 v1->z = LODWORD(v14); | 20389 v1->z = LODWORD(v14); |
20390 } | 20390 } |
20391 | 20391 |
20392 | 20392 //----- (0044C448) -------------------------------------------------------- |
20393 | 20393 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...) |
20394 | 20394 { |
20395 | 20395 GUIFont *result; // eax@1 |
20396 | 20396 const char *v3; // edi@1 |
20397 const char **v4; // ebx@2 | |
20398 unsigned int v5; // eax@3 | |
20399 unsigned __int16 **v6; // ecx@6 | |
20400 GUIFont *v7; // [sp+4h] [bp-Ch]@1 | |
20401 int v8; // [sp+8h] [bp-8h]@1 | |
20402 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2 | |
20403 | |
20404 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0); | |
20405 v3 = pFontPalette; | |
20406 v8 = 0; | |
20407 v7 = result; | |
20408 if ( pFontPalette ) | |
20409 { | |
20410 v4 = &pFontPalette; | |
20411 v9 = result->pFontPalettes; | |
20412 do | |
20413 { | |
20414 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE); | |
20415 if ( v5 == -1 ) | |
20416 { | |
20417 sprintf(pTmpBuf, "Unable to open %s", v3); | |
20418 Abortf(pTmpBuf); | |
20419 } | |
20420 ++v4; | |
20421 v6 = v9; | |
20422 v3 = *v4; | |
20423 ++v8; | |
20424 ++v9; | |
20425 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0); | |
20426 } | |
20427 while ( v3 ); | |
20428 result = v7; | |
20429 } | |
20430 result->field_8 = v8; | |
20431 return result; | |
20432 } | |
20433 | |
20434 | |
20435 | |
20436 | |
20437 //----- (0044C768) -------------------------------------------------------- | |
20438 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) | |
20439 { | |
20440 const char *v5; // edi@1 | |
20441 GUIFont *v6; // esi@1 | |
20442 unsigned int v8; // eax@3 | |
20443 int v9; // edi@3 | |
20444 unsigned __int8 v10; // cl@4 | |
20445 int v11; // edx@10 | |
20446 GUICharMetric *v12; // ecx@10 | |
20447 int v13; // edx@11 | |
20448 int v14; // edx@12 | |
20449 int v15; // edx@13 | |
20450 unsigned int v16; // esi@15 | |
20451 unsigned int v17; // edx@15 | |
20452 unsigned int v18; // ecx@15 | |
20453 int v19; // ebx@16 | |
20454 unsigned __int8 v20; // zf@16 | |
20455 char v21; // sf@16 | |
20456 unsigned __int8 v22; // of@16 | |
20457 int v23; // edi@16 | |
20458 unsigned __int8 v24; // dl@17 | |
20459 int v25; // edi@39 | |
20460 int v26; // eax@42 | |
20461 std::string v27; // [sp-18h] [bp-40h]@2 | |
20462 const char *v28; // [sp-8h] [bp-30h]@2 | |
20463 int v29; // [sp-4h] [bp-2Ch]@2 | |
20464 const char *v30; // [sp+Ch] [bp-1Ch]@1 | |
20465 char Str[3]; // [sp+10h] [bp-18h]@42 | |
20466 char v32; // [sp+13h] [bp-15h]@42 | |
20467 size_t v33; // [sp+14h] [bp-14h]@3 | |
20468 unsigned int v34; // [sp+18h] [bp-10h]@3 | |
20469 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1 | |
20470 int v36; // [sp+20h] [bp-8h]@3 | |
20471 int v37; // [sp+24h] [bp-4h]@3 | |
20472 | |
20473 v5 = pInString; | |
20474 v6 = pFont; | |
20475 v30 = pInString; | |
20476 v35 = pFont; | |
20477 if ( !pInString ) | |
20478 { | |
20479 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); | |
20480 return 0; | |
20481 } | |
20482 v33 = strlen(pInString); | |
20483 strcpy(pTmpBuf3, v5); | |
20484 v8 = uX; | |
20485 v9 = 0; | |
20486 v36 = 0; | |
20487 v34 = uX; | |
20488 v37 = 0; | |
20489 if ( (signed int)v33 > 0 ) | |
20490 { | |
20491 while ( 1 ) | |
20492 { | |
20493 v10 = pTmpBuf3[v9]; | |
20494 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar) | |
20495 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' ) | |
20496 goto LABEL_34; | |
20497 v11 = v10 - 9; | |
20498 v12 = &v6->pMetrics[v10]; | |
20499 if ( !v11 ) | |
20500 { | |
20501 strncpy(Str, &pTmpBuf3[v9 + 1], 3u); | |
20502 v32 = 0; | |
20503 v26 = atoi(Str); | |
20504 v8 = uX + v26; | |
20505 v25 = v9 + 3; | |
20506 v34 = v8; | |
20507 goto LABEL_43; | |
20508 } | |
20509 v13 = v11 - 1; | |
20510 if ( !v13 ) | |
20511 break; | |
20512 v14 = v13 - 2; | |
20513 if ( !v14 ) | |
20514 { | |
20515 v25 = v9 + 5; | |
20516 LABEL_43: | |
20517 v37 = v25; | |
20518 goto LABEL_34; | |
20519 } | |
20520 v15 = v14 - 1; | |
20521 if ( v15 ) | |
20522 { | |
20523 if ( v15 != 19 ) | |
20524 { | |
20525 v16 = v12->uRightSpacing; | |
20526 v17 = v12->uWidth; | |
20527 v18 = v12->uLeftSpacing; | |
20528 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) | |
20529 { | |
20530 if ( v37 > v36 ) | |
20531 v8 += v18; | |
20532 v8 += v17; | |
20533 if ( v37 < (signed int)v33 ) | |
20534 v8 += v16; | |
20535 v6 = v35; | |
20536 } | |
20537 else | |
20538 { | |
20539 v19 = v36; | |
20540 v8 = v34; | |
20541 v22 = v36 > v37; | |
20542 v20 = v36 == v37; | |
20543 v21 = v36 - v37 < 0; | |
20544 v6 = v35; | |
20545 pTmpBuf3[v36] = 10; | |
20546 v23 = v19; | |
20547 if ( (unsigned __int8)(v21 ^ v22) | v20 ) | |
20548 { | |
20549 do | |
20550 { | |
20551 v24 = pTmpBuf3[v23]; | |
20552 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 ) | |
20553 { | |
20554 if ( v23 > v19 ) | |
20555 v8 += v6->pMetrics[v24].uLeftSpacing; | |
20556 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9); | |
20557 if ( v23 < v37 ) | |
20558 v8 += v6->pMetrics[v24].uRightSpacing; | |
20559 } | |
20560 ++v23; | |
20561 } | |
20562 while ( v23 <= v37 ); | |
20563 } | |
20564 } | |
20565 goto LABEL_34; | |
20566 } | |
20567 v8 += v12->uWidth; | |
20568 goto LABEL_41; | |
20569 } | |
20570 if ( !a5 ) | |
20571 return (char *)v30; | |
20572 LABEL_34: | |
20573 v9 = v37++ + 1; | |
20574 if ( v37 >= (signed int)v33 ) | |
20575 return pTmpBuf3; | |
20576 } | |
20577 v8 = v34; | |
20578 LABEL_41: | |
20579 v36 = v9; | |
20580 goto LABEL_34; | |
20581 } | |
20582 return pTmpBuf3; | |
20583 } | |
20397 //----- (00401000) -------------------------------------------------------- | 20584 //----- (00401000) -------------------------------------------------------- |
20398 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) | 20585 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) |
20399 { | 20586 { |
20400 void *v4; // esi@2 | 20587 void *v4; // esi@2 |
20401 int v5; // edi@2 | 20588 int v5; // edi@2 |