Mercurial > mm7
comparison Render.cpp @ 64:f6e7d7110512
Слияние
author | Ritor1 |
---|---|
date | Wed, 23 Jan 2013 13:14:41 +0600 |
parents | a96ebf3123d2 80484cf3a683 |
children | 31feb3432bbd |
comparison
equal
deleted
inserted
replaced
63:a96ebf3123d2 | 64:f6e7d7110512 |
---|---|
999 int v97; // ST08_4@204 | 999 int v97; // ST08_4@204 |
1000 float result; // eax@212 | 1000 float result; // eax@212 |
1001 char v102; // [sp+Ch] [bp-68h]@191 | 1001 char v102; // [sp+Ch] [bp-68h]@191 |
1002 __int16 v103; // [sp+10h] [bp-64h]@190 | 1002 __int16 v103; // [sp+10h] [bp-64h]@190 |
1003 __int16 v104; // [sp+12h] [bp-62h]@190 | 1003 __int16 v104; // [sp+12h] [bp-62h]@190 |
1004 int v105; // [sp+1Ch] [bp-58h]@1 | 1004 int pHeight; // [sp+1Ch] [bp-58h]@1 |
1005 int v106; // [sp+20h] [bp-54h]@3 | 1005 int v106; // [sp+20h] [bp-54h]@3 |
1006 int v107; // [sp+24h] [bp-50h]@3 | 1006 int v107; // [sp+24h] [bp-50h]@3 |
1007 int v108; // [sp+28h] [bp-4Ch]@9 | 1007 int v108; // [sp+28h] [bp-4Ch]@9 |
1008 int v109; // [sp+2Ch] [bp-48h]@9 | 1008 int v109; // [sp+2Ch] [bp-48h]@9 |
1009 int v110; // [sp+30h] [bp-44h]@9 | 1009 int v110; // [sp+30h] [bp-44h]@9 |
1023 float v124; // [sp+68h] [bp-Ch]@1 | 1023 float v124; // [sp+68h] [bp-Ch]@1 |
1024 int v125; // [sp+6Ch] [bp-8h]@9 | 1024 int v125; // [sp+6Ch] [bp-8h]@9 |
1025 float v126; // [sp+70h] [bp-4h]@9 | 1025 float v126; // [sp+70h] [bp-4h]@9 |
1026 | 1026 |
1027 memset(&v102, 0, sizeof(v102)); | 1027 memset(&v102, 0, sizeof(v102)); |
1028 v105 = pIndoorCamera->sRotationY / ((signed int)stru_5C6E00->uIntegerHalfPi / 2); | 1028 pHeight = pIndoorCamera->sRotationY / ((signed int)stru_5C6E00->uIntegerHalfPi / 2); |
1029 v0 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerDoublePi - pIndoorCamera->sRotationY); | 1029 v0 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerDoublePi - pIndoorCamera->sRotationY); |
1030 v1 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + v0); | 1030 v1 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + v0); |
1031 LODWORD(v124) = (signed int)((pIndoorCamera->uMapGridCellX << 16) | 1031 LODWORD(v124) = (signed int)((pIndoorCamera->uMapGridCellX << 16) |
1032 + 3 | 1032 + 3 |
1033 * stru_5C6E00->SinCos( | 1033 * stru_5C6E00->SinCos( |
1147 } | 1147 } |
1148 LODWORD(v16) = 0; | 1148 LODWORD(v16) = 0; |
1149 LODWORD(v126) = 0; | 1149 LODWORD(v126) = 0; |
1150 v17 = v117 - 1; | 1150 v17 = v117 - 1; |
1151 v18 = v116 - 1; | 1151 v18 = v116 - 1; |
1152 switch ( v105 ) | 1152 switch ( pHeight ) |
1153 { | 1153 { |
1154 case 0: | 1154 case 0: |
1155 case 7: | 1155 case 7: |
1156 v116 = terrain_76DFC8[v17]; | 1156 v116 = terrain_76DFC8[v17]; |
1157 if ( v120 > v116 ) | 1157 if ( v120 > v116 ) |
1559 LABEL_173: | 1559 LABEL_173: |
1560 v69 = LODWORD(v16) - 1; | 1560 v69 = LODWORD(v16) - 1; |
1561 ptr_801A08 = pVerticesSR_806210; | 1561 ptr_801A08 = pVerticesSR_806210; |
1562 ptr_801A04 = pVerticesSR_801A10; | 1562 ptr_801A04 = pVerticesSR_801A10; |
1563 LODWORD(v126) = v69; | 1563 LODWORD(v126) = v69; |
1564 if ( v105 && v105 != 7 && v105 != 3 && v105 != 4 ) | 1564 if ( pHeight && pHeight != 7 && pHeight != 3 && pHeight != 4 ) |
1565 { | 1565 { |
1566 for ( i = v69; i >= 1; --i ) | 1566 for ( i = v69; i >= 1; --i ) |
1567 { | 1567 { |
1568 v70 = i; | 1568 v70 = i; |
1569 v71 = terrain_76D7C8[i]; | 1569 v71 = terrain_76D7C8[i]; |
1588 if ( v73 - 2 < v75 ) | 1588 if ( v73 - 2 < v75 ) |
1589 { | 1589 { |
1590 v127 = 0; | 1590 v127 = 0; |
1591 v79 = (v73 - 66) << 9; | 1591 v79 = (v73 - 66) << 9; |
1592 v116 = v77; | 1592 v116 = v77; |
1593 v105 = v79; | 1593 pHeight = v79; |
1594 v111 = v75 - v77; | 1594 v111 = v75 - v77; |
1595 do | 1595 do |
1596 {// | 1596 {// |
1597 *(float *)&v106 = (double)v105; | 1597 *(float *)&v106 = (double)pHeight; |
1598 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;//x | 1598 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;//x |
1599 v105 = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; | 1599 pHeight = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; |
1600 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)v105;//y | 1600 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)pHeight;//y |
1601 v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70)); | 1601 pHeight = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70)); |
1602 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)v105;//z | 1602 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)pHeight;//z |
1603 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;//x | 1603 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;//x |
1604 v105 = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; | 1604 pHeight = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; |
1605 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)v105;//y | 1605 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)pHeight;//y |
1606 v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1); | 1606 pHeight = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1); |
1607 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)v105;//z | 1607 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)pHeight;//z |
1608 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) | 1608 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) |
1609 { | 1609 { |
1610 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1); | 1610 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1); |
1611 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1); | 1611 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1); |
1612 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1, 0); | 1612 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1, 0); |
1613 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1, 0); | 1613 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v127, 1, 0); |
1614 } | 1614 } |
1615 v79 += 512; | 1615 v79 += 512; |
1616 v127 += 48; | 1616 v127 += 48; |
1617 ++v116; | 1617 ++v116; |
1618 v105 = v79; | 1618 pHeight = v79; |
1619 } | 1619 } |
1620 while ( v116 < v107 ); | 1620 while ( v116 < v107 ); |
1621 } | 1621 } |
1622 v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); | 1622 v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); |
1623 v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); | 1623 v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); |
1624 //if ( pRenderer->pRenderD3D ) | 1624 if ( pRenderer->pRenderD3D )//Ritor1: do comment to test |
1625 //Render::DrawTerrainD3D(v111, 0, (int)&v102); | 1625 Render::DrawTerrainD3D(v111, 0, (int)&v102); |
1626 //else | 1626 else |
1627 //Render::DrawTerrainSW(v111, 0, (int)&v102); | 1627 Render::DrawTerrainSW(v111, 0, (int)&v102); |
1628 } | 1628 } |
1629 } | 1629 } |
1630 else | 1630 else |
1631 { | 1631 { |
1632 for ( i = v69; i >= 1; --i ) | 1632 for ( i = v69; i >= 1; --i ) |
1651 if ( v89 - 2 < v90 + 2 ) | 1651 if ( v89 - 2 < v90 + 2 ) |
1652 { | 1652 { |
1653 v86 = 0; | 1653 v86 = 0; |
1654 v116 = v89 - 2; | 1654 v116 = v89 - 2; |
1655 v92 = (66 - v89) << 9; | 1655 v92 = (66 - v89) << 9; |
1656 v105 = (66 - v89) << 9; | 1656 pHeight = (66 - v89) << 9; |
1657 v111 = v90 + 2 - (v89 - 2); | 1657 v111 = v90 + 2 - (v89 - 2); |
1658 do | 1658 do |
1659 { | 1659 { |
1660 v93 = v116; | 1660 v93 = v116; |
1661 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 64) << 9; | 1661 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 64) << 9; |
1662 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v86) = (double)v106; | 1662 *(float *)((char *)&ptr_801A08->vWorldPosition.x + v86) = (double)v106; |
1663 *(float *)&v105 = (double)v105; | 1663 *(float *)&pHeight = (double)pHeight; |
1664 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v86) = *(float *)&v105; | 1664 *(float *)((char *)&ptr_801A08->vWorldPosition.y + v86) = *(float *)&pHeight; |
1665 v106 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86), v93); | 1665 v106 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86), v93); |
1666 v97 = v116; | 1666 v97 = v116; |
1667 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v86) = (double)v106; | 1667 *(float *)((char *)&ptr_801A08->vWorldPosition.z + v86) = (double)v106; |
1668 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 63) << 9; | 1668 v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 63) << 9; |
1669 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v86) = (double)v106; | 1669 *(float *)((char *)&ptr_801A04->vWorldPosition.x + v86) = (double)v106; |
1670 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v86) = *(float *)&v105; | 1670 *(float *)((char *)&ptr_801A04->vWorldPosition.y + v86) = *(float *)&pHeight; |
1671 v105 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86) + 1, v97); | 1671 pHeight = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86) + 1, v97); |
1672 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v86) = (double)v105; | 1672 *(float *)((char *)&ptr_801A04->vWorldPosition.z + v86) = (double)pHeight; |
1673 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) | 1673 if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) |
1674 { | 1674 { |
1675 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1); | 1675 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1); |
1676 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1); | 1676 a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1); |
1677 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1, 0); | 1677 a1->Project((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1, 0); |
1678 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1, 0); | 1678 a1->Project((RenderVertexSoft *)(char *)ptr_801A04 + v86, 1, 0); |
1679 } | 1679 } |
1680 v92 -= 512; | 1680 v92 -= 512; |
1681 v86 += 48; | 1681 v86 += 48; |
1682 ++v116; | 1682 ++v116; |
1683 v105 = v92; | 1683 pHeight = v92; |
1684 } | 1684 } |
1685 while ( v116 < v107 ); | 1685 while ( v116 < v107 ); |
1686 } | 1686 } |
1687 v103 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]); | 1687 v103 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]); |
1688 v104 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]); | 1688 v104 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]); |
1689 //if ( pRenderer->pRenderD3D ) | 1689 if ( pRenderer->pRenderD3D ) |
1690 //Render::DrawTerrainD3D(v111, 1, (int)&v102); | 1690 Render::DrawTerrainD3D(v111, 1, (int)&v102); |
1691 //else | 1691 else |
1692 //Render::DrawTerrainSW(v111, 1, (int)&v102); | 1692 Render::DrawTerrainSW(v111, 1, (int)&v102); |
1693 } | 1693 } |
1694 } | 1694 } |
1695 result = v126; | 1695 result = v126; |
1696 pOutdoorCamera->field_40 = v126; | 1696 pOutdoorCamera->field_40 = v126; |
1697 return result; | 1697 return result; |
1849 v12 = v11 + 6.755399441055744e15, | 1849 v12 = v11 + 6.755399441055744e15, |
1850 sX = LODWORD(v12), | 1850 sX = LODWORD(v12), |
1851 v13 = v8->vWorldPosition.y + 6.755399441055744e15, | 1851 v13 = v8->vWorldPosition.y + 6.755399441055744e15, |
1852 sY = LODWORD(v13), | 1852 sY = LODWORD(v13), |
1853 thisd = (v10->vWorldPosition.x + v8->vWorldPosition.x) * 0.5, | 1853 thisd = (v10->vWorldPosition.x + v8->vWorldPosition.x) * 0.5, |
1854 v14 = WorldPosToGridCellX(floorf(thisd + 0.5f)), | 1854 v14 = WorldPosToGridCellX(floorf(thisd + 0.5f)),//maybe current camera position X |
1855 v15 = v9->vWorldPosition.y + v8->vWorldPosition.y, | 1855 v15 = v9->vWorldPosition.y + v8->vWorldPosition.y, |
1856 v89 = v14, | 1856 v89 = v14, |
1857 thise = v15 * 0.5, | 1857 thise = v15 * 0.5, |
1858 _this = (LightmapBuilder *)WorldPosToGridCellZ(floorf(thisd + 0.5f)), | 1858 _this = (LightmapBuilder *)WorldPosToGridCellZ(floorf(thisd + 0.5f)),//maybe current camera position Z |
1859 WorldPosToGridCellX(sX), | 1859 WorldPosToGridCellX(sX), |
1860 WorldPosToGridCellZ(sY), | 1860 WorldPosToGridCellZ(sY), |
1861 !byte_4D864C) | 1861 !byte_4D864C) |
1862 || !(pGame->uFlags & 0x80)) | 1862 || !(pGame->uFlags & 0x80)) |
1863 && !sub_481EFA(v8, v9, v101, pVertices, 1)) ) | 1863 && !sub_481EFA(v8, v9, v101, pVertices, 1)) ) |
2108 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) | 2108 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) |
2109 { | 2109 { |
2110 a8 = (RenderVertexSoft *)(this_3a ? 3 : v108 != 0 ? 5 : 0); | 2110 a8 = (RenderVertexSoft *)(this_3a ? 3 : v108 != 0 ? 5 : 0); |
2111 static_sub_0048034E_stru_76D590._49B0C9(v99, *(float *)&a4); | 2111 static_sub_0048034E_stru_76D590._49B0C9(v99, *(float *)&a4); |
2112 if ( pDecalBuilder->uNumDecals > 0 ) | 2112 if ( pDecalBuilder->uNumDecals > 0 ) |
2113 pDecalBuilder->ApplyDecals( | 2113 pDecalBuilder->ApplyDecals(31 - v40->field_58, 4, &static_sub_0048034E_stru_76D590, uNumVertices, array_50AC10, 0, (char)a8, -1); |
2114 31 - v40->field_58, | |
2115 4, | |
2116 &static_sub_0048034E_stru_76D590, | |
2117 uNumVertices, | |
2118 array_50AC10, | |
2119 0, | |
2120 (char)a8, | |
2121 -1); | |
2122 } | 2114 } |
2123 if ( stru_F8AD28.uNumLightsApplied > 0 ) | 2115 if ( stru_F8AD28.uNumLightsApplied > 0 ) |
2124 v96->ApplyLights( | 2116 v96->ApplyLights(&stru_F8AD28, &static_sub_0048034E_stru_76D590, uNumVertices, array_50AC10, 0, (char)a8); |
2125 &stru_F8AD28, | |
2126 &static_sub_0048034E_stru_76D590, | |
2127 uNumVertices, | |
2128 array_50AC10, | |
2129 0, | |
2130 (char)a8); | |
2131 v55 = uNumVertices; | 2117 v55 = uNumVertices; |
2132 v35 = byte_4D864C == 0; | 2118 v35 = byte_4D864C == 0; |
2133 v40->uNumVertices = uNumVertices; | 2119 v40->uNumVertices = uNumVertices; |
2134 if ( v35 || !(pGame->uFlags & 0x80) ) | 2120 if ( v35 || !(pGame->uFlags & 0x80) ) |
2135 { | 2121 { |
2834 DWORD v11; // eax@13 | 2820 DWORD v11; // eax@13 |
2835 int v12; // eax@13 | 2821 int v12; // eax@13 |
2836 int v13; // eax@14 | 2822 int v13; // eax@14 |
2837 RenderBillboardTransform_local0 billboard; // [sp+4h] [bp-60h]@1 | 2823 RenderBillboardTransform_local0 billboard; // [sp+4h] [bp-60h]@1 |
2838 int v15; // [sp+54h] [bp-10h]@13 | 2824 int v15; // [sp+54h] [bp-10h]@13 |
2839 int i; // [sp+58h] [bp-Ch]@1 | 2825 int v16; // [sp+58h] [bp-Ch]@1 |
2840 int v17; // [sp+5Ch] [bp-8h]@2 | 2826 int v17; // [sp+5Ch] [bp-8h]@2 |
2841 int v18; // [sp+60h] [bp-4h]@13 | 2827 int v18; // [sp+60h] [bp-4h]@13 |
2842 | 2828 |
2843 billboard.uParentBillboardID = -1; | 2829 billboard.uParentBillboardID = -1; |
2844 billboard.pTarget = pRenderer->pTargetSurface; | 2830 billboard.pTarget = pRenderer->pTargetSurface; |
2848 billboard.uViewportY = pViewport->uViewportY; | 2834 billboard.uViewportY = pViewport->uViewportY; |
2849 billboard.uViewportZ = pViewport->uViewportZ - 1; | 2835 billboard.uViewportZ = pViewport->uViewportZ - 1; |
2850 billboard.uViewportW = pViewport->uViewportW; | 2836 billboard.uViewportW = pViewport->uViewportW; |
2851 v0 = 0; | 2837 v0 = 0; |
2852 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; | 2838 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; |
2853 //v16 = 0; | 2839 v16 = 0; |
2854 for (i = 0; i < uNumBillboardsToDraw; ++i)//if ( (signed int)uNumBillboardsToDraw > 0 ) | 2840 if ( (signed int)uNumBillboardsToDraw > 0 ) |
2855 { | 2841 { |
2856 v17 = 0; | 2842 v17 = 0; |
2857 struct RenderBillboard *pBillboard; | |
2858 pBillboard = &pBillboardRenderList[i]; | |
2859 v1 = (char *)&pBillboardRenderList[0].uScreenSpaceY; | 2843 v1 = (char *)&pBillboardRenderList[0].uScreenSpaceY; |
2860 //do | 2844 do |
2861 //{ | 2845 { |
2862 billboard.uScreenSpaceX = pBillboard->uScreenSpaceX;; | 2846 billboard.uScreenSpaceX = *((short *)v1 - 1); |
2863 v2 = pBillboard->field_1E; | 2847 v2 = *((short *)v1 - 5); |
2864 billboard.uScreenSpaceY = pBillboard->uScreenSpaceY; | 2848 billboard.uScreenSpaceY = *(short *)v1; |
2865 //v3 = *((int *)v1 - 10); | 2849 v3 = *((int *)v1 - 10); |
2866 billboard.uParentBillboardID = i; | 2850 billboard.uParentBillboardID = v0; |
2867 //v4 = *((int *)v1 + 1); | 2851 v4 = *((int *)v1 + 1); |
2868 billboard.field_10 = pBillboard->field_0; | 2852 billboard.field_10 = v3; |
2869 //v5 = *((int *)v1 - 9); | 2853 v5 = *((int *)v1 - 9); |
2870 billboard.uTintColor = pBillboard->uTintColor; | 2854 billboard.uTintColor = v4; |
2871 //v6 = *((short *)v1 - 8); | 2855 v6 = *((short *)v1 - 8); |
2872 billboard.field_14 = pBillboard->field_4; | 2856 billboard.field_14 = v5; |
2873 //v7 = *((int *)v1 - 6); | 2857 v7 = *((int *)v1 - 6); |
2874 billboard.sZValue = pBillboard->sZValue; | 2858 billboard.sZValue = *((int *)v1 - 6); |
2875 billboard.uFlags = pBillboard->field_1E; | 2859 billboard.uFlags = v2; |
2876 if ( pBillboard->uHwSpriteID != -1 ) | 2860 if ( v6 != -1 ) |
2877 { | 2861 { |
2878 v8 = pBillboard->uPaletteSubindex;; | 2862 v8 = *((short *)v1 + 1); |
2879 //if ( pRenderer->pRenderD3D ) | 2863 if ( pRenderer->pRenderD3D ) |
2880 //{ | 2864 { |
2881 billboard.sZValue = pBillboard->sZValue; | 2865 billboard.sZValue = v7; |
2882 billboard.uFlags = pBillboard->field_1E; | 2866 billboard.uFlags = v2; |
2883 pRenderer->TransformBillboard(&billboard, &pSprites_LOD->pHardwareSprites[pBillboard->uHwSpriteID], pBillboard->uPaletteSubindex, pBillboard); | 2867 pRenderer->TransformBillboard(&billboard, &pSprites_LOD->pHardwareSprites[v6], v8, (RenderBillboard *)(v1 - 40)); |
2884 //} | 2868 } |
2885 //else | 2869 else |
2886 //{ | 2870 { |
2887 /*if ( *(v1 - 10) & 2 ) | 2871 if ( *(v1 - 10) & 2 ) |
2888 v9 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 0, 1); | 2872 v9 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 0, 1); |
2889 else | 2873 else |
2890 v9 = GetBillboardPalette((RenderBillboard *)(v1 - 40), *((short *)v1 - 7), v7, *((short *)v1 + 1)); | 2874 v9 = GetBillboardPalette((RenderBillboard *)(v1 - 40), *((short *)v1 - 7), v7, *((short *)v1 + 1)); |
2891 v10 = (*(v1 - 9) & 1) == 0; | 2875 v10 = (*(v1 - 9) & 1) == 0; |
2892 billboard.pPalette = v9; | 2876 billboard.pPalette = v9; |
2900 v18 = (unsigned __int64)(15i64 * v15) >> 16; | 2884 v18 = (unsigned __int64)(15i64 * v15) >> 16; |
2901 billboard.pPalette2 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 15 - v18, 1); | 2885 billboard.pPalette2 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 15 - v18, 1); |
2902 } | 2886 } |
2903 v13 = *((short *)v1 - 8); | 2887 v13 = *((short *)v1 - 8); |
2904 if ( v13 >= 0 ) | 2888 if ( v13 >= 0 ) |
2905 pSprites_LOD->pSpriteHeaders[v13]._4ACC38(&billboard, 1);*/ | 2889 pSprites_LOD->pSpriteHeaders[v13]._4ACC38(&billboard, 1); |
2906 //} | 2890 } |
2907 } | 2891 } |
2908 v17 += 5; | 2892 v17 += 5; |
2909 //v0 = i + 1; | 2893 v0 = v16 + 1; |
2910 v1 += 52; | 2894 v1 += 52; |
2911 //++v16; | 2895 ++v16; |
2912 //} | 2896 } |
2913 //while ( v16 < (signed int)uNumBillboardsToDraw ); | 2897 while ( v16 < (signed int)uNumBillboardsToDraw ); |
2914 } | 2898 } |
2915 } | 2899 } |
2916 | 2900 |
2917 | 2901 |
2918 //----- (0047AF11) -------------------------------------------------------- | 2902 //----- (0047AF11) -------------------------------------------------------- |
4289 } | 4273 } |
4290 else | 4274 else |
4291 { | 4275 { |
4292 if ( !v54 || byte_4D864C && pGame->uFlags & 2 ) | 4276 if ( !v54 || byte_4D864C && pGame->uFlags & 2 ) |
4293 { | 4277 { |
4294 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 1u)); | 4278 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 1u));// |
4295 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW)); | 4279 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW)); |
4296 if (bUsingSpecular) | 4280 if (bUsingSpecular) |
4297 { | 4281 { |
4298 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, true)); | 4282 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, true)); |
4299 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2)); | 4283 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2)); |