Mercurial > might-and-magic-trilogy
comparison GUIWindow.cpp @ 160:062e8a8e09bc
LoadWindow(work)
30.11.12
author | Ritor1 |
---|---|
date | Fri, 30 Nov 2012 17:29:38 +0600 |
parents | b39bdc150e90 |
children | 90a9c828c2a6 |
comparison
equal
deleted
inserted
replaced
159:494015e90b8b | 160:062e8a8e09bc |
---|---|
1611 | 1611 |
1612 | 1612 |
1613 //----- (0044D406) -------------------------------------------------------- | 1613 //----- (0044D406) -------------------------------------------------------- |
1614 char *GUIWindow::DrawText2(GUIFont *a2, unsigned int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing) | 1614 char *GUIWindow::DrawText2(GUIFont *a2, unsigned int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing) |
1615 { | 1615 { |
1616 GUIWindow *v7; // esi@1 | 1616 GUIWindow *pWindow; // esi@1 |
1617 unsigned int v8; // ebx@1 | 1617 unsigned int v8; // ebx@1 |
1618 char *v9; // eax@1 | 1618 char *v9; // eax@1 |
1619 char *result; // eax@1 | 1619 char *result; // eax@1 |
1620 unsigned int v11; // edi@1 | 1620 unsigned int v11; // edi@1 |
1621 signed int v12; // esi@1 | 1621 signed int v12; // esi@1 |
1622 int v13; // eax@2 | 1622 int v13; // eax@2 |
1623 GUIFont *v14; // [sp+Ch] [bp-4h]@1 | 1623 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 |
1624 const char *Stra; // [sp+24h] [bp+14h]@5 | 1624 const char *Stra; // [sp+24h] [bp+14h]@5 |
1625 | 1625 |
1626 v7 = this; | 1626 pWindow = this; |
1627 v14 = a2; | 1627 pFont = a2; |
1628 v8 = this->uFrameWidth - uHorizontalMargin; | 1628 v8 = this->uFrameWidth - uHorizontalMargin; |
1629 ui_current_text_color = uDefaultColor; | 1629 ui_current_text_color = uDefaultColor; |
1630 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | 1630 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); |
1631 result = strtok(v9, "\n"); | 1631 result = strtok(v9, "\n"); |
1632 v11 = uHorizontalMargin + v7->uFrameX; | 1632 v11 = uHorizontalMargin + pWindow->uFrameX; |
1633 v12 = uVerticalMargin + v7->uFrameY; | 1633 v12 = uVerticalMargin + pWindow->uFrameY; |
1634 while ( 1 ) | 1634 while ( 1 ) |
1635 { | 1635 { |
1636 Stra = result; | 1636 Stra = result; |
1637 if ( !result ) | 1637 if ( !result ) |
1638 break; | 1638 break; |
1639 v13 = (signed int)(v8 - v14->GetLineWidth(result)) >> 1; | 1639 v13 = (signed int)(v8 - pFont->GetLineWidth(result)) >> 1; |
1640 if ( v13 < 0 ) | 1640 if ( v13 < 0 ) |
1641 v13 = 0; | 1641 v13 = 0; |
1642 v14->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640); | 1642 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640); |
1643 v12 += LOBYTE(v14->uFontHeight) - uLineSpacing; | 1643 v12 += LOBYTE(pFont->uFontHeight) - uLineSpacing; |
1644 result = strtok(0, "\n"); | 1644 result = strtok(0, "\n"); |
1645 } | 1645 } |
1646 return result; | 1646 return result; |
1647 } | 1647 } |
1648 // 5C6DB4: using guessed type int ui_current_text_color; | 1648 // 5C6DB4: using guessed type int ui_current_text_color; |
1837 int v24; // ebx@36 | 1837 int v24; // ebx@36 |
1838 char Str; // [sp+Ch] [bp-20h]@34 | 1838 char Str; // [sp+Ch] [bp-20h]@34 |
1839 char v26; // [sp+Fh] [bp-1Dh]@34 | 1839 char v26; // [sp+Fh] [bp-1Dh]@34 |
1840 char v27; // [sp+11h] [bp-1Bh]@35 | 1840 char v27; // [sp+11h] [bp-1Bh]@35 |
1841 int v28; // [sp+20h] [bp-Ch]@17 | 1841 int v28; // [sp+20h] [bp-Ch]@17 |
1842 GUIWindow *a1; // [sp+24h] [bp-8h]@1 | 1842 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 |
1843 size_t v30; // [sp+28h] [bp-4h]@1 | 1843 size_t v30; // [sp+28h] [bp-4h]@1 |
1844 size_t Str1a; // [sp+40h] [bp+14h]@5 | 1844 size_t Str1a; // [sp+40h] [bp+14h]@5 |
1845 size_t Str1b; // [sp+40h] [bp+14h]@19 | 1845 size_t Str1b; // [sp+40h] [bp+14h]@19 |
1846 const char *Sourcea; // [sp+44h] [bp+18h]@20 | 1846 const char *Sourcea; // [sp+44h] [bp+18h]@20 |
1847 int v34; // [sp+48h] [bp+1Ch]@26 | 1847 int v34; // [sp+48h] [bp+1Ch]@26 |
1848 | 1848 |
1849 v8 = a2; | 1849 v8 = a2; |
1850 a1 = this; | 1850 pWindow = this; |
1851 v30 = strlen(Str1); | 1851 v30 = strlen(Str1); |
1852 v9 = v8->GetLineWidth(Str1); | 1852 v9 = v8->GetLineWidth(Str1); |
1853 if ( v9 < Source ) | 1853 if ( v9 < Source ) |
1854 { | 1854 { |
1855 a1->DrawText(v8, uX, uY, uColor, Str1, 0, 0, 0); | 1855 pWindow->DrawText(v8, uX, uY, uColor, Str1, 0, 0, 0); |
1856 return v9; | 1856 return v9; |
1857 } | 1857 } |
1858 strcpy(pTmpBuf2, Str1); | 1858 strcpy(pTmpBuf2, Str1); |
1859 v11 = 0; | 1859 v11 = 0; |
1860 if ( a8 ) | 1860 if ( a8 ) |
1900 v30 = strlen(pTmpBuf2); | 1900 v30 = strlen(pTmpBuf2); |
1901 v28 = v8->GetLineWidth(pTmpBuf2); | 1901 v28 = v8->GetLineWidth(pTmpBuf2); |
1902 if ( a8 ) | 1902 if ( a8 ) |
1903 _strrev(pTmpBuf2); | 1903 _strrev(pTmpBuf2); |
1904 Str1b = 0; | 1904 Str1b = 0; |
1905 v13 = uX + a1->uFrameX; | 1905 v13 = uX + pWindow->uFrameX; |
1906 v14 = uY + a1->uFrameY; | 1906 v14 = uY + pWindow->uFrameY; |
1907 if ( (signed int)v30 > 0 ) | 1907 if ( (signed int)v30 > 0 ) |
1908 { | 1908 { |
1909 Sourcea = &pTmpBuf2[1]; | 1909 Sourcea = &pTmpBuf2[1]; |
1910 do | 1910 do |
1911 { | 1911 { |
1927 v26 = 0; | 1927 v26 = 0; |
1928 Str1b += 3; | 1928 Str1b += 3; |
1929 Sourcea += 3; | 1929 Sourcea += 3; |
1930 v22 = atoi(&Str); | 1930 v22 = atoi(&Str); |
1931 v23 = v8->GetLineWidth(&pTmpBuf2[Str1b]); | 1931 v23 = v8->GetLineWidth(&pTmpBuf2[Str1b]); |
1932 v13 = a1->uFrameZ - v23 - v22; | 1932 v13 = pWindow->uFrameZ - v23 - v22; |
1933 v14 = uY; | 1933 v14 = uY; |
1934 } | 1934 } |
1935 else | 1935 else |
1936 { | 1936 { |
1937 v20 = *((int *)&v8->cFirstChar + 3 * v16 + 9); | 1937 v20 = *((int *)&v8->cFirstChar + 3 * v16 + 9); |