Mercurial > mm7
comparison mm7_3.cpp @ 1546:9a6567c6c76c
stru141 & misc cleaning
author | Nomad |
---|---|
date | Sat, 07 Sep 2013 21:55:02 +0200 |
parents | c4ab816fcc5e |
children | 0311debb684c |
comparison
equal
deleted
inserted
replaced
1545:c4ab816fcc5e | 1546:9a6567c6c76c |
---|---|
156 { | 156 { |
157 if ( v16 <= v15 ) | 157 if ( v16 <= v15 ) |
158 { | 158 { |
159 a3 = stru_721530.field_6C; | 159 a3 = stru_721530.field_6C; |
160 if ( sub_47531C(stru_721530.prolly_normal_d, &a3, stru_721530.normal.x, stru_721530.normal.y, stru_721530.normal.z, | 160 if ( sub_47531C(stru_721530.prolly_normal_d, &a3, stru_721530.normal.x, stru_721530.normal.y, stru_721530.normal.z, |
161 stru_721530.field_58.x, stru_721530.field_58.y, stru_721530.field_58.z, pFace, a10) ) | 161 stru_721530.direction.x, stru_721530.direction.y, stru_721530.direction.z, pFace, a10) ) |
162 { | 162 { |
163 v17 = a3; | 163 v17 = a3; |
164 } | 164 } |
165 else | 165 else |
166 { | 166 { |
167 a3 = stru_721530.field_6C + stru_721530.prolly_normal_d; | 167 a3 = stru_721530.field_6C + stru_721530.prolly_normal_d; |
168 if ( !sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, pFace) ) | 168 if ( !sub_475D85(&stru_721530.normal, &stru_721530.direction, &a3, pFace) ) |
169 goto LABEL_34; | 169 goto LABEL_34; |
170 v17 = a3 - stru_721530.prolly_normal_d; | 170 v17 = a3 - stru_721530.prolly_normal_d; |
171 a3 -= stru_721530.prolly_normal_d; | 171 a3 -= stru_721530.prolly_normal_d; |
172 } | 172 } |
173 if ( v17 < stru_721530.field_7C ) | 173 if ( v17 < stru_721530.field_7C ) |
183 LABEL_34: | 183 LABEL_34: |
184 if ( !(stru_721530.field_0 & 1) | 184 if ( !(stru_721530.field_0 & 1) |
185 || (v19 = pFace->pFacePlane_old.vNormal.x, | 185 || (v19 = pFace->pFacePlane_old.vNormal.x, |
186 v20 = pFace->pFacePlane_old.vNormal.y, | 186 v20 = pFace->pFacePlane_old.vNormal.y, |
187 v30 = v19, | 187 v30 = v19, |
188 v21 = (stru_721530.field_34.x * v19 + pFace->pFacePlane_old.dist + stru_721530.field_34.y * v20 | 188 v21 = (stru_721530.position.x * v19 + pFace->pFacePlane_old.dist + stru_721530.position.y * v20 |
189 + stru_721530.field_34.z * pFace->pFacePlane_old.vNormal.z) >> 16, | 189 + stru_721530.position.z * pFace->pFacePlane_old.vNormal.z) >> 16, |
190 v21 <= 0) | 190 v21 <= 0) |
191 || (v22 = (stru_721530.field_4C * v30 + pFace->pFacePlane_old.dist + stru_721530.field_50 * v20 | 191 || (v22 = (stru_721530.field_4C * v30 + pFace->pFacePlane_old.dist + stru_721530.field_50 * v20 |
192 + stru_721530.field_54 * pFace->pFacePlane_old.vNormal.z) >> 16, | 192 + stru_721530.field_54 * pFace->pFacePlane_old.vNormal.z) >> 16, |
193 v21 > stru_721530.prolly_normal_d) | 193 v21 > stru_721530.prolly_normal_d) |
194 && v22 > stru_721530.prolly_normal_d | 194 && v22 > stru_721530.prolly_normal_d |
195 || v22 > v21 ) | 195 || v22 > v21 ) |
196 goto LABEL_45; | 196 goto LABEL_45; |
197 a3 = stru_721530.field_6C; | 197 a3 = stru_721530.field_6C; |
198 if ( sub_47531C(stru_721530.field_8, &a3, stru_721530.field_34.x, stru_721530.field_34.y, stru_721530.field_34.z, | 198 if ( sub_47531C(stru_721530.field_8_radius, &a3, stru_721530.position.x, stru_721530.position.y, stru_721530.position.z, |
199 stru_721530.field_58.x, stru_721530.field_58.y, stru_721530.field_58.z, pFace, a10) ) | 199 stru_721530.direction.x, stru_721530.direction.y, stru_721530.direction.z, pFace, a10) ) |
200 { | 200 { |
201 v23 = a3; | 201 v23 = a3; |
202 goto LABEL_43; | 202 goto LABEL_43; |
203 } | 203 } |
204 a3 = stru_721530.field_6C + stru_721530.field_8; | 204 a3 = stru_721530.field_6C + stru_721530.field_8_radius; |
205 if ( sub_475D85(&stru_721530.field_34, &stru_721530.field_58, &a3, pFace) ) | 205 if ( sub_475D85(&stru_721530.position, &stru_721530.direction, &a3, pFace) ) |
206 { | 206 { |
207 v23 = a3 - stru_721530.prolly_normal_d; | 207 v23 = a3 - stru_721530.prolly_normal_d; |
208 a3 -= stru_721530.prolly_normal_d; | 208 a3 -= stru_721530.prolly_normal_d; |
209 LABEL_43: | 209 LABEL_43: |
210 if ( v23 < stru_721530.field_7C ) | 210 if ( v23 < stru_721530.field_7C ) |
369 stru_721530.prolly_normal_d, | 369 stru_721530.prolly_normal_d, |
370 &a2, | 370 &a2, |
371 stru_721530.normal.x, | 371 stru_721530.normal.x, |
372 stru_721530.normal.y, | 372 stru_721530.normal.y, |
373 stru_721530.normal.z, | 373 stru_721530.normal.z, |
374 stru_721530.field_58.x, | 374 stru_721530.direction.x, |
375 stru_721530.field_58.y, | 375 stru_721530.direction.y, |
376 stru_721530.field_58.z, | 376 stru_721530.direction.z, |
377 &f, | 377 &f, |
378 a10, | 378 a10, |
379 a11) ) | 379 a11) ) |
380 { | 380 { |
381 v10 = a2; | 381 v10 = a2; |
382 } | 382 } |
383 else | 383 else |
384 { | 384 { |
385 v11 = stru_721530.field_58.y; | 385 v11 = stru_721530.direction.y; |
386 v12 = stru_721530.field_58.z; | 386 v12 = stru_721530.direction.z; |
387 v13 = stru_721530.normal.y; | 387 v13 = stru_721530.normal.y; |
388 a2 = stru_721530.prolly_normal_d + stru_721530.field_6C; | 388 a2 = stru_721530.prolly_normal_d + stru_721530.field_6C; |
389 if ( !sub_475F30( | 389 if ( !sub_475F30( |
390 &a2, | 390 &a2, |
391 &f, | 391 &f, |
392 stru_721530.normal.x, | 392 stru_721530.normal.x, |
393 v13, | 393 v13, |
394 stru_721530.normal.z, | 394 stru_721530.normal.z, |
395 stru_721530.field_58.x, | 395 stru_721530.direction.x, |
396 v11, | 396 v11, |
397 v12, | 397 v12, |
398 a10) ) | 398 a10) ) |
399 goto LABEL_29; | 399 goto LABEL_29; |
400 v10 = a2 - stru_721530.prolly_normal_d; | 400 v10 = a2 - stru_721530.prolly_normal_d; |
411 } | 411 } |
412 } | 412 } |
413 LABEL_29: | 413 LABEL_29: |
414 if ( stru_721530.field_0 & 1 ) | 414 if ( stru_721530.field_0 & 1 ) |
415 { | 415 { |
416 v15 = (f.pFacePlane_old.vNormal.z * stru_721530.field_34.z | 416 v15 = (f.pFacePlane_old.vNormal.z * stru_721530.position.z |
417 + f.pFacePlane_old.dist | 417 + f.pFacePlane_old.dist |
418 + f.pFacePlane_old.vNormal.y * stru_721530.field_34.y | 418 + f.pFacePlane_old.vNormal.y * stru_721530.position.y |
419 + f.pFacePlane_old.vNormal.x * stru_721530.field_34.x) >> 16; | 419 + f.pFacePlane_old.vNormal.x * stru_721530.position.x) >> 16; |
420 if ( v15 > 0 ) | 420 if ( v15 > 0 ) |
421 { | 421 { |
422 v16 = (f.pFacePlane_old.vNormal.z * stru_721530.field_54 | 422 v16 = (f.pFacePlane_old.vNormal.z * stru_721530.field_54 |
423 + f.pFacePlane_old.dist | 423 + f.pFacePlane_old.dist |
424 + f.pFacePlane_old.vNormal.y * stru_721530.field_50 | 424 + f.pFacePlane_old.vNormal.y * stru_721530.field_50 |
426 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d ) | 426 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d ) |
427 { | 427 { |
428 if ( v16 <= v15 ) | 428 if ( v16 <= v15 ) |
429 { | 429 { |
430 a2 = stru_721530.field_6C; | 430 a2 = stru_721530.field_6C; |
431 if ( sub_4754BF( | 431 if ( sub_4754BF(stru_721530.field_8_radius, |
432 stru_721530.field_8, | |
433 &a2, | 432 &a2, |
434 stru_721530.field_34.x, | 433 stru_721530.position.x, |
435 stru_721530.field_34.y, | 434 stru_721530.position.y, |
436 stru_721530.field_34.z, | 435 stru_721530.position.z, |
437 stru_721530.field_58.x, | 436 stru_721530.direction.x, |
438 stru_721530.field_58.y, | 437 stru_721530.direction.y, |
439 stru_721530.field_58.z, | 438 stru_721530.direction.z, |
440 &f, | 439 &f, |
441 a10, | 440 a10, |
442 a11) ) | 441 a11) ) |
443 { | 442 { |
444 if ( a2 < stru_721530.field_7C ) | 443 if ( a2 < stru_721530.field_7C ) |
449 stru_721530.uFaceID = v17; | 448 stru_721530.uFaceID = v17; |
450 } | 449 } |
451 } | 450 } |
452 else | 451 else |
453 { | 452 { |
454 v18 = stru_721530.field_58.y; | 453 v18 = stru_721530.direction.y; |
455 v19 = stru_721530.field_58.z; | 454 v19 = stru_721530.direction.z; |
456 v20 = stru_721530.field_34.y; | 455 v20 = stru_721530.position.y; |
457 a2 = stru_721530.field_6C + stru_721530.field_8; | 456 a2 = stru_721530.field_6C + stru_721530.field_8_radius; |
458 if ( sub_475F30( | 457 if ( sub_475F30(&a2, |
459 &a2, | |
460 &f, | 458 &f, |
461 stru_721530.field_34.x, | 459 stru_721530.position.x, |
462 v20, | 460 v20, |
463 stru_721530.field_34.z, | 461 stru_721530.position.z, |
464 stru_721530.field_58.x, | 462 stru_721530.direction.x, |
465 v18, | 463 v18, |
466 v19, | 464 v19, |
467 a10) ) | 465 a10) ) |
468 { | 466 { |
469 v2 = v28; | 467 v2 = v28; |
560 { | 558 { |
561 if ( stru_721530.sMinZ >= v7 ) | 559 if ( stru_721530.sMinZ >= v7 ) |
562 { | 560 { |
563 v8 = v4 - stru_721530.normal.x; | 561 v8 = v4 - stru_721530.normal.x; |
564 v9 = v5 - stru_721530.normal.y; | 562 v9 = v5 - stru_721530.normal.y; |
565 if ( abs(((v4 - stru_721530.normal.x) * stru_721530.field_58.y | 563 if ( abs(((v4 - stru_721530.normal.x) * stru_721530.direction.y |
566 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16) <= v3 | 564 - (v5 - stru_721530.normal.y) * stru_721530.direction.x) >> 16) <= v3 |
567 + stru_721530.prolly_normal_d ) | 565 + stru_721530.prolly_normal_d ) |
568 { | 566 { |
569 v10 = (v8 * stru_721530.field_58.x + v9 * stru_721530.field_58.y) >> 16; | 567 v10 = (v8 * stru_721530.direction.x + v9 * stru_721530.direction.y) >> 16; |
570 if ( v10 > 0 ) | 568 if ( v10 > 0 ) |
571 { | 569 { |
572 v11 = stru_721530.normal.z | 570 v11 = stru_721530.normal.z |
573 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v10) >> 16); | 571 + ((unsigned __int64)(stru_721530.direction.z * (signed __int64)v10) >> 16); |
574 if ( v11 >= *(int *)(v14 + 10) - stru_721530.prolly_normal_d ) | 572 if ( v11 >= *(int *)(v14 + 10) - stru_721530.prolly_normal_d ) |
575 { | 573 { |
576 if ( v11 <= v13 + stru_721530.prolly_normal_d + *(int *)(v14 + 10) ) | 574 if ( v11 <= v13 + stru_721530.prolly_normal_d + *(int *)(v14 + 10) ) |
577 { | 575 { |
578 if ( v10 < stru_721530.field_7C ) | 576 if ( v10 < stru_721530.field_7C ) |
596 while ( (signed int)v15 < (signed int)uNumSpriteObjects ); | 594 while ( (signed int)v15 < (signed int)uNumSpriteObjects ); |
597 } | 595 } |
598 } | 596 } |
599 | 597 |
600 //----- (0046EF01) -------------------------------------------------------- | 598 //----- (0046EF01) -------------------------------------------------------- |
601 int _46EF01_collision_chech_player(int a1) | 599 int _46EF01_collision_chech_player(int a1) |
602 { | 600 { |
603 int v1; // edx@1 | 601 int v1; // edx@1 |
604 int result; // eax@1 | 602 int result; // eax@1 |
605 int v3; // ebx@7 | 603 int v3; // ebx@7 |
606 int v4; // esi@7 | 604 int v4; // esi@7 |
611 unsigned int v9; // [sp+10h] [bp-Ch]@1 | 609 unsigned int v9; // [sp+10h] [bp-Ch]@1 |
612 int v10; // [sp+14h] [bp-8h]@7 | 610 int v10; // [sp+14h] [bp-8h]@7 |
613 int v11; // [sp+18h] [bp-4h]@7 | 611 int v11; // [sp+18h] [bp-4h]@7 |
614 | 612 |
615 v8 = a1; | 613 v8 = a1; |
616 v1 = 2 * pParty->field_14; | 614 v1 = 2 * pParty->field_14_radius; |
617 result = pParty->vPosition.x; | 615 result = pParty->vPosition.x; |
618 v9 = pParty->uPartyHeight; | 616 v9 = pParty->uPartyHeight; |
619 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 ) | 617 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14_radius ) |
620 { | 618 { |
621 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 ) | 619 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 ) |
622 { | 620 { |
623 if ( stru_721530.sMaxY <= pParty->vPosition.y + v1 ) | 621 if ( stru_721530.sMaxY <= pParty->vPosition.y + v1 ) |
624 { | 622 { |
628 { | 626 { |
629 if ( stru_721530.sMinZ >= pParty->vPosition.z ) | 627 if ( stru_721530.sMinZ >= pParty->vPosition.z ) |
630 { | 628 { |
631 v3 = stru_721530.prolly_normal_d + v1; | 629 v3 = stru_721530.prolly_normal_d + v1; |
632 v11 = pParty->vPosition.x - stru_721530.normal.x; | 630 v11 = pParty->vPosition.x - stru_721530.normal.x; |
633 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y | 631 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.direction.y |
634 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16; | 632 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.direction.x) >> 16; |
635 v10 = pParty->vPosition.y - stru_721530.normal.y; | 633 v10 = pParty->vPosition.y - stru_721530.normal.y; |
636 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y | 634 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.direction.y |
637 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16); | 635 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.direction.x) >> 16); |
638 if ( result <= v3 ) | 636 if ( result <= v3 ) |
639 { | 637 { |
640 result = v10 * stru_721530.field_58.y; | 638 result = v10 * stru_721530.direction.y; |
641 v5 = (v10 * stru_721530.field_58.y + v11 * stru_721530.field_58.x) >> 16; | 639 v5 = (v10 * stru_721530.direction.y + v11 * stru_721530.direction.x) >> 16; |
642 if ( v5 > 0 ) | 640 if ( v5 > 0 ) |
643 { | 641 { |
644 v6 = ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v5) >> 16) + stru_721530.normal.z; | 642 v6 = ((unsigned __int64)(stru_721530.direction.z * (signed __int64)v5) >> 16) + stru_721530.normal.z; |
645 result = pParty->vPosition.z; | 643 result = pParty->vPosition.z; |
646 if ( v6 >= pParty->vPosition.z ) | 644 if ( v6 >= pParty->vPosition.z ) |
647 { | 645 { |
648 result = v9 + pParty->vPosition.z; | 646 result = v9 + pParty->vPosition.z; |
649 if ( v6 <= (signed int)(v9 + pParty->vPosition.z) || v8 ) | 647 if ( v6 <= (signed int)(v9 + pParty->vPosition.z) || v8 ) |
706 && stru_721530.sMaxY <= v3->pBounding.y2 | 704 && stru_721530.sMaxY <= v3->pBounding.y2 |
707 && stru_721530.sMinY >= v3->pBounding.y1 | 705 && stru_721530.sMinY >= v3->pBounding.y1 |
708 && stru_721530.sMaxZ <= v3->pBounding.z2 | 706 && stru_721530.sMaxZ <= v3->pBounding.z2 |
709 && stru_721530.sMinZ >= v3->pBounding.z1 ) | 707 && stru_721530.sMinZ >= v3->pBounding.z1 ) |
710 { | 708 { |
711 v4 = (stru_721530.normal.x * v3->pFacePlane_old.vNormal.x | 709 v4 = (stru_721530.normal.x * v3->pFacePlane_old.vNormal.x + v3->pFacePlane_old.dist |
712 + v3->pFacePlane_old.dist | |
713 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y | 710 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y |
714 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16; | 711 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16; |
715 v5 = (stru_721530.normal2.z * v3->pFacePlane_old.vNormal.z | 712 v5 = (stru_721530.normal2.z * v3->pFacePlane_old.vNormal.z + v3->pFacePlane_old.dist |
716 + v3->pFacePlane_old.dist | |
717 + stru_721530.normal2.x * v3->pFacePlane_old.vNormal.x | 713 + stru_721530.normal2.x * v3->pFacePlane_old.vNormal.x |
718 + stru_721530.normal2.y * v3->pFacePlane_old.vNormal.y) >> 16; | 714 + stru_721530.normal2.y * v3->pFacePlane_old.vNormal.y) >> 16; |
719 if ( (v4 < stru_721530.prolly_normal_d || v5 < stru_721530.prolly_normal_d) | 715 if ( (v4 < stru_721530.prolly_normal_d || v5 < stru_721530.prolly_normal_d) |
720 && (v4 > -stru_721530.prolly_normal_d || v5 > -stru_721530.prolly_normal_d) | 716 && (v4 > -stru_721530.prolly_normal_d || v5 > -stru_721530.prolly_normal_d) |
721 && (a3 = stru_721530.field_6C, sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, v3)) | 717 && (a3 = stru_721530.field_6C, sub_475D85(&stru_721530.normal, &stru_721530.direction, &a3, v3)) |
722 && a3 < (signed int)v10 ) | 718 && a3 < (signed int)v10 ) |
723 { | 719 { |
724 v0 = v9; | 720 v0 = v9; |
725 v10 = a3; | 721 v10 = a3; |
726 v12 = v9->pPortals[v8]; | 722 v12 = v9->pPortals[v8]; |
754 } | 750 } |
755 return result; | 751 return result; |
756 } | 752 } |
757 | 753 |
758 //----- (0047050A) -------------------------------------------------------- | 754 //----- (0047050A) -------------------------------------------------------- |
759 int stru141::_47050A(int a2) | 755 int stru141_actor_collision_object::_47050A(int dt) |
760 { | 756 { |
761 stru141 *v2; // esi@1 | 757 stru141_actor_collision_object *v2; // esi@1 |
762 signed int v3; // eax@1 | 758 //signed int v3; // eax@1 |
763 int v4; // ecx@1 | 759 //int v4; // ecx@1 |
764 int v5; // edx@1 | 760 //int v5; // edx@1 |
765 int v6; // edx@1 | 761 //int v6; // edx@1 |
766 int v7; // eax@1 | 762 int v7; // eax@1 |
767 int v8; // eax@3 | 763 int v8; // eax@3 |
768 signed int result; // eax@4 | 764 signed int result; // eax@4 |
769 int v10; // eax@5 | 765 int v10; // eax@5 |
770 int v11; // eax@5 | 766 int v11; // eax@5 |
785 int v26; // eax@16 | 781 int v26; // eax@16 |
786 int v27; // eax@17 | 782 int v27; // eax@17 |
787 int v28; // [sp+14h] [bp+8h]@5 | 783 int v28; // [sp+14h] [bp+8h]@5 |
788 | 784 |
789 v2 = this; | 785 v2 = this; |
790 v3 = integer_sqrt(this->field_24 * this->field_24 + this->field_20 * this->field_20 + this->field_1C * this->field_1C); | 786 int speed = 1 | integer_sqrt(this->velocity.z * this->velocity.z + this->velocity.y * this->velocity.y + this->velocity.x * this->velocity.x); |
791 v4 = v3 | 1; | 787 |
792 v5 = v2->field_1C; | 788 v2->direction.x = 65536 / speed * v2->velocity.x; |
793 v2->field_64 = v3 | 1; | 789 v2->direction.y = 65536 / speed * v2->velocity.y; |
794 v2->field_58.x = 65536 / (v3 | 1) * v5; | 790 v2->direction.z = 65536 / speed * v2->velocity.z; |
795 v2->field_58.y = 65536 / (v3 | 1) * v2->field_20; | 791 |
796 v6 = 65536 / (v3 | 1) * v2->field_24; | 792 v2->speed = speed; |
797 v2->field_68 = 65536 / (v3 | 1); | 793 v2->inv_speed = 65536 / speed; |
798 v7 = a2; | 794 |
799 v2->field_58.z = v6; | 795 if (dt) |
800 if ( !a2 ) | 796 v7 = dt; |
797 else | |
801 v7 = pEventTimer->dt_in_some_format; | 798 v7 = pEventTimer->dt_in_some_format; |
802 v8 = fixpoint_sub0(v7, v4) - v2->field_70; | 799 |
800 v8 = fixpoint_sub0(v7, speed) - v2->field_70; // speed * dt - something | |
803 v2->field_6C = v8; | 801 v2->field_6C = v8; |
804 if ( v8 > 0 ) | 802 if ( v8 > 0 ) |
805 { | 803 { |
806 v10 = fixpoint_sub0(v8, v2->field_58.x) + v2->normal.x; | 804 v10 = fixpoint_sub0(v8, v2->direction.x) + v2->normal.x; |
807 v2->field_4C = v10; | 805 v2->field_4C = v10; |
808 v2->normal2.x = v10; | 806 v2->normal2.x = v10; |
809 v11 = fixpoint_sub0(v2->field_6C, v2->field_58.y) + v2->normal.y; | 807 v11 = fixpoint_sub0(v2->field_6C, v2->direction.y) + v2->normal.y; |
810 v2->field_50 = v11; | 808 v2->field_50 = v11; |
811 v2->normal2.y = v11; | 809 v2->normal2.y = v11; |
812 v2->normal2.z = fixpoint_sub0(v2->field_6C, v2->field_58.z) + v2->normal.z; | 810 v2->normal2.z = fixpoint_sub0(v2->field_6C, v2->direction.z) + v2->normal.z; |
813 v12 = v2->field_34.z; | 811 v12 = v2->position.z; |
814 v13 = v2->normal.x; | 812 v13 = v2->normal.x; |
815 v14 = v2->normal2.x; | 813 v14 = v2->normal2.x; |
816 v15 = v2->prolly_normal_d; | 814 v15 = v2->prolly_normal_d; |
817 v16 = v12 + fixpoint_sub0(v2->field_6C, v2->field_58.z); | 815 v16 = v12 + fixpoint_sub0(v2->field_6C, v2->direction.z); |
818 v28 = v16; | 816 v28 = v16; |
819 v2->field_54 = v16; | 817 v2->field_54 = v16; |
820 v17 = v13; | 818 v17 = v13; |
821 if ( v13 >= v14 ) | 819 if ( v13 >= v14 ) |
822 v17 = v14; | 820 v17 = v14; |
840 if ( v24 >= v23 ) | 838 if ( v24 >= v23 ) |
841 v25 = v23 - v15; | 839 v25 = v23 - v15; |
842 else | 840 else |
843 v25 = v24 - v15; | 841 v25 = v24 - v15; |
844 v2->sMaxZ = v25; | 842 v2->sMaxZ = v25; |
845 v26 = v2->field_8; | 843 v26 = v2->field_8_radius; |
846 if ( v12 <= v28 ) | 844 if ( v12 <= v28 ) |
847 v27 = v28 + v26; | 845 v27 = v28 + v26; |
848 else | 846 else |
849 v27 = v12 + v26; | 847 v27 = v12 + v26; |
850 v2->uFaceID = 0; | 848 v2->uFaceID = 0; |
889 //int v22; // edi@42 | 887 //int v22; // edi@42 |
890 //int v23; // ecx@42 | 888 //int v23; // ecx@42 |
891 //__int16 v24; // ax@42 | 889 //__int16 v24; // ax@42 |
892 int v25; // eax@45 | 890 int v25; // eax@45 |
893 signed int v26; // ecx@50 | 891 signed int v26; // ecx@50 |
894 int v27; // eax@52 | 892 //int v27; // eax@52 |
895 int v28; // eax@54 | 893 int v28; // eax@54 |
896 signed int v29; // ebx@57 | 894 signed int v29; // ebx@57 |
897 signed int v30; // eax@57 | 895 signed int v30; // eax@57 |
898 int v31; // edi@57 | 896 int v31; // edi@57 |
899 signed int i; // ebx@57 | 897 signed int i; // ebx@57 |
1061 stru_721530.field_0 = 1; | 1059 stru_721530.field_0 = 1; |
1062 if ( !uIsFlying ) | 1060 if ( !uIsFlying ) |
1063 v26 = 40; | 1061 v26 = 40; |
1064 else | 1062 else |
1065 v26 = v0->uActorRadius; | 1063 v26 = v0->uActorRadius; |
1066 v27 = v0->uActorHeight; | 1064 |
1067 stru_721530.field_84 = -1; | 1065 stru_721530.field_84 = -1; |
1068 stru_721530.field_8 = v26; | 1066 stru_721530.field_8_radius = v26; |
1069 stru_721530.prolly_normal_d = v26; | 1067 stru_721530.prolly_normal_d = v26; |
1070 stru_721530.field_C = v27; | 1068 stru_721530.height = v0->uActorHeight; |
1071 stru_721530.field_70 = 0; | 1069 stru_721530.field_70 = 0; |
1072 v69 = 0; | 1070 v69 = 0; |
1073 while ( 1 ) | 1071 while ( 1 ) |
1074 { | 1072 { |
1075 stru_721530.field_34.x = v0->vPosition.x; | 1073 stru_721530.position.x = v0->vPosition.x; |
1076 stru_721530.normal.x = stru_721530.field_34.x; | 1074 stru_721530.normal.x = stru_721530.position.x; |
1077 stru_721530.field_34.y = v0->vPosition.y; | 1075 stru_721530.position.y = v0->vPosition.y; |
1078 stru_721530.normal.y = stru_721530.field_34.y; | 1076 stru_721530.normal.y = stru_721530.position.y; |
1079 v28 = v0->vPosition.z; | 1077 v28 = v0->vPosition.z; |
1080 stru_721530.normal.z = v28 + v26 + 1; | 1078 stru_721530.normal.z = v28 + v26 + 1; |
1081 stru_721530.field_34.z = v28 - v26 + stru_721530.field_C - 1; | 1079 stru_721530.position.z = v28 - v26 + stru_721530.height - 1; |
1082 if ( stru_721530.field_34.z < stru_721530.normal.z ) | 1080 if ( stru_721530.position.z < stru_721530.normal.z ) |
1083 stru_721530.field_34.z = v28 + v26 + 1; | 1081 stru_721530.position.z = v28 + v26 + 1; |
1084 stru_721530.field_1C = v0->vVelocity.x; | 1082 stru_721530.velocity.x = v0->vVelocity.x; |
1085 stru_721530.uSectorID = 0; | 1083 stru_721530.uSectorID = 0; |
1086 stru_721530.field_20 = v0->vVelocity.y; | 1084 stru_721530.velocity.y = v0->vVelocity.y; |
1087 stru_721530.field_24 = v0->vVelocity.z; | 1085 stru_721530.velocity.z = v0->vVelocity.z; |
1088 if ( stru_721530._47050A(0) ) | 1086 if ( stru_721530._47050A(0) ) |
1089 break; | 1087 break; |
1090 _46E889_collide_against_bmodels(1u); | 1088 _46E889_collide_against_bmodels(1u); |
1091 v29 = WorldPosToGridCellZ(v0->vPosition.y); | 1089 v29 = WorldPosToGridCellZ(v0->vPosition.y); |
1092 v30 = WorldPosToGridCellX(v0->vPosition.x); | 1090 v30 = WorldPosToGridCellX(v0->vPosition.x); |
1100 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) ) | 1098 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) ) |
1101 ++i; | 1099 ++i; |
1102 } | 1100 } |
1103 v71 = i > 1; | 1101 v71 = i > 1; |
1104 if ( stru_721530.field_7C < stru_721530.field_6C ) | 1102 if ( stru_721530.field_7C < stru_721530.field_6C ) |
1105 v70 = fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.z); | 1103 v70 = fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); |
1106 //v34 = 0; | 1104 //v34 = 0; |
1107 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 1105 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
1108 v36 = ODM_GetFloorLevel(stru_721530.normal2.x, | 1106 v36 = ODM_GetFloorLevel(stru_721530.normal2.x, |
1109 stru_721530.normal2.y, | 1107 stru_721530.normal2.y, |
1110 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, | 1108 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, |
1134 v0->vPosition.y = LOWORD(stru_721530.normal2.y); | 1132 v0->vPosition.y = LOWORD(stru_721530.normal2.y); |
1135 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; | 1133 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; |
1136 break; | 1134 break; |
1137 } | 1135 } |
1138 //v72b = fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.x); | 1136 //v72b = fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.x); |
1139 v0->vPosition.x += fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.x); | 1137 v0->vPosition.x += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); |
1140 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 1138 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
1141 v0->vPosition.y += fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.y); | 1139 v0->vPosition.y += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); |
1142 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; | 1140 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
1143 v0->vPosition.z += fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.z); | 1141 v0->vPosition.z += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); |
1144 v38 = stru_721530.uFaceID; | 1142 v38 = stru_721530.uFaceID; |
1145 stru_721530.field_70 += stru_721530.field_7C; | 1143 stru_721530.field_70 += stru_721530.field_7C; |
1146 v39 = PID_ID(v38); | 1144 v39 = PID_ID(v38); |
1147 switch ( PID_TYPE(v38) ) | 1145 switch ( PID_TYPE(v38) ) |
1148 { | 1146 { |
1221 } | 1219 } |
1222 else | 1220 else |
1223 { | 1221 { |
1224 v72b = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z | 1222 v72b = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z |
1225 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16; | 1223 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16; |
1226 if ( stru_721530.field_64 >> 3 > v72b ) | 1224 if ( (stru_721530.speed >> 3) > v72b ) |
1227 v72b = stru_721530.field_64 >> 3; | 1225 v72b = stru_721530.speed >> 3; |
1228 | 1226 |
1229 v0->vVelocity.x += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.x); | 1227 v0->vVelocity.x += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.x); |
1230 v0->vVelocity.y += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.y); | 1228 v0->vVelocity.y += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.y); |
1231 v0->vVelocity.z += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.z); | 1229 v0->vVelocity.z += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.z); |
1232 if ( v42 != 4 ) | 1230 if ( v42 != 4 ) |
1699 else | 1697 else |
1700 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); | 1698 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); |
1701 break; | 1699 break; |
1702 | 1700 |
1703 case PARTY_StrafeLeft: | 1701 case PARTY_StrafeLeft: |
1704 v2 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; | 1702 v2 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); |
1705 v1 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; | 1703 v1 += fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); |
1706 v78 = 1; | 1704 v78 = 1; |
1707 break; | 1705 break; |
1708 case PARTY_StrafeRight: | 1706 case PARTY_StrafeRight: |
1709 v2 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; | 1707 v2 += fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); |
1710 v1 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; | 1708 v1 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); |
1711 v78 = 1; | 1709 v78 = 1; |
1712 break; | 1710 break; |
1713 case PARTY_WalkForward: | 1711 case PARTY_WalkForward: |
1714 v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)(5 * (double)v81 * fWalkSpeedMultiplier)) >> 16; | 1712 v2 += fixpoint_sub0(stru_5C6E00->Cos(angle), 5 * v81 * fWalkSpeedMultiplier); |
1715 v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)(5 * (double)v81 * fWalkSpeedMultiplier)) >> 16; | 1713 v1 += fixpoint_sub0(stru_5C6E00->Sin(angle), 5 * v81 * fWalkSpeedMultiplier); |
1716 v78 = 1; | 1714 v78 = 1; |
1717 break; | 1715 break; |
1718 case PARTY_WalkBackward: | 1716 case PARTY_WalkBackward: |
1719 v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; | 1717 v2 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); |
1720 v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; | 1718 v1 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); |
1721 v78 = 1; | 1719 v78 = 1; |
1722 break; | 1720 break; |
1723 case PARTY_RunForward: | 1721 case PARTY_RunForward: |
1724 v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; | 1722 v2 += fixpoint_sub0(stru_5C6E00->Cos(angle), 2 * v81 * fWalkSpeedMultiplier); |
1725 v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; | 1723 v1 += fixpoint_sub0(stru_5C6E00->Sin(angle), 2 * v81 * fWalkSpeedMultiplier); |
1726 v72 = 1; | 1724 v72 = 1; |
1727 break; | 1725 break; |
1728 case PARTY_RunBackward: | 1726 case PARTY_RunBackward: |
1729 //v32 = stru_5C6E00->SinCos(angle); | 1727 //v32 = stru_5C6E00->SinCos(angle); |
1730 //v33 = (double)v81; | 1728 //v33 = (double)v81; |
1731 //v88 = (double)v81; | 1729 //v88 = (double)v81; |
1732 v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; | 1730 v2 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); |
1733 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 1731 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
1734 v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; | 1732 v1 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); |
1735 v72 = 1; | 1733 v72 = 1; |
1736 break; | 1734 break; |
1737 case PARTY_LookUp: | 1735 case PARTY_LookUp: |
1738 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); | 1736 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); |
1739 if ( _view_angle > 128 ) | 1737 if ( _view_angle > 128 ) |
1806 v1 = 0; | 1804 v1 = 0; |
1807 v2 = 0; | 1805 v2 = 0; |
1808 } | 1806 } |
1809 stru_721530.field_84 = -1; | 1807 stru_721530.field_84 = -1; |
1810 stru_721530.field_70 = 0; | 1808 stru_721530.field_70 = 0; |
1811 stru_721530.prolly_normal_d = pParty->field_14; | 1809 stru_721530.prolly_normal_d = pParty->field_14_radius; |
1812 stru_721530.field_8 = pParty->field_14 >> 1; | 1810 stru_721530.field_8_radius = pParty->field_14_radius / 2; |
1813 auto v83 = 0; | 1811 auto v83 = 0; |
1814 stru_721530.field_0 = 1; | 1812 stru_721530.field_0 = 1; |
1815 stru_721530.field_C = pParty->uPartyHeight - 32; | 1813 stru_721530.height = pParty->uPartyHeight - 32; |
1816 while ( 1 ) | 1814 while ( 1 ) |
1817 { | 1815 { |
1818 new_party_z = party_z; | 1816 new_party_z = party_z; |
1819 stru_721530.field_34.x = new_party_x; | 1817 stru_721530.position.x = new_party_x; |
1820 stru_721530.normal.x = new_party_x; | 1818 stru_721530.normal.x = new_party_x; |
1821 stru_721530.field_1C = v2; | 1819 stru_721530.velocity.x = v2; |
1822 stru_721530.field_34.y = new_party_y; | 1820 stru_721530.position.y = new_party_y; |
1823 stru_721530.normal.y = new_party_y; | 1821 stru_721530.normal.y = new_party_y; |
1824 stru_721530.field_20 = v1; | 1822 stru_721530.velocity.y = v1; |
1825 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1; | 1823 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1; |
1826 stru_721530.field_34.z = stru_721530.field_C + party_z + 1; | 1824 stru_721530.position.z = stru_721530.height + party_z + 1; |
1827 stru_721530.field_24 = pParty->uFallSpeed; | 1825 stru_721530.velocity.z = pParty->uFallSpeed; |
1828 stru_721530.uSectorID = uSectorID; | 1826 stru_721530.uSectorID = uSectorID; |
1829 v38 = 0; | 1827 v38 = 0; |
1830 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 ) | 1828 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 ) |
1831 v38 = 13312; | 1829 v38 = 13312; |
1832 if ( stru_721530._47050A(v38) ) | 1830 if ( stru_721530._47050A(v38) ) |
1849 uSectorID = stru_721530.normal2.y; | 1847 uSectorID = stru_721530.normal2.y; |
1850 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 1848 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
1851 } | 1849 } |
1852 else | 1850 else |
1853 { | 1851 { |
1854 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + new_party_x; | 1852 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16) + new_party_x; |
1855 uSectorID = new_party_y + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); | 1853 uSectorID = new_party_y + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16); |
1856 v40 = new_party_z + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); | 1854 v40 = new_party_z + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16); |
1857 } | 1855 } |
1858 v42 = collide_against_floor(v39, uSectorID, v40 + 40, &stru_721530.uSectorID, &uFaceID); | 1856 v42 = collide_against_floor(v39, uSectorID, v40 + 40, &stru_721530.uSectorID, &uFaceID); |
1859 if ( v42 == -30000 || v42 - new_party_z > 128 ) | 1857 if ( v42 == -30000 || v42 - new_party_z > 128 ) |
1860 return; | 1858 return; |
1861 if ( stru_721530.field_7C >= stru_721530.field_6C ) | 1859 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
1863 new_party_x = stru_721530.normal2.x; | 1861 new_party_x = stru_721530.normal2.x; |
1864 new_party_y = stru_721530.normal2.y; | 1862 new_party_y = stru_721530.normal2.y; |
1865 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 1863 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
1866 break; | 1864 break; |
1867 } | 1865 } |
1868 new_party_x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; | 1866 new_party_x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; |
1869 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 1867 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; |
1870 v43 = stru_721530.uFaceID; | 1868 v43 = stru_721530.uFaceID; |
1871 uSectorID = stru_721530.uSectorID; | 1869 uSectorID = stru_721530.uSectorID; |
1872 stru_721530.field_70 += stru_721530.field_7C; | 1870 stru_721530.field_70 += stru_721530.field_7C; |
1873 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; | 1871 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16) + new_party_z; |
1874 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) | 1872 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) |
1875 { | 1873 { |
1876 if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0 | 1874 if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0 |
1877 && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)) ) | 1875 && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)) ) |
1878 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | 1876 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); |
1915 v47 = v45 == 4; | 1913 v47 = v45 == 4; |
1916 v48 = v44->pFacePlane_old.vNormal.x; | 1914 v48 = v44->pFacePlane_old.vNormal.x; |
1917 if ( !v47 ) | 1915 if ( !v47 ) |
1918 { | 1916 { |
1919 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | 1917 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; |
1920 if ( stru_721530.field_64 >> 3 > v80 ) | 1918 if ((stru_721530.speed >> 3) > v80 ) |
1921 v80 = stru_721530.field_64 >> 3; | 1919 v80 = stru_721530.speed >> 3; |
1922 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | 1920 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; |
1923 v81 = v44->pFacePlane_old.vNormal.y; | 1921 v81 = v44->pFacePlane_old.vNormal.y; |
1924 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; | 1922 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; |
1925 v82 = v44->pFacePlane_old.vNormal.z; | 1923 v82 = v44->pFacePlane_old.vNormal.z; |
1926 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; | 1924 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; |
1943 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; | 1941 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; |
1944 } | 1942 } |
1945 else | 1943 else |
1946 { | 1944 { |
1947 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | 1945 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; |
1948 if ( stru_721530.field_64 >> 3 > v80 ) | 1946 if ((stru_721530.speed >> 3) > v80 ) |
1949 v80 = stru_721530.field_64 >> 3; | 1947 v80 = stru_721530.speed >> 3; |
1950 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | 1948 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; |
1951 v81 = v44->pFacePlane_old.vNormal.y; | 1949 v81 = v44->pFacePlane_old.vNormal.y; |
1952 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; | 1950 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; |
1953 v82 = v44->pFacePlane_old.vNormal.z; | 1951 v82 = v44->pFacePlane_old.vNormal.z; |
1954 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; | 1952 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; |
2659 *(float *)&v128 = 0.0; | 2657 *(float *)&v128 = 0.0; |
2660 v2 = 0; | 2658 v2 = 0; |
2661 } | 2659 } |
2662 stru_721530.field_84 = -1; | 2660 stru_721530.field_84 = -1; |
2663 stru_721530.field_70 = 0; | 2661 stru_721530.field_70 = 0; |
2664 stru_721530.prolly_normal_d = pParty->field_14; | 2662 stru_721530.prolly_normal_d = pParty->field_14_radius; |
2665 stru_721530.field_8 = pParty->field_14 >> 1; | 2663 stru_721530.field_8_radius = pParty->field_14_radius >> 1; |
2666 v126 = 0; | 2664 v126 = 0; |
2667 stru_721530.field_0 = 1; | 2665 stru_721530.field_0 = 1; |
2668 stru_721530.field_C = pParty->uPartyHeight - 32; | 2666 stru_721530.height = pParty->uPartyHeight - 32; |
2669 do | 2667 do |
2670 { | 2668 { |
2671 stru_721530.field_34.x = pX; | 2669 stru_721530.position.x = pX; |
2672 stru_721530.normal.x = pX; | 2670 stru_721530.normal.x = pX; |
2673 stru_721530.field_1C = v2; | 2671 stru_721530.velocity.x = v2; |
2674 stru_721530.field_34.y = pY; | 2672 stru_721530.position.y = pY; |
2675 stru_721530.normal.y = pY; | 2673 stru_721530.normal.y = pY; |
2676 stru_721530.normal.z = stru_721530.prolly_normal_d + pZ + 1; | 2674 stru_721530.normal.z = stru_721530.prolly_normal_d + pZ + 1; |
2677 stru_721530.field_34.z = stru_721530.field_C + pZ + 1; | 2675 stru_721530.position.z = stru_721530.height + pZ + 1; |
2678 stru_721530.field_20 = v128; | 2676 stru_721530.velocity.y = v128; |
2679 stru_721530.field_24 = pParty->uFallSpeed; | 2677 stru_721530.velocity.z = pParty->uFallSpeed; |
2680 v36 = 0; | 2678 v36 = 0; |
2681 stru_721530.uSectorID = 0; | 2679 stru_721530.uSectorID = 0; |
2682 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 ) | 2680 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 ) |
2683 v36 = 13312; | 2681 v36 = 13312; |
2684 if ( stru_721530._47050A(v36) ) | 2682 if ( stru_721530._47050A(v36) ) |
2696 _angle_y = stru_721530.normal2.y; | 2694 _angle_y = stru_721530.normal2.y; |
2697 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 2695 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2698 } | 2696 } |
2699 else | 2697 else |
2700 { | 2698 { |
2701 _angle_x = pX + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16); | 2699 _angle_x = pX + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); |
2702 _angle_y = pY + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); | 2700 _angle_y = pY + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); |
2703 pModel = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); | 2701 pModel = (BSPModel *)fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); |
2704 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + pZ; | 2702 v40 = fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z) + pZ; |
2705 } | 2703 } |
2706 v122 = v40; | 2704 v122 = v40; |
2707 ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); | 2705 ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); |
2708 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); | 2706 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); |
2709 auto v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); | 2707 auto v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); |
2835 continue; | 2833 continue; |
2836 } | 2834 } |
2837 if ( !v129 && (pODMFace->uPolygonType != POLYGON_InBetweenFloorAndWall || v119) )// упёрся в столб | 2835 if ( !v129 && (pODMFace->uPolygonType != POLYGON_InBetweenFloorAndWall || v119) )// упёрся в столб |
2838 { | 2836 { |
2839 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; | 2837 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; |
2840 if ( stru_721530.field_64 >> 3 > v118 ) | 2838 if ((stru_721530.speed >> 3) > v118 ) |
2841 v118 = stru_721530.field_64 >> 3; | 2839 v118 = stru_721530.speed >> 3; |
2842 v129 = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.x) >> 16; | 2840 v129 = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.x) >> 16; |
2843 _walk_speed = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.y) >> 16; | 2841 _walk_speed = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.y) >> 16; |
2844 v54 = 0; | 2842 v54 = 0; |
2845 if ( !v119 ) | 2843 if ( !v119 ) |
2846 { | 2844 { |
2877 ++v126; | 2875 ++v126; |
2878 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; | 2876 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; |
2879 continue; | 2877 continue; |
2880 } | 2878 } |
2881 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; | 2879 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; |
2882 if ( stru_721530.field_64 >> 3 > v118 ) | 2880 if ((stru_721530.speed >> 3) > v118 ) |
2883 v118 = stru_721530.field_64 >> 3; | 2881 v118 = stru_721530.speed >> 3; |
2884 v122 = pODMFace->pFacePlane.vNormal.x; | 2882 v122 = pODMFace->pFacePlane.vNormal.x; |
2885 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16; | 2883 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16; |
2886 pModel = (BSPModel *)pODMFace->pFacePlane.vNormal.y; | 2884 pModel = (BSPModel *)pODMFace->pFacePlane.vNormal.y; |
2887 pModel = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)pModel) >> 16); | 2885 pModel = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)pModel) >> 16); |
2888 v129 = pODMFace->pFacePlane.vNormal.z; | 2886 v129 = pODMFace->pFacePlane.vNormal.z; |
6836 { | 6834 { |
6837 v11 = &pOutdoor->pBModels[i].pFaces[j];//&v8[v4]->pFaces[v22 / 0x134]; | 6835 v11 = &pOutdoor->pBModels[i].pFaces[j];//&v8[v4]->pFaces[v22 / 0x134]; |
6838 v12 = v11->sCogTriggeredID; | 6836 v12 = v11->sCogTriggeredID; |
6839 if ( v12 ) | 6837 if ( v12 ) |
6840 { | 6838 { |
6841 if ( !(BYTE2(v11->uAttributes) & 0x10) ) | 6839 if ( !(v11->uAttributes & 0x100000) ) |
6842 { | 6840 { |
6843 v13 = GetEventHintString(v12); | 6841 v13 = GetEventHintString(v12); |
6844 v14 = v13; | 6842 v14 = v13; |
6845 if ( v13 ) | 6843 if ( v13 ) |
6846 { | 6844 { |
6903 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | 6901 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); |
6904 } | 6902 } |
6905 } | 6903 } |
6906 | 6904 |
6907 //----- (004452BB) -------------------------------------------------------- | 6905 //----- (004452BB) -------------------------------------------------------- |
6908 void sub_4452BB() | 6906 void sub_4452BB() |
6909 { | 6907 { |
6910 pGUIWindow2->Release(); | 6908 pGUIWindow2->Release(); |
6911 pGUIWindow2 = 0; | 6909 pGUIWindow2 = 0; |
6912 activeLevelDecoration = _591094_decoration; | 6910 activeLevelDecoration = _591094_decoration; |
6913 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); | 6911 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); |
7384 v16.uIndex = v8 + 2 * v9 + v9; | 7382 v16.uIndex = v8 + 2 * v9 + v9; |
7385 v10 = pMapStats->GetMapInfo(pCurrentMapName); | 7383 v10 = pMapStats->GetMapInfo(pCurrentMapName); |
7386 if ( v10 ) | 7384 if ( v10 ) |
7387 { | 7385 { |
7388 v11 = uNumActors; | 7386 v11 = uNumActors; |
7389 SpawnEncounter((MapInfo *)&pMapStats->pInfos[v10], &v16, 0, count, 0); | 7387 SpawnEncounter(&pMapStats->pInfos[v10], &v16, 0, count, 0); |
7390 memcpy(&v15, Actor::GetDirectionInfo(PID(OBJECT_Actor, v11), 4u, &a3, 1), sizeof(v15)); | 7388 memcpy(&v15, Actor::GetDirectionInfo(PID(OBJECT_Actor, v11), 4u, &a3, 1), sizeof(v15)); |
7391 v12 = v11; | 7389 v12 = v11; |
7392 if ( (signed int)v11 < (signed int)uNumActors ) | 7390 if ( (signed int)v11 < (signed int)uNumActors ) |
7393 { | 7391 { |
7394 for ( pActor = &pActors[v11]; v12 < (signed int)uNumActors; ++pActor ) | 7392 for ( pActor = &pActors[v11]; v12 < (signed int)uNumActors; ++pActor ) |
7400 } | 7398 } |
7401 } | 7399 } |
7402 } | 7400 } |
7403 } | 7401 } |
7404 | 7402 |
7405 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[]; | |
7406 | 7403 |
7407 //----- (0044987B) -------------------------------------------------------- | 7404 //----- (0044987B) -------------------------------------------------------- |
7408 void sub_44987B(const char *pMapName, MapStartPoint start_point) | 7405 void sub_44987B(const char *pMapName, MapStartPoint start_point) |
7409 { | 7406 { |
7410 const char *v2; // edi@1 | 7407 const char *v2; // edi@1 |
7441 case MapStartPoint_Party: v10 = "Party Start"; break; | 7438 case MapStartPoint_Party: v10 = "Party Start"; break; |
7442 case MapStartPoint_North: v10 = "North Start"; break; | 7439 case MapStartPoint_North: v10 = "North Start"; break; |
7443 case MapStartPoint_South: v10 = "South Start"; break; | 7440 case MapStartPoint_South: v10 = "South Start"; break; |
7444 case MapStartPoint_East: v10 = "East Start"; break; | 7441 case MapStartPoint_East: v10 = "East Start"; break; |
7445 case MapStartPoint_West: v10 = "West Start"; break; | 7442 case MapStartPoint_West: v10 = "West Start"; break; |
7443 default: | |
7444 Error("Invalid enum value: %u", point); | |
7446 } | 7445 } |
7447 | 7446 |
7448 strcpy(pName, v10); | 7447 strcpy(pName, v10); |
7449 v4 = pDecorationList->GetDecorIdByName(pName); | 7448 v4 = pDecorationList->GetDecorIdByName(pName); |
7450 if ( v4 ) | 7449 if ( v4 ) |
7616 pArray[v3 / 8] &= ~set_bit; | 7615 pArray[v3 / 8] &= ~set_bit; |
7617 } | 7616 } |
7618 | 7617 |
7619 //----- (0044C175) -------------------------------------------------------- | 7618 //----- (0044C175) -------------------------------------------------------- |
7620 void ShowStatusBarString( const char *pString, unsigned int uNumSeconds ) | 7619 void ShowStatusBarString( const char *pString, unsigned int uNumSeconds ) |
7621 { | 7620 { |
7622 unsigned int v2; // esi@1 | |
7623 int i; // eax@1 | |
7624 | |
7625 v2 = uNumSeconds; | |
7626 strcpy(GameUI_Footer_TimedString.data(), pString); | 7621 strcpy(GameUI_Footer_TimedString.data(), pString); |
7627 GameUI_Footer_TimeLeft = 1000 * v2 + GetTickCount(); | 7622 GameUI_Footer_TimeLeft = 1000 * uNumSeconds + GetTickCount(); |
7628 for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | 7623 |
7624 for (int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | |
7629 i > 450; | 7625 i > 450; |
7630 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) | 7626 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) |
7631 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | 7627 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; |
7632 } | 7628 } |
7633 | 7629 |
7634 //----- (0044C1D0) -------------------------------------------------------- | 7630 //----- (0044C1D0) -------------------------------------------------------- |
7635 void ShowNothingHereStatus() | 7631 void ShowNothingHereStatus() |
7636 { | 7632 { |
7637 if ( !GameUI_Footer_TimeLeft ) | 7633 if ( !GameUI_Footer_TimeLeft ) |
7638 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here | 7634 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2);// Nothing here |
7639 } | 7635 } |
7640 | 7636 |
7641 //----- (0044C28B) -------------------------------------------------------- | 7637 //----- (0044C28B) -------------------------------------------------------- |
7642 int const_2() | 7638 int const_2() |
7643 { | 7639 { |
7683 while ( v5 ); | 7679 while ( v5 ); |
7684 } | 7680 } |
7685 } | 7681 } |
7686 | 7682 |
7687 //----- (0040261D) -------------------------------------------------------- | 7683 //----- (0040261D) -------------------------------------------------------- |
7688 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8) | 7684 void stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8) |
7689 { | 7685 { |
7690 int result; // eax@1 | 7686 if (count < 100) |
7691 | 7687 { |
7692 result = this->count; | 7688 pIDs[count] = uID; |
7693 if ( this->count < 100 ) | 7689 pXs[count] = x; |
7694 { | 7690 pYs[count] = y; |
7695 this->pIDs[result] = uID; | 7691 pZs[count] = z; |
7696 this->pXs[this->count] = x; | 7692 field_324[count] = a3; |
7697 this->pYs[this->count] = y; | 7693 field_3EC[count] = a8; |
7698 this->pZs[this->count] = z; | 7694 field_450[count++] = a7; |
7699 this->field_324[this->count] = a3; | 7695 } |
7700 this->field_3EC[this->count] = a8; | |
7701 result = this->count; | |
7702 this->field_450[this->count++] = a7; | |
7703 } | |
7704 return result; | |
7705 } | 7696 } |
7706 | 7697 |
7707 //----- (00402CAE) -------------------------------------------------------- | 7698 //----- (00402CAE) -------------------------------------------------------- |
7708 int stru193_math::Cos(int angle) | 7699 int stru193_math::Cos(int angle) |
7709 { | 7700 { |