Mercurial > mm7
comparison GUIFont.cpp @ 24:352b15291822
18.01.13 (PlaySound work)
author | Ritor1 |
---|---|
date | Fri, 18 Jan 2013 17:30:54 +0600 |
parents | 9c0607679772 |
children | 5629105aa178 |
comparison
equal
deleted
inserted
replaced
23:75d706037de4 | 24:352b15291822 |
---|---|
622 | 622 |
623 | 623 |
624 //----- (0044C51E) -------------------------------------------------------- | 624 //----- (0044C51E) -------------------------------------------------------- |
625 int GUIFont::GetLineWidth(const char *pString) | 625 int GUIFont::GetLineWidth(const char *pString) |
626 { | 626 { |
627 GUIFont *v2; // edi@1 | 627 GUIFont *pFont; // edi@1 |
628 size_t v4; // ebp@3 | 628 size_t pNumLen; // ebp@3 |
629 int v5; // esi@3 | 629 int v5; // esi@3 |
630 signed int i; // ebx@3 | 630 signed int i; // ebx@3 |
631 unsigned __int8 v7; // cl@4 | 631 unsigned __int8 v7; // cl@4 |
632 const char *v8; // [sp+0h] [bp-4h]@1 | 632 const char *pStr; // [sp+0h] [bp-4h]@1 |
633 | 633 |
634 v8 = pString; | 634 pStr = pString; |
635 v2 = this; | 635 pFont = this; |
636 if ( !pString ) | 636 if ( !pString ) // == 0 |
637 return 0; | 637 return 0; |
638 v4 = strlen(pString); | 638 pNumLen = strlen(pString); |
639 v5 = 0; | 639 v5 = 0; |
640 for ( i = 0; i < (signed int)v4; ++i ) | 640 for ( i = 0; i < (signed int)pNumLen; ++i ) |
641 { | 641 { |
642 if ( IsCharValid(v7 = v8[i]) ) | 642 if ( IsCharValid(v7 = pStr[i]) ) |
643 { | 643 { |
644 if ( v7 < 9u ) | 644 if ( v7 < 9u ) |
645 goto LABEL_9; | 645 { |
646 if ( i > 0 ) | |
647 v5 += pFont->pMetrics[v7].uLeftSpacing; | |
648 v5 += *((int *)&pFont->cFirstChar + 3 * v7 + 9); | |
649 if ( i < (signed int)pNumLen ) | |
650 v5 += pFont->pMetrics[v7].uRightSpacing; | |
651 continue; | |
652 } | |
646 if ( v7 <= 0xAu ) | 653 if ( v7 <= 0xAu ) |
647 return v5; | 654 return v5; |
648 if ( v7 != '\f' ) | 655 if ( v7 != '\f' ) |
649 { | 656 { |
650 if ( v7 == '\r' ) | 657 if ( v7 == '\r' ) |
651 return v5; | 658 return v5; |
652 LABEL_9: | |
653 if ( i > 0 ) | 659 if ( i > 0 ) |
654 v5 += v2->pMetrics[v7].uLeftSpacing; | 660 v5 += pFont->pMetrics[v7].uLeftSpacing; |
655 v5 += *((int *)&v2->cFirstChar + 3 * v7 + 9); | 661 v5 += *((int *)&pFont->cFirstChar + 3 * v7 + 9); |
656 if ( i < (signed int)v4 ) | 662 if ( i < (signed int)pNumLen ) |
657 v5 += v2->pMetrics[v7].uRightSpacing; | 663 v5 += pFont->pMetrics[v7].uRightSpacing; |
658 continue; | 664 continue; |
659 } | 665 } |
660 i += 5; | 666 i += 5; |
661 } | 667 } |
662 } | 668 } |