Mercurial > mm7
comparison IndoorCameraD3D.cpp @ 2277:b9adf4f414f6
submenu Other
author | Ritor1 |
---|---|
date | Fri, 14 Mar 2014 13:58:51 +0600 |
parents | aff7a7b072b7 |
children | d8b4a36f54a4 |
comparison
equal
deleted
inserted
replaced
2276:e2433db49428 | 2277:b9adf4f414f6 |
---|---|
514 | 514 |
515 | 515 |
516 //----- (00437AB5) -------------------------------------------------------- | 516 //----- (00437AB5) -------------------------------------------------------- |
517 void IndoorCameraD3D::do_draw_debug_line_sw(RenderVertexSoft *pLineBegin, signed int sStartDiffuse, RenderVertexSoft *pLineEnd, signed int sEndDiffuse, unsigned int uOutNumVertices, float z_stuff) | 517 void IndoorCameraD3D::do_draw_debug_line_sw(RenderVertexSoft *pLineBegin, signed int sStartDiffuse, RenderVertexSoft *pLineEnd, signed int sEndDiffuse, unsigned int uOutNumVertices, float z_stuff) |
518 { | 518 { |
519 char *v7; // eax@2 | |
520 signed int v8; // edx@2 | |
521 float v9; // ecx@5 | |
522 float v10; // eax@5 | |
523 char *v11; // eax@6 | |
524 signed int v12; // edx@6 | |
525 float v13; // edx@8 | |
526 float v14; // eax@8 | |
527 float v15; // eax@8 | |
528 double v16; // st7@11 | |
529 HRESULT v17; // eax@11 | |
530 std::string v18; // [sp-18h] [bp-7E4h]@12 | |
531 IDirect3DDevice3 *v19; // [sp-Ch] [bp-7D8h]@8 | |
532 const char *v20; // [sp-8h] [bp-7D4h]@8 | |
533 int v21; // [sp-4h] [bp-7D0h]@8 | |
534 RenderVertexSoft a1[20]; // [sp+8h] [bp-7C4h]@6 | 519 RenderVertexSoft a1[20]; // [sp+8h] [bp-7C4h]@6 |
535 RenderVertexSoft pVertices[20]; // [sp+3C8h] [bp-404h]@2 | 520 RenderVertexSoft pVertices[20]; // [sp+3C8h] [bp-404h]@2 |
536 RenderVertexD3D3 v24[2]; // [sp+788h] [bp-44h]@11 | 521 RenderVertexD3D3 v24[2]; // [sp+788h] [bp-44h]@11 |
537 IndoorCameraD3D *v25; // [sp+7C8h] [bp-4h]@1 | 522 |
538 | |
539 v25 = this; | |
540 //if ( pRenderer->pRenderD3D ) | 523 //if ( pRenderer->pRenderD3D ) |
541 { | 524 //{ |
542 v7 = (char *)&pVertices[0].flt_2C; | 525 for ( uint i = 0; i < 20; i++ ) |
543 v8 = 20; | 526 pVertices[i].flt_2C = 0.0; |
544 do | |
545 { | |
546 *(float *)v7 = 0.0; | |
547 v7 += 48; | |
548 --v8; | |
549 } | |
550 while ( v8 ); | |
551 if ( (char)uOutNumVertices ) | 527 if ( (char)uOutNumVertices ) |
552 { | 528 { |
553 v9 = pLineBegin->vWorldViewProjX; | 529 pVertices[0].vWorldViewProjX = pLineBegin->vWorldViewProjX; |
554 pVertices[0].vWorldViewProjY = pLineBegin->vWorldViewProjY; | 530 pVertices[0].vWorldViewProjY = pLineBegin->vWorldViewProjY; |
555 pVertices[0].vWorldViewProjX = v9; | 531 |
556 v10 = pLineEnd->vWorldViewProjY; | |
557 pVertices[1].vWorldViewProjX = pLineEnd->vWorldViewProjX; | 532 pVertices[1].vWorldViewProjX = pLineEnd->vWorldViewProjX; |
558 pVertices[1].vWorldViewProjY = v10; | 533 pVertices[1].vWorldViewProjY = pLineEnd->vWorldViewProjY; |
559 LABEL_11: | |
560 v16 = 0.001 - z_stuff; | |
561 v24[0].specular = 0; | 534 v24[0].specular = 0; |
562 v24[0].pos.x = pVertices[0].vWorldViewProjX; | 535 v24[0].pos.x = pVertices[0].vWorldViewProjX; |
563 v24[0].pos.y = pVertices[0].vWorldViewProjY; | 536 v24[0].pos.y = pVertices[0].vWorldViewProjY; |
564 v24[0].pos.z = v16; | 537 v24[0].pos.z = 0.001 - z_stuff; |
565 v24[0].diffuse = sStartDiffuse; | 538 v24[0].diffuse = sStartDiffuse; |
566 v24[0].rhw = 0.001; | 539 v24[0].rhw = 0.001; |
540 v24[0].texcoord.x = 0.0; | |
541 v24[0].texcoord.y = 0.0; | |
542 | |
567 v24[1].pos.x = pVertices[1].vWorldViewProjX; | 543 v24[1].pos.x = pVertices[1].vWorldViewProjX; |
568 v24[0].texcoord.x = 0.0; | |
569 v24[1].pos.y = pVertices[1].vWorldViewProjY; | 544 v24[1].pos.y = pVertices[1].vWorldViewProjY; |
570 v24[0].texcoord.y = 0.0; | |
571 v24[1].diffuse = sEndDiffuse; | 545 v24[1].diffuse = sEndDiffuse; |
572 v24[1].pos.z = v16; | 546 v24[1].pos.z = 0.001 - z_stuff; |
573 v24[1].specular = 0; | 547 v24[1].specular = 0; |
574 v21 = 0; | |
575 v24[1].rhw = 0.001; | 548 v24[1].rhw = 0.001; |
576 v20 = 0; | |
577 v24[1].texcoord.x = 0.0; | 549 v24[1].texcoord.x = 0.0; |
578 v24[1].texcoord.y = 0.0; | 550 v24[1].texcoord.y = 0.0; |
579 //v19 = pRenderer->pRenderD3D->pDevice; | 551 //v19 = pRenderer->pRenderD3D->pDevice; |
580 pRenderer->DrawLines(v24, 2); | 552 pRenderer->DrawLines(v24, 2); |
581 return; | 553 return; |
582 } | 554 } |
583 v11 = (char *)&a1[0].flt_2C; | 555 for ( uint i = 0; i < 20; i++ ) |
584 v12 = 20; | 556 a1[i].flt_2C = 0.0; |
585 do | |
586 { | |
587 *(float *)v11 = 0.0; | |
588 v11 += 48; | |
589 --v12; | |
590 } | |
591 while ( v12 ); | |
592 v21 = 0; | |
593 v20 = (const char *)1; | |
594 v19 = (IDirect3DDevice3 *)4; | |
595 v13 = pLineBegin->vWorldPosition.x; | |
596 uOutNumVertices = 2; | 557 uOutNumVertices = 2; |
597 a1[0].vWorldPosition.x = v13; | 558 a1[0].vWorldPosition.x = pLineBegin->vWorldPosition.x; |
598 v14 = pLineBegin->vWorldPosition.z; | |
599 a1[0].vWorldPosition.y = pLineBegin->vWorldPosition.y; | 559 a1[0].vWorldPosition.y = pLineBegin->vWorldPosition.y; |
600 a1[0].vWorldPosition.z = v14; | 560 a1[0].vWorldPosition.z = pLineBegin->vWorldPosition.z; |
601 a1[1].vWorldPosition.x = pLineEnd->vWorldPosition.x; | 561 a1[1].vWorldPosition.x = pLineEnd->vWorldPosition.x; |
602 v15 = pLineEnd->vWorldPosition.z; | |
603 a1[1].vWorldPosition.y = pLineEnd->vWorldPosition.y; | 562 a1[1].vWorldPosition.y = pLineEnd->vWorldPosition.y; |
604 a1[1].vWorldPosition.z = v15; | 563 a1[1].vWorldPosition.z = pLineEnd->vWorldPosition.z; |
605 if ( CalcPortalShape( | 564 if ( CalcPortalShape(a1, &uOutNumVertices, pVertices, this->std__vector_000034_prolly_frustrum, 4, 1, 0) != 1 || (signed int)uOutNumVertices >= 2 ) |
606 a1, | 565 { |
607 &uOutNumVertices, | 566 ViewTransform(pVertices, 2); |
608 pVertices, | 567 Project(pVertices, 2, 0); |
609 this->std__vector_000034_prolly_frustrum, | 568 v24[0].specular = 0; |
610 4, | 569 v24[0].pos.x = pVertices[0].vWorldViewProjX; |
611 1, | 570 v24[0].pos.y = pVertices[0].vWorldViewProjY; |
612 0) != 1 | 571 v24[0].pos.z = 0.001 - z_stuff; |
613 || (signed int)uOutNumVertices >= 2 ) | 572 v24[0].diffuse = sStartDiffuse; |
614 { | 573 v24[0].rhw = 0.001; |
615 ViewTransform(pVertices, 2u); | 574 v24[0].texcoord.x = 0.0; |
616 Project(pVertices, 2u, 0); | 575 v24[0].texcoord.y = 0.0; |
617 goto LABEL_11; | 576 |
618 } | 577 v24[1].pos.x = pVertices[1].vWorldViewProjX; |
619 } | 578 v24[1].pos.y = pVertices[1].vWorldViewProjY; |
579 v24[1].diffuse = sEndDiffuse; | |
580 v24[1].pos.z = 0.001 - z_stuff; | |
581 v24[1].specular = 0; | |
582 v24[1].rhw = 0.001; | |
583 v24[1].texcoord.x = 0.0; | |
584 v24[1].texcoord.y = 0.0; | |
585 //v19 = pRenderer->pRenderD3D->pDevice; | |
586 pRenderer->DrawLines(v24, 2); | |
587 return; | |
588 } | |
589 //} | |
620 } | 590 } |
621 | 591 |
622 //----- (00437A55) -------------------------------------------------------- | 592 //----- (00437A55) -------------------------------------------------------- |
623 void IndoorCameraD3D::debug_outline_d3d(const RenderVertexD3D3 *pLineVertices, unsigned int uNumLines, int uDiffuse, float z_stuff) | 593 void IndoorCameraD3D::debug_outline_d3d(const RenderVertexD3D3 *pLineVertices, unsigned int uNumLines, int uDiffuse, float z_stuff) |
624 { | 594 { |
625 unsigned int v5; // esi@1 | 595 unsigned int v5; // esi@1 |
626 const RenderVertexD3D3 *v6; // ecx@2 | 596 const RenderVertexD3D3 *v6; // ecx@2 |
627 unsigned int v7; // ebx@2 | 597 unsigned int v7; // ebx@2 |
628 const RenderVertexD3D3 *v8; // edi@3 | 598 const RenderVertexD3D3 *v8; // edi@3 |
629 IndoorCameraD3D *thisa; // [sp+10h] [bp-4h]@1 | |
630 | 599 |
631 v5 = 0; | 600 v5 = 0; |
632 thisa = this; | |
633 if ( (signed int)(uNumLines - 1) > 0 ) | 601 if ( (signed int)(uNumLines - 1) > 0 ) |
634 { | 602 { |
635 v6 = pLineVertices; | 603 v6 = pLineVertices; |
636 v7 = uNumLines - 1; | |
637 v5 = uNumLines - 1; | 604 v5 = uNumLines - 1; |
638 do | 605 for ( v7 = uNumLines - 1; v7; --v7 ) |
639 { | 606 { |
640 v8 = v6 + 1; | 607 v8 = v6 + 1; |
641 pRenderer->do_draw_debug_line_d3d(v6, uDiffuse, v6 + 1, uDiffuse, z_stuff); | 608 pRenderer->do_draw_debug_line_d3d(v6, uDiffuse, v6 + 1, uDiffuse, z_stuff); |
642 --v7; | |
643 v6 = v8; | 609 v6 = v8; |
644 } | 610 } |
645 while ( v7 ); | |
646 } | 611 } |
647 pRenderer->do_draw_debug_line_d3d(&pLineVertices[v5], uDiffuse, pLineVertices, uDiffuse, z_stuff); | 612 pRenderer->do_draw_debug_line_d3d(&pLineVertices[v5], uDiffuse, pLineVertices, uDiffuse, z_stuff); |
648 } | 613 } |
649 | 614 |
650 //----- (004379EE) -------------------------------------------------------- | 615 //----- (004379EE) -------------------------------------------------------- |
730 static_sub_437906_array_50CDD0[i].vWorldPosition.z = (double)pIndoor->pVertices[pFace->pVertexIDs[i]].z; | 695 static_sub_437906_array_50CDD0[i].vWorldPosition.z = (double)pIndoor->pVertices[pFace->pVertexIDs[i]].z; |
731 static_sub_437906_array_50CDD0[i].u = (double)pFace->pVertexUIDs[i]; | 696 static_sub_437906_array_50CDD0[i].u = (double)pFace->pVertexUIDs[i]; |
732 static_sub_437906_array_50CDD0[i].v = (double)pFace->pVertexVIDs[i]; | 697 static_sub_437906_array_50CDD0[i].v = (double)pFace->pVertexVIDs[i]; |
733 } | 698 } |
734 } | 699 } |
735 extern bool draw_debug_line; | 700 if ( draw_portals_loops ) |
736 if ( draw_debug_line ) | |
737 debug_outline_sw(static_sub_437906_array_50CDD0, pFace->uNumVertices, uDiffuse, 0.0); | 701 debug_outline_sw(static_sub_437906_array_50CDD0, pFace->uNumVertices, uDiffuse, 0.0); |
738 } | 702 } |
739 // 50D9D0: using guessed type char static_sub_437906_byte_50D9D0_init_flag; | 703 // 50D9D0: using guessed type char static_sub_437906_byte_50D9D0_init_flag; |
740 | 704 |
741 //----- (004378BA) -------------------------------------------------------- | 705 //----- (004378BA) -------------------------------------------------------- |