Mercurial > mm7
comparison DecalBuilder.cpp @ 2275:8193a64c7461
Слияние
author | Ritor1 |
---|---|
date | Fri, 14 Mar 2014 09:32:42 +0600 |
parents | 47b87aea14ba |
children | 8e9be4fa33a8 |
comparison
equal
deleted
inserted
replaced
2274:90f56da08d76 | 2275:8193a64c7461 |
---|---|
30 result = (field_20_time - pEventTimer->Time() + 384) / 384.0; | 30 result = (field_20_time - pEventTimer->Time() + 384) / 384.0; |
31 else | 31 else |
32 result = 0.0; | 32 result = 0.0; |
33 } | 33 } |
34 else | 34 else |
35 { | |
36 result = 1.0; | 35 result = 1.0; |
37 } | |
38 return result; | 36 return result; |
39 } | 37 } |
40 | |
41 | |
42 | |
43 | |
44 | 38 |
45 //----- (0043B6EF) -------------------------------------------------------- | 39 //----- (0043B6EF) -------------------------------------------------------- |
46 void BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b) | 40 void BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b) |
47 { | 41 { |
48 int v8; // esi@1 | 42 int v8; // esi@1 |
51 | 45 |
52 v8 = this->uNumBloodsplats; | 46 v8 = this->uNumBloodsplats; |
53 if ( this->uNumBloodsplats == 64 ) | 47 if ( this->uNumBloodsplats == 64 ) |
54 v8 = 0; | 48 v8 = 0; |
55 v9 = 5 * (v8 + 1); | 49 v9 = 5 * (v8 + 1); |
56 v10 = &this->std__vector_pBloodsplats[8 * v9 / 0x28u]; | 50 v10 = &this->std__vector_pBloodsplats[8 * v9 / 40]; |
57 v10->x = x; | 51 v10->x = x; |
58 v10->y = y; | 52 v10->y = y; |
59 v10->z = z; | 53 v10->z = z; |
60 v10->radius = radius; | 54 v10->radius = radius; |
61 v10->r = r; | 55 v10->r = r; |
467 | 461 |
468 //----- (0049BCEB) -------------------------------------------------------- | 462 //----- (0049BCEB) -------------------------------------------------------- |
469 char DecalBuilder::ApplyDecals_OutdoorFace(ODMFace *pFace) | 463 char DecalBuilder::ApplyDecals_OutdoorFace(ODMFace *pFace) |
470 { | 464 { |
471 double v8; // st7@12 | 465 double v8; // st7@12 |
472 unsigned int v10; // [sp+20h] [bp-1Ch]@1 | 466 //unsigned int v10; // [sp+20h] [bp-1Ch]@1 |
473 | 467 |
474 Bloodsplat *pBloodsplat; | 468 Bloodsplat *pBloodsplat; |
475 | 469 |
476 this->uNumDecals = 0; | 470 this->uNumDecals = 0; |
477 v10 = pBloodsplatContainer->std__vector_pBloodsplats_size; | 471 //v10 = pBloodsplatContainer->std__vector_pBloodsplats_size; |
478 if ( !pFace->Indoor_sky() && !pFace->Fluid() ) | 472 if ( !pFace->Indoor_sky() && !pFace->Fluid() ) |
479 { | 473 { |
480 for(int i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; i++ ) | 474 for(int i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; i++ ) |
481 { | 475 { |
482 pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i]; | 476 pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i]; |
504 | 498 |
505 //----- (0049BE8A) -------------------------------------------------------- | 499 //----- (0049BE8A) -------------------------------------------------------- |
506 bool DecalBuilder::_49BE8A(struct Polygon *a2, Vec3_float_ *_a3, float *a4, RenderVertexSoft *a5, unsigned int uStripType, char a7) | 500 bool DecalBuilder::_49BE8A(struct Polygon *a2, Vec3_float_ *_a3, float *a4, RenderVertexSoft *a5, unsigned int uStripType, char a7) |
507 { | 501 { |
508 bool result; // eax@1 | 502 bool result; // eax@1 |
509 RenderVertexSoft *v8; // edi@3 | 503 //RenderVertexSoft *v8; // edi@3 |
510 Vec3_float_ *v9; // ebx@3 | 504 //Vec3_float_ *v9; // ebx@3 |
511 Bloodsplat *v10; // esi@3 | 505 //Bloodsplat *v10; // esi@3 |
512 float v11; // eax@5 | 506 //float v11; // eax@5 |
513 float v12; // eax@6 | 507 float v12; // eax@6 |
514 double v13; // st7@13 | 508 //double v13; // st7@13 |
515 double v14; // st7@19 | 509 double v14; // st7@19 |
516 short v15; // eax@20 | 510 //short v15; // eax@20 |
517 int v16; // eax@22 | 511 int v16; // eax@22 |
518 int v17; // edx@24 | 512 //int v17; // edx@24 |
519 DecalBuilder *v18; // eax@24 | 513 //DecalBuilder *v18; // eax@24 |
520 std::string v19; // [sp-18h] [bp-54h]@12 | 514 std::string v19; // [sp-18h] [bp-54h]@12 |
521 const char *v20; // [sp-8h] [bp-44h]@12 | 515 const char *v20; // [sp-8h] [bp-44h]@12 |
522 int v21; // [sp-4h] [bp-40h]@12 | 516 //int v21; // [sp-4h] [bp-40h]@12 |
523 double v22; // [sp+Ch] [bp-30h]@19 | 517 double v22; // [sp+Ch] [bp-30h]@19 |
524 unsigned int v23; // [sp+14h] [bp-28h]@1 | 518 unsigned int v23; // [sp+14h] [bp-28h]@1 |
525 DecalBuilder *v24; // [sp+18h] [bp-24h]@1 | 519 //DecalBuilder *v24; // [sp+18h] [bp-24h]@1 |
526 int v25; // [sp+1Ch] [bp-20h]@19 | 520 //int v25; // [sp+1Ch] [bp-20h]@19 |
527 float v26; // [sp+20h] [bp-1Ch]@12 | 521 float v26; // [sp+20h] [bp-1Ch]@12 |
528 int v27; // [sp+24h] [bp-18h]@12 | 522 int v27; // [sp+24h] [bp-18h]@12 |
529 float v28; // [sp+28h] [bp-14h]@13 | 523 float v28; // [sp+28h] [bp-14h]@13 |
530 float v29; // [sp+2Ch] [bp-10h]@7 | 524 //float v29; // [sp+2Ch] [bp-10h]@7 |
531 float v30; // [sp+30h] [bp-Ch]@6 | 525 float v30; // [sp+30h] [bp-Ch]@6 |
532 float v31; // [sp+34h] [bp-8h]@6 | 526 float v31; // [sp+34h] [bp-8h]@6 |
533 bool v32; // [sp+38h] [bp-4h]@2 | 527 bool v32; // [sp+38h] [bp-4h]@2 |
534 float a3; | 528 float a3; |
535 | 529 |
536 this->uNumDecals = 0; | 530 this->uNumDecals = 0; |
537 result = pBloodsplatContainer->std__vector_pBloodsplats_size != 0; | 531 result = pBloodsplatContainer->std__vector_pBloodsplats_size != 0; |
538 v24 = this; | 532 // v24 = this; |
539 v23 = pBloodsplatContainer->std__vector_pBloodsplats_size; | 533 v23 = pBloodsplatContainer->std__vector_pBloodsplats_size; |
540 if ( pBloodsplatContainer->std__vector_pBloodsplats_size ) | 534 if ( pBloodsplatContainer->std__vector_pBloodsplats_size ) |
541 { | 535 { |
542 v32 = 0; | 536 |
543 if ( (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 ) | 537 if ( (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 ) |
544 { | 538 { |
545 v8 = a5; | 539 //v8 = a5; |
546 v9 = _a3; | 540 //v9 = _a3; |
547 v10 = pBloodsplatContainer->std__vector_pBloodsplats; | 541 for ( v32 = 0; v32 < (signed int)v23; ++v32 ) |
548 while ( v32 < (signed int)v23) | |
549 { | 542 { |
550 if ( uStripType == 4 ) | 543 if ( uStripType == 4 ) |
551 { | 544 { |
552 a3 = v8->vWorldPosition.x; | 545 a3 = a5->vWorldPosition.x; |
553 v11 = v8[3].vWorldPosition.x; | 546 //v11 = v8[3].vWorldPosition.x; |
554 v31 = v11; | 547 v31 = a5[3].vWorldPosition.x; |
555 v30 = v8[1].vWorldPosition.y; | 548 v30 = a5[1].vWorldPosition.y; |
556 v12 = v8->vWorldPosition.y; | 549 v12 = a5->vWorldPosition.y; |
557 v29 = v12; | 550 //v29 = v12; |
558 } | 551 } |
559 else if ( uStripType == 3 ) | 552 else if ( uStripType == 3 ) |
560 { | 553 { |
561 if ( a7 ) | 554 if ( a7 ) |
562 { | 555 { |
563 a3 = v8->vWorldPosition.x; | 556 a3 = a5->vWorldPosition.x; |
564 v31 = v8[2].vWorldPosition.x; | 557 v31 = a5[2].vWorldPosition.x; |
565 v30 = v8[1].vWorldPosition.y; | 558 v30 = a5[1].vWorldPosition.y; |
566 v12 = v8[2].vWorldPosition.y; | 559 v12 = a5[2].vWorldPosition.y; |
567 v29 = v12; | 560 //v29 = v12; |
568 } | 561 } |
569 else | 562 else |
570 { | 563 { |
571 a3 = v8[1].vWorldPosition.x; | 564 a3 = a5[1].vWorldPosition.x; |
572 v11 = v8[2].vWorldPosition.x; | 565 //v11 = v8[2].vWorldPosition.x; |
573 v31 = v11; | 566 v31 = a5[2].vWorldPosition.x; |
574 v30 = v8[1].vWorldPosition.y; | 567 v30 = a5[1].vWorldPosition.y; |
575 v12 = v8->vWorldPosition.y; | 568 v12 = a5->vWorldPosition.y; |
576 v29 = v12; | 569 //v29 = v12; |
577 } | 570 } |
578 } | 571 } |
579 else | 572 else |
580 MessageBoxW(nullptr, L"Uknown strip type detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:434", 0); | 573 MessageBoxW(nullptr, L"Uknown strip type detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:434", 0); |
581 v21 = uStripType; | 574 //v21 = uStripType; |
582 v13 = pGame->pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType); | 575 //v13 = pGame->pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType); |
583 v21 = uStripType; | 576 //v21 = uStripType; |
584 v28 = v13; | 577 v28 = pGame->pIndoorCameraD3D->GetPolygonMinZ(a5, uStripType); |
585 v26 = pGame->pIndoorCameraD3D->GetPolygonMaxZ(v8, uStripType); | 578 v26 = pGame->pIndoorCameraD3D->GetPolygonMaxZ(a5, uStripType); |
586 if ( a3 - v10->radius < v10->x && | 579 if ( a3 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].x && |
587 v31 + v10->radius > v10->x && | 580 v31 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].x && |
588 v30 - v10->radius < v10->y && | 581 v30 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].y && |
589 v29 + v10->radius > v10->y && | 582 v12 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].y && |
590 v28 - v10->radius < v10->z && | 583 v28 - pBloodsplatContainer->std__vector_pBloodsplats[v32].radius < pBloodsplatContainer->std__vector_pBloodsplats[v32].z && |
591 v26 + v10->radius > v10->z ) | 584 v26 + pBloodsplatContainer->std__vector_pBloodsplats[v32].radius > pBloodsplatContainer->std__vector_pBloodsplats[v32].z ) |
592 { | 585 { |
593 Vec3_float_::NegDot(&v8->vWorldPosition, v9, a4); | 586 Vec3_float_::NegDot(&a5->vWorldPosition, _a3, a4); |
594 v26 = v9->y * v10->y | 587 v26 = _a3->y * pBloodsplatContainer->std__vector_pBloodsplats[v32].y |
595 + v9->z * v10->z | 588 + _a3->z * pBloodsplatContainer->std__vector_pBloodsplats[v32].z |
596 + v9->x * v10->x | 589 + _a3->x * pBloodsplatContainer->std__vector_pBloodsplats[v32].x |
597 + *a4; | 590 + *a4; |
598 v22 = v26 + 6.7553994e15; | 591 v22 = v26 + 6.7553994e15; |
599 v25 = LODWORD(v22); | 592 //v25 = LODWORD(v22); |
600 v14 = (double)SLODWORD(v22); | 593 v14 = (double)SLODWORD(v22); |
601 v28 = v14; | 594 v28 = v14; |
602 if ( v14 <= v10->radius ) | 595 if ( v14 <= pBloodsplatContainer->std__vector_pBloodsplats[v32].radius ) |
603 { | 596 { |
604 v15 = a2->flags; | 597 //v15 = a2->flags; |
605 if ( a2->flags & 2 || a2->flags & 0x100 ) | 598 if ( a2->flags & 2 || a2->flags & 0x100 ) |
606 { | 599 { |
607 v16 = v10->field_1C; | 600 v16 = pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C; |
608 if ( !(v16 & 1) ) | 601 if ( !(pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C & 1) ) |
609 { | 602 { |
610 LOBYTE(v16) = v16 | 1; | 603 LOBYTE(v16) = v16 | 1; |
611 v10->field_1C = v16; | 604 pBloodsplatContainer->std__vector_pBloodsplats[v32].field_1C = v16; |
612 v10->field_20 = pEventTimer->Time(); | 605 pBloodsplatContainer->std__vector_pBloodsplats[v32].field_20 = pEventTimer->Time(); |
613 } | 606 } |
614 } | 607 } |
615 v17 = v32; | 608 //v17 = v32; |
616 v10->dot_dist = LODWORD(v28); | 609 pBloodsplatContainer->std__vector_pBloodsplats[v32].dot_dist = LODWORD(v28); |
617 v18 = v24; | 610 //v18 = this; |
618 v24->std__vector_30B00C[v24->uNumDecals] = v17; | 611 this->std__vector_30B00C[this->uNumDecals] = v32; |
619 ++v18->uNumDecals; | 612 ++this->uNumDecals; |
620 } | 613 } |
621 } | 614 } |
622 ++v32; | 615 //++v32; |
623 ++v10; | 616 //++v10; |
624 result = v32; | 617 result = v32; |
625 } | 618 } |
626 } | 619 } |
627 } | 620 } |
628 LOBYTE(result) = 1; | 621 LOBYTE(result) = 1; |