Mercurial > mm7
comparison mm7_3.cpp @ 166:71b13d70f5a6
Слияние
author | Ritor1 |
---|---|
date | Thu, 14 Feb 2013 14:48:54 +0600 |
parents | 572d821561f3 933e2655c33d |
children | 90521fb9766c |
comparison
equal
deleted
inserted
replaced
165:572d821561f3 | 166:71b13d70f5a6 |
---|---|
19824 | 19824 |
19825 | 19825 |
19826 //----- (0044C768) -------------------------------------------------------- | 19826 //----- (0044C768) -------------------------------------------------------- |
19827 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) | 19827 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) |
19828 { | 19828 { |
19829 const char *v5; // edi@1 | |
19830 GUIFont *v6; // esi@1 | |
19831 unsigned int v8; // eax@3 | 19829 unsigned int v8; // eax@3 |
19832 int v9; // edi@3 | |
19833 unsigned __int8 v10; // cl@4 | 19830 unsigned __int8 v10; // cl@4 |
19834 int v11; // edx@10 | |
19835 GUICharMetric *v12; // ecx@10 | 19831 GUICharMetric *v12; // ecx@10 |
19836 int v13; // edx@11 | |
19837 int v14; // edx@12 | |
19838 int v15; // edx@13 | |
19839 unsigned int v16; // esi@15 | 19832 unsigned int v16; // esi@15 |
19840 unsigned int v17; // edx@15 | 19833 unsigned int v17; // edx@15 |
19841 unsigned int v18; // ecx@15 | 19834 unsigned int v18; // ecx@15 |
19842 int v19; // ebx@16 | |
19843 unsigned __int8 v20; // zf@16 | |
19844 char v21; // sf@16 | |
19845 unsigned __int8 v22; // of@16 | |
19846 int v23; // edi@16 | |
19847 unsigned __int8 v24; // dl@17 | 19835 unsigned __int8 v24; // dl@17 |
19848 int v25; // edi@39 | 19836 int v25; // edi@39 |
19849 int v26; // eax@42 | 19837 int v26; // eax@42 |
19850 std::string v27; // [sp-18h] [bp-40h]@2 | 19838 std::string v27; // [sp-18h] [bp-40h]@2 |
19851 const char *v28; // [sp-8h] [bp-30h]@2 | 19839 const char *v28; // [sp-8h] [bp-30h]@2 |
19852 int v29; // [sp-4h] [bp-2Ch]@2 | 19840 int v29; // [sp-4h] [bp-2Ch]@2 |
19853 const char *v30; // [sp+Ch] [bp-1Ch]@1 | |
19854 char Str[3]; // [sp+10h] [bp-18h]@42 | 19841 char Str[3]; // [sp+10h] [bp-18h]@42 |
19855 char v32; // [sp+13h] [bp-15h]@42 | 19842 char v32; // [sp+13h] [bp-15h]@42 |
19856 size_t v33; // [sp+14h] [bp-14h]@3 | 19843 int v33; // [sp+14h] [bp-14h]@3 |
19857 unsigned int v34; // [sp+18h] [bp-10h]@3 | |
19858 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1 | |
19859 int v36; // [sp+20h] [bp-8h]@3 | 19844 int v36; // [sp+20h] [bp-8h]@3 |
19860 int v37; // [sp+24h] [bp-4h]@3 | 19845 |
19861 | |
19862 v5 = pInString; | |
19863 v6 = pFont; | |
19864 v30 = pInString; | |
19865 v35 = pFont; | |
19866 if ( !pInString ) | 19846 if ( !pInString ) |
19867 { | 19847 { |
19868 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); | 19848 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); |
19869 return 0; | 19849 return 0; |
19870 } | 19850 } |
19871 v33 = strlen(pInString); | 19851 v33 = strlen(pInString); |
19872 strcpy(pTmpBuf3, v5); | 19852 strcpy(pTmpBuf3, pInString); |
19873 v8 = uX; | 19853 v8 = uX; |
19874 v9 = 0; | |
19875 v36 = 0; | 19854 v36 = 0; |
19876 v34 = uX; | 19855 for(int i=0;i<v33;i++) |
19877 v37 = 0; | 19856 { |
19878 if ( (signed int)v33 > 0 ) | 19857 v10 = pTmpBuf3[i]; |
19879 { | 19858 if(!(v10 < pFont->cFirstChar || v10 > pFont->cLastChar) || v10 == '\f' || v10 == '\r' || v10 == '\t' || v10 == '\n' ) |
19880 while ( 1 ) | 19859 { |
19881 { | 19860 v12 = &pFont->pMetrics[v10]; |
19882 v10 = pTmpBuf3[v9]; | 19861 if ( v10 == '\t' ) |
19883 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar) | 19862 { |
19884 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' ) | 19863 strncpy(Str, &pTmpBuf3[i + 1], 3u); |
19885 goto LABEL_34; | 19864 v32 = 0; |
19886 v11 = v10 - 9; | 19865 v26 = atoi(Str); |
19887 v12 = &v6->pMetrics[v10]; | 19866 v8 = uX + v26; |
19888 if ( !v11 ) | 19867 i+=3; |
19889 { | 19868 } |
19890 strncpy(Str, &pTmpBuf3[v9 + 1], 3u); | 19869 else if ( v10 == '\n' ) |
19891 v32 = 0; | 19870 { |
19892 v26 = atoi(Str); | 19871 v36 = i; |
19893 v8 = uX + v26; | 19872 } |
19894 v25 = v9 + 3; | 19873 else if ( v10 == '\f' ) |
19895 v34 = v8; | 19874 { |
19896 goto LABEL_43; | 19875 i+=5; |
19897 } | 19876 } |
19898 v13 = v11 - 1; | 19877 else if ( v10 == '\r' && !a5) |
19899 if ( !v13 ) | 19878 return (char *)pInString; |
19900 break; | 19879 else if ( v10 == ' ' ) |
19901 v14 = v13 - 2; | 19880 { |
19902 if ( !v14 ) | 19881 v8 += v12->uWidth; |
19903 { | 19882 v36 = i; |
19904 v25 = v9 + 5; | 19883 } |
19905 LABEL_43: | 19884 else |
19906 v37 = v25; | 19885 { |
19907 goto LABEL_34; | 19886 v16 = v12->uRightSpacing; |
19908 } | 19887 v17 = v12->uWidth; |
19909 v15 = v14 - 1; | 19888 v18 = v12->uLeftSpacing; |
19910 if ( v15 ) | 19889 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) |
19911 { | 19890 { |
19912 if ( v15 != 19 ) | 19891 if ( i > v36 ) |
19913 { | 19892 v8 += v18; |
19914 v16 = v12->uRightSpacing; | 19893 v8 += v17; |
19915 v17 = v12->uWidth; | 19894 if ( i < v33 ) |
19916 v18 = v12->uLeftSpacing; | 19895 v8 += v16; |
19917 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) | 19896 } |
19918 { | 19897 else |
19919 if ( v37 > v36 ) | 19898 { |
19920 v8 += v18; | 19899 pTmpBuf3[v36] = 10; |
19921 v8 += v17; | 19900 if ( v36 == i )//(unsigned __int8)(v21 ^ v22) | v20 ) |
19922 if ( v37 < (signed int)v33 ) | 19901 { |
19923 v8 += v16; | 19902 for(int j=v36;j<=i;j++) |
19924 v6 = v35; | 19903 { |
19925 } | 19904 v24 = pTmpBuf3[j]; |
19926 else | 19905 if ( v24 >= pFont->cFirstChar && v24 <= pFont->cLastChar || v24 == '\f' || v24 == '\r' || v24 == '\t' || v24 == '\n' ) |
19927 { | 19906 { |
19928 v19 = v36; | 19907 if ( j > v36 ) |
19929 v8 = v34; | 19908 v8 += pFont->pMetrics[v24].uLeftSpacing; |
19930 v22 = v36 > v37; | 19909 v8 += pFont->pMetrics[v24].uWidth;//*((int *)&pFont->cFirstChar + 3 * v24 + 9); |
19931 v20 = v36 == v37; | 19910 if ( j < i ) |
19932 v21 = v36 - v37 < 0; | 19911 v8 += pFont->pMetrics[v24].uRightSpacing; |
19933 v6 = v35; | 19912 } |
19934 pTmpBuf3[v36] = 10; | 19913 } |
19935 v23 = v19; | 19914 } |
19936 if ( (unsigned __int8)(v21 ^ v22) | v20 ) | 19915 } |
19937 { | 19916 } |
19938 do | 19917 } |
19939 { | |
19940 v24 = pTmpBuf3[v23]; | |
19941 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 ) | |
19942 { | |
19943 if ( v23 > v19 ) | |
19944 v8 += v6->pMetrics[v24].uLeftSpacing; | |
19945 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9); | |
19946 if ( v23 < v37 ) | |
19947 v8 += v6->pMetrics[v24].uRightSpacing; | |
19948 } | |
19949 ++v23; | |
19950 } | |
19951 while ( v23 <= v37 ); | |
19952 } | |
19953 } | |
19954 goto LABEL_34; | |
19955 } | |
19956 v8 += v12->uWidth; | |
19957 goto LABEL_41; | |
19958 } | |
19959 if ( !a5 ) | |
19960 return (char *)v30; | |
19961 LABEL_34: | |
19962 v9 = v37++ + 1; | |
19963 if ( v37 >= (signed int)v33 ) | |
19964 return pTmpBuf3; | |
19965 } | |
19966 v8 = v34; | |
19967 LABEL_41: | |
19968 v36 = v9; | |
19969 goto LABEL_34; | |
19970 } | 19918 } |
19971 return pTmpBuf3; | 19919 return pTmpBuf3; |
19972 } | 19920 } |
19973 //----- (00401000) -------------------------------------------------------- | 19921 //----- (00401000) -------------------------------------------------------- |
19974 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) | 19922 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) |