comparison Render.cpp @ 123:05b2d9653abc

15.11.12
author Ritor1
date Thu, 15 Nov 2012 16:36:30 +0600
parents 51a5b0dc3f30
children 5eb242640b6f 1d44b914b7bd
comparison
equal deleted inserted replaced
122:2546de5c70dd 123:05b2d9653abc
904 } 904 }
905 905
906 //----- (0047F5C6) -------------------------------------------------------- 906 //----- (0047F5C6) --------------------------------------------------------
907 float Render::DrawBezierTerrain() 907 float Render::DrawBezierTerrain()
908 { 908 {
909 __debugbreak(); 909 // __debugbreak();
910 return 0; 910 // return 0;
911 /* 911
912 unsigned int v0; // ebx@1 912 unsigned int v0; // ebx@1
913 unsigned int v1; // edi@1 913 unsigned int v1; // edi@1
914 unsigned int v2; // eax@1 914 unsigned int v2; // eax@1
915 int v3; // eax@3 915 int v3; // eax@3
916 int v4; // edi@3 916 int v4; // edi@3
986 int v74; // eax@182 986 int v74; // eax@182
987 int v75; // eax@184 987 int v75; // eax@184
988 IndoorCameraD3D *v76; // ecx@184 988 IndoorCameraD3D *v76; // ecx@184
989 int v77; // ecx@184 989 int v77; // ecx@184
990 int v79; // ebx@185 990 int v79; // ebx@185
991 int v127; // esi@185
991 int v86; // edi@196 992 int v86; // edi@196
992 int v87; // eax@196 993 int v87; // eax@196
993 int v88; // ecx@196 994 int v88; // ecx@196
994 int v89; // eax@198 995 int v89; // eax@198
995 int v90; // ecx@200 996 int v90; // ecx@200
1583 v107 = v75; 1584 v107 = v75;
1584 a1 = v76; 1585 a1 = v76;
1585 v77 = v73 - 2; 1586 v77 = v73 - 2;
1586 if ( v73 - 2 < v75 ) 1587 if ( v73 - 2 < v75 )
1587 { 1588 {
1588 _ESI = 0; 1589 v127 = 0;
1589 v79 = (v73 - 66) << 9; 1590 v79 = (v73 - 66) << 9;
1590 v116 = v77; 1591 v116 = v77;
1591 v105 = v79; 1592 v105 = v79;
1592 v111 = v75 - v77; 1593 v111 = v75 - v77;
1593 do 1594 do
1594 { 1595 {
1595 __asm { fild [ebp+var_58] } 1596 *(float *)&v106 = (double)v105;
1596 _EAX = ptr_801A08; 1597 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;
1597 __asm 1598 v105 = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9;
1598 { 1599 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)v105;
1599 fst [ebp+var_54] 1600 v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70));
1600 fstp dword ptr [esi+eax] 1601 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)v105;
1601 } 1602 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;
1602 v105 = (64 - terrain_76D9C8[v70]) << 9; 1603 v105 = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9;
1603 _EAX = ptr_801A08; 1604 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)v105;
1604 __asm 1605 v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1);
1605 { 1606 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)v105;
1606 fild [ebp+var_58]
1607 fstp dword ptr [esi+eax+4]
1608 }
1609 v105 = pOutdoor->GetHeightOnTerrain(v116, terrain_76D9C8[v70]);
1610 _EAX = ptr_801A08;
1611 __asm
1612 {
1613 fild [ebp+var_58]
1614 fstp dword ptr [esi+eax+8]
1615 fld [ebp+var_54]
1616 }
1617 _EAX = ptr_801A04;
1618 __asm { fstp dword ptr [esi+eax] }
1619 v105 = (63 - terrain_76D9C8[v70]) << 9;
1620 _EAX = ptr_801A04;
1621 __asm
1622 {
1623 fild [ebp+var_58]
1624 fstp dword ptr [esi+eax+4]
1625 }
1626 v105 = pOutdoor->GetHeightOnTerrain(v116, terrain_76D9C8[v70] + 1);
1627 _EAX = ptr_801A04;
1628 __asm
1629 {
1630 fild [ebp+var_58]
1631 fstp dword ptr [esi+eax+8]
1632 }
1633 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) 1607 if ( !byte_4D864C || !(pGame->uFlags & 0x80) )
1634 { 1608 {
1635 a1->ViewTransform(&ptr_801A08[_ESI], 1u); 1609 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1);
1636 a1->ViewTransform(&ptr_801A04[_ESI], 1u); 1610 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1);
1637 a1->Project(&ptr_801A08[_ESI], 1u, 0); 1611 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1, 0);
1638 a1->Project(&ptr_801A04[_ESI], 1u, 0); 1612 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1, 0);
1639 } 1613 }
1640 v79 += 512; 1614 v79 += 512;
1641 ++_ESI; 1615 v127 += 48;
1642 ++v116; 1616 ++v116;
1643 v105 = v79; 1617 v105 = v79;
1644 } 1618 }
1645 while ( v116 < v107 ); 1619 while ( v116 < v107 );
1646 } 1620 }
1647 v103 = abs(pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); 1621 v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]);
1648 v104 = abs(pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); 1622 v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]);
1649 if ( pRenderer->pRenderD3D ) 1623 if ( pRenderer->pRenderD3D )
1650 Render::DrawTerrainD3D(v111, 0, (int)&v102); 1624 Render::DrawTerrainD3D(v111, 0, (int)&v102);
1651 else 1625 else
1652 Render::DrawTerrainSW(v111, 0, (int)&v102); 1626 Render::DrawTerrainSW(v111, 0, (int)&v102);
1653 } 1627 }
1654 } 1628 }
1673 v90 = -v90; 1647 v90 = -v90;
1674 a1 = pGame->pIndoorCameraD3D; 1648 a1 = pGame->pIndoorCameraD3D;
1675 v107 = v90 + 2; 1649 v107 = v90 + 2;
1676 if ( v89 - 2 < v90 + 2 ) 1650 if ( v89 - 2 < v90 + 2 )
1677 { 1651 {
1678 _ESI = 0; 1652 v86 = 0;
1679 v116 = v89 - 2; 1653 v116 = v89 - 2;
1680 v92 = (66 - v89) << 9; 1654 v92 = (66 - v89) << 9;
1681 v105 = (66 - v89) << 9; 1655 v105 = (66 - v89) << 9;
1682 v111 = v90 + 2 - (v89 - 2); 1656 v111 = v90 + 2 - (v89 - 2);
1683 do 1657 do
1684 { 1658 {
1685 v93 = v116; 1659 v93 = v116;
1686 v106 = (terrain_76DBC8[v86] - 64) << 9; 1660 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 64) << 9;
1687 _EAX = ptr_801A08; 1661 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v86) = (double)v106;
1688 __asm 1662 *(float *)&v105 = (double)v105;
1689 { 1663 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v86) = *(float *)&v105;
1690 fild [ebp+var_54] 1664 v106 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86), v93);
1691 fstp dword ptr [esi+eax]
1692 fild [ebp+var_58]
1693 }
1694 _EAX = ptr_801A08;
1695 __asm
1696 {
1697 fst [ebp+var_58]
1698 fstp dword ptr [esi+eax+4]
1699 }
1700 v106 = pOutdoor->GetHeightOnTerrain(terrain_76DBC8[v86], v93);
1701 _EAX = ptr_801A08;
1702 __asm { fild [ebp+var_54] }
1703 v97 = v116; 1665 v97 = v116;
1704 __asm { fstp dword ptr [esi+eax+8] } 1666 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v86) = (double)v106;
1705 v106 = (terrain_76DBC8[v86] - 63) << 9; 1667 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 63) << 9;
1706 _EAX = ptr_801A04; 1668 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v86) = (double)v106;
1707 __asm 1669 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v86) = *(float *)&v105;
1708 { 1670 v105 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86) + 1, v97);
1709 fild [ebp+var_54] 1671 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v86) = (double)v105;
1710 fstp dword ptr [esi+eax]
1711 fld [ebp+var_58]
1712 }
1713 _EAX = ptr_801A04;
1714 __asm { fstp dword ptr [esi+eax+4] }
1715 v105 = pOutdoor->GetHeightOnTerrain(terrain_76DBC8[v86] + 1, v97);
1716 _EAX = ptr_801A04;
1717 __asm
1718 {
1719 fild [ebp+var_58]
1720 fstp dword ptr [esi+eax+8]
1721 }
1722 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) 1672 if ( !byte_4D864C || !(pGame->uFlags & 0x80) )
1723 { 1673 {
1724 a1->ViewTransform(&ptr_801A08[_ESI], 1u); 1674 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1);
1725 a1->ViewTransform(&ptr_801A04[_ESI], 1u); 1675 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1);
1726 a1->Project(&ptr_801A08[_ESI], 1u, 0); 1676 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1, 0);
1727 a1->Project(&ptr_801A04[_ESI], 1u, 0); 1677 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1, 0);
1728 } 1678 }
1729 v92 -= 512; 1679 v92 -= 512;
1730 ++_ESI; 1680 v86 += 48;
1731 ++v116; 1681 ++v116;
1732 v105 = v92; 1682 v105 = v92;
1733 } 1683 }
1734 while ( v116 < v107 ); 1684 while ( v116 < v107 );
1735 } 1685 }
1736 v103 = abs(pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]); 1686 v103 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]);
1737 v104 = abs(pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]); 1687 v104 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]);
1738 if ( pRenderer->pRenderD3D ) 1688 if ( pRenderer->pRenderD3D )
1739 Render::DrawTerrainD3D(v111, 1, (int)&v102); 1689 Render::DrawTerrainD3D(v111, 1, (int)&v102);
1740 else 1690 else
1741 Render::DrawTerrainSW(v111, 1, (int)&v102); 1691 Render::DrawTerrainSW(v111, 1, (int)&v102);
1742 } 1692 }
1743 } 1693 }
1744 result = v126; 1694 result = v126;
1745 pOutdoorCamera->field_40 = v126; 1695 pOutdoorCamera->field_40 = v126;
1746 return result;*/ 1696 return result;
1747 } 1697 }
1748 // 47FFC4: inconsistent fpu stack 1698 // 47FFC4: inconsistent fpu stack
1749 // 4D864C: using guessed type char byte_4D864C; 1699 // 4D864C: using guessed type char byte_4D864C;
1750 1700
1751 1701
1852 unsigned int uNumVertices; // [sp+A8h] [bp-28h]@73 1802 unsigned int uNumVertices; // [sp+A8h] [bp-28h]@73
1853 int v100; // [sp+ACh] [bp-24h]@122 1803 int v100; // [sp+ACh] [bp-24h]@122
1854 int sY; // [sp+B0h] [bp-20h]@6 1804 int sY; // [sp+B0h] [bp-20h]@6
1855 RenderVertexSoft *a2; // [sp+B4h] [bp-1Ch]@3 1805 RenderVertexSoft *a2; // [sp+B4h] [bp-1Ch]@3
1856 unsigned int a5; // [sp+B8h] [bp-18h]@21 1806 unsigned int a5; // [sp+B8h] [bp-18h]@21
1857 RenderVertexSoft *_ECX; // [sp+BCh] [bp-14h]@6 1807 RenderVertexSoft *v101; // [sp+BCh] [bp-14h]@6
1858 Vec3_float_ *v99; // [sp+C0h] [bp-10h]@17 1808 Vec3_float_ *v99; // [sp+C0h] [bp-10h]@17
1859 RenderVertexSoft *pVertices; // [sp+C4h] [bp-Ch]@6 1809 RenderVertexSoft *pVertices; // [sp+C4h] [bp-Ch]@6
1860 RenderVertexSoft *a8; // [sp+C8h] [bp-8h]@6 1810 RenderVertexSoft *a8; // [sp+C8h] [bp-8h]@6
1861 char v108; // [sp+CFh] [bp-1h]@36 1811 char v108; // [sp+CFh] [bp-1h]@36
1862 float thisd; // [sp+D8h] [bp+8h]@6 1812 float thisd; // [sp+D8h] [bp+8h]@6
1887 { 1837 {
1888 v5 = abs(X); 1838 v5 = abs(X);
1889 v6 = abs(v83); 1839 v6 = abs(v83);
1890 --X; 1840 --X;
1891 v93 = &stru_76E5C8[(v5 << 7) + v6]; 1841 v93 = &stru_76E5C8[(v5 << 7) + v6];
1892 if ( !v93->field_0 1842 if ( !v93->field_0 || ((v7 = 48 * v4, v8 = &pVerticesSR_806210[v4], a2 = v8, !v82) ? (v9 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7),
1893 || ((v7 = v4, v8 = &pVerticesSR_806210[v4], a2 = v8, !v82) ? (v9 = &pVerticesSR_801A10[v7], 1843 v10 = &pVerticesSR_806210[1] + v7) : (v9 = &pVerticesSR_806210[1] + v7, v10 = (RenderVertexSoft *)((char *)&pVerticesSR_801A10 + v7)),
1894 v10 = &pVerticesSR_806210[v7 + 1]) : (v9 = &pVerticesSR_806210[v7 + 1], v10 = &pVerticesSR_801A10[v7]),
1895 ((a8 = v9, 1844 ((a8 = v9,
1896 pVertices = &pVerticesSR_801A10[v7 + 1], 1845 pVertices = &pVerticesSR_801A10[1] + v7,
1897 v11 = v8->vWorldPosition.x, 1846 v11 = v8->vWorldPosition.x,
1898 _ECX = v10, 1847 v101 = v10,
1899 v12 = v11 + 6.7553994e15, 1848 v12 = v11 + 6.755399441055744e15,
1900 sX = LODWORD(v12), 1849 sX = LODWORD(v12),
1901 v13 = v8->vWorldPosition.y + 6.7553994e15, 1850 v13 = v8->vWorldPosition.y + 6.755399441055744e15,
1902 sY = LODWORD(v13), 1851 sY = LODWORD(v13),
1903 thisd = (v10->vWorldPosition.x + v8->vWorldPosition.x) * 0.5, 1852 thisd = (v10->vWorldPosition.x + v8->vWorldPosition.x) * 0.5,
1904 v14 = WorldPosToGridCellX(COERCE_UNSIGNED_INT64(thisd + 6.7553994e15)), 1853 v14 = WorldPosToGridCellX(COERCE_UNSIGNED_INT64(thisd + 6.755399441055744e15)),
1905 v15 = v9->vWorldPosition.y + v8->vWorldPosition.y, 1854 v15 = v9->vWorldPosition.y + v8->vWorldPosition.y,
1906 v89 = v14, 1855 v89 = v14,
1907 thise = v15 * 0.5, 1856 thise = v15 * 0.5,
1908 _this = (LightmapBuilder *)WorldPosToGridCellZ(COERCE_UNSIGNED_INT64(thise + 6.7553994e15)), 1857 _this = (LightmapBuilder *)WorldPosToGridCellZ(COERCE_UNSIGNED_INT64(thise + 6.755399441055744e15)),
1909 WorldPosToGridCellX(sX), 1858 WorldPosToGridCellX(sX),
1910 WorldPosToGridCellZ(sY), 1859 WorldPosToGridCellZ(sY),
1911 !byte_4D864C) 1860 !byte_4D864C)
1912 || !(pGame->uFlags & 0x80)) 1861 || !(pGame->uFlags & 0x80))
1913 && !sub_481EFA(v8, v9, _ECX, pVertices, 1)) ) 1862 && !sub_481EFA(v8, v9, v101, pVertices, 1)) )
1914 goto LABEL_162; 1863 goto LABEL_162;
1915 if ( v8->vWorldPosition.z != v9->vWorldPosition.z 1864 if ( v8->vWorldPosition.z != v9->vWorldPosition.z || v9->vWorldPosition.z != pVertices->vWorldPosition.z || pVertices->vWorldPosition.z != v101->vWorldPosition.z )
1916 || v9->vWorldPosition.z != pVertices->vWorldPosition.z
1917 || pVertices->vWorldPosition.z != _ECX->vWorldPosition.z )
1918 break; 1865 break;
1919 v16 = &array_77EC08[pOutdoorCamera->numStru148s]; 1866 v16 = &array_77EC08[pOutdoorCamera->numStru148s];
1920 v17 = pOutdoor->GetTileTexture(sX, sY); 1867 v17 = pOutdoor->GetTileTexture(sX, sY);
1921 v16->uTileBitmapID = v17; 1868 v16->uTileBitmapID = v17;
1922 if ( v17 != -1 ) 1869 if ( v17 != -1 )
1938 v23 = &pTerrainNormals[v22]; 1885 v23 = &pTerrainNormals[v22];
1939 v24 = v92 * v23->z; 1886 v24 = v92 * v23->z;
1940 v99 = v23; 1887 v99 = v23;
1941 thisf = 20.0 - (-v24 - v91 * v23->y - v90 * v23->x) * 20.0; 1888 thisf = 20.0 - (-v24 - v91 * v23->y - v90 * v23->x) * 20.0;
1942 v25 = thisf + 6.7553994e15; 1889 v25 = thisf + 6.7553994e15;
1943 v27 = __OFSUB__(pOutdoorCamera->numStru148s, 1999); 1890 v27 = pOutdoorCamera->numStru148s > 1999;
1944 v26 = pOutdoorCamera->numStru148s - 1999 < 0; 1891 v26 = pOutdoorCamera->numStru148s - 1999 < 0;
1945 v16->field_58 = LOBYTE(v25); 1892 v16->field_58 = LOBYTE(v25);
1946 if ( !(v26 ^ v27) ) 1893 if ( !(v26 ^ v27) )
1947 return; 1894 return;
1948 ++pOutdoorCamera->numStru148s; 1895 ++pOutdoorCamera->numStru148s;
1949 if ( !sub_481FC9(v8, a8, _ECX, v16) ) 1896 if ( !sub_481FC9(v8, a8, v101, v16) )
1950 goto LABEL_126; 1897 goto LABEL_126;
1951 v28 = 1.0 / (a2->vWorldViewPosition.x + 0.0000001); 1898 v28 = 1.0 / (a2->vWorldViewPosition.x + 0.0000001);
1952 memcpy(array_50AC10, a2, 0x30u); 1899 memcpy(array_50AC10, a2, 0x30u);
1953 array_50AC10[0].flt_20 = v28; 1900 array_50AC10[0].flt_20 = v28;
1954 array_50AC10[0].u = 0.0; 1901 array_50AC10[0].u = 0.0;
1961 v30 = pVertices->vWorldViewPosition.x + 0.0000001; 1908 v30 = pVertices->vWorldViewPosition.x + 0.0000001;
1962 memcpy(&array_50AC10[2], pVertices, sizeof(array_50AC10[2])); 1909 memcpy(&array_50AC10[2], pVertices, sizeof(array_50AC10[2]));
1963 array_50AC10[2].flt_20 = 1.0 / v30; 1910 array_50AC10[2].flt_20 = 1.0 / v30;
1964 array_50AC10[2].u = 1.0; 1911 array_50AC10[2].u = 1.0;
1965 array_50AC10[2].v = 1.0; 1912 array_50AC10[2].v = 1.0;
1966 v31 = _ECX->vWorldViewPosition.x + 0.0000001; 1913 v31 = v101->vWorldViewPosition.x + 0.0000001;
1967 memcpy(&array_50AC10[3], _ECX, sizeof(array_50AC10[3])); 1914 memcpy(&array_50AC10[3], v101, sizeof(array_50AC10[3]));
1968 array_50AC10[3].flt_20 = 1.0 / v31; 1915 array_50AC10[3].flt_20 = 1.0 / v31;
1969 array_50AC10[3].u = 1.0; 1916 array_50AC10[3].u = 1.0;
1970 array_50AC10[3].v = 0.0; 1917 array_50AC10[3].v = 0.0;
1971 1918
1972 static stru154 static_sub_0048034E_stru_154; 1919 static stru154 static_sub_0048034E_stru_154;
1990 thisa->ViewTransform(array_50AC10, a5); 1937 thisa->ViewTransform(array_50AC10, a5);
1991 thisa->Project(array_50AC10, a5, 0); 1938 thisa->Project(array_50AC10, a5, 0);
1992 } 1939 }
1993 this_3 = a2->vWorldViewPosition.x < 8.0 1940 this_3 = a2->vWorldViewPosition.x < 8.0
1994 || a8->vWorldViewPosition.x < 8.0 1941 || a8->vWorldViewPosition.x < 8.0
1995 || _ECX->vWorldViewPosition.x < 8.0 1942 || v101->vWorldViewPosition.x < 8.0
1996 || pVertices->vWorldViewPosition.x < 8.0; 1943 || pVertices->vWorldViewPosition.x < 8.0;
1997 v32 = (double)pOutdoorCamera->shading_dist_mist; 1944 v32 = (double)pOutdoorCamera->shading_dist_mist;
1998 v108 = v32 < a2->vWorldViewPosition.x 1945 v108 = v32 < a2->vWorldViewPosition.x
1999 || v32 < a8->vWorldViewPosition.x 1946 || v32 < a8->vWorldViewPosition.x
2000 || v32 < _ECX->vWorldViewPosition.x 1947 || v32 < v101->vWorldViewPosition.x
2001 || v32 < pVertices->vWorldViewPosition.x; 1948 || v32 < pVertices->vWorldViewPosition.x;
2002 LOBYTE(v33) = 0; 1949 LOBYTE(v33) = 0;
2003 pGame->pLightmapBuilder->std__vector_000004_size = 0; 1950 pGame->pLightmapBuilder->std__vector_000004_size = 0;
2004 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) 1951 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
2005 { 1952 {
2236 if ( SLOBYTE(v65) < 0 ) 2183 if ( SLOBYTE(v65) < 0 )
2237 v59->field_58 = 0; 2184 v59->field_58 = 0;
2238 if ( pOutdoorCamera->numStru148s >= 1999 ) 2185 if ( pOutdoorCamera->numStru148s >= 1999 )
2239 return; 2186 return;
2240 ++pOutdoorCamera->numStru148s; 2187 ++pOutdoorCamera->numStru148s;
2241 if ( !sub_481FC9(_ECX, a2, pVertices, v59) ) 2188 if ( !sub_481FC9(v101, a2, pVertices, v59) )
2242 { 2189 {
2243 LABEL_126: 2190 LABEL_126:
2244 --pOutdoorCamera->numStru148s; 2191 --pOutdoorCamera->numStru148s;
2245 goto LABEL_162; 2192 goto LABEL_162;
2246 } 2193 }
2252 v67 = pVertices->vWorldViewPosition.x + 0.0000001; 2199 v67 = pVertices->vWorldViewPosition.x + 0.0000001;
2253 memcpy(&array_50AC10[1], pVertices, sizeof(array_50AC10[1])); 2200 memcpy(&array_50AC10[1], pVertices, sizeof(array_50AC10[1]));
2254 array_50AC10[1].flt_20 = 1.0 / v67; 2201 array_50AC10[1].flt_20 = 1.0 / v67;
2255 array_50AC10[1].u = 1.0; 2202 array_50AC10[1].u = 1.0;
2256 array_50AC10[1].v = 1.0; 2203 array_50AC10[1].v = 1.0;
2257 v68 = _ECX->vWorldViewPosition.x + 0.0000001; 2204 v68 = v101->vWorldViewPosition.x + 0.0000001;
2258 memcpy(&array_50AC10[2], _ECX, sizeof(array_50AC10[2])); 2205 memcpy(&array_50AC10[2], v101, sizeof(array_50AC10[2]));
2259 array_50AC10[2].flt_20 = 1.0 / v68; 2206 array_50AC10[2].flt_20 = 1.0 / v68;
2260 array_50AC10[2].u = 1.0; 2207 array_50AC10[2].u = 1.0;
2261 array_50AC10[2].v = 0.0; 2208 array_50AC10[2].v = 0.0;
2262 2209
2263 static stru154 static_sub_0048034E_stru_76D578; 2210 static stru154 static_sub_0048034E_stru_76D578;
2281 thisc->ViewTransform(array_50AC10, v100); 2228 thisc->ViewTransform(array_50AC10, v100);
2282 thisc->Project(array_50AC10, v100, 0); 2229 thisc->Project(array_50AC10, v100, 0);
2283 } 2230 }
2284 this_3b = a2->vWorldViewPosition.x < 8.0 2231 this_3b = a2->vWorldViewPosition.x < 8.0
2285 || pVertices->vWorldViewPosition.x < 8.0 2232 || pVertices->vWorldViewPosition.x < 8.0
2286 || _ECX->vWorldViewPosition.x < 8.0; 2233 || v101->vWorldViewPosition.x < 8.0;
2287 v69 = (double)pOutdoorCamera->shading_dist_mist; 2234 v69 = (double)pOutdoorCamera->shading_dist_mist;
2288 v108 = v69 < a2->vWorldViewPosition.x || v69 < pVertices->vWorldViewPosition.x || v69 < _ECX->vWorldViewPosition.x; 2235 v108 = v69 < a2->vWorldViewPosition.x || v69 < pVertices->vWorldViewPosition.x || v69 < v101->vWorldViewPosition.x;
2289 LOBYTE(v70) = 0; 2236 LOBYTE(v70) = 0;
2290 v96->std__vector_000004_size = 0; 2237 v96->std__vector_000004_size = 0;
2291 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) 2238 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
2292 { 2239 {
2293 if ( this_3b ) 2240 if ( this_3b )
7138 7085
7139 7086
7140 //----- (004A2031) -------------------------------------------------------- 7087 //----- (004A2031) --------------------------------------------------------
7141 unsigned int Render::GetActorTintColor(float a2, int a3, int a4, int a5, RenderBillboard *a6) 7088 unsigned int Render::GetActorTintColor(float a2, int a3, int a4, int a5, RenderBillboard *a6)
7142 { 7089 {
7143 return GetActorTintColor(a3, a4, a2, a5, a6); 7090 return ::GetActorTintColor(a3, a4, a2, a5, a6);
7144 } 7091 }
7145 7092
7146 7093
7147 //----- (004A26BC) -------------------------------------------------------- 7094 //----- (004A26BC) --------------------------------------------------------
7148 void Render::DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, int a6, int a7) 7095 void Render::DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, int a6, int a7)