Mercurial > mm7
comparison mm7_6.cpp @ 1794:3f1e09a71726
Merge
author | Grumpy7 |
---|---|
date | Sun, 06 Oct 2013 09:21:09 +0200 |
parents | 0c4d3c6a9d5a |
children | bdac32c645c5 |
comparison
equal
deleted
inserted
replaced
1793:4dee76d79c78 | 1794:3f1e09a71726 |
---|---|
40 | 40 |
41 #include "mm7_data.h" | 41 #include "mm7_data.h" |
42 | 42 |
43 | 43 |
44 | 44 |
45 //----- (00424EE0) -------------------------------------------------------- | |
46 int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
47 { | |
48 //unsigned int v1; // edx@1 | |
49 double v2; // st7@1 | |
50 signed int v3; // edi@1 | |
51 char *v4; // esi@4 | |
52 char *v5; // ecx@4 | |
53 //unsigned int v6; // eax@4 | |
54 char *v7; // edx@4 | |
55 double v8; // st6@10 | |
56 double v9; // st5@10 | |
57 double v10; // st6@11 | |
58 unsigned __int8 v11; // c2@15 | |
59 unsigned __int8 v12; // c3@15 | |
60 void *v13; // edi@22 | |
61 char *v14; // eax@22 | |
62 double v15; // st6@22 | |
63 char *v16; // ecx@22 | |
64 signed int result; // eax@24 | |
65 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
66 bool v19; // [sp+Ch] [bp-28h]@6 | |
67 char *v20; // [sp+10h] [bp-24h]@4 | |
68 char *v21; // [sp+14h] [bp-20h]@4 | |
69 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
70 char *v23; // [sp+1Ch] [bp-18h]@4 | |
71 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
72 char *v25; // [sp+24h] [bp-10h]@4 | |
73 char *v26; // [sp+28h] [bp-Ch]@4 | |
74 char *v27; // [sp+2Ch] [bp-8h]@4 | |
75 char *v28; // [sp+30h] [bp-4h]@4 | |
76 | |
77 v2 = (double)pODMRenderParams->shading_dist_mist; | |
78 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
79 v3 = 0; | |
80 v22 = 0; | |
81 if ( array_50AC10[0].vWorldViewPosition.x <= (double)pODMRenderParams->shading_dist_mist ) | |
82 v3 = 1; | |
83 if ( (signed int)(uVertexID + 1) <= 1 ) | |
84 return 0; | |
85 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
86 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
87 v23 = (char *)&array_507D30[0].flt_2C; | |
88 v26 = (char *)&array_507D30[0]._rhw; | |
89 v24 = array_507D30; | |
90 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
91 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
92 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
93 v27 = (char *)&array_507D30[0].v; | |
94 v28 = (char *)&array_507D30[0].u; | |
95 v7 = (char *)&array_50AC10[0].v; | |
96 for ( v18 = 1; v18 <= uVertexID; ++v18 ) | |
97 { | |
98 v19 = v2 >= array_50AC10[v18].vWorldViewPosition.x; | |
99 if ( v3 != v19 ) | |
100 { | |
101 if ( v19 ) | |
102 { | |
103 v8 = (v2 - array_50AC10[v18 - 1].vWorldViewPosition.x) / (array_50AC10[v18].vWorldViewPosition.x - array_50AC10[v18 - 1].vWorldViewPosition.x); | |
104 *(float *)v5 = (array_50AC10[v18].vWorldViewPosition.y - array_50AC10[v18 - 1].vWorldViewPosition.y) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.y; | |
105 *(float *)v4 = (array_50AC10[v18].vWorldViewPosition.z - array_50AC10[v18 - 1].vWorldViewPosition.z) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.z; | |
106 *(float *)v28 = (array_50AC10[v18].u - array_50AC10[v18 - 1].u) * v8 + array_50AC10[v18 - 1].u; | |
107 v9 = (array_50AC10[v18].v - array_50AC10[v18 - 1].v) * v8 + array_50AC10[v18 - 1].v; | |
108 } | |
109 else | |
110 { | |
111 v10 = (v2 - array_50AC10[v18].vWorldViewPosition.x) / (array_50AC10[v18 - 1].vWorldViewPosition.x - array_50AC10[v18].vWorldViewPosition.x); | |
112 *(float *)v5 = (array_50AC10[v18 - 1].vWorldViewPosition.y - array_50AC10[v18].vWorldViewPosition.y) * v10 + array_50AC10[v18].vWorldViewPosition.y; | |
113 *(float *)v4 = (array_50AC10[v18 - 1].vWorldViewPosition.z - array_50AC10[v18].vWorldViewPosition.z) * v10 + array_50AC10[v18].vWorldViewPosition.z; | |
114 *(float *)v28 = (array_50AC10[v18 - 1].u - array_50AC10[v18].u) * v10 + array_50AC10[v18].u; | |
115 v9 = (array_50AC10[v18 - 1].v - array_50AC10[v18].v) * v10 + array_50AC10[v18].v; | |
116 } | |
117 *(float *)v27 = v9; | |
118 *(float *)v25 = v2; | |
119 *(float *)v26 = 1.0 / v2; | |
120 if ( v3 ) | |
121 { | |
122 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
123 { | |
124 v11 = 0; | |
125 v12 = *(float *)v4 == *((float *)v7 - 5); | |
126 if ( ! (v12 | v11) ) | |
127 { | |
128 v26 += 48; | |
129 ++v24; | |
130 v25 += 48; | |
131 v27 += 48; | |
132 v28 += 48; | |
133 v5 += 48; | |
134 v4 += 48; | |
135 ++v22; | |
136 v23 += 48; | |
137 v21 = v5; | |
138 v20 = v4; | |
139 } | |
140 } | |
141 } | |
142 else | |
143 { | |
144 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
145 { | |
146 v11 = 0; | |
147 v12 = *(float *)v4 == *((float *)v7 + 7); | |
148 if ( !(v12 | v11) ) | |
149 { | |
150 v26 += 48; | |
151 ++v24; | |
152 v25 += 48; | |
153 v27 += 48; | |
154 v28 += 48; | |
155 v5 += 48; | |
156 v4 += 48; | |
157 ++v22; | |
158 v23 += 48; | |
159 v21 = v5; | |
160 v20 = v4; | |
161 } | |
162 } | |
163 } | |
164 v26 += 48; | |
165 ++v24; | |
166 v25 += 48; | |
167 v27 += 48; | |
168 v28 += 48; | |
169 v5 += 48; | |
170 v4 += 48; | |
171 ++v22; | |
172 v23 += 48; | |
173 v21 = v5; | |
174 v20 = v4; | |
175 } | |
176 if ( v19 ) | |
177 { | |
178 v13 = v24; | |
179 v14 = v26; | |
180 v21 += 48; | |
181 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
182 v20 += 48; | |
183 ++v22; | |
184 v28 += 48; | |
185 v27 += 48; | |
186 v25 += 48; | |
187 ++v24; | |
188 v26 += 48; | |
189 memcpy(v13, v7 + 8, 0x30u); | |
190 v16 = v23; | |
191 v23 += 48; | |
192 v4 = v20; | |
193 *(float *)v14 = v15; | |
194 *(int *)v16 = *((int *)v7 + 13); | |
195 v5 = v21; | |
196 } | |
197 v3 = v19; | |
198 v7 += 48; | |
199 //--v18; | |
200 } | |
201 //while ( v18 ); | |
202 result = v22; | |
203 if ( v22 < 3 ) | |
204 return 0; | |
205 return result; | |
206 } | |
207 | |
208 | |
209 //----- (00426A5A) -------------------------------------------------------- | 45 //----- (00426A5A) -------------------------------------------------------- |
210 void stru319::LootActor(Actor *pActor) | 46 void stru319::LootActor(Actor *pActor) |
211 { | 47 { |
212 signed int v2; // edi@1 | 48 signed int v2; // edi@1 |
213 char v3; // zf@1 | 49 char v3; // zf@1 |
230 v13 = 0; | 66 v13 = 0; |
231 v14 = 0; | 67 v14 = 0; |
232 if ( v3 ) | 68 if ( v3 ) |
233 { | 69 { |
234 if ( pActor->pMonsterInfo.uTreasureDiceRolls ) | 70 if ( pActor->pMonsterInfo.uTreasureDiceRolls ) |
235 { | 71 { |
236 do | 72 do |
237 { | 73 { |
238 ++v2; | 74 ++v2; |
239 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | 75 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; |
240 } | 76 } |