comparison mm7_1.cpp @ 1289:772f805df4f7

m
author Ritor1
date Tue, 11 Jun 2013 17:30:54 +0600
parents 77ea5c5f2c0b
children 1577d75db258
comparison
equal deleted inserted replaced
1288:7adc8b9b6a25 1289:772f805df4f7
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 *pFace; // ebx@1 1490 BLVFace *pFace; // ebx@1
1491 //Vec3_short_ *v2; // esi@1
1492 //int v3; // ST28_4@1
1493 //__int16 v4; // ST2C_2@1
1494 //signed int v5; // esi@1
1495 //Vec3_short_ *v6; // eax@4
1496 //signed int v7; // edi@5
1497 //signed int v8; // eax@5
1498 //signed int i_; // ecx@10
1499 //int v10; // eax@10
1500 //int v11; // edx@11
1501 //int v12; // ST28_4@12
1502 //signed int v13; // edx@12
1503 //signed __int64 v14; // qtt@12
1504 //int *v15; // ebx@12
1505 //int v16; // ST28_4@14
1506 //signed int v17; // eax@14
1507 //signed __int64 v18; // qtt@14
1508 signed int v19; // edx@15
1509 signed int v20; // edx@17
1510 signed int v21; // ebx@19
1511 //signed int v22; // esi@20
1512 int v23; // edi@21
1513 int v24; // eax@21
1514 //int v25; // eax@22
1515 int v26; // eax@22
1516 //signed int v27; // ST30_4@24
1517 //signed __int64 v28; // qtt@24
1518 //int v29; // ST18_4@25
1519 int v30; // eax@26
1520 //int v31; // eax@27
1521 int v32; // eax@27
1522 //signed int v33; // ST30_4@29
1523 //signed __int64 v34; // qtt@29
1524 //int v35; // ST30_4@30
1525 signed int v36; // edi@31
1526 //unsigned int v37; // eax@31
1527 bool v38; // edx@31
1528 //int v39; // ecx@31
1529 //int v40; // ecx@32
1530 //int v41; // esi@32
1531 int v42; // eax@34
1532 signed int v43; // ebx@41
1533 //unsigned int v44; // eax@41
1534 //signed int v45; // ecx@42
1535 //int v46; // esi@42
1536 int v47; // eax@44
1537 signed int v48; // edi@51
1538 //unsigned int v49; // eax@51
1539 bool v50; // edx@51
1540 //int v51; // ecx@51
1541 //int v52; // ecx@52
1542 //signed int v53; // esi@52
1543 int v54; // eax@54
1544 int v55; // ebx@61
1545 //unsigned int v56; // eax@61
1546 //signed int v57; // ecx@62
1547 //int v58; // esi@62
1548 int v59; // eax@64
1549 char v61; // zf@72
1550 signed int v62; // edx@75
1551 int v63; // ecx@76
1552 int v64; // esi@76
1553 int v65; // ecx@83
1554 //signed int v66; // [sp+14h] [bp-14h]@3
1555 int v67; // [sp+14h] [bp-14h]@34
1556 int v68; // [sp+14h] [bp-14h]@44
1557 int v69; // [sp+14h] [bp-14h]@54
1558 int v70; // [sp+14h] [bp-14h]@64
1559 signed int v71; // [sp+14h] [bp-14h]@75
1560 bool thisa; // [sp+18h] [bp-10h]@9
1561 int thisb; // [sp+18h] [bp-10h]@12
1562 //int thisc; // [sp+18h] [bp-10h]@20
1563 bool thisd; // [sp+18h] [bp-10h]@41
1564 bool thise; // [sp+18h] [bp-10h]@61
1565 int thisf; // [sp+18h] [bp-10h]@74
1566 signed int v79; // [sp+1Ch] [bp-Ch]@9
1567 int v80; // [sp+1Ch] [bp-Ch]@76
1568 bool v81; // [sp+20h] [bp-8h]@10
1569 bool v82; // [sp+20h] [bp-8h]@32
1570 bool v83; // [sp+20h] [bp-8h]@42
1571 bool v84; // [sp+20h] [bp-8h]@52
1572 bool v85; // [sp+20h] [bp-8h]@62
1573 //signed int i; // [sp+24h] [bp-4h]@9
1574 //unsigned int i; // [sp+24h] [bp-4h]@19
1575 //signed int ix; // [sp+24h] [bp-4h]@31
1576 //signed int iz; // [sp+24h] [bp-4h]@41
1577 //signed int iy; // [sp+24h] [bp-4h]@51
1578 //signed int iw; // [sp+24h] [bp-4h]@61
1579
1580 pFace = &pIndoor->pFaces[uFaceID];
1581 //v2 = &pIndoor->pVertices[pFace->pVertexIDs[0]];
1582 //v4 = pIndoor->pVertices[pFace->pVertexIDs[0]].z;
1583 if ( pFace->pFacePlane.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pBLVRenderParams->vPartyPos.x)//maybe it's length = n * direction vector
1584 + pFace->pFacePlane.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pBLVRenderParams->vPartyPos.y)
1585 + pFace->pFacePlane.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pBLVRenderParams->vPartyPos.z) < 0 )
1586 {
1587 stru_50B700.field_0 = 1;
1588 }
1589 else
1590 {
1591 stru_50B700.field_0 = 0;
1592 if ( !pFace->Portal() )
1593 return 0;
1594 }
1595 for (uint i = 0; i < pFace->uNumVertices; ++i)
1596 {
1597 //auto v6 = &pIndoor->pVertices[pFace->pVertexIDs[i]];
1598 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(pIndoor->pVertices[pFace->pVertexIDs[i]].x,
1599 pIndoor->pVertices[pFace->pVertexIDs[i]].y, pIndoor->pVertices[pFace->pVertexIDs[i]].z,
1600 &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0);
1601 }
1602
1603 if (pFace->uNumVertices <= 0)
1604 return 0;
1605
1606 bool bFound = false;
1607 for (uint i = 0; i < pFace->uNumVertices; ++i)
1608 if (stru_50B700._view_transformed_xs[i] >= 0x80000u)
1609 {
1610 bFound = true;
1611 break;
1612 }
1613 if (!bFound)
1614 return 0;
1615
1616 v79 = 0;
1617 stru_50B700._view_transformed_xs[pFace->uNumVertices] = stru_50B700._view_transformed_xs[0];
1618 stru_50B700._view_transformed_zs[pFace->uNumVertices] = stru_50B700._view_transformed_zs[0];
1619 stru_50B700._view_transformed_ys[pFace->uNumVertices] = stru_50B700._view_transformed_ys[0];
1620
1621 //maybe for near clip plane
1622 thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u;
1623 for ( uint i = 1; i <= pFace->uNumVertices; ++i)
1624 {
1625 v81 = stru_50B700._view_transformed_xs[i] >= (signed int)0x80000u;
1626 if ( thisa ^ v81 )
1627 {
1628 if ( stru_50B700._view_transformed_xs[i] >= (signed int)0x80000u )
1629 {
1630 //v12 = stru_50B700._view_transformed_xs[i] - stru_50B700._view_transformed_xs[i - 1];
1631 //v13 = 0x80000 - stru_50B700._view_transformed_xs[i - 1];
1632 //LODWORD(v14) = v13 << 16;
1633 //HIDWORD(v14) = v13 >> 16;
1634 //v15 = &stru_50B700._view_transformed_ys[i - 1];
1635 stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1])
1636 * (0x80000 - stru_50B700._view_transformed_xs[i - 1])
1637 / (stru_50B700._view_transformed_xs[i] - stru_50B700._view_transformed_xs[i - 1])))
1638 + stru_50B700._view_transformed_zs[i - 1];
1639 thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1])
1640 * (0x80000 - stru_50B700._view_transformed_xs[i - 1])
1641 / (stru_50B700._view_transformed_xs[i] - stru_50B700._view_transformed_xs[i - 1]));
1642 }
1643 else
1644 {
1645 //v16 = stru_50B700._view_transformed_xs[i - 1] - stru_50B700._view_transformed_xs[i];
1646 //v17 = 0x80000 - stru_50B700._view_transformed_xs[i];
1647 //LODWORD(v18) = v17 << 16;
1648 //HIDWORD(v18) = v17 >> 16;
1649 //v15 = &stru_50B700._view_transformed_ys[i];
1650 stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i])
1651 * (0x80000 - stru_50B700._view_transformed_xs[i])
1652 / (stru_50B700._view_transformed_xs[i - 1] - stru_50B700._view_transformed_xs[i])))
1653 + stru_50B700._view_transformed_zs[i];
1654 thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i])
1655 * (0x80000 - stru_50B700._view_transformed_xs[i])
1656 / (stru_50B700._view_transformed_xs[i - 1] - stru_50B700._view_transformed_xs[i]));
1657 }
1658 v19 = v79++;
1659 stru_50B700.field_38[v19] = thisb + stru_50B700._view_transformed_ys[i];
1660 stru_50B700.field_218[v19] = 0x80000u;
1661 }
1662 if ( v81 )
1663 {
1664 v20 = v79++;
1665 stru_50B700.field_218[v20] = stru_50B700._view_transformed_xs[i];
1666 stru_50B700.field_128[v20] = stru_50B700._view_transformed_zs[i];
1667 stru_50B700.field_38[v20] = stru_50B700._view_transformed_ys[i];
1668 }
1669 thisa = v81;
1670 }
1671 v21 = v79;
1672 stru_50B700.field_218[v79] = stru_50B700.field_218[0];
1673 stru_50B700.field_128[v79] = stru_50B700.field_128[0];
1674 stru_50B700.field_38[v79] = stru_50B700.field_38[0];
1675
1676 //maybe for far clip plane
1677 for ( uint i = 0; i < v79; ++i )
1678 {
1679 if ( abs(stru_50B700.field_128[i]) <= abs(stru_50B700.field_218[i]) )
1680 {
1681 //LODWORD(v28) = stru_50B700.field_128[i] << 16;
1682 //HIDWORD(v28) = stru_50B700.field_128[i] >> 16;
1683 v26 = stru_50B700.field_128[i] / stru_50B700.field_218[i];
1684 v23 = 0;
1685 }
1686 else
1687 {
1688 v23 = 0;
1689 v24 = 0;
1690 if ( stru_50B700.field_128[i] >= 0 )
1691 {
1692 LOBYTE(v24) = stru_50B700.field_218[i] >= 0;
1693 v26 = ((v24 - 1) & 0xFF800000) + 0x400000;
1694 }
1695 else
1696 {
1697 LOBYTE(v24) = stru_50B700.field_218[i] >= 0;
1698 //v25 = v24 - 1;
1699 v26 = ((v24 - 1) & 0x800000) - 0x400000;
1700 }
1701 }
1702 stru_50B700._xs3[i] = v26;
1703 if ( abs(stru_50B700.field_38[i]) <= abs(stru_50B700.field_218[i]) )
1704 {
1705 //LODWORD(v34) = stru_50B700.field_38[i] << 16;
1706 //HIDWORD(v34) = stru_50B700.field_38[i] >> 16;
1707 v32 = stru_50B700.field_38[i] / stru_50B700.field_218[i];
1708 }
1709 else
1710 {
1711 v30 = 0;
1712 if ( stru_50B700.field_38[i] >= v23 )
1713 {
1714 LOBYTE(v30) = stru_50B700.field_218[i] >= v23;
1715 v32 = ((v30 - 1) & 0xFF800000) + 0x400000;
1716 }
1717 else
1718 {
1719 LOBYTE(v30) = stru_50B700.field_218[i] >= v23;
1720 v32 = ((v30 - 1) & 0x800000) - 0x400000;
1721 }
1722 }
1723 stru_50B700._ys2[i] = v32;
1724 stru_50B700._xs3[i] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._xs3[i]);
1725 stru_50B700._xs3[i] = pBLVRenderParams->uViewportCenterX - stru_50B700._xs3[i];
1726 stru_50B700._ys2[i] = pBLVRenderParams->uViewportCenterY - (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40)
1727 * (signed __int64)stru_50B700._ys2[i]);
1728 }
1729 v36 = 0;
1730 stru_50B700._xs3[v21] = stru_50B700._xs3[0];
1731 stru_50B700._ys2[v21] = stru_50B700._ys2[0];
1732 v38 = stru_50B700._xs3[0] < (signed int)pBLVRenderParams->uViewportX;
1733 LOBYTE(v38) = stru_50B700._xs3[0] >= (signed int)pBLVRenderParams->uViewportX;
1734 if ( v79 < 1 )
1735 return 0;
1736
1737 //maybe for left clip plane
1738 for ( uint i = 1; i <= v79; i++ )
1739 {
1740 v82 = stru_50B700._xs3[i] >= (signed int)pBLVRenderParams->uViewportX;
1741 if ( v38 ^ v82 )
1742 {
1743 if ( stru_50B700._xs3[i] >= (signed int)pBLVRenderParams->uViewportX )
1744 {
1745 //v67 = (a-b)*(c-d)/(e-f)
1746 v67 = (signed int)(pBLVRenderParams->uViewportX - stru_50B700._xs3[i - 1])
1747 * (signed __int64)(stru_50B700._ys2[i] - stru_50B700._ys2[i - 1]) / (stru_50B700._xs3[i] - stru_50B700._xs3[i - 1]);
1748 v42 = stru_50B700._ys2[i - 1];//d
1749 }
1750 else
1751 {
1752 //v67 = (a-e)*(d-c)/(f-e)
1753 v67 = (signed int)(pBLVRenderParams->uViewportX - stru_50B700._xs3[i])
1754 * (signed __int64)(stru_50B700._ys2[i - 1] - stru_50B700._ys2[i]) / (stru_50B700._xs3[i - 1] - stru_50B700._xs3[i]);
1755 v42 = stru_50B700._ys2[i];//c
1756 }
1757 stru_50B700._ys[v36] = v67 + v42;
1758 stru_50B700._xs2[v36] = pBLVRenderParams->uViewportX;
1759 ++v36;
1760 }
1761 v38 = v82;
1762 if ( v82 )
1763 {
1764 stru_50B700._xs2[v36] = stru_50B700._xs3[i];
1765 stru_50B700._ys[v36] = stru_50B700._ys2[i];
1766 ++v36;
1767 }
1768 }
1769
1770 if (v36 < 1)
1771 return 0;
1772
1773 v43 = 0;
1774 stru_50B700._xs2[v36] = stru_50B700._xs2[0];
1775 stru_50B700._ys[v36] = stru_50B700._ys[0];
1776
1777 //maybe for right clip plane
1778 thisd = stru_50B700._xs2[0] <= (signed int)pBLVRenderParams->uViewportZ;
1779 for ( uint i = 1; i <= v36; ++i )
1780 {
1781 v83 = stru_50B700._xs2[i] <= (signed int)pBLVRenderParams->uViewportZ;
1782 if ( thisd ^ v83 )
1783 {
1784 if ( stru_50B700._xs2[i] <= (signed int)pBLVRenderParams->uViewportZ )
1785 {
1786 //v68 = (a-b)*(c-d)/(e-b)
1787 v68 = (signed int)(pBLVRenderParams->uViewportZ - stru_50B700._xs2[i - 1])
1788 * (signed __int64)(stru_50B700._ys[i] - stru_50B700._ys[i - 1]) / (stru_50B700._xs2[i] - stru_50B700._xs2[i - 1]);
1789 v47 = stru_50B700._ys[i - 1];//d
1790 }
1791 else
1792 {
1793 //v68 = (a-e)*(d-c)/(b-e)
1794 v68 = (signed int)(pBLVRenderParams->uViewportZ - stru_50B700._xs2[i])
1795 * (signed __int64)(stru_50B700._ys[i - 1] - stru_50B700._ys[i]) / (stru_50B700._xs2[i - 1] - stru_50B700._xs2[i]);
1796 v47 = stru_50B700._ys[i];//c
1797 }
1798 stru_50B700.field_2F0[v43] = v68 + v47;
1799 stru_50B700._xs[v43] = pBLVRenderParams->uViewportZ;
1800 ++v43;
1801 }
1802 if ( v83 )
1803 {
1804 stru_50B700._xs[v43] = stru_50B700._xs2[i];
1805 stru_50B700.field_2F0[v43++] = stru_50B700._ys[i];
1806 }
1807 thisd = v83;
1808 }
1809
1810 if (v43 < 1)
1811 return 0;
1812
1813 v48 = 0;
1814 stru_50B700._xs[v43] = stru_50B700._xs[0];
1815 stru_50B700.field_2F0[v43] = stru_50B700.field_2F0[0];
1816 v50 = stru_50B700.field_2F0[0] < (signed int)pBLVRenderParams->uViewportY;
1817
1818 //maybr for top clip plane
1819 LOBYTE(v50) = stru_50B700.field_2F0[0] >= (signed int)pBLVRenderParams->uViewportY;
1820 for ( uint i = 1; i <= v43; i++ )
1821 {
1822 v84 = stru_50B700.field_2F0[i] >= (signed int)pBLVRenderParams->uViewportY;
1823 if ( v50 ^ v84 )
1824 {
1825 if ( stru_50B700.field_2F0[i] >= (signed int)pBLVRenderParams->uViewportY )
1826 {
1827 //v69 = (a-b)*(c-d)/(e-b)
1828 v69 = (signed int)(pBLVRenderParams->uViewportY - stru_50B700.field_2F0[i - 1])
1829 * (signed __int64)(stru_50B700._xs[i] - stru_50B700._xs[i - 1]) / (stru_50B700.field_2F0[i] - stru_50B700.field_2F0[i - 1]);
1830 v54 = stru_50B700._xs[i - 1];//d
1831 }
1832 else
1833 {
1834 //v69 = (a-e)*(d-c)/(b-e)
1835 v69 = (signed int)(pBLVRenderParams->uViewportY - stru_50B700.field_2F0[i])
1836 * (signed __int64)(stru_50B700._xs[i - 1] - stru_50B700._xs[i]) / (stru_50B700.field_2F0[i - 1] - stru_50B700.field_2F0[i]);
1837 v54 = stru_50B700._xs[i];//c
1838 }
1839 stru_50B700.field_3D4[v48] = v69 + v54;
1840 stru_50B700._xs[v48 + 1] = pBLVRenderParams->uViewportY;
1841 ++v48;
1842 }
1843 v50 = v84;
1844 if ( v84 )
1845 {
1846 stru_50B700.field_3D4[v48] = stru_50B700._xs[i];
1847 stru_50B700._xs[v48 + 1] = stru_50B700.field_2F0[i];
1848 v48++;
1849 }
1850 }
1851
1852 if (v48 < 1)
1853 return 0;
1854
1855 v55 = 0;
1856 stru_50B700.field_3D4[v48] = stru_50B700.field_3D4[0];
1857 stru_50B700._xs[v48 + 1] = stru_50B700._xs[1];
1858
1859 //maybe for bottom clip plane
1860 thise = stru_50B700._xs[1] <= (signed int)pBLVRenderParams->uViewportW;
1861 for ( uint i = 1; i <= v48; ++i )
1862 {
1863 v85 = stru_50B700._xs[i + 1] <= (signed int)pBLVRenderParams->uViewportW;
1864 if ( thise ^ v85 )
1865 {
1866 if ( stru_50B700._xs[i + 1] <= (signed int)pBLVRenderParams->uViewportW )
1867 {
1868 //v70 = (a-b)*(c-d)/(e-b)
1869 v70 = (signed int)(pBLVRenderParams->uViewportW - stru_50B700._xs[i])
1870 * (signed __int64)(stru_50B700.field_3D4[i] - stru_50B700.field_3D4[i - 1]) / (stru_50B700._xs[i + 1] - stru_50B700._xs[i]);
1871 v59 = stru_50B700.field_3D4[i - 1];//d
1872 }
1873 else
1874 {
1875 //v70 = (a-e)*(d-c)/(b-e)
1876 v70 = (signed int)(pBLVRenderParams->uViewportW - stru_50B700._xs[i + 1])
1877 * (signed __int64)(stru_50B700.field_3D4[i - 1] - stru_50B700.field_3D4[i]) / (stru_50B700._xs[i] - stru_50B700._xs[i + 1]);
1878 v59 = stru_50B700.field_3D4[i];//c
1879 }
1880 stru_50B700._screen_space_x[v55] = v70 + v59;
1881 stru_50B700._screen_space_y[v55] = pBLVRenderParams->uViewportW;
1882 ++v55;
1883 }
1884 if ( v85 )
1885 {
1886 stru_50B700._screen_space_x[v55] = stru_50B700.field_3D4[i];
1887 stru_50B700._screen_space_y[v55++] = stru_50B700._xs[i + 1];
1888 }
1889 thise = v85;
1890 }
1891
1892 if ( !v55 )
1893 return 0;
1894 v61 = pRenderer->pRenderD3D == 0;
1895 stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0];
1896 stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0];
1897 if ( v61 && v55 > 3 )
1898 {
1899 stru_50B700._screen_space_x[v55 + 1] = stru_50B700._screen_space_x[1];
1900 stru_50B700._screen_space_y[v55 + 1] = stru_50B700._screen_space_y[1];
1901 thisf = 2 * (stru_50B700.field_0 != 0) - 1;
1902 if ( v55 > 0 )
1903 {
1904 v62 = 1;
1905 v71 = 1;
1906 do
1907 {
1908 v63 = v62 - 1;
1909 v64 = v62 + 1;
1910 v80 = v62 + 1;
1911 if ( v62 - 1 >= v55 )
1912 v63 -= v55;
1913 if ( v62 >= v55 )
1914 v62 -= v55;
1915 if ( v64 >= v55 )
1916 v64 -= v55;
1917 if ( thisf * ((stru_50B700._screen_space_y[v64] - stru_50B700._screen_space_y[v63])
1918 * (stru_50B700._screen_space_x[v62] - stru_50B700._screen_space_x[v63])
1919 - (stru_50B700._screen_space_y[v62] - stru_50B700._screen_space_y[v63])
1920 * (stru_50B700._screen_space_x[v64] - stru_50B700._screen_space_x[v63])) < 0 )
1921 {
1922 v62 = v80;
1923 v71 = v80;
1924 }
1925 else
1926 {
1927 v62 = v71;
1928 v65 = v71;
1929 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) )
1930 {
1931 memcpy(&stru_50B700._screen_space_y[v65], &stru_50B700._screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
1932 memcpy(&stru_50B700._screen_space_x[v65], &stru_50B700._screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
1933 }
1934 --v55;
1935 }
1936 }
1937 while ( v62 - 1 < v55 );
1938 }
1939 stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0];
1940 stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0];
1941 }
1942 return v55;
1943 }
1944
1945 //old function
1946 /*int __fastcall sub_423B5D(unsigned int uFaceID)
1947 {
1948 BLVFace *v1; // ebx@1
1491 Vec3_short_ *v2; // esi@1 1949 Vec3_short_ *v2; // esi@1
1492 //int v3; // ST28_4@1 1950 //int v3; // ST28_4@1
1493 __int16 v4; // ST2C_2@1 1951 __int16 v4; // ST2C_2@1
1494 //signed int v5; // esi@1 1952 //signed int v5; // esi@1
1495 //Vec3_short_ *v6; // eax@4 1953 //Vec3_short_ *v6; // eax@4
1575 signed int ib; // [sp+24h] [bp-4h]@31 2033 signed int ib; // [sp+24h] [bp-4h]@31
1576 signed int ic; // [sp+24h] [bp-4h]@41 2034 signed int ic; // [sp+24h] [bp-4h]@41
1577 signed int id; // [sp+24h] [bp-4h]@51 2035 signed int id; // [sp+24h] [bp-4h]@51
1578 signed int ie; // [sp+24h] [bp-4h]@61 2036 signed int ie; // [sp+24h] [bp-4h]@61
1579 2037
1580 pFace = &pIndoor->pFaces[uFaceID]; 2038 v1 = &pIndoor->pFaces[uFaceID];
1581 //this = pGame->pIndoorCameraD3D; 2039 //this = pGame->pIndoorCameraD3D;
1582 v2 = &pIndoor->pVertices[pFace->pVertexIDs[0]]; 2040 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]];
1583 //v3 = *(_DWORD *)&v2->x; 2041 //v3 = *(_DWORD *)&v2->x;
1584 v4 = v2->z; 2042 v4 = v2->z;
1585 //v5 = 0; 2043 //v5 = 0;
1586 if ( pFace->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) 2044 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x)
1587 + pFace->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) 2045 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y)
1588 + pFace->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) 2046 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 )
1589 { 2047 {
1590 stru_50B700.field_0 = 1; 2048 dword_50B700 = 1;
1591 } 2049 }
1592 else 2050 else
1593 { 2051 {
1594 stru_50B700.field_0 = 0; 2052 dword_50B700 = 0;
1595 if ( !pFace->Portal() ) 2053 if ( !v1->Portal() )
1596 return 0; 2054 return 0;
1597 } 2055 }
1598 //v66 = v1->uNumVertices; 2056 //v66 = v1->uNumVertices;
1599 for (uint i = 0; i < pFace->uNumVertices; ++i) 2057 for (uint i = 0; i < v1->uNumVertices; ++i)
1600 { 2058 {
1601 auto v6 = &pIndoor->pVertices[pFace->pVertexIDs[i]]; 2059 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]];
1602 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(v6->x, v6->y, v6->z, 2060 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
1603 &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0); 2061 v6->x,
2062 v6->y,
2063 v6->z,
2064 &_50B924_view_transformed_xs[i],
2065 &_50B834_view_transformed_zs[i],
2066 &_50B744_view_transformed_ys[i],
2067 0);
1604 } 2068 }
1605 2069
1606 //v7 = v1->uNumVertices; 2070 //v7 = v1->uNumVertices;
1607 //v8 = 0; 2071 //v8 = 0;
1608 if (pFace->uNumVertices <= 0) 2072 if (v1->uNumVertices <= 0)
1609 return 0; 2073 return 0;
1610 2074
1611 bool bFound = false; 2075 bool bFound = false;
1612 for (uint i = 0; i < pFace->uNumVertices; ++i) 2076 for (uint i = 0; i < v1->uNumVertices; ++i)
1613 if (stru_50B700._view_transformed_xs[i] >= 0x80000u) 2077 if (_50B924_view_transformed_xs[i] >= 0x80000u)
1614 { 2078 {
1615 bFound = true; 2079 bFound = true;
1616 break; 2080 break;
1617 } 2081 }
1618 if (!bFound) 2082 if (!bFound)
1619 return 0; 2083 return 0;
1620 2084
1621 v79 = 0; 2085 v79 = 0;
1622 stru_50B700._view_transformed_xs[pFace->uNumVertices] = stru_50B700._view_transformed_xs[0]; 2086 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0];
1623 stru_50B700._view_transformed_zs[pFace->uNumVertices] = stru_50B700._view_transformed_zs[0]; 2087 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0];
1624 stru_50B700._view_transformed_ys[pFace->uNumVertices] = stru_50B700._view_transformed_ys[0]; 2088 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0];
1625 thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u; 2089 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u;
1626 //int i = 1; 2090 //int i = 1;
1627 for (uint i = 1; i <= pFace->uNumVertices; ++i) 2091 for (uint i = 1; i <= v1->uNumVertices; ++i)
1628 { 2092 {
1629 v10 = stru_50B700._view_transformed_xs[i]; 2093 v10 = _50B924_view_transformed_xs[i];
1630 v81 = v10 >= (signed int)0x80000u; 2094 v81 = v10 >= (signed int)0x80000u;
1631 if ( thisa ^ v81 ) 2095 if ( thisa ^ v81 )
1632 { 2096 {
1633 v11 = stru_50B700._view_transformed_xs[i - 1]; 2097 v11 = _50B924_view_transformed_xs[i - 1];
1634 if ( v10 >= (signed int)0x80000u ) 2098 if ( v10 >= (signed int)0x80000u )
1635 { 2099 {
1636 v12 = v10 - v11; 2100 v12 = v10 - v11;
1637 v13 = 0x80000 - v11; 2101 v13 = 0x80000 - v11;
1638 LODWORD(v14) = v13 << 16; 2102 LODWORD(v14) = v13 << 16;
1639 HIDWORD(v14) = v13 >> 16; 2103 HIDWORD(v14) = v13 >> 16;
1640 v15 = &stru_50B700._view_transformed_ys[i - 1]; 2104 v15 = &_50B744_view_transformed_ys[i - 1];
1641 stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1]) * v14 / v12) >> 16) + stru_50B700._view_transformed_zs[i - 1]; 2105 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) * v14 / v12) >> 16) + _50B834_view_transformed_zs[i - 1];
1642 thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1]) * v14 / v12) >> 16; 2106 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16;
1643 } 2107 }
1644 else 2108 else
1645 { 2109 {
1646 v16 = v11 - v10; 2110 v16 = v11 - v10;
1647 v17 = 0x80000 - v10; 2111 v17 = 0x80000 - v10;
1648 LODWORD(v18) = v17 << 16; 2112 LODWORD(v18) = v17 << 16;
1649 HIDWORD(v18) = v17 >> 16; 2113 HIDWORD(v18) = v17 >> 16;
1650 v15 = &stru_50B700._view_transformed_ys[i]; 2114 v15 = &_50B744_view_transformed_ys[i];
1651 stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i]) * v18 / v16) >> 16) + stru_50B700._view_transformed_zs[i]; 2115 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i - 1] - _50B834_view_transformed_zs[i]) * v18 / v16) >> 16) + _50B834_view_transformed_zs[i];
1652 thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i]) * v18 / v16) >> 16; 2116 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16;
1653 } 2117 }
1654 v19 = v79++; 2118 v19 = v79++;
1655 //v7 = v66; 2119 //v7 = v66;
1656 stru_50B700.field_38[v19] = thisb + *v15; 2120 dword_50B738[v19] = thisb + *v15;
1657 stru_50B700.field_218[v19] = 0x80000u; 2121 dword_50B918[v19] = 0x80000u;
1658 } 2122 }
1659 if ( v81 ) 2123 if ( v81 )
1660 { 2124 {
1661 v20 = v79++; 2125 v20 = v79++;
1662 stru_50B700.field_218[v20] = stru_50B700._view_transformed_xs[i]; 2126 dword_50B918[v20] = _50B924_view_transformed_xs[i];
1663 stru_50B700.field_128[v20] = stru_50B700._view_transformed_zs[i]; 2127 dword_50B828[v20] = _50B834_view_transformed_zs[i];
1664 stru_50B700.field_38[v20] = stru_50B700._view_transformed_ys[i]; 2128 dword_50B738[v20] = _50B744_view_transformed_ys[i];
1665 } 2129 }
1666 //++i; 2130 //++i;
1667 thisa = v81; 2131 thisa = v81;
1668 } 2132 }
1669 v21 = v79; 2133 v21 = v79;
1670 stru_50B700.field_218[v79] = stru_50B700.field_218[0]; 2134 dword_50B918[v79] = dword_50B918[0];
1671 stru_50B700.field_128[v79] = stru_50B700.field_128[0]; 2135 dword_50B828[v79] = dword_50B828[0];
1672 stru_50B700.field_38[v79] = stru_50B700.field_38[0]; 2136 dword_50B738[v79] = dword_50B738[0];
1673 for (ia = 0; ia < v79; ++ia) 2137 for (ia = 0; ia < v79; ++ia)
1674 { 2138 {
1675 v22 = ia; 2139 v22 = ia;
1676 thisc = abs(stru_50B700.field_218[ia]); 2140 thisc = abs(dword_50B918[ia]);
1677 if ( abs(stru_50B700.field_128[ia]) >> 13 <= thisc ) 2141 if ( abs(dword_50B828[ia]) >> 13 <= thisc )
1678 { 2142 {
1679 v27 = stru_50B700.field_128[v22]; 2143 v27 = dword_50B828[v22];
1680 LODWORD(v28) = v27 << 16; 2144 LODWORD(v28) = v27 << 16;
1681 HIDWORD(v28) = v27 >> 16; 2145 HIDWORD(v28) = v27 >> 16;
1682 v26 = v28 / stru_50B700.field_218[v22]; 2146 v26 = v28 / dword_50B918[v22];
1683 v23 = 0; 2147 v23 = 0;
1684 } 2148 }
1685 else 2149 else
1686 { 2150 {
1687 v23 = 0; 2151 v23 = 0;
1688 v24 = 0; 2152 v24 = 0;
1689 if ( stru_50B700.field_128[v22] >= 0 ) 2153 if ( dword_50B828[v22] >= 0 )
1690 { 2154 {
1691 LOBYTE(v24) = stru_50B700.field_218[v22] >= 0; 2155 LOBYTE(v24) = dword_50B918[v22] >= 0;
1692 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; 2156 v26 = ((v24 - 1) & 0xFF800000) + 0x400000;
1693 } 2157 }
1694 else 2158 else
1695 { 2159 {
1696 LOBYTE(v24) = stru_50B700.field_218[v22] >= 0; 2160 LOBYTE(v24) = dword_50B918[v22] >= 0;
1697 v25 = v24 - 1; 2161 v25 = v24 - 1;
1698 v26 = (v25 & 0x800000) - 0x400000; 2162 v26 = (v25 & 0x800000) - 0x400000;
1699 } 2163 }
1700 } 2164 }
1701 v29 = stru_50B700.field_38[v22]; 2165 v29 = dword_50B738[v22];
1702 stru_50B700._xs3[v22] = v26; 2166 dword_50BAF8_xs[v22] = v26;
1703 if ( abs(v29) >> 13 <= thisc ) 2167 if ( abs(v29) >> 13 <= thisc )
1704 { 2168 {
1705 v33 = stru_50B700.field_38[v22]; 2169 v33 = dword_50B738[v22];
1706 LODWORD(v34) = v33 << 16; 2170 LODWORD(v34) = v33 << 16;
1707 HIDWORD(v34) = v33 >> 16; 2171 HIDWORD(v34) = v33 >> 16;
1708 v32 = v34 / stru_50B700.field_218[v22]; 2172 v32 = v34 / dword_50B918[v22];
1709 } 2173 }
1710 else 2174 else
1711 { 2175 {
1712 v30 = 0; 2176 v30 = 0;
1713 if ( stru_50B700.field_38[v22] >= v23 ) 2177 if ( dword_50B738[v22] >= v23 )
1714 { 2178 {
1715 LOBYTE(v30) = stru_50B700.field_218[v22] >= v23; 2179 LOBYTE(v30) = dword_50B918[v22] >= v23;
1716 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; 2180 v32 = ((v30 - 1) & 0xFF800000) + 0x400000;
1717 } 2181 }
1718 else 2182 else
1719 { 2183 {
1720 LOBYTE(v30) = stru_50B700.field_218[v22] >= v23; 2184 LOBYTE(v30) = dword_50B918[v22] >= v23;
1721 v31 = v30 - 1; 2185 v31 = v30 - 1;
1722 v32 = (v31 & 0x800000) - 0x400000; 2186 v32 = (v31 & 0x800000) - 0x400000;
1723 } 2187 }
1724 } 2188 }
1725 stru_50B700._ys2[v22] = v32; 2189 dword_50BA08_ys[v22] = v32;
1726 stru_50B700._xs3[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._xs3[v22]) >> 16; 2190 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16;
1727 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._ys2[v22]) >> 16; 2191 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16;
1728 stru_50B700._xs3[v22] = pBLVRenderParams->uViewportCenterX - stru_50B700._xs3[v22]; 2192 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22];
1729 stru_50B700._ys2[v22] = pBLVRenderParams->uViewportCenterY - v35; 2193 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35;
1730 } 2194 }
1731 v36 = 0; 2195 v36 = 0;
1732 stru_50B700._xs3[v21] = stru_50B700._xs3[0]; 2196 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0];
1733 stru_50B700._ys2[v21] = stru_50B700._ys2[0]; 2197 dword_50BA08_ys[v21] = dword_50BA08_ys[0];
1734 v37 = pBLVRenderParams->uViewportX; 2198 v37 = pBLVRenderParams->uViewportX;
1735 v38 = stru_50B700._xs3[0] < (signed int)pBLVRenderParams->uViewportX; 2199 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX;
1736 LOBYTE(v38) = stru_50B700._xs3[0] >= (signed int)pBLVRenderParams->uViewportX; 2200 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX;
1737 v39 = 1; 2201 v39 = 1;
1738 ib = 1; 2202 ib = 1;
1739 if ( v79 < 1 ) 2203 if ( v79 < 1 )
1740 return 0; 2204 return 0;
1741 do 2205 do
1742 { 2206 {
1743 v40 = v39; 2207 v40 = v39;
1744 v41 = stru_50B700._xs3[v40]; 2208 v41 = dword_50BAF8_xs[v40];
1745 v82 = v41 >= (signed int)v37; 2209 v82 = v41 >= (signed int)v37;
1746 if ( v38 ^ v82 ) 2210 if ( v38 ^ v82 )
1747 { 2211 {
1748 if ( v41 >= (signed int)v37 ) 2212 if ( v41 >= (signed int)v37 )
1749 { 2213 {
1750 v67 = (signed int)(v37 - stru_50B700._xs3[v40 - 1]) * (signed __int64)(stru_50B700._ys2[v40] - stru_50B700._ys2[v40 - 1]) / (v41 - stru_50B700._xs3[v40 - 1]); 2214 v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]);
1751 v42 = stru_50B700._ys2[v40 - 1]; 2215 v42 = dword_50BA08_ys[v40 - 1];
1752 } 2216 }
1753 else 2217 else
1754 { 2218 {
1755 v67 = (signed int)(v37 - v41) * (signed __int64)(stru_50B700._ys2[v40 - 1] - stru_50B700._ys2[v40]) / (stru_50B700._xs3[v40 - 1] - v41); 2219 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41);
1756 v42 = stru_50B700._ys2[v40]; 2220 v42 = dword_50BA08_ys[v40];
1757 } 2221 }
1758 stru_50B700._ys[v36] = v67 + v42; 2222 dword_50B9FC_ys[v36] = v67 + v42;
1759 v37 = pBLVRenderParams->uViewportX; 2223 v37 = pBLVRenderParams->uViewportX;
1760 stru_50B700._xs2[v36] = pBLVRenderParams->uViewportX; 2224 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX;
1761 ++v36; 2225 ++v36;
1762 } 2226 }
1763 v38 = v82; 2227 v38 = v82;
1764 if ( v82 ) 2228 if ( v82 )
1765 { 2229 {
1766 stru_50B700._xs2[v36] = stru_50B700._xs3[v40]; 2230 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40];
1767 stru_50B700._ys[v36] = stru_50B700._ys2[v40]; 2231 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40];
1768 ++v36; 2232 ++v36;
1769 } 2233 }
1770 v39 = ib++ + 1; 2234 v39 = ib++ + 1;
1771 } 2235 }
1772 while ( ib <= v79 ); 2236 while ( ib <= v79 );
1773 2237
1774 if (v36 < 1) 2238 if (v36 < 1)
1775 return 0; 2239 return 0;
1776 2240
1777 v43 = 0; 2241 v43 = 0;
1778 stru_50B700._xs2[v36] = stru_50B700._xs2[0]; 2242 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0];
1779 stru_50B700._ys[v36] = stru_50B700._ys[0]; 2243 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0];
1780 v44 = pBLVRenderParams->uViewportZ; 2244 v44 = pBLVRenderParams->uViewportZ;
1781 thisd = stru_50B700._xs2[0] <= (signed int)pBLVRenderParams->uViewportZ; 2245 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ;
1782 ic = 1; 2246 ic = 1;
1783 2247
1784 do 2248 do
1785 { 2249 {
1786 v45 = ic; 2250 v45 = ic;
1787 v46 = stru_50B700._xs2[ic]; 2251 v46 = dword_50BAEC_xs[ic];
1788 v83 = v46 <= (signed int)v44; 2252 v83 = v46 <= (signed int)v44;
1789 if ( thisd ^ v83 ) 2253 if ( thisd ^ v83 )
1790 { 2254 {
1791 if ( v46 <= (signed int)v44 ) 2255 if ( v46 <= (signed int)v44 )
1792 { 2256 {
1793 v68 = (signed int)(v44 - stru_50B700._xs2[v45 - 1]) * (signed __int64)(stru_50B700._ys[v45] - stru_50B700._ys[v45 - 1]) / (v46 - stru_50B700._xs2[v45 - 1]); 2257 v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]);
1794 v47 = stru_50B700._ys[v45 - 1]; 2258 v47 = dword_50B9FC_ys[v45 - 1];
1795 } 2259 }
1796 else 2260 else
1797 { 2261 {
1798 v68 = (signed int)(v44 - v46) * (signed __int64)(stru_50B700._ys[v45 - 1] - stru_50B700._ys[v45]) / (stru_50B700._xs2[v45 - 1] - v46); 2262 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46);
1799 v47 = stru_50B700._ys[v45]; 2263 v47 = dword_50B9FC_ys[v45];
1800 } 2264 }
1801 stru_50B700.field_2F0[v43] = v68 + v47; 2265 dword_50B9F0[v43] = v68 + v47;
1802 v44 = pBLVRenderParams->uViewportZ; 2266 v44 = pBLVRenderParams->uViewportZ;
1803 stru_50B700._xs[v43] = pBLVRenderParams->uViewportZ; 2267 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ;
1804 ++v43; 2268 ++v43;
1805 } 2269 }
1806 if ( v83 ) 2270 if ( v83 )
1807 { 2271 {
1808 stru_50B700._xs[v43] = stru_50B700._xs2[v45]; 2272 dword_50BAE0[v43] = dword_50BAEC_xs[v45];
1809 stru_50B700.field_2F0[v43++] = stru_50B700._ys[v45]; 2273 dword_50B9F0[v43++] = dword_50B9FC_ys[v45];
1810 } 2274 }
1811 ++ic; 2275 ++ic;
1812 thisd = v83; 2276 thisd = v83;
1813 } 2277 }
1814 while ( ic <= v36 ); 2278 while ( ic <= v36 );
1815 2279
1816 if (v43 < 1) 2280 if (v43 < 1)
1817 return 0; 2281 return 0;
1818 2282
1819 v48 = 0; 2283 v48 = 0;
1820 stru_50B700._xs[v43] = stru_50B700._xs[0]; 2284 dword_50BAE0[v43] = dword_50BAE0[0];
1821 stru_50B700.field_2F0[v43] = stru_50B700.field_2F0[0]; 2285 dword_50B9F0[v43] = dword_50B9F0[0];
1822 v49 = pBLVRenderParams->uViewportY; 2286 v49 = pBLVRenderParams->uViewportY;
1823 v50 = stru_50B700.field_2F0[0] < (signed int)pBLVRenderParams->uViewportY; 2287 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY;
1824 LOBYTE(v50) = stru_50B700.field_2F0[0] >= (signed int)pBLVRenderParams->uViewportY; 2288 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY;
1825 v51 = 1; 2289 v51 = 1;
1826 id = 1; 2290 id = 1;
1827 do 2291 do
1828 { 2292 {
1829 v52 = v51; 2293 v52 = v51;
1830 v53 = stru_50B700.field_2F0[v52]; 2294 v53 = dword_50B9F0[v52];
1831 v84 = v53 >= (signed int)v49; 2295 v84 = v53 >= (signed int)v49;
1832 if ( v50 ^ v84 ) 2296 if ( v50 ^ v84 )
1833 { 2297 {
1834 if ( v53 >= (signed int)v49 ) 2298 if ( v53 >= (signed int)v49 )
1835 { 2299 {
1836 v69 = (signed int)(v49 - stru_50B700.field_2F0[v52 - 1]) * (signed __int64)(stru_50B700._xs[v52] - stru_50B700._xs[v52 - 1]) / (v53 - stru_50B700.field_2F0[v52 - 1]); 2300 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]);
1837 v54 = stru_50B700._xs[v52 - 1]; 2301 v54 = dword_50BAE0[v52 - 1];
1838 } 2302 }
1839 else 2303 else
1840 { 2304 {
1841 v69 = (signed int)(v49 - v53) * (signed __int64)(stru_50B700._xs[v52 - 1] - stru_50B700._xs[v52]) / (stru_50B700.field_2F0[v52 - 1] - v53); 2305 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53);
1842 v54 = stru_50B700._xs[v52]; 2306 v54 = dword_50BAE0[v52];
1843 } 2307 }
1844 stru_50B700.field_3D4[v48] = v69 + v54; 2308 dword_50BAD4[v48] = v69 + v54;
1845 v49 = pBLVRenderParams->uViewportY; 2309 v49 = pBLVRenderParams->uViewportY;
1846 stru_50B700._xs[v48+1] = pBLVRenderParams->uViewportY; 2310 dword_50B9E4[v48] = pBLVRenderParams->uViewportY;
1847 ++v48; 2311 ++v48;
1848 } 2312 }
1849 v50 = v84; 2313 v50 = v84;
1850 if ( v84 ) 2314 if ( v84 )
1851 { 2315 {
1852 stru_50B700.field_3D4[v48] = stru_50B700._xs[v52]; 2316 dword_50BAD4[v48] = dword_50BAE0[v52];
1853 stru_50B700._xs[v48+1] = stru_50B700.field_2F0[v52]; 2317 dword_50B9E4[v48++] = dword_50B9F0[v52];
1854 v48++;
1855 } 2318 }
1856 v51 = id++ + 1; 2319 v51 = id++ + 1;
1857 } 2320 }
1858 while ( id <= v43 ); 2321 while ( id <= v43 );
1859 2322
1860 if (v48 < 1) 2323 if (v48 < 1)
1861 return 0; 2324 return 0;
1862 2325
1863 v55 = 0; 2326 v55 = 0;
1864 stru_50B700.field_3D4[v48] = stru_50B700.field_3D4[0]; 2327 dword_50BAD4[v48] = dword_50BAD4[0];
1865 stru_50B700._xs[v48+1] = stru_50B700._xs[1]; 2328 dword_50B9E4[v48] = dword_50B9E4[0];
1866 v56 = pBLVRenderParams->uViewportW; 2329 v56 = pBLVRenderParams->uViewportW;
1867 thise = stru_50B700._xs[1] <= (signed int)pBLVRenderParams->uViewportW; 2330 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW;
1868 ie = 1; 2331 ie = 1;
1869 do 2332 do
1870 { 2333 {
1871 v57 = ie; 2334 v57 = ie;
1872 v58 = stru_50B700._xs[ie+1]; 2335 v58 = dword_50B9E4[ie];
1873 v85 = v58 <= (signed int)v56; 2336 v85 = v58 <= (signed int)v56;
1874 if ( thise ^ v85 ) 2337 if ( thise ^ v85 )
1875 { 2338 {
1876 if ( v58 <= (signed int)v56 ) 2339 if ( v58 <= (signed int)v56 )
1877 { 2340 {
1878 v70 = (signed int)(v56 - stru_50B700._xs[v57]) * (signed __int64)(stru_50B700.field_3D4[v57] - stru_50B700.field_3D4[v57 - 1]) / (v58 - stru_50B700._xs[v57]); 2341 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]);
1879 v59 = stru_50B700.field_3D4[v57 - 1]; 2342 v59 = dword_50BAD4[v57 - 1];
1880 } 2343 }
1881 else 2344 else
1882 { 2345 {
1883 v70 = (signed int)(v56 - v58) * (signed __int64)(stru_50B700.field_3D4[v57 - 1] - stru_50B700.field_3D4[v57]) / (stru_50B700._xs[v57] - v58); 2346 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58);
1884 v59 = stru_50B700.field_3D4[v57]; 2347 v59 = dword_50BAD4[v57];
1885 } 2348 }
1886 stru_50B700._screen_space_x[v55] = v70 + v59; 2349 _50BAC8_screen_space_x[v55] = v70 + v59;
1887 v56 = pBLVRenderParams->uViewportW; 2350 v56 = pBLVRenderParams->uViewportW;
1888 stru_50B700._screen_space_y[v55] = pBLVRenderParams->uViewportW; 2351 _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW;
1889 ++v55; 2352 ++v55;
1890 } 2353 }
1891 if ( v85 ) 2354 if ( v85 )
1892 { 2355 {
1893 stru_50B700._screen_space_x[v55] = stru_50B700.field_3D4[v57]; 2356 _50BAC8_screen_space_x[v55] = dword_50BAD4[v57];
1894 stru_50B700._screen_space_y[v55++] = stru_50B700._xs[v57+1]; 2357 _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57];
1895 } 2358 }
1896 ++ie; 2359 ++ie;
1897 thise = v85; 2360 thise = v85;
1898 } 2361 }
1899 while ( ie <= v48 ); 2362 while ( ie <= v48 );
1900 2363
1901 if ( !v55 ) 2364 if ( !v55 )
1902 return 0; 2365 return 0;
1903 v61 = pRenderer->pRenderD3D == 0; 2366 v61 = pRenderer->pRenderD3D == 0;
1904 stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0]; 2367 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
1905 stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0]; 2368 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
1906 if ( v61 && v55 > 3 ) 2369 if ( v61 && v55 > 3 )
1907 { 2370 {
1908 stru_50B700._screen_space_x[v55 + 1] = stru_50B700._screen_space_x[1]; 2371 _50BAC8_screen_space_x[v55 + 1] = _50BAC8_screen_space_x[1];
1909 stru_50B700._screen_space_y[v55 + 1] = stru_50B700._screen_space_y[1]; 2372 _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1];
1910 thisf = 2 * (stru_50B700.field_0 != 0) - 1; 2373 thisf = 2 * (dword_50B700 != 0) - 1;
1911 if ( v55 > 0 ) 2374 if ( v55 > 0 )
1912 { 2375 {
1913 v62 = 1; 2376 v62 = 1;
1914 v71 = 1; 2377 v71 = 1;
1915 do 2378 do
1922 if ( v62 >= v55 ) 2385 if ( v62 >= v55 )
1923 v62 -= v55; 2386 v62 -= v55;
1924 if ( v64 >= v55 ) 2387 if ( v64 >= v55 )
1925 v64 -= v55; 2388 v64 -= v55;
1926 if ( thisf 2389 if ( thisf
1927 * ((stru_50B700._screen_space_y[v64] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v62] - stru_50B700._screen_space_x[v63]) 2390 * ((_50B9D8_screen_space_y[v64] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v62] - _50BAC8_screen_space_x[v63])
1928 - (stru_50B700._screen_space_y[v62] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v64] - stru_50B700._screen_space_x[v63])) < 0 ) 2391 - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 )
1929 { 2392 {
1930 v62 = v80; 2393 v62 = v80;
1931 v71 = v80; 2394 v71 = v80;
1932 } 2395 }
1933 else 2396 else
1934 { 2397 {
1935 v62 = v71; 2398 v62 = v71;
1936 v65 = v71; 2399 v65 = v71;
1937 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) 2400 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) )
1938 { 2401 {
1939 memcpy(&stru_50B700._screen_space_y[v65], &stru_50B700._screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); 2402 memcpy(&_50B9D8_screen_space_y[v65], &_50B9D8_screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
1940 memcpy(&stru_50B700._screen_space_x[v65], &stru_50B700._screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); 2403 memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
1941 } 2404 }
1942 --v55; 2405 --v55;
1943 } 2406 }
1944 } 2407 }
1945 while ( v62 - 1 < v55 ); 2408 while ( v62 - 1 < v55 );
1946 } 2409 }
1947 stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0]; 2410 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
1948 stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0]; 2411 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
1949 } 2412 }
1950 return v55; 2413 return v55;
1951 } 2414 }*/
1952 2415
1953 //----- (00424579) -------------------------------------------------------- 2416 //----- (00424579) --------------------------------------------------------
1954 int __fastcall sub_424579(int uFaceID, stru320 *a2) 2417 int __fastcall sub_424579(int uFaceID, stru320 *a2)
1955 { 2418 {
1956 __debugbreak(); 2419 __debugbreak();