0
|
1 #include "stru10.h"
|
|
2 #include "Render.h"
|
|
3 #include "Indoor.h"
|
|
4 #include "Game.h"
|
|
5 #include "Party.h"
|
|
6
|
|
7 #include "mm7_data.h"
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12 //----- (0049CE9E) --------------------------------------------------------
|
|
13 void stru10::_49CE9E(BLVFace *pFace, RenderVertexSoft *a2, signed int a3, RenderVertexSoft *a4)
|
|
14 {
|
|
15 char *v5; // eax@1
|
|
16 signed int v6; // edx@1
|
|
17 unsigned int v7; // eax@3
|
|
18 signed int v8; // ecx@11
|
|
19 signed int v9; // esi@11
|
|
20 RenderVertexSoft *v10; // edx@12
|
|
21 double v11; // st6@14
|
|
22 RenderVertexSoft *v12; // edx@19
|
|
23 signed int v13; // ecx@19
|
|
24 signed int v14; // esi@19
|
|
25 RenderVertexSoft *v15; // edi@20
|
|
26 double v16; // st6@22
|
|
27 signed int v17; // ecx@27
|
|
28 signed int v18; // edi@27
|
|
29 char *v19; // esi@28
|
|
30 double v20; // st6@30
|
|
31 signed int v21; // ecx@35
|
|
32 signed int v22; // edi@35
|
|
33 char *v23; // esi@36
|
|
34 double v24; // st7@38
|
|
35 signed int v25; // ecx@45
|
|
36 signed int v26; // esi@45
|
|
37 RenderVertexSoft *v27; // edx@46
|
|
38 double v28; // st6@48
|
|
39 signed int v29; // ecx@53
|
|
40 signed int v30; // esi@53
|
|
41 RenderVertexSoft *v31; // edi@54
|
|
42 double v32; // st6@56
|
|
43 signed int v33; // ecx@61
|
|
44 signed int v34; // edi@61
|
|
45 char *v35; // esi@62
|
|
46 double v36; // st6@64
|
|
47 signed int v37; // edi@69
|
|
48 char *v38; // esi@70
|
|
49 double v39; // st7@72
|
|
50 RenderVertexSoft *v40; // esi@77
|
|
51 signed int v41; // ecx@79
|
|
52 signed int v42; // esi@79
|
|
53 char *v43; // edx@80
|
|
54 double v44; // st6@82
|
|
55 RenderVertexSoft *v45; // eax@87
|
|
56 signed int v46; // ecx@87
|
|
57 signed int v47; // edi@87
|
|
58 char *v48; // esi@88
|
|
59 double v49; // st6@90
|
|
60 signed int v50; // ecx@96
|
|
61 signed int v51; // edi@96
|
|
62 char *v52; // esi@97
|
|
63 double v53; // st6@99
|
|
64 signed int v54; // ecx@105
|
|
65 signed int v55; // edi@105
|
|
66 char *v56; // esi@106
|
|
67 double v57; // st7@108
|
|
68 RenderVertexSoft a2a[64]; // [sp+0h] [bp-C18h]@1
|
|
69 float v59; // [sp+C00h] [bp-18h]@4
|
|
70 float v60; // [sp+C04h] [bp-14h]@9
|
|
71 float v61; // [sp+C08h] [bp-10h]@4
|
|
72 float v62; // [sp+C0Ch] [bp-Ch]@9
|
|
73 float v63; // [sp+C10h] [bp-8h]@4
|
|
74 float v64; // [sp+C14h] [bp-4h]@4
|
|
75 float a1a; // [sp+C20h] [bp+8h]@11
|
|
76 float a1b; // [sp+C20h] [bp+8h]@19
|
|
77 float a1c; // [sp+C20h] [bp+8h]@27
|
|
78 float a1d; // [sp+C20h] [bp+8h]@35
|
|
79 float a1e; // [sp+C20h] [bp+8h]@45
|
|
80 float a1f; // [sp+C20h] [bp+8h]@53
|
|
81 float a1g; // [sp+C20h] [bp+8h]@61
|
|
82 float a1h; // [sp+C20h] [bp+8h]@69
|
|
83 float a1i; // [sp+C20h] [bp+8h]@79
|
|
84 float a1j; // [sp+C20h] [bp+8h]@87
|
|
85 float a1k; // [sp+C20h] [bp+8h]@96
|
|
86 float a1l; // [sp+C20h] [bp+8h]@105
|
|
87
|
|
88 v5 = (char *)&a2a[0].flt_2C;
|
|
89 v6 = 64;
|
|
90 do
|
|
91 {
|
|
92 *(float *)v5 = 0.0;
|
|
93 v5 += 48;
|
|
94 --v6;
|
|
95 }
|
|
96 while ( v6 );
|
|
97 stru10::_49D379(pFace, a2a);
|
|
98 v7 = pFace->uAttributes;
|
|
99 if ( v7 & 0x100 )
|
|
100 {
|
|
101 v63 = a2a[0].vWorldPosition.x;
|
|
102 v59 = a2a[2].vWorldPosition.x;
|
|
103 v61 = a2a[1].vWorldPosition.y;
|
|
104 v64 = a2a[3].vWorldPosition.y;
|
|
105 goto LABEL_10;
|
|
106 }
|
|
107 if ( v7 & 0x200 )
|
|
108 {
|
|
109 v63 = a2a[0].vWorldPosition.x;
|
|
110 v59 = a2a[2].vWorldPosition.x;
|
|
111 }
|
|
112 else
|
|
113 {
|
|
114 if ( !(v7 & 0x400) )
|
|
115 goto LABEL_10;
|
|
116 v61 = a2a[0].vWorldPosition.y;
|
|
117 v64 = a2a[2].vWorldPosition.y;
|
|
118 }
|
|
119 v62 = a2a[1].vWorldPosition.z;
|
|
120 v60 = a2a[3].vWorldPosition.z;
|
|
121 LABEL_10:
|
|
122 if ( v7 & 0x100 )
|
|
123 {
|
|
124 v8 = -1;
|
|
125 a1a = 3.4028235e38;
|
|
126 v9 = 0;
|
|
127 if ( a3 > 0 )
|
|
128 {
|
|
129 v10 = a2;
|
|
130 do
|
|
131 {
|
|
132 if ( v10->vWorldPosition.x <= (double)v63 )
|
|
133 v11 = v63 - v10->vWorldPosition.x;
|
|
134 else
|
|
135 v11 = v10->vWorldPosition.x - v63;
|
|
136 if ( v11 < a1a )
|
|
137 {
|
|
138 a1a = v11;
|
|
139 v8 = v9;
|
|
140 }
|
|
141 ++v9;
|
|
142 ++v10;
|
|
143 }
|
|
144 while ( v9 < a3 );
|
|
145 }
|
|
146 v12 = a4;
|
|
147 a1b = 3.4028235e38;
|
|
148 memcpy(a4, &a2[v8], 0x30u);
|
|
149 v13 = -1;
|
|
150 v14 = 0;
|
|
151 if ( a3 > 0 )
|
|
152 {
|
|
153 v15 = a2;
|
|
154 do
|
|
155 {
|
|
156 if ( v15->vWorldPosition.x <= (double)v59 )
|
|
157 v16 = v59 - v15->vWorldPosition.x;
|
|
158 else
|
|
159 v16 = v15->vWorldPosition.x - v59;
|
|
160 if ( v16 < a1b )
|
|
161 {
|
|
162 a1b = v16;
|
|
163 v13 = v14;
|
|
164 }
|
|
165 ++v14;
|
|
166 ++v15;
|
|
167 }
|
|
168 while ( v14 < a3 );
|
|
169 }
|
|
170 a1c = 3.4028235e38;
|
|
171 memcpy(&a4[2], &a2[v13], sizeof(a4[2]));
|
|
172 v17 = -1;
|
|
173 v18 = 0;
|
|
174 if ( a3 > 0 )
|
|
175 {
|
|
176 v19 = (char *)&a2->vWorldPosition.y;
|
|
177 do
|
|
178 {
|
|
179 if ( *(float *)v19 <= (double)v61 )
|
|
180 v20 = v61 - *(float *)v19;
|
|
181 else
|
|
182 v20 = *(float *)v19 - v61;
|
|
183 if ( v20 < a1c )
|
|
184 {
|
|
185 a1c = v20;
|
|
186 v17 = v18;
|
|
187 }
|
|
188 ++v18;
|
|
189 v19 += 48;
|
|
190 }
|
|
191 while ( v18 < a3 );
|
|
192 }
|
|
193 a1d = 3.4028235e38;
|
|
194 memcpy(&a4[1], &a2[v17], sizeof(a4[1]));
|
|
195 v21 = -1;
|
|
196 v22 = 0;
|
|
197 if ( a3 > 0 )
|
|
198 {
|
|
199 v23 = (char *)&a2->vWorldPosition.y;
|
|
200 do
|
|
201 {
|
|
202 if ( *(float *)v23 <= (double)v64 )
|
|
203 v24 = v64 - *(float *)v23;
|
|
204 else
|
|
205 v24 = *(float *)v23 - v64;
|
|
206 if ( v24 < a1d )
|
|
207 {
|
|
208 a1d = v24;
|
|
209 v21 = v22;
|
|
210 }
|
|
211 ++v22;
|
|
212 v23 += 48;
|
|
213 }
|
|
214 while ( v22 < a3 );
|
|
215 }
|
|
216 LABEL_77:
|
|
217 v40 = &a2[v21];
|
|
218 goto LABEL_115;
|
|
219 }
|
|
220 if ( v7 & 0x200 )
|
|
221 {
|
|
222 v25 = -1;
|
|
223 a1e = 3.4028235e38;
|
|
224 v26 = 0;
|
|
225 if ( a3 > 0 )
|
|
226 {
|
|
227 v27 = a2;
|
|
228 do
|
|
229 {
|
|
230 if ( v27->vWorldPosition.x <= (double)v63 )
|
|
231 v28 = v63 - v27->vWorldPosition.x;
|
|
232 else
|
|
233 v28 = v27->vWorldPosition.x - v63;
|
|
234 if ( v28 < a1e )
|
|
235 {
|
|
236 a1e = v28;
|
|
237 v25 = v26;
|
|
238 }
|
|
239 ++v26;
|
|
240 ++v27;
|
|
241 }
|
|
242 while ( v26 < a3 );
|
|
243 }
|
|
244 v12 = a4;
|
|
245 a1f = 3.4028235e38;
|
|
246 memcpy(a4, &a2[v25], 0x30u);
|
|
247 v29 = -1;
|
|
248 v30 = 0;
|
|
249 if ( a3 > 0 )
|
|
250 {
|
|
251 v31 = a2;
|
|
252 do
|
|
253 {
|
|
254 if ( v31->vWorldPosition.x <= (double)v59 )
|
|
255 v32 = v59 - v31->vWorldPosition.x;
|
|
256 else
|
|
257 v32 = v31->vWorldPosition.x - v59;
|
|
258 if ( v32 < a1f )
|
|
259 {
|
|
260 a1f = v32;
|
|
261 v29 = v30;
|
|
262 }
|
|
263 ++v30;
|
|
264 ++v31;
|
|
265 }
|
|
266 while ( v30 < a3 );
|
|
267 }
|
|
268 a1g = 3.4028235e38;
|
|
269 memcpy(&a4[2], &a2[v29], sizeof(a4[2]));
|
|
270 v33 = -1;
|
|
271 v34 = 0;
|
|
272 if ( a3 > 0 )
|
|
273 {
|
|
274 v35 = (char *)&a2->vWorldPosition.z;
|
|
275 do
|
|
276 {
|
|
277 if ( *(float *)v35 <= (double)v62 )
|
|
278 v36 = v62 - *(float *)v35;
|
|
279 else
|
|
280 v36 = *(float *)v35 - v62;
|
|
281 if ( v36 < a1g )
|
|
282 {
|
|
283 a1g = v36;
|
|
284 v33 = v34;
|
|
285 }
|
|
286 ++v34;
|
|
287 v35 += 48;
|
|
288 }
|
|
289 while ( v34 < a3 );
|
|
290 }
|
|
291 a1h = 3.4028235e38;
|
|
292 memcpy(&a4[1], &a2[v33], sizeof(a4[1]));
|
|
293 v21 = -1;
|
|
294 v37 = 0;
|
|
295 if ( a3 > 0 )
|
|
296 {
|
|
297 v38 = (char *)&a2->vWorldPosition.z;
|
|
298 do
|
|
299 {
|
|
300 if ( *(float *)v38 <= (double)v60 )
|
|
301 v39 = v60 - *(float *)v38;
|
|
302 else
|
|
303 v39 = *(float *)v38 - v60;
|
|
304 if ( v39 < a1h )
|
|
305 {
|
|
306 a1h = v39;
|
|
307 v21 = v37;
|
|
308 }
|
|
309 ++v37;
|
|
310 v38 += 48;
|
|
311 }
|
|
312 while ( v37 < a3 );
|
|
313 }
|
|
314 goto LABEL_77;
|
|
315 }
|
|
316 if ( !(v7 & 0x400) )
|
|
317 return;
|
|
318 v41 = -1;
|
|
319 a1i = 3.4028235e38;
|
|
320 v42 = 0;
|
|
321 if ( a3 > 0 )
|
|
322 {
|
|
323 v43 = (char *)&a2->vWorldPosition.y;
|
|
324 do
|
|
325 {
|
|
326 if ( *(float *)v43 <= (double)v61 )
|
|
327 v44 = v61 - *(float *)v43;
|
|
328 else
|
|
329 v44 = *(float *)v43 - v61;
|
|
330 if ( v44 < a1i )
|
|
331 {
|
|
332 a1i = v44;
|
|
333 v41 = v42;
|
|
334 }
|
|
335 ++v42;
|
|
336 v43 += 48;
|
|
337 }
|
|
338 while ( v42 < a3 );
|
|
339 }
|
|
340 v45 = a2;
|
|
341 v12 = a4;
|
|
342 a1j = 3.4028235e38;
|
|
343 memcpy(a4, &a2[v41], 0x30u);
|
|
344 v46 = -1;
|
|
345 v47 = 0;
|
|
346 if ( a3 > 0 )
|
|
347 {
|
|
348 v48 = (char *)&a2->vWorldPosition.y;
|
|
349 do
|
|
350 {
|
|
351 if ( *(float *)v48 <= (double)v64 )
|
|
352 v49 = v64 - *(float *)v48;
|
|
353 else
|
|
354 v49 = *(float *)v48 - v64;
|
|
355 if ( v49 < a1j )
|
|
356 {
|
|
357 a1j = v49;
|
|
358 v46 = v47;
|
|
359 }
|
|
360 ++v47;
|
|
361 v48 += 48;
|
|
362 }
|
|
363 while ( v47 < a3 );
|
|
364 v45 = a2;
|
|
365 }
|
|
366 a1k = 3.4028235e38;
|
|
367 memcpy(&a4[2], &v45[v46], sizeof(a4[2]));
|
|
368 v50 = -1;
|
|
369 v51 = 0;
|
|
370 if ( a3 > 0 )
|
|
371 {
|
|
372 v52 = (char *)&v45->vWorldPosition.z;
|
|
373 do
|
|
374 {
|
|
375 if ( *(float *)v52 <= (double)v62 )
|
|
376 v53 = v62 - *(float *)v52;
|
|
377 else
|
|
378 v53 = *(float *)v52 - v62;
|
|
379 if ( v53 < a1k )
|
|
380 {
|
|
381 a1k = v53;
|
|
382 v50 = v51;
|
|
383 }
|
|
384 ++v51;
|
|
385 v52 += 48;
|
|
386 }
|
|
387 while ( v51 < a3 );
|
|
388 v45 = a2;
|
|
389 }
|
|
390 a1l = 3.4028235e38;
|
|
391 memcpy(&a4[1], &v45[v50], sizeof(a4[1]));
|
|
392 v54 = -1;
|
|
393 v55 = 0;
|
|
394 if ( a3 > 0 )
|
|
395 {
|
|
396 v56 = (char *)&v45->vWorldPosition.z;
|
|
397 do
|
|
398 {
|
|
399 if ( *(float *)v56 <= (double)v60 )
|
|
400 v57 = v60 - *(float *)v56;
|
|
401 else
|
|
402 v57 = *(float *)v56 - v60;
|
|
403 if ( v57 < a1l )
|
|
404 {
|
|
405 a1l = v57;
|
|
406 v54 = v55;
|
|
407 }
|
|
408 ++v55;
|
|
409 v56 += 48;
|
|
410 }
|
|
411 while ( v55 < a3 );
|
|
412 v45 = a2;
|
|
413 }
|
|
414 v40 = &v45[v54];
|
|
415 LABEL_115:
|
|
416 memcpy(&v12[3], v40, sizeof(v12[3]));
|
|
417 }
|
|
418
|
|
419 //----- (0049D379) --------------------------------------------------------
|
|
420 int stru10::_49D379(BLVFace *pFace, RenderVertexSoft *pVertices)
|
|
421 {
|
|
422 BLVFace *v3; // edx@1
|
|
423 Vec3_short_ *v4; // ecx@1
|
|
424 int v5; // eax@2
|
|
425 unsigned __int16 *v6; // esi@3
|
|
426 char *v7; // eax@3
|
|
427 int v8; // ebx@4
|
|
428 int v9; // edi@4
|
|
429 int v10; // ebx@4
|
|
430 int v11; // edi@4
|
|
431 double v12; // st7@4
|
|
432 int v13; // edi@4
|
|
433 unsigned __int16 *v14; // esi@7
|
|
434 char *v15; // eax@7
|
|
435 int v16; // ebx@8
|
|
436 int v17; // edi@8
|
|
437 int v18; // ebx@8
|
|
438 int v19; // edi@8
|
|
439 double v20; // st7@8
|
|
440 int v21; // edi@8
|
|
441 unsigned __int16 *v22; // esi@11
|
|
442 char *v23; // eax@11
|
|
443 int v24; // ebx@12
|
|
444 int v25; // edi@12
|
|
445 int v26; // ebx@12
|
|
446 int v27; // edi@12
|
|
447 double v28; // st7@12
|
|
448 int v29; // edi@12
|
|
449 int v30; // eax@13
|
|
450 double v31; // st7@13
|
|
451 char *v32; // esi@14
|
|
452 int v33; // edi@14
|
|
453 int v34; // eax@24
|
|
454 Vec3_short_ *v35; // eax@24
|
|
455 signed int v36; // ecx@24
|
|
456 signed int v37; // eax@24
|
|
457 Vec3_short_ *v38; // eax@24
|
|
458 signed int v39; // ecx@24
|
|
459 signed int v40; // eax@24
|
|
460 Vec3_short_ *v41; // eax@24
|
|
461 signed int v42; // ecx@24
|
|
462 signed int v43; // eax@24
|
|
463 Vec3_short_ *v44; // eax@24
|
|
464 signed int v45; // ecx@24
|
|
465 signed int result; // eax@24
|
|
466 char v47; // [sp+10h] [bp-350h]@3
|
|
467 RenderVertexSoft v48; // [sp+30Ch] [bp-54h]@24
|
|
468 int v49; // [sp+33Ch] [bp-24h]@16
|
|
469 int v50; // [sp+340h] [bp-20h]@20
|
|
470 int v51; // [sp+344h] [bp-1Ch]@18
|
|
471 int v52; // [sp+348h] [bp-18h]@22
|
|
472 unsigned __int16 *v53; // [sp+34Ch] [bp-14h]@3
|
|
473 Vec3_short_ *v54; // [sp+350h] [bp-10h]@3
|
|
474 float v55; // [sp+354h] [bp-Ch]@1
|
|
475 float v56; // [sp+358h] [bp-8h]@4
|
|
476 Vec3_short_ *v57; // [sp+35Ch] [bp-4h]@4
|
|
477 int pFacea; // [sp+368h] [bp+8h]@2
|
|
478 int pFaceb; // [sp+368h] [bp+8h]@6
|
|
479 int pFacec; // [sp+368h] [bp+8h]@10
|
|
480 float pFaced; // [sp+368h] [bp+8h]@13
|
|
481 signed int pFacee; // [sp+368h] [bp+8h]@24
|
|
482 signed int pFacef; // [sp+368h] [bp+8h]@24
|
|
483 signed int pFaceg; // [sp+368h] [bp+8h]@24
|
|
484 signed int pFaceh; // [sp+368h] [bp+8h]@24
|
|
485
|
|
486 v3 = pFace;
|
|
487 v4 = pIndoor->pVertices;
|
|
488 LODWORD(v55) = pFace->uAttributes;
|
|
489 if ( BYTE1(v55) & 1 )
|
|
490 {
|
|
491 v5 = pFace->uNumVertices;
|
|
492 pFacea = 0;
|
|
493 if ( v5 > 0 )
|
|
494 {
|
|
495 v6 = v3->pVertexIDs;
|
|
496 v7 = &v47;
|
|
497 v53 = (unsigned short *)((char *)v3->pXInterceptDisplacements - (char *)v6);
|
|
498 v54 = (Vec3_short_ *)((char *)v3->pYInterceptDisplacements - (char *)v6);
|
|
499 do
|
|
500 {
|
|
501 v8 = *(unsigned __int16 *)((char *)v53 + (int)v6);
|
|
502 v57 = &v4[*v6];
|
|
503 LODWORD(v56) = v57->x + v8;
|
|
504 v9 = *(__int16 *)((char *)&v54->x + (int)v6);
|
|
505 v10 = v57->y;
|
|
506 *((float *)v7 - 1) = (double)SLODWORD(v56);
|
|
507 v57 = (Vec3_short_ *)(v10 + v9);
|
|
508 v11 = pFacea;
|
|
509 v12 = (double)(signed int)v57;
|
|
510 ++pFacea;
|
|
511 *((int *)v7 + 1) = v11;
|
|
512 v13 = v3->uNumVertices;
|
|
513 *(float *)v7 = v12;
|
|
514 v7 += 12;
|
|
515 ++v6;
|
|
516 }
|
|
517 while ( pFacea < v13 );
|
|
518 }
|
|
519 }
|
|
520 if ( BYTE1(v55) & 2 )
|
|
521 {
|
|
522 pFaceb = 0;
|
|
523 if ( (signed int)v3->uNumVertices > 0 )
|
|
524 {
|
|
525 v14 = v3->pVertexIDs;
|
|
526 v15 = &v47;
|
|
527 v53 = (unsigned short *)((char *)v3->pXInterceptDisplacements - (char *)v14);
|
|
528 LODWORD(v56) = (char *)v3->pZInterceptDisplacements - (char *)v14;
|
|
529 do
|
|
530 {
|
|
531 v16 = *(unsigned __int16 *)((char *)v53 + (int)v14);
|
|
532 v54 = &v4[*v14];
|
|
533 v57 = (Vec3_short_ *)(v54->x + v16);
|
|
534 v17 = *(signed __int16 *)((char *)v14 + LODWORD(v56));
|
|
535 v18 = v54->z;
|
|
536 *((float *)v15 - 1) = (double)(signed int)v57;
|
|
537 v57 = (Vec3_short_ *)(v18 + v17);
|
|
538 v19 = pFaceb;
|
|
539 v20 = (double)(signed int)v57;
|
|
540 ++pFaceb;
|
|
541 *((int *)v15 + 1) = v19;
|
|
542 v21 = v3->uNumVertices;
|
|
543 *(float *)v15 = v20;
|
|
544 v15 += 12;
|
|
545 ++v14;
|
|
546 }
|
|
547 while ( pFaceb < v21 );
|
|
548 }
|
|
549 }
|
|
550 if ( BYTE1(v55) & 4 )
|
|
551 {
|
|
552 pFacec = 0;
|
|
553 if ( (signed int)v3->uNumVertices > 0 )
|
|
554 {
|
|
555 v22 = v3->pVertexIDs;
|
|
556 v23 = &v47;
|
|
557 v54 = (Vec3_short_ *)((char *)v3->pYInterceptDisplacements - (char *)v22);
|
|
558 LODWORD(v56) = (char *)v3->pZInterceptDisplacements - (char *)v22;
|
|
559 do
|
|
560 {
|
|
561 v24 = *(__int16 *)((char *)&v54->x + (int)v22);
|
|
562 LODWORD(v55) = (unsigned int)&v4[*v22];
|
|
563 v57 = (Vec3_short_ *)(*(short *)(LODWORD(v55) + 2) + v24);
|
|
564 v25 = *(signed __int16 *)((char *)v22 + LODWORD(v56));
|
|
565 v26 = *(short *)(LODWORD(v55) + 4);
|
|
566 *((float *)v23 - 1) = (double)(signed int)v57;
|
|
567 v57 = (Vec3_short_ *)(v26 + v25);
|
|
568 v27 = pFacec;
|
|
569 v28 = (double)(signed int)v57;
|
|
570 ++pFacec;
|
|
571 *((int *)v23 + 1) = v27;
|
|
572 v29 = v3->uNumVertices;
|
|
573 *(float *)v23 = v28;
|
|
574 v23 += 12;
|
|
575 ++v22;
|
|
576 }
|
|
577 while ( pFacec < v29 );
|
|
578 }
|
|
579 }
|
|
580 v30 = v3->uNumVertices;
|
|
581 pFaced = 3.4028235e38;
|
|
582 v56 = 3.4028235e38;
|
|
583 v31 = -3.4028235e38;
|
|
584 v55 = -3.4028235e38;
|
|
585 if ( v30 > 0 )
|
|
586 {
|
|
587 v32 = &v47;
|
|
588 v33 = v30;
|
|
589 do
|
|
590 {
|
|
591 if ( *((float *)v32 - 1) < (double)pFaced )
|
|
592 {
|
|
593 LODWORD(pFaced) = *((int *)v32 - 1);
|
|
594 v49 = *((int *)v32 + 1);
|
|
595 }
|
|
596 if ( *((float *)v32 - 1) > (double)v55 )
|
|
597 {
|
|
598 LODWORD(v55) = *((int *)v32 - 1);
|
|
599 v51 = *((int *)v32 + 1);
|
|
600 }
|
|
601 if ( *(float *)v32 < (double)v56 )
|
|
602 {
|
|
603 LODWORD(v56) = *(int *)v32;
|
|
604 v50 = *((int *)v32 + 1);
|
|
605 }
|
|
606 if ( v31 < *(float *)v32 )
|
|
607 {
|
|
608 v31 = *(float *)v32;
|
|
609 v52 = *((int *)v32 + 1);
|
|
610 }
|
|
611 v32 += 12;
|
|
612 --v33;
|
|
613 }
|
|
614 while ( v33 );
|
|
615 }
|
|
616 v34 = v3->pVertexIDs[v49];
|
|
617 v48.flt_2C = 0.0;
|
|
618 v35 = &v4[v34];
|
|
619 pFacee = v35->x;
|
|
620 v36 = v35->y;
|
|
621 v37 = v35->z;
|
|
622 v48.vWorldPosition.x = (double)pFacee;
|
|
623 v48.vWorldPosition.y = (double)v36;
|
|
624 v48.vWorldPosition.z = (double)v37;
|
|
625 memcpy(pVertices, &v48, 0x30u);
|
|
626 v48.flt_2C = 0.0;
|
|
627 v38 = &pIndoor->pVertices[v3->pVertexIDs[v50]];
|
|
628 pFacef = v38->x;
|
|
629 v39 = v38->y;
|
|
630 v40 = v38->z;
|
|
631 v48.vWorldPosition.x = (double)pFacef;
|
|
632 v48.vWorldPosition.y = (double)v39;
|
|
633 v48.vWorldPosition.z = (double)v40;
|
|
634 memcpy(&pVertices[1], &v48, sizeof(pVertices[1]));
|
|
635 v48.flt_2C = 0.0;
|
|
636 v41 = &pIndoor->pVertices[v3->pVertexIDs[v51]];
|
|
637 pFaceg = v41->x;
|
|
638 v42 = v41->y;
|
|
639 v43 = v41->z;
|
|
640 v48.vWorldPosition.x = (double)pFaceg;
|
|
641 v48.vWorldPosition.y = (double)v42;
|
|
642 v48.vWorldPosition.z = (double)v43;
|
|
643 memcpy(&pVertices[2], &v48, sizeof(pVertices[2]));
|
|
644 v48.flt_2C = 0.0;
|
|
645 v44 = &pIndoor->pVertices[v3->pVertexIDs[v52]];
|
|
646 pFaceh = v44->x;
|
|
647 v45 = v44->y;
|
|
648 result = v44->z;
|
|
649 v48.vWorldPosition.x = (double)pFaceh;
|
|
650 v48.vWorldPosition.y = (double)v45;
|
|
651 v48.vWorldPosition.z = (double)result;
|
|
652 memcpy(&pVertices[3], &v48, sizeof(pVertices[3]));
|
|
653 return result;
|
|
654 }
|
|
655
|
|
656
|
|
657 //----- (0049C9E3) --------------------------------------------------------
|
|
658 bool stru10::_49C9E3(BLVFace *a3, RenderVertexSoft *arg4, unsigned int uNumVertices, RenderVertexSoft *arg0)
|
|
659 {
|
|
660 __debugbreak();
|
|
661 return 0;
|
|
662 /*IndoorCameraD3D *v6; // edi@1
|
|
663 PolygonType v7; // al@1
|
|
664 unsigned int v8; // edx@7
|
|
665 char v10; // zf@10
|
|
666 float v13; // ST14_4@20
|
|
667 stru10 *v15; // ecx@21
|
|
668 RenderVertexSoft *v16; // ST0C_4@21
|
|
669 bool result; // eax@21
|
|
670 float v18; // ST14_4@24
|
|
671 stru10 *v19; // edi@29
|
|
672 float v20; // ST14_4@30
|
|
673 float v21; // ST14_4@30
|
|
674 float v22; // ST14_4@30
|
|
675 float v23; // ST14_4@30
|
|
676 float v24; // ST14_4@31
|
|
677 RenderVertexSoft v25; // [sp+10h] [bp-90h]@24
|
|
678 RenderVertexSoft v26; // [sp+40h] [bp-60h]@20
|
|
679 IndoorCameraD3D *thisa; // [sp+70h] [bp-30h]@1
|
|
680 stru10 *v31; // [sp+84h] [bp-1Ch]@1
|
|
681 float v32; // [sp+88h] [bp-18h]@8
|
|
682 Vec3_float_ a1; // [sp+8Ch] [bp-14h]@1
|
|
683 float v35; // [sp+9Ch] [bp-4h]@8
|
|
684
|
|
685 _ESI = a3;
|
|
686 v31 = this;
|
|
687 __asm
|
|
688 {
|
|
689 fld dword ptr [esi]
|
|
690 fld dword ptr [esi+4]
|
|
691 fldz
|
|
692 }
|
|
693 v6 = pGame->pIndoorCameraD3D;
|
|
694 v7 = a3->uPolygonType;
|
|
695 __asm
|
|
696 {
|
|
697 fstp [ebp+var_28]
|
|
698 fldz
|
|
699 }
|
|
700 thisa = v6;
|
|
701 __asm
|
|
702 {
|
|
703 fstp [ebp+var_24]
|
|
704 fldz
|
|
705 fstp [ebp+a1.x]
|
|
706 fldz
|
|
707 fstp [ebp+a1.y]
|
|
708 fldz
|
|
709 fstp [ebp+a1.z]
|
|
710 }
|
|
711 if ( v7 == 1 )
|
|
712 {
|
|
713 __asm
|
|
714 {
|
|
715 fchs
|
|
716 fstp [ebp+a1.x]
|
|
717 fstp [ebp+a1.y]
|
|
718 fldz
|
|
719 fstp [ebp+a1.z]
|
|
720 }
|
|
721 a1.Normalize();
|
|
722 __asm
|
|
723 {
|
|
724 fldz
|
|
725 fstp [ebp+var_28]
|
|
726 fld1
|
|
727 }
|
|
728 LABEL_6:
|
|
729 __asm { fstp [ebp+var_24] }
|
|
730 goto LABEL_7;
|
|
731 }
|
|
732 __asm
|
|
733 {
|
|
734 fstp st
|
|
735 fstp st
|
|
736 }
|
|
737 if ( v7 == 3 || v7 == 5 )
|
|
738 {
|
|
739 __asm
|
|
740 {
|
|
741 fld1
|
|
742 fstp [ebp+a1.x]
|
|
743 fldz
|
|
744 fstp [ebp+a1.y]
|
|
745 fldz
|
|
746 fstp [ebp+a1.z]
|
|
747 fld1
|
|
748 fstp [ebp+var_28]
|
|
749 fldz
|
|
750 }
|
|
751 goto LABEL_6;
|
|
752 }
|
|
753 LABEL_7:
|
|
754 v8 = _ESI->uAttributes;
|
|
755 _ECX = arg4;
|
|
756 __asm { fld ds:flt_4D84F0 }
|
|
757 if ( BYTE1(v8) & 1 )
|
|
758 {
|
|
759 __asm
|
|
760 {
|
|
761 fld dword ptr [ecx+60h]
|
|
762 fadd dword ptr [ecx]
|
|
763 fmul st, st(1)
|
|
764 fstp [ebp+arg4]
|
|
765 fld dword ptr [ecx+94h]
|
|
766 fadd dword ptr [ecx+34h]
|
|
767 fmul st, st(1)
|
|
768 fstp [ebp+var_18]
|
|
769 fld dword ptr [ecx+68h]
|
|
770 fadd dword ptr [ecx+8]
|
|
771 fmul st, st(1)
|
|
772 fstp [ebp+var_4]
|
|
773 fld [ebp+arg4]
|
|
774 fsub dword ptr [ecx]
|
|
775 fstp [ebp+a3]
|
|
776 fld [ebp+var_18]
|
|
777 fsub dword ptr [ecx+34h]
|
|
778 fstp [ebp+var_8]
|
|
779 }
|
|
780 }
|
|
781 if ( BYTE1(v8) & 2 )
|
|
782 {
|
|
783 __asm
|
|
784 {
|
|
785 fld dword ptr [ecx+60h]
|
|
786 fadd dword ptr [ecx]
|
|
787 }
|
|
788 v10 = _ESI->uPolygonType == 1;
|
|
789 __asm
|
|
790 {
|
|
791 fmul st, st(1)
|
|
792 fstp [ebp+arg4]
|
|
793 fld dword ptr [ecx+64h]
|
|
794 fadd dword ptr [ecx+4]
|
|
795 fmul st, st(1)
|
|
796 fstp [ebp+var_18]
|
|
797 fld dword ptr [ecx+98h]
|
|
798 fadd dword ptr [ecx+38h]
|
|
799 fmul st, st(1)
|
|
800 fstp [ebp+var_4]
|
|
801 fld [ebp+arg4]
|
|
802 fsub dword ptr [ecx]
|
|
803 fstp [ebp+a3]
|
|
804 fld [ebp+var_4]
|
|
805 fsub dword ptr [ecx+38h]
|
|
806 fstp [ebp+var_8]
|
|
807 }
|
|
808 if ( v10 )
|
|
809 {
|
|
810 __asm
|
|
811 {
|
|
812 fld [ebp+a1.x]
|
|
813 fcomp ds:dword_4D84A8
|
|
814 fnstsw ax
|
|
815 }
|
|
816 if ( __SETP__(HIBYTE(_AX) & 0x44, 0) )
|
|
817 {
|
|
818 __asm
|
|
819 {
|
|
820 fld [ebp+a3]
|
|
821 fdiv [ebp+a1.x]
|
|
822 fstp [ebp+a3]
|
|
823 }
|
|
824 }
|
|
825 }
|
|
826 }
|
|
827 if ( BYTE1(v8) & 4 )
|
|
828 {
|
|
829 __asm
|
|
830 {
|
|
831 fld dword ptr [ecx+60h]
|
|
832 fadd dword ptr [ecx]
|
|
833 }
|
|
834 v10 = _ESI->uPolygonType == 1;
|
|
835 __asm
|
|
836 {
|
|
837 fmul st, st(1)
|
|
838 fstp [ebp+arg4]
|
|
839 fld dword ptr [ecx+64h]
|
|
840 fadd dword ptr [ecx+4]
|
|
841 fmul st, st(1)
|
|
842 fstp [ebp+var_18]
|
|
843 fld dword ptr [ecx+98h]
|
|
844 fadd dword ptr [ecx+38h]
|
|
845 fmul st, st(1)
|
|
846 fstp [ebp+var_4]
|
|
847 fstp st
|
|
848 fld [ebp+var_18]
|
|
849 fsub dword ptr [ecx+4]
|
|
850 fstp [ebp+a3]
|
|
851 fld [ebp+var_4]
|
|
852 fsub dword ptr [ecx+38h]
|
|
853 fstp [ebp+var_8]
|
|
854 }
|
|
855 if ( v10 )
|
|
856 {
|
|
857 __asm
|
|
858 {
|
|
859 fld [ebp+a1.x]
|
|
860 fcomp ds:dword_4D84A8
|
|
861 fnstsw ax
|
|
862 }
|
|
863 if ( __SETP__(HIBYTE(_AX) & 0x44, 0) )
|
|
864 {
|
|
865 __asm
|
|
866 {
|
|
867 fld [ebp+a3]
|
|
868 fdiv [ebp+a1.y]
|
|
869 fstp [ebp+a3]
|
|
870 }
|
|
871 }
|
|
872 }
|
|
873 }
|
|
874 else
|
|
875 {
|
|
876 __asm { fstp st }
|
|
877 }
|
|
878 if ( byte_4D864C && pGame->uFlags & 8 )
|
|
879 {
|
|
880 __asm { fldz }
|
|
881 LODWORD(v26.vWorldPosition.x) = arg4;
|
|
882 __asm { fstp [ebp+var_60.flt_2C] }
|
|
883 v26.vWorldPosition.y = v32;
|
|
884 __asm { fldz }
|
|
885 v26.vWorldPosition.z = v35;
|
|
886 __asm { fstp [esp+0A0h+var_A0] }
|
|
887 v6->do_draw_debug_line_sw(_ECX, 0xFF00u, &v26, 0xFF0000u, 0, v13);
|
|
888 }
|
|
889 __asm
|
|
890 {
|
|
891 fld [ebp+var_8]
|
|
892 fmul ds:flt_4D84E8
|
|
893 fld [ebp+var_8]
|
|
894 fmul [ebp+var_28]
|
|
895 fld [ebp+var_8]
|
|
896 fmul [ebp+var_24]
|
|
897 }
|
|
898 _EBX = arg0;
|
|
899 v15 = v31;
|
|
900 __asm
|
|
901 {
|
|
902 fst [ebp+var_20]
|
|
903 fld [ebp+a3]
|
|
904 fmul [ebp+a1.x]
|
|
905 fld [ebp+a3]
|
|
906 fmul [ebp+a1.y]
|
|
907 fld [ebp+a3]
|
|
908 fmul [ebp+a1.z]
|
|
909 }
|
|
910 v16 = arg0;
|
|
911 __asm
|
|
912 {
|
|
913 fstp [ebp+var_8]
|
|
914 fld [ebp+arg4]
|
|
915 fsub st, st(2)
|
|
916 fld st
|
|
917 fadd st, st(6)
|
|
918 fstp dword ptr [ebx]
|
|
919 fld [ebp+var_18]
|
|
920 fsub st, st(2)
|
|
921 fld st
|
|
922 fadd st, st(6)
|
|
923 fstp dword ptr [ebx+4]
|
|
924 fld [ebp+var_4]
|
|
925 fsub [ebp+var_8]
|
|
926 fst [ebp+a3]
|
|
927 fadd st, st(5)
|
|
928 fstp dword ptr [ebx+8]
|
|
929 fld st(1)
|
|
930 fsub st, st(7)
|
|
931 fstp dword ptr [ebx+30h]
|
|
932 fsub st, st(5)
|
|
933 fstp dword ptr [ebx+34h]
|
|
934 fstp st
|
|
935 fld [ebp+a3]
|
|
936 fsub st, st(3)
|
|
937 fstp dword ptr [ebx+38h]
|
|
938 fld st(1)
|
|
939 fadd [ebp+arg4]
|
|
940 fst [ebp+a3]
|
|
941 fsub st, st(5)
|
|
942 fstp dword ptr [ebx+60h]
|
|
943 fadd [ebp+var_18]
|
|
944 fstp st(2)
|
|
945 fstp st
|
|
946 fld st
|
|
947 fsub st, st(2)
|
|
948 fstp dword ptr [ebx+64h]
|
|
949 fld [ebp+var_8]
|
|
950 fadd [ebp+var_4]
|
|
951 fst [ebp+arg0]
|
|
952 fsub [ebp+var_20]
|
|
953 fstp dword ptr [ebx+68h]
|
|
954 fld [ebp+a3]
|
|
955 fadd st, st(3)
|
|
956 fstp dword ptr [ebx+90h]
|
|
957 fadd st, st(1)
|
|
958 fstp dword ptr [ebx+94h]
|
|
959 fstp st
|
|
960 fstp st
|
|
961 fld [ebp+arg0]
|
|
962 fadd [ebp+var_20]
|
|
963 fstp dword ptr [ebx+98h]
|
|
964 fldz
|
|
965 fstp [ebp+a1.x]
|
|
966 fldz
|
|
967 fstp [ebp+a1.y]
|
|
968 fldz
|
|
969 fstp [ebp+a1.z]
|
|
970 }
|
|
971 result = this->_49C8DC(v16, &a1, (float *)&a3);
|
|
972 if ( result )
|
|
973 {
|
|
974 if ( byte_4D864C )
|
|
975 {
|
|
976 HIWORD(result) = HIWORD(pGame);
|
|
977 if ( pGame->uFlags & 8 )
|
|
978 {
|
|
979 __asm
|
|
980 {
|
|
981 fldz
|
|
982 fstp [ebp+var_60.flt_2C]
|
|
983 fld ds:flt_4D8770
|
|
984 fld [ebp+a1.x]
|
|
985 fmul st, st(1)
|
|
986 }
|
|
987 LODWORD(v25.vWorldPosition.x) = (uint)arg4;
|
|
988 v25.vWorldPosition.y = v32;
|
|
989 __asm
|
|
990 {
|
|
991 fstp [ebp+var_60.vWorldPosition.x]
|
|
992 fld [ebp+a1.y]
|
|
993 fmul st, st(1)
|
|
994 }
|
|
995 v25.vWorldPosition.z = v35;
|
|
996 __asm
|
|
997 {
|
|
998 fstp [ebp+var_60.vWorldPosition.y]
|
|
999 fld [ebp+a1.z]
|
|
1000 fmul st, st(1)
|
|
1001 fstp [ebp+var_60.vWorldPosition.z]
|
|
1002 fstp st
|
|
1003 fldz
|
|
1004 fstp [ebp+var_90.flt_2C]
|
|
1005 fldz
|
|
1006 fstp [esp+0A0h+var_A0]
|
|
1007 }
|
|
1008 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v25, 0xFFFFFFFFu, &v26, 0xFFFF00u, 0, v18);
|
|
1009 }
|
|
1010 }
|
|
1011 __asm { fild pBLVRenderParams->vPartyPos.z }
|
|
1012 memcpy(&v25, _EBX, sizeof(v25));
|
|
1013 __asm
|
|
1014 {
|
|
1015 fsubr [ebp+var_90.vWorldPosition.z]
|
|
1016 fmul [ebp+a1.z]
|
|
1017 fild pBLVRenderParams->vPartyPos.y
|
|
1018 fsubr [ebp+var_90.vWorldPosition.y]
|
|
1019 fmul [ebp+a1.y]
|
|
1020 faddp st(1), st
|
|
1021 fild pBLVRenderParams->vPartyPos.x
|
|
1022 fsubr [ebp+var_90.vWorldPosition.x]
|
|
1023 fmul [ebp+a1.x]
|
|
1024 faddp st(1), st
|
|
1025 fcomp ds:flt_4D84E8
|
|
1026 fnstsw ax
|
|
1027 }
|
|
1028 if ( !__SETP__(BYTE1(result) & 5, 0) )
|
|
1029 {
|
|
1030 result = (bool)&_EBX[1];
|
|
1031 memcpy(&v25, &_EBX[1], sizeof(v25));
|
|
1032 memcpy(&_EBX[1], &_EBX[3], sizeof(_EBX[1]));
|
|
1033 memcpy(&_EBX[3], &v25, sizeof(_EBX[3]));
|
|
1034 }
|
|
1035 if ( byte_4D864C && pGame->uFlags & 8 )
|
|
1036 {
|
|
1037 v19 = v31;
|
|
1038 if ( !LOBYTE(v31->field_4) )
|
|
1039 {
|
|
1040 __asm
|
|
1041 {
|
|
1042 fldz
|
|
1043 fstp [ebp+var_60.flt_2C]
|
|
1044 fild pParty->vPosition.x
|
|
1045 }
|
|
1046 a3 = (BLVFace *)(pParty->vPosition.y + pParty->sEyelevel);
|
|
1047 __asm
|
|
1048 {
|
|
1049 fstp [ebp+var_60.vWorldPosition.x]
|
|
1050 fild pParty->vPosition.z
|
|
1051 fstp [ebp+var_60.vWorldPosition.y]
|
|
1052 fild [ebp+a3]
|
|
1053 fstp [ebp+var_60.vWorldPosition.z]
|
|
1054 fldz
|
|
1055 fstp [esp+0A0h+var_A0]
|
|
1056 }
|
|
1057 IndoorCameraD3D::do_draw_debug_line_sw(pGame->pIndoorCameraD3D, &v26, 0xFF0000u, _EBX, 0xFF0000u, 0, v20);
|
|
1058 __asm
|
|
1059 {
|
|
1060 fldz
|
|
1061 fstp [esp+0A0h+var_A0]
|
|
1062 }
|
|
1063 IndoorCameraD3D::do_draw_debug_line_sw(pGame->pIndoorCameraD3D, &v26, 0xFF00u, _EBX + 1, 0xFF00u, 0, v21);
|
|
1064 __asm
|
|
1065 {
|
|
1066 fldz
|
|
1067 fstp [esp+0A0h+var_A0]
|
|
1068 }
|
|
1069 IndoorCameraD3D::do_draw_debug_line_sw(pGame->pIndoorCameraD3D, &v26, 0xFFu, _EBX + 2, 0xFFu, 0, v22);
|
|
1070 __asm
|
|
1071 {
|
|
1072 fldz
|
|
1073 fstp [esp+0A0h+var_A0]
|
|
1074 }
|
|
1075 IndoorCameraD3D::do_draw_debug_line_sw(pGame->pIndoorCameraD3D, &v26, 0xFFFFFFu, _EBX + 3, 0xFFFFFFu, 0, v23);
|
|
1076 LOBYTE(v19->field_4) = 1;
|
|
1077 }
|
|
1078 __asm
|
|
1079 {
|
|
1080 fld ds:flt_4D86E8
|
|
1081 fstp [esp+0A0h+var_A0]
|
|
1082 }
|
|
1083 IndoorCameraD3D::debug_outline_sw(thisa, _EBX, uNumVertices, 0x1EFF1Eu, v24);
|
|
1084 }
|
|
1085 LOBYTE(result) = 1;
|
|
1086 }
|
|
1087 return result;*/
|
|
1088 }
|
|
1089
|
|
1090
|
|
1091
|
|
1092 //----- (0049C5B0) --------------------------------------------------------
|
|
1093 stru10::stru10()
|
|
1094 {
|
|
1095 LOBYTE(this->field_4) = 0;
|
|
1096 }
|
|
1097
|
|
1098 //----- (0049C5BD) --------------------------------------------------------
|
|
1099 stru10::~stru10()
|
|
1100 {
|
|
1101 }
|
|
1102
|
|
1103 //----- (0049C5DA) --------------------------------------------------------
|
|
1104 char stru10::_49C5DA(BLVFace *a2, RenderVertexSoft *a3, int *a4, IndoorCameraD3D_Vec4 *a5, RenderVertexSoft *a6)
|
|
1105 {
|
|
1106 stru10 *v6; // edi@1
|
|
1107 char *v7; // eax@1
|
|
1108 signed int v8; // ecx@1
|
|
1109 IndoorCameraD3D *v9; // esi@3
|
|
1110 char result; // al@6
|
|
1111 RenderVertexSoft a4a[4]; // [sp+Ch] [bp-C0h]@1
|
|
1112
|
|
1113 v6 = this;
|
|
1114 v7 = (char *)&a4a[0].flt_2C;
|
|
1115 v8 = 4;
|
|
1116 do
|
|
1117 {
|
|
1118 *(float *)v7 = 0.0;
|
|
1119 v7 += 48;
|
|
1120 --v8;
|
|
1121 }
|
|
1122 while ( v8 );
|
|
1123 v9 = pGame->pIndoorCameraD3D;
|
|
1124 _49CE9E(a2, a3, *a4, a4a);
|
|
1125 if ( byte_4D864C && pGame->uFlags & 8 )
|
|
1126 pGame->pIndoorCameraD3D->debug_outline_sw(a4a, 4u, 0xFF1E1Eu, 0.000099999997);
|
|
1127 result = _49C9E3(a2, a4a, 4u, a6);
|
|
1128 if ( result )
|
|
1129 result = _49C720(a6, a5);
|
|
1130 return result;
|
|
1131 }
|
|
1132 // 4D864C: using guessed type char byte_4D864C;
|
|
1133
|
|
1134 //----- (0049C681) --------------------------------------------------------
|
|
1135 char stru10::_49C681(BLVFace *pFace, IndoorCameraD3D_Vec4 *a3, RenderVertexSoft *pArrayOf4)
|
|
1136 {
|
|
1137 stru10 *v4; // edi@1
|
|
1138 char *v5; // eax@1
|
|
1139 signed int v6; // ecx@1
|
|
1140 IndoorCameraD3D *v7; // esi@3
|
|
1141 char result; // al@6
|
|
1142 RenderVertexSoft a2a[4]; // [sp+Ch] [bp-C0h]@1
|
|
1143
|
|
1144 v4 = this;
|
|
1145 v5 = (char *)&a2a[0].flt_2C;
|
|
1146 v6 = 4;
|
|
1147 do
|
|
1148 {
|
|
1149 *(float *)v5 = 0.0;
|
|
1150 v5 += 48;
|
|
1151 --v6;
|
|
1152 }
|
|
1153 while ( v6 );
|
|
1154 v7 = pGame->pIndoorCameraD3D;
|
|
1155 _49D379(pFace, a2a);
|
|
1156 if ( byte_4D864C && pGame->uFlags & 8 )
|
|
1157 pGame->pIndoorCameraD3D->debug_outline_sw(a2a, 4u, 0xFF1E1Eu, 0.000099999997);
|
|
1158 result = _49C9E3(pFace, a2a, 4u, pArrayOf4);
|
|
1159 if ( result )
|
|
1160 result = _49C720(pArrayOf4, a3);
|
|
1161 return result;
|
|
1162 }
|
|
1163 // 4D864C: using guessed type char byte_4D864C;
|
|
1164
|
|
1165 //----- (0049C720) --------------------------------------------------------
|
|
1166 char stru10::_49C720(RenderVertexSoft *a2, IndoorCameraD3D_Vec4 *a4)
|
|
1167 {
|
|
1168 char result; // al@2
|
|
1169 Vec3_float_ a3; // [sp+4h] [bp-34h]@1
|
|
1170 float v5; // [sp+30h] [bp-8h]@1
|
|
1171 stru10 *thisa; // [sp+34h] [bp-4h]@1
|
|
1172
|
|
1173 v5 = 0.0;
|
|
1174 a3.x = (double)pBLVRenderParams->vPartyPos.x;
|
|
1175 a3.y = (double)pBLVRenderParams->vPartyPos.y;
|
|
1176 thisa = this;
|
|
1177 a3.z = (double)pBLVRenderParams->vPartyPos.z;
|
|
1178 if ( _49C7C5(a2, a2 + 1, &a3, a4)
|
|
1179 && _49C7C5(a2 + 1, a2 + 2, &a3, a4 + 1)
|
|
1180 && _49C7C5(a2 + 2, a2 + 3, &a3, a4 + 2) )
|
|
1181 result = _49C7C5(a2 + 3, a2, &a3, a4 + 3) != 0;
|
|
1182 else
|
|
1183 result = 0;
|
|
1184 return result;
|
|
1185 }
|
|
1186
|
|
1187 //----- (0049C7C5) --------------------------------------------------------
|
|
1188 bool stru10::_49C7C5(RenderVertexSoft *a1, RenderVertexSoft *a2, Vec3_float_ *a3, IndoorCameraD3D_Vec4 *a4)
|
|
1189 {
|
|
1190 double v5; // st7@1
|
|
1191 double v6; // st6@1
|
|
1192 double v7; // st5@1
|
|
1193 Vec3_float_ *result; // eax@1
|
|
1194 __int16 v9; // fps@3
|
|
1195 char v10; // c0@3
|
|
1196 char v11; // c2@3
|
|
1197 char v12; // c3@3
|
|
1198 float v13; // ecx@5
|
|
1199 double v14; // st7@5
|
|
1200 double v15; // st6@5
|
|
1201 Vec3_float_ v1; // [sp+4h] [bp-48h]@1
|
|
1202 Vec3_float_ v2; // [sp+10h] [bp-3Ch]@1
|
|
1203 float v18; // [sp+20h] [bp-2Ch]@1
|
|
1204 float v19; // [sp+24h] [bp-28h]@1
|
|
1205 Vec3_float_ v20; // [sp+28h] [bp-24h]@1
|
|
1206 Vec3_float_ v21; // [sp+34h] [bp-18h]@1
|
|
1207 Vec3_float_ a1a; // [sp+40h] [bp-Ch]@1
|
|
1208
|
|
1209 a1a.x = 0.0;
|
|
1210 a1a.y = 0.0;
|
|
1211 a1a.z = 0.0;
|
|
1212 v21.x = a3->x;
|
|
1213 v21.y = a3->y;
|
|
1214 v21.z = a3->z;
|
|
1215 v5 = a1->vWorldPosition.x;
|
|
1216 v6 = a1->vWorldPosition.y;
|
|
1217 v2.z = a1->vWorldPosition.z;
|
|
1218 v7 = a2->vWorldPosition.x;
|
|
1219 v18 = a2->vWorldPosition.y;
|
|
1220 v19 = a2->vWorldPosition.z;
|
|
1221 v20.x = v5 - v21.x;
|
|
1222 v20.y = v6 - v21.y;
|
|
1223 v20.z = v2.z - v21.z;
|
|
1224 LODWORD(v1.x) = (int)v20.x;
|
|
1225 v1.y = v20.y;
|
|
1226 v1.z = v20.z;
|
|
1227 v20.x = v7 - v5;
|
|
1228 v20.y = v18 - v6;
|
|
1229 v20.z = v19 - v2.z;
|
|
1230 result = Vec3_float_::Cross(&v1, &v2, v20.x, v20.y, v20.z);
|
|
1231 a1a.x = result->x;
|
|
1232 a1a.y = result->y;
|
|
1233 a1a.z = result->z;
|
|
1234 if ( a1a.x != 0.0
|
|
1235 || a1a.y != 0.0
|
|
1236 || (/*UNDEF(v9),*/ v10 = a1a.z < 0.0, v11 = 0, v12 = a1a.z == 0.0, BYTE1(result) = HIBYTE(v9), a1a.z != 0.0) )
|
|
1237 {
|
|
1238 a1a.Normalize();
|
|
1239 result = (Vec3_float_ *)a4;
|
|
1240 v13 = a1a.y;
|
|
1241 a4->x = a1a.x;
|
|
1242 v14 = v21.z * a1a.z;
|
|
1243 v15 = v21.y * a1a.y;
|
|
1244 a4->y = v13;
|
|
1245 a4->z = a1a.z;
|
|
1246 a4->dot = v14 + v15 + v21.x * a1a.x;
|
|
1247 LOBYTE(result) = 1;
|
|
1248 }
|
|
1249 else
|
|
1250 {
|
|
1251 LOBYTE(result) = 0;
|
|
1252 }
|
|
1253 return (bool)result;
|
|
1254 }
|
|
1255
|
|
1256 //----- (0049C8DC) --------------------------------------------------------
|
|
1257 bool stru10::_49C8DC(RenderVertexSoft *arg0, Vec3_float_ *a2, float *a3)
|
|
1258 {
|
|
1259 double v4; // st7@1
|
|
1260 double v5; // st6@1
|
|
1261 double v6; // st5@1
|
|
1262 Vec3_float_ *result; // eax@1
|
|
1263 __int16 v8; // fps@3
|
|
1264 char v9; // c0@3
|
|
1265 char v10; // c2@3
|
|
1266 char v11; // c3@3
|
|
1267 float v12; // ecx@5
|
|
1268 double v13; // st7@5
|
|
1269 double v14; // st6@5
|
|
1270 Vec3_float_ v1; // [sp+8h] [bp-3Ch]@1
|
|
1271 Vec3_float_ v2; // [sp+14h] [bp-30h]@1
|
|
1272 float v17; // [sp+24h] [bp-20h]@1
|
|
1273 float v18; // [sp+28h] [bp-1Ch]@1
|
|
1274 float v19; // [sp+2Ch] [bp-18h]@1
|
|
1275 float v20; // [sp+30h] [bp-14h]@1
|
|
1276 float v21; // [sp+34h] [bp-10h]@1
|
|
1277 Vec3_float_ a1; // [sp+38h] [bp-Ch]@1
|
|
1278
|
|
1279 v19 = arg0->vWorldPosition.x;
|
|
1280 v20 = arg0->vWorldPosition.y;
|
|
1281 v21 = arg0->vWorldPosition.z;
|
|
1282 v4 = arg0[1].vWorldPosition.x;
|
|
1283 v5 = arg0[1].vWorldPosition.y;
|
|
1284 v2.z = arg0[1].vWorldPosition.z;
|
|
1285 v6 = arg0[2].vWorldPosition.x;
|
|
1286 v17 = arg0[2].vWorldPosition.y;
|
|
1287 v18 = arg0[2].vWorldPosition.z;
|
|
1288 a1.x = v4 - v19;
|
|
1289 a1.y = v5 - v20;
|
|
1290 a1.z = v2.z - v21;
|
|
1291 LODWORD(v1.x) = (int)a1.x;
|
|
1292 v1.y = a1.y;
|
|
1293 v1.z = a1.z;
|
|
1294 a1.x = v6 - v4;
|
|
1295 a1.y = v17 - v5;
|
|
1296 a1.z = v18 - v2.z;
|
|
1297 result = Vec3_float_::Cross(&v1, &v2, a1.x, a1.y, a1.z);
|
|
1298 a1.x = result->x;
|
|
1299 a1.y = result->y;
|
|
1300 a1.z = result->z;
|
|
1301 if ( a1.x != 0.0
|
|
1302 || a1.y != 0.0
|
|
1303 || (/*UNDEF(v8),*/ v9 = a1.z < 0.0, v10 = 0, v11 = a1.z == 0.0, BYTE1(result) = HIBYTE(v8), a1.z != 0.0) )
|
|
1304 {
|
|
1305 a1.Normalize();
|
|
1306 v12 = a1.y;
|
|
1307 a2->x = a1.x;
|
|
1308 v13 = v21 * a1.z;
|
|
1309 v14 = v20 * a1.y;
|
|
1310 a2->y = v12;
|
|
1311 a2->z = a1.z;
|
|
1312 result = (Vec3_float_ *)a3;
|
|
1313 *a3 = -(v13 + v14 + v19 * a1.x);
|
|
1314 LOBYTE(result) = 1;
|
|
1315 }
|
|
1316 else
|
|
1317 {
|
|
1318 LOBYTE(result) = 0;
|
|
1319 }
|
|
1320 return (bool)result;
|
|
1321 }
|