Mercurial > mm7
comparison mm7_6.cpp @ 1765:53c0453f4eb2
new_draw_object_dist
author | Ritor1 |
---|---|
date | Wed, 02 Oct 2013 17:11:15 +0600 |
parents | 845a6503f55c |
children | d73f4668ef94 |
comparison
equal
deleted
inserted
replaced
1764:2051dfa0a00c | 1765:53c0453f4eb2 |
---|---|
43 | 43 |
44 | 44 |
45 //----- (00424EE0) -------------------------------------------------------- | 45 //----- (00424EE0) -------------------------------------------------------- |
46 int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | 46 int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) |
47 { | 47 { |
48 unsigned int v1; // edx@1 | 48 //unsigned int v1; // edx@1 |
49 double v2; // st7@1 | 49 double v2; // st7@1 |
50 signed int v3; // edi@1 | 50 signed int v3; // edi@1 |
51 char *v4; // esi@4 | 51 char *v4; // esi@4 |
52 char *v5; // ecx@4 | 52 char *v5; // ecx@4 |
53 unsigned int v6; // eax@4 | 53 //unsigned int v6; // eax@4 |
54 char *v7; // edx@4 | 54 char *v7; // edx@4 |
55 double v8; // st6@10 | 55 double v8; // st6@10 |
56 double v9; // st5@10 | 56 double v9; // st5@10 |
57 double v10; // st6@11 | 57 double v10; // st6@11 |
58 unsigned __int8 v11; // c2@15 | 58 unsigned __int8 v11; // c2@15 |
72 char *v25; // [sp+24h] [bp-10h]@4 | 72 char *v25; // [sp+24h] [bp-10h]@4 |
73 char *v26; // [sp+28h] [bp-Ch]@4 | 73 char *v26; // [sp+28h] [bp-Ch]@4 |
74 char *v27; // [sp+2Ch] [bp-8h]@4 | 74 char *v27; // [sp+2Ch] [bp-8h]@4 |
75 char *v28; // [sp+30h] [bp-4h]@4 | 75 char *v28; // [sp+30h] [bp-4h]@4 |
76 | 76 |
77 v1 = uVertexID; | |
78 v2 = (double)pODMRenderParams->shading_dist_mist; | 77 v2 = (double)pODMRenderParams->shading_dist_mist; |
79 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | 78 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); |
80 v3 = 0; | 79 v3 = 0; |
81 v22 = 0; | 80 v22 = 0; |
82 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | 81 if ( array_50AC10[0].vWorldViewPosition.x <= (double)pODMRenderParams->shading_dist_mist ) |
83 v3 = 1; | 82 v3 = 1; |
84 if ( (signed int)(uVertexID + 1) <= 1 ) | 83 if ( (signed int)(uVertexID + 1) <= 1 ) |
85 return 0; | 84 return 0; |
86 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | 85 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; |
87 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | 86 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; |
88 v6 = v1; | |
89 v23 = (char *)&array_507D30[0].flt_2C; | 87 v23 = (char *)&array_507D30[0].flt_2C; |
90 v26 = (char *)&array_507D30[0]._rhw; | 88 v26 = (char *)&array_507D30[0]._rhw; |
91 v24 = array_507D30; | 89 v24 = array_507D30; |
92 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | 90 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; |
93 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | 91 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; |
94 v25 = (char *)&array_507D30[0].vWorldViewPosition; | 92 v25 = (char *)&array_507D30[0].vWorldViewPosition; |
95 v27 = (char *)&array_507D30[0].v; | 93 v27 = (char *)&array_507D30[0].v; |
96 v28 = (char *)&array_507D30[0].u; | 94 v28 = (char *)&array_507D30[0].u; |
97 v7 = (char *)&array_50AC10[0].v; | 95 v7 = (char *)&array_50AC10[0].v; |
98 v18 = v6; | 96 for ( v18 = 1; v18 <= uVertexID; ++v18 ) |
99 do | 97 { |
100 { | 98 v19 = v2 >= array_50AC10[v18].vWorldViewPosition.x; |
101 v19 = v2 >= *((float *)v7 + 5); | |
102 if ( v3 != v19 ) | 99 if ( v3 != v19 ) |
103 { | 100 { |
104 if ( v19 ) | 101 if ( v19 ) |
105 { | 102 { |
106 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | 103 v8 = (v2 - array_50AC10[v18 - 1].vWorldViewPosition.x) / (array_50AC10[v18].vWorldViewPosition.x - array_50AC10[v18 - 1].vWorldViewPosition.x); |
107 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | 104 *(float *)v5 = (array_50AC10[v18].vWorldViewPosition.y - array_50AC10[v18 - 1].vWorldViewPosition.y) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.y; |
108 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | 105 *(float *)v4 = (array_50AC10[v18].vWorldViewPosition.z - array_50AC10[v18 - 1].vWorldViewPosition.z) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.z; |
109 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | 106 *(float *)v28 = (array_50AC10[v18].u - array_50AC10[v18 - 1].u) * v8 + array_50AC10[v18 - 1].u; |
110 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | 107 v9 = (array_50AC10[v18].v - array_50AC10[v18 - 1].v) * v8 + array_50AC10[v18 - 1].v; |
111 } | 108 } |
112 else | 109 else |
113 { | 110 { |
114 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | 111 v10 = (v2 - array_50AC10[v18].vWorldViewPosition.x) / (array_50AC10[v18 - 1].vWorldViewPosition.x - array_50AC10[v18].vWorldViewPosition.x); |
115 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | 112 *(float *)v5 = (array_50AC10[v18 - 1].vWorldViewPosition.y - array_50AC10[v18].vWorldViewPosition.y) * v10 + array_50AC10[v18].vWorldViewPosition.y; |
116 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | 113 *(float *)v4 = (array_50AC10[v18 - 1].vWorldViewPosition.z - array_50AC10[v18].vWorldViewPosition.z) * v10 + array_50AC10[v18].vWorldViewPosition.z; |
117 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | 114 *(float *)v28 = (array_50AC10[v18 - 1].u - array_50AC10[v18].u) * v10 + array_50AC10[v18].u; |
118 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | 115 v9 = (array_50AC10[v18 - 1].v - array_50AC10[v18].v) * v10 + array_50AC10[v18].v; |
119 } | 116 } |
120 *(float *)v27 = v9; | 117 *(float *)v27 = v9; |
121 *(float *)v25 = v2; | 118 *(float *)v25 = v2; |
122 *(float *)v26 = 1.0 / v2; | 119 *(float *)v26 = 1.0 / v2; |
123 if ( v3 ) | 120 if ( v3 ) |
197 *(int *)v16 = *((int *)v7 + 13); | 194 *(int *)v16 = *((int *)v7 + 13); |
198 v5 = v21; | 195 v5 = v21; |
199 } | 196 } |
200 v3 = v19; | 197 v3 = v19; |
201 v7 += 48; | 198 v7 += 48; |
202 --v18; | 199 //--v18; |
203 } | 200 } |
204 while ( v18 ); | 201 //while ( v18 ); |
205 result = v22; | 202 result = v22; |
206 if ( v22 < 3 ) | 203 if ( v22 < 3 ) |
207 return 0; | 204 return 0; |
208 return result; | 205 return result; |
209 } | 206 } |
323 ShowStatusBarString(pTmpBuf2.data(), 2u); | 320 ShowStatusBarString(pTmpBuf2.data(), 2u); |
324 if ( !pParty->AddItemToParty(&Dst) ) | 321 if ( !pParty->AddItemToParty(&Dst) ) |
325 pParty->SetHoldingItem(&Dst); | 322 pParty->SetHoldingItem(&Dst); |
326 v13 = 1; | 323 v13 = 1; |
327 } | 324 } |
328 goto LABEL_44; | 325 v8 = pParty; |
326 goto LABEL_45; | |
329 } | 327 } |
330 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | 328 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) |
331 { | 329 { |
332 LABEL_44: | |
333 v8 = pParty; | 330 v8 = pParty; |
334 goto LABEL_45; | 331 goto LABEL_45; |
335 } | 332 } |
336 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | 333 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); |
337 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | 334 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; |
338 if ( v14 ) | 335 if ( v14 ) |
339 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10); | 336 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);//Вы нашли ^I[%d] золот^L[ой;ых;ых] и предмет (%s)! |
340 else | 337 else |
341 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10); | 338 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);//Вы нашли ^Pv[%s]! |
342 ShowStatusBarString(pTmpBuf2.data(), 2u); | 339 ShowStatusBarString(pTmpBuf2.data(), 2); |
343 v8 = pParty; | 340 v8 = pParty; |
344 if ( !pParty->AddItemToParty(&Dst) ) | 341 if ( !pParty->AddItemToParty(&Dst) ) |
345 pParty->SetHoldingItem(&Dst); | 342 pParty->SetHoldingItem(&Dst); |
346 v13 = 1; | 343 v13 = 1; |
347 LABEL_45: | 344 LABEL_45: |
889 v5 = 0; | 886 v5 = 0; |
890 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | 887 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) |
891 v5 = pActor->pActorBuffs[14].uPower; | 888 v5 = pActor->pActorBuffs[14].uPower; |
892 switch ( a2 ) | 889 switch ( a2 ) |
893 { | 890 { |
894 case 4: | |
895 v6 = pActor->pMonsterInfo.uResPhysical; | |
896 break; | |
897 case 0: | 891 case 0: |
898 v6 = pActor->pMonsterInfo.uResFire; | 892 v6 = pActor->pMonsterInfo.uResFire; |
899 v4 = v5; | 893 v4 = v5; |
900 break; | 894 break; |
901 case 1: | 895 case 1: |
907 v4 = v5; | 901 v4 = v5; |
908 break; | 902 break; |
909 case 3: | 903 case 3: |
910 v6 = pActor->pMonsterInfo.uResEarth; | 904 v6 = pActor->pMonsterInfo.uResEarth; |
911 v4 = v5; | 905 v4 = v5; |
906 break; | |
907 case 4: | |
908 v6 = pActor->pMonsterInfo.uResPhysical; | |
912 break; | 909 break; |
913 case 6: | 910 case 6: |
914 v6 = pActor->pMonsterInfo.uResSpirit; | 911 v6 = pActor->pMonsterInfo.uResSpirit; |
915 break; | 912 break; |
916 case 7: | 913 case 7: |
958 } | 955 } |
959 | 956 |
960 //----- (00427662) -------------------------------------------------------- | 957 //----- (00427662) -------------------------------------------------------- |
961 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | 958 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) |
962 { | 959 { |
963 Actor *v3; // edi@2 | 960 signed int resist; // esi@2 |
964 signed int v4; // esi@2 | |
965 bool result; // eax@13 | 961 bool result; // eax@13 |
966 | 962 |
967 switch ( uType ) | 963 switch ( uType ) |
968 { | 964 { |
969 case 0u: | 965 case 0: |
970 v3 = pActor; | 966 resist = pActor->pMonsterInfo.uResFire; |
971 v4 = pActor->pMonsterInfo.uResFire; | 967 break; |
972 case 1u: | 968 case 1: |
973 v3 = pActor; | 969 resist = pActor->pMonsterInfo.uResAir; |
974 v4 = pActor->pMonsterInfo.uResAir; | 970 break; |
975 case 2u: | 971 case 2: |
976 v3 = pActor; | 972 resist = pActor->pMonsterInfo.uResWater; |
977 v4 = pActor->pMonsterInfo.uResWater; | 973 break; |
978 case 3u: | 974 case 3: |
979 v3 = pActor; | 975 resist = pActor->pMonsterInfo.uResEarth; |
980 v4 = pActor->pMonsterInfo.uResEarth; | 976 break; |
981 case 7u: | 977 case 4: |
982 v3 = pActor; | 978 resist = pActor->pMonsterInfo.uResPhysical; |
983 v4 = pActor->pMonsterInfo.uResMind; | 979 break; |
984 case 6u: | 980 case 6: |
985 v3 = pActor; | 981 resist = pActor->pMonsterInfo.uResSpirit; |
986 v4 = pActor->pMonsterInfo.uResSpirit; | 982 break; |
987 case 8u: | 983 case 7: |
988 v3 = pActor; | 984 resist = pActor->pMonsterInfo.uResMind; |
989 v4 = pActor->pMonsterInfo.uResBody; | 985 case 8: |
990 case 9u: | 986 resist = pActor->pMonsterInfo.uResBody; |
991 v3 = pActor; | 987 break; |
992 v4 = pActor->pMonsterInfo.uResLight; | 988 case 9: |
993 case 0xAu: | 989 resist = pActor->pMonsterInfo.uResLight; |
994 v3 = pActor; | 990 break; |
995 v4 = pActor->pMonsterInfo.uResDark; | 991 case 10: |
996 case 4u: | 992 resist = pActor->pMonsterInfo.uResDark; |
997 v3 = pActor; | |
998 v4 = pActor->pMonsterInfo.uResPhysical; | |
999 break; | 993 break; |
1000 default: | 994 default: |
1001 return 1; | 995 return 1; |
1002 } | 996 } |
1003 if ( v4 < 200 ) | 997 if ( resist < 200 ) |
1004 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | 998 result = rand() % (signed int)(((unsigned int)pActor->pMonsterInfo.uLevel >> 2) + resist + 30) < 30; |
1005 else | 999 else |
1006 result = 0; | 1000 result = 0; |
1007 return result; | 1001 return result; |
1008 } | 1002 } |
1009 | 1003 |
1010 //----- (0042EB8D) -------------------------------------------------------- | 1004 //----- (0042EB8D) -------------------------------------------------------- |
1011 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) | 1005 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |