comparison mm7_1.cpp @ 1238:77ea5c5f2c0b

m
author Ritor1
date Mon, 10 Jun 2013 00:37:03 +0600
parents 182b910c528d
children b9747d9e9b4e 21a46b38ca24 772f805df4f7
comparison
equal deleted inserted replaced
1237:8ee5f1554b64 1238:77ea5c5f2c0b
1485 } 1485 }
1486 1486
1487 //----- (00423B5D) -------------------------------------------------------- 1487 //----- (00423B5D) --------------------------------------------------------
1488 int __fastcall sub_423B5D(unsigned int uFaceID) 1488 int __fastcall sub_423B5D(unsigned int uFaceID)
1489 { 1489 {
1490 BLVFace *v1; // ebx@1 1490 BLVFace *pFace; // ebx@1
1491 Vec3_short_ *v2; // esi@1 1491 Vec3_short_ *v2; // esi@1
1492 //int v3; // ST28_4@1 1492 //int v3; // ST28_4@1
1493 __int16 v4; // ST2C_2@1 1493 __int16 v4; // ST2C_2@1
1494 //signed int v5; // esi@1 1494 //signed int v5; // esi@1
1495 //Vec3_short_ *v6; // eax@4 1495 //Vec3_short_ *v6; // eax@4
1575 signed int ib; // [sp+24h] [bp-4h]@31 1575 signed int ib; // [sp+24h] [bp-4h]@31
1576 signed int ic; // [sp+24h] [bp-4h]@41 1576 signed int ic; // [sp+24h] [bp-4h]@41
1577 signed int id; // [sp+24h] [bp-4h]@51 1577 signed int id; // [sp+24h] [bp-4h]@51
1578 signed int ie; // [sp+24h] [bp-4h]@61 1578 signed int ie; // [sp+24h] [bp-4h]@61
1579 1579
1580 v1 = &pIndoor->pFaces[uFaceID]; 1580 pFace = &pIndoor->pFaces[uFaceID];
1581 //this = pGame->pIndoorCameraD3D; 1581 //this = pGame->pIndoorCameraD3D;
1582 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; 1582 v2 = &pIndoor->pVertices[pFace->pVertexIDs[0]];
1583 //v3 = *(_DWORD *)&v2->x; 1583 //v3 = *(_DWORD *)&v2->x;
1584 v4 = v2->z; 1584 v4 = v2->z;
1585 //v5 = 0; 1585 //v5 = 0;
1586 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) 1586 if ( pFace->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x)
1587 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) 1587 + pFace->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y)
1588 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) 1588 + pFace->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 )
1589 { 1589 {
1590 stru_50B700.field_0 = 1; 1590 stru_50B700.field_0 = 1;
1591 } 1591 }
1592 else 1592 else
1593 { 1593 {
1594 stru_50B700.field_0 = 0; 1594 stru_50B700.field_0 = 0;
1595 if ( !v1->Portal() ) 1595 if ( !pFace->Portal() )
1596 return 0; 1596 return 0;
1597 } 1597 }
1598 //v66 = v1->uNumVertices; 1598 //v66 = v1->uNumVertices;
1599 for (uint i = 0; i < v1->uNumVertices; ++i) 1599 for (uint i = 0; i < pFace->uNumVertices; ++i)
1600 { 1600 {
1601 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; 1601 auto v6 = &pIndoor->pVertices[pFace->pVertexIDs[i]];
1602 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( 1602 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(v6->x, v6->y, v6->z,
1603 v6->x, 1603 &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0);
1604 v6->y,
1605 v6->z,
1606 &stru_50B700._view_transformed_xs[i],
1607 &stru_50B700._view_transformed_zs[i],
1608 &stru_50B700._view_transformed_ys[i],
1609 0);
1610 } 1604 }
1611 1605
1612 //v7 = v1->uNumVertices; 1606 //v7 = v1->uNumVertices;
1613 //v8 = 0; 1607 //v8 = 0;
1614 if (v1->uNumVertices <= 0) 1608 if (pFace->uNumVertices <= 0)
1615 return 0; 1609 return 0;
1616 1610
1617 bool bFound = false; 1611 bool bFound = false;
1618 for (uint i = 0; i < v1->uNumVertices; ++i) 1612 for (uint i = 0; i < pFace->uNumVertices; ++i)
1619 if (stru_50B700._view_transformed_xs[i] >= 0x80000u) 1613 if (stru_50B700._view_transformed_xs[i] >= 0x80000u)
1620 { 1614 {
1621 bFound = true; 1615 bFound = true;
1622 break; 1616 break;
1623 } 1617 }
1624 if (!bFound) 1618 if (!bFound)
1625 return 0; 1619 return 0;
1626 1620
1627 v79 = 0; 1621 v79 = 0;
1628 stru_50B700._view_transformed_xs[v1->uNumVertices] = stru_50B700._view_transformed_xs[0]; 1622 stru_50B700._view_transformed_xs[pFace->uNumVertices] = stru_50B700._view_transformed_xs[0];
1629 stru_50B700._view_transformed_zs[v1->uNumVertices] = stru_50B700._view_transformed_zs[0]; 1623 stru_50B700._view_transformed_zs[pFace->uNumVertices] = stru_50B700._view_transformed_zs[0];
1630 stru_50B700._view_transformed_ys[v1->uNumVertices] = stru_50B700._view_transformed_ys[0]; 1624 stru_50B700._view_transformed_ys[pFace->uNumVertices] = stru_50B700._view_transformed_ys[0];
1631 thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u; 1625 thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u;
1632 //int i = 1; 1626 //int i = 1;
1633 for (uint i = 1; i <= v1->uNumVertices; ++i) 1627 for (uint i = 1; i <= pFace->uNumVertices; ++i)
1634 { 1628 {
1635 v10 = stru_50B700._view_transformed_xs[i]; 1629 v10 = stru_50B700._view_transformed_xs[i];
1636 v81 = v10 >= (signed int)0x80000u; 1630 v81 = v10 >= (signed int)0x80000u;
1637 if ( thisa ^ v81 ) 1631 if ( thisa ^ v81 )
1638 { 1632 {