Mercurial > mm7
comparison Render.cpp @ 1206:ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 01:10:49 +0200 |
parents | 8c02e6f74b29 |
children | 96a81634669e |
comparison
equal
deleted
inserted
replaced
1205:8c02e6f74b29 | 1206:ab6560001f5b |
---|---|
40 #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib") | 40 #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib") |
41 #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib") | 41 #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib") |
42 | 42 |
43 struct IDirectDrawClipper *pDDrawClipper; | 43 struct IDirectDrawClipper *pDDrawClipper; |
44 struct Render *pRenderer; // idb | 44 struct Render *pRenderer; // idb |
45 struct RenderVertexD3D3 pVertices[50]; | 45 struct RenderVertexD3D3 pVertices[50]; |
46 int uNumDecorationsDrawnThisFrame; // weak | 46 int uNumDecorationsDrawnThisFrame; // weak |
47 RenderBillboard pBillboardRenderList[500]; | 47 std::array<RenderBillboard, 500> pBillboardRenderList; |
48 unsigned int uNumBillboardsToDraw; | 48 unsigned int uNumBillboardsToDraw; |
49 int uNumSpritesDrawnThisFrame; // weak | 49 int uNumSpritesDrawnThisFrame; // weak |
50 | 50 |
51 RenderVertexSoft array_507D30[50]; | 51 std::array<RenderVertexSoft, 50> array_507D30; |
52 RenderVertexSoft array_508690[50]; | 52 std::array<RenderVertexSoft, 50> array_508690; |
53 RenderVertexSoft array_508FF0[50]; | 53 std::array<RenderVertexSoft, 50> array_508FF0; |
54 RenderVertexSoft array_509950[50]; | 54 std::array<RenderVertexSoft, 50> array_509950; |
55 RenderVertexSoft array_50A2B0[50]; | 55 std::array<RenderVertexSoft, 100> array_50A2B0; |
56 RenderVertexSoft array_50AC10[50]; | 56 std::array<RenderVertexSoft, 50> array_50AC10; |
57 | 57 |
58 RenderVertexSoft array_73D150[20]; | 58 std::array<RenderVertexSoft, 20> array_73D150; |
59 | 59 |
60 RenderVertexD3D3 d3d_vertex_buffer[50]; | 60 std::array<RenderVertexD3D3, 50> d3d_vertex_buffer; |
61 | 61 |
62 RenderVertexSoft *ptr_801A04; | 62 RenderVertexSoft *ptr_801A04; |
63 RenderVertexSoft *ptr_801A08; | 63 RenderVertexSoft *ptr_801A08; |
64 | 64 |
65 RenderVertexSoft pVerticesSR_801A10[384]; | 65 std::array<RenderVertexSoft, 384> pVerticesSR_801A10; |
66 RenderVertexSoft pVerticesSR_806210[384]; | 66 std::array<RenderVertexSoft, 384> pVerticesSR_806210; |
67 | 67 |
68 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1); | 68 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1); |
69 | 69 |
70 /* 384 */ | 70 /* 384 */ |
71 #pragma pack(push, 1) | 71 #pragma pack(push, 1) |
159 soft_billboard.uViewportW = pBLVRenderParams->uViewportW; | 159 soft_billboard.uViewportW = pBLVRenderParams->uViewportW; |
160 | 160 |
161 pOutdoorCamera->uNumBillboards = ::uNumBillboardsToDraw; | 161 pOutdoorCamera->uNumBillboards = ::uNumBillboardsToDraw; |
162 for (uint i = 0; i < ::uNumBillboardsToDraw; ++i) | 162 for (uint i = 0; i < ::uNumBillboardsToDraw; ++i) |
163 { | 163 { |
164 auto p = pBillboardRenderList + i; | 164 auto p = &pBillboardRenderList[i]; |
165 | 165 |
166 soft_billboard.uScreenSpaceX = p->uScreenSpaceX; | 166 soft_billboard.uScreenSpaceX = p->uScreenSpaceX; |
167 soft_billboard.uParentBillboardID = i; | 167 soft_billboard.uParentBillboardID = i; |
168 soft_billboard.uScreenSpaceY = p->uScreenSpaceY; | 168 soft_billboard.uScreenSpaceY = p->uScreenSpaceY; |
169 soft_billboard._screenspace_x_scaler_packedfloat = p->_screenspace_x_scaler_packedfloat; | 169 soft_billboard._screenspace_x_scaler_packedfloat = p->_screenspace_x_scaler_packedfloat; |
265 char v41; // [sp+30h] [bp-2Ch]@57 | 265 char v41; // [sp+30h] [bp-2Ch]@57 |
266 | 266 |
267 v0 = pRenderer->pTargetSurface; | 267 v0 = pRenderer->pTargetSurface; |
268 v1 = pOutdoorCamera->numStru148s; | 268 v1 = pOutdoorCamera->numStru148s; |
269 a1 = pRenderer->pTargetSurface; | 269 a1 = pRenderer->pTargetSurface; |
270 v2 = array_77EC08; | 270 v2 = array_77EC08.data(); |
271 v37 = pOutdoorCamera->numStru148s; | 271 v37 = pOutdoorCamera->numStru148s; |
272 if ( !(pParty->uFlags & 2) ) | 272 if ( !(pParty->uFlags & 2) ) |
273 { | 273 { |
274 v1 = uNumElementsIn80AA28; | 274 v1 = uNumElementsIn80AA28; |
275 v2 = ptr_80AA28[0]; | 275 v2 = ptr_80AA28[0]; |
1529 } | 1529 } |
1530 default: | 1530 default: |
1531 break; | 1531 break; |
1532 } | 1532 } |
1533 //v69 = v16 - 1; | 1533 //v69 = v16 - 1; |
1534 ptr_801A08 = pVerticesSR_806210; | 1534 ptr_801A08 = pVerticesSR_806210.data(); |
1535 ptr_801A04 = pVerticesSR_801A10; | 1535 ptr_801A04 = pVerticesSR_801A10.data(); |
1536 //v126 = v69; | 1536 //v126 = v69; |
1537 | 1537 |
1538 if ( v105 && v105 != 7 && v105 != 3 && v105 != 4 )//блок | 1538 if ( v105 && v105 != 7 && v105 != 3 && v105 != 4 )//блок |
1539 { | 1539 { |
1540 for ( i = v16 - 1; i >= 1; --i ) | 1540 for ( i = v16 - 1; i >= 1; --i ) |
1772 v8->field_59 = 1; | 1772 v8->field_59 = 1; |
1773 //v8->field_5D = (char)WorldPosToGridCellZ(floorf((pVertices->vWorldPosition.z + v8a->vWorldPosition.z) / 2 + 0.5f)); | 1773 //v8->field_5D = (char)WorldPosToGridCellZ(floorf((pVertices->vWorldPosition.z + v8a->vWorldPosition.z) / 2 + 0.5f)); |
1774 //v8->field_5C = WorldPosToGridCellX(floorf((v101->vWorldPosition.x + v8->vWorldPosition.x) / 2 + 0.5f));; | 1774 //v8->field_5C = WorldPosToGridCellX(floorf((v101->vWorldPosition.x + v8->vWorldPosition.x) / 2 + 0.5f));; |
1775 v8->sTextureDeltaU = 0; | 1775 v8->sTextureDeltaU = 0; |
1776 v8->sTextureDeltaV = 0; | 1776 v8->sTextureDeltaV = 0; |
1777 memcpy(array_73D150 + 0, &pTerrainVertices[z * 128 + x], sizeof(RenderVertexSoft)); | 1777 memcpy(&array_73D150[0], &pTerrainVertices[z * 128 + x], sizeof(RenderVertexSoft)); |
1778 array_73D150[0].u = 0; | 1778 array_73D150[0].u = 0; |
1779 array_73D150[0].v = 0; | 1779 array_73D150[0].v = 0; |
1780 memcpy(array_73D150 + 1, &pTerrainVertices[z * 128 + x + 1], sizeof(RenderVertexSoft)); | 1780 memcpy(&array_73D150[1], &pTerrainVertices[z * 128 + x + 1], sizeof(RenderVertexSoft)); |
1781 array_73D150[1].u = 1; | 1781 array_73D150[1].u = 1; |
1782 array_73D150[1].v = 0; | 1782 array_73D150[1].v = 0; |
1783 memcpy(array_73D150 + 2, &pTerrainVertices[(z + 1) * 128 + x + 1], sizeof(RenderVertexSoft)); | 1783 memcpy(&array_73D150[2], &pTerrainVertices[(z + 1) * 128 + x + 1], sizeof(RenderVertexSoft)); |
1784 array_73D150[2].u = 1; | 1784 array_73D150[2].u = 1; |
1785 array_73D150[2].v = 1; | 1785 array_73D150[2].v = 1; |
1786 memcpy(array_73D150 + 3, &pTerrainVertices[(z + 1) * 128 + x], sizeof(RenderVertexSoft)); | 1786 memcpy(&array_73D150[3], &pTerrainVertices[(z + 1) * 128 + x], sizeof(RenderVertexSoft)); |
1787 array_73D150[3].u = 0; | 1787 array_73D150[3].u = 0; |
1788 array_73D150[3].v = 1; | 1788 array_73D150[3].v = 1; |
1789 v55 = 0; | 1789 v55 = 0; |
1790 v54 = false; | 1790 v54 = false; |
1791 v58 = 0; | 1791 v58 = 0; |
2094 { | 2094 { |
2095 byte_76D5C0 |= 1u; | 2095 byte_76D5C0 |= 1u; |
2096 stru154(stru_76D5A8); | 2096 stru154(stru_76D5A8); |
2097 atexit(loc_481199); | 2097 atexit(loc_481199); |
2098 }*/ | 2098 }*/ |
2099 v32 = (struct8 *)array_50AC10; | 2099 v32 = (struct8 *)array_50AC10.data(); |
2100 v97 = (int)pGame->pLightmapBuilder; | 2100 v97 = (int)pGame->pLightmapBuilder; |
2101 pGame->pLightmapBuilder->StackLights_TerrainFace(v23, &v95, array_50AC10, 4, 1); | 2101 pGame->pLightmapBuilder->StackLights_TerrainFace(v23, &v95, array_50AC10.data(), 4, 1); |
2102 pDecalBuilder->_49BE8A(v16, v23, &v95, array_50AC10, 4, 1); | 2102 pDecalBuilder->_49BE8A(v16, v23, &v95, array_50AC10.data(), 4, 1); |
2103 a5 = 4; | 2103 a5 = 4; |
2104 if ( byte_4D864C && pGame->uFlags & 0x80 ) | 2104 if ( byte_4D864C && pGame->uFlags & 0x80 ) |
2105 { | 2105 { |
2106 thisa = pGame->pIndoorCameraD3D; | 2106 thisa = pGame->pIndoorCameraD3D; |
2107 if ( pGame->pIndoorCameraD3D->_4371C3(array_50AC10, &a5, 0) == 1 && !a5 ) | 2107 if ( pGame->pIndoorCameraD3D->_4371C3(array_50AC10.data(), &a5, 0) == 1 && !a5 ) |
2108 goto LABEL_162; | 2108 goto LABEL_162; |
2109 thisa->ViewTransform(array_50AC10, a5); | 2109 thisa->ViewTransform(array_50AC10.data(), a5); |
2110 thisa->Project(array_50AC10, a5, 0); | 2110 thisa->Project(array_50AC10.data(), a5, 0); |
2111 } | 2111 } |
2112 this_3 = v102->vWorldViewPosition.x < 8.0 || pVertices->vWorldViewPosition.x < 8.0 | 2112 this_3 = v102->vWorldViewPosition.x < 8.0 || pVertices->vWorldViewPosition.x < 8.0 |
2113 || v101->vWorldViewPosition.x < 8.0 || pVertices2->vWorldViewPosition.x < 8.0; | 2113 || v101->vWorldViewPosition.x < 8.0 || pVertices2->vWorldViewPosition.x < 8.0; |
2114 v3a = (double)pOutdoorCamera->shading_dist_mist; | 2114 v3a = (double)pOutdoorCamera->shading_dist_mist; |
2115 v108 = v3a < v102->vWorldViewPosition.x || v3a < pVertices->vWorldViewPosition.x | 2115 v108 = v3a < v102->vWorldViewPosition.x || v3a < pVertices->vWorldViewPosition.x |
2122 v33 = 3; | 2122 v33 = 3; |
2123 else | 2123 else |
2124 v33 = v108 != 0 ? 5 : 0; | 2124 v33 = v108 != 0 ? 5 : 0; |
2125 static_sub_0048034E_stru_154.ClassifyPolygon(v23, v95); | 2125 static_sub_0048034E_stru_154.ClassifyPolygon(v23, v95); |
2126 if ( pDecalBuilder->uNumDecals > 0 ) | 2126 if ( pDecalBuilder->uNumDecals > 0 ) |
2127 pDecalBuilder->ApplyDecals(31 - v16->dimming_level, 4, &static_sub_0048034E_stru_154, a5, array_50AC10, 0, *(float *)&v33, -1); | 2127 pDecalBuilder->ApplyDecals(31 - v16->dimming_level, 4, &static_sub_0048034E_stru_154, a5, array_50AC10.data(), 0, *(float *)&v33, -1); |
2128 } | 2128 } |
2129 if ( stru_F8AD28.uNumLightsApplied > 0 ) | 2129 if ( stru_F8AD28.uNumLightsApplied > 0 ) |
2130 pGame->pLightmapBuilder->ApplyLights(&stru_F8AD28, &static_sub_0048034E_stru_154, a5, array_50AC10, 0, v33); | 2130 pGame->pLightmapBuilder->ApplyLights(&stru_F8AD28, &static_sub_0048034E_stru_154, a5, array_50AC10.data(), 0, v33); |
2131 v34 = a5; | 2131 v34 = a5; |
2132 //v35 = byte_4D864C == 0; | 2132 //v35 = byte_4D864C == 0; |
2133 v16->uNumVertices = a5; | 2133 v16->uNumVertices = a5; |
2134 if ( !byte_4D864C || ~pGame->uFlags & 0x80 ) | 2134 if ( !byte_4D864C || ~pGame->uFlags & 0x80 ) |
2135 { | 2135 { |
2651 return; | 2651 return; |
2652 ++pOutdoorCamera->numStru148s; | 2652 ++pOutdoorCamera->numStru148s; |
2653 if ( !sub_481FC9(v10, (RenderVertexSoft *)HIDWORD(v101), v102, v17) ) | 2653 if ( !sub_481FC9(v10, (RenderVertexSoft *)HIDWORD(v101), v102, v17) ) |
2654 goto LABEL_104; | 2654 goto LABEL_104; |
2655 v26 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); | 2655 v26 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); |
2656 memcpy(array_50AC10, v104, 0x30u); | 2656 memcpy(array_50AC10.data(), v104, 0x30u); |
2657 array_50AC10[0]._rhw = v26; | 2657 array_50AC10[0]._rhw = v26; |
2658 array_50AC10[0].u = 0.0; | 2658 array_50AC10[0].u = 0.0; |
2659 array_50AC10[0].v = 0.0; | 2659 array_50AC10[0].v = 0.0; |
2660 v27 = *(float *)(HIDWORD(v101) + 12) + 0.0000001; | 2660 v27 = *(float *)(HIDWORD(v101) + 12) + 0.0000001; |
2661 memcpy(&array_50AC10[1], (void *)HIDWORD(v101), sizeof(array_50AC10[1])); | 2661 memcpy(&array_50AC10[1], (void *)HIDWORD(v101), sizeof(array_50AC10[1])); |
2670 v29 = v102->vWorldViewPosition.x + 0.0000001; | 2670 v29 = v102->vWorldViewPosition.x + 0.0000001; |
2671 memcpy(&array_50AC10[3], v102, sizeof(array_50AC10[3])); | 2671 memcpy(&array_50AC10[3], v102, sizeof(array_50AC10[3])); |
2672 array_50AC10[3]._rhw = 1.0 / v29; | 2672 array_50AC10[3]._rhw = 1.0 / v29; |
2673 array_50AC10[3].u = 1.0; | 2673 array_50AC10[3].u = 1.0; |
2674 array_50AC10[3].v = 0.0; | 2674 array_50AC10[3].v = 0.0; |
2675 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormal, &a3a, array_50AC10, 4u, 1); | 2675 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormal, &a3a, array_50AC10.data(), 4u, 1); |
2676 if ( stru_F8AD28.uNumLightsApplied <= 0 ) | 2676 if ( stru_F8AD28.uNumLightsApplied <= 0 ) |
2677 { | 2677 { |
2678 v17->field_108 = 0; | 2678 v17->field_108 = 0; |
2679 } | 2679 } |
2680 else | 2680 else |
2681 { | 2681 { |
2682 v30 = pGame; | 2682 v30 = pGame; |
2683 v17->field_108 = 1; | 2683 v17->field_108 = 1; |
2684 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, 4, pNormal); | 2684 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10.data(), 4, pNormal); |
2685 } | 2685 } |
2686 if ( v104->vWorldViewPosition.x < 8.0 | 2686 if ( v104->vWorldViewPosition.x < 8.0 |
2687 || *(float *)(HIDWORD(v101) + 12) < 8.0 | 2687 || *(float *)(HIDWORD(v101) + 12) < 8.0 |
2688 || (v31 = v102, v102->vWorldViewPosition.x < 8.0) | 2688 || (v31 = v102, v102->vWorldViewPosition.x < 8.0) |
2689 || v103->vWorldViewPosition.x < 8.0 ) | 2689 || v103->vWorldViewPosition.x < 8.0 ) |
2772 return; | 2772 return; |
2773 ++pOutdoorCamera->numStru148s; | 2773 ++pOutdoorCamera->numStru148s; |
2774 if ( !sub_481FC9((RenderVertexSoft *)HIDWORD(v101), v103, v104, v38) ) | 2774 if ( !sub_481FC9((RenderVertexSoft *)HIDWORD(v101), v103, v104, v38) ) |
2775 goto LABEL_74; | 2775 goto LABEL_74; |
2776 v48 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); | 2776 v48 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); |
2777 memcpy(array_50AC10, v104, 0x30u); | 2777 memcpy(array_50AC10.data(), v104, 0x30u); |
2778 array_50AC10[0]._rhw = v48; | 2778 array_50AC10[0]._rhw = v48; |
2779 array_50AC10[0].u = 0.0; | 2779 array_50AC10[0].u = 0.0; |
2780 array_50AC10[0].v = 0.0; | 2780 array_50AC10[0].v = 0.0; |
2781 v49 = *(float *)(HIDWORD(v101) + 12) + 0.0000001; | 2781 v49 = *(float *)(HIDWORD(v101) + 12) + 0.0000001; |
2782 memcpy(&array_50AC10[1], (void *)HIDWORD(v101), sizeof(array_50AC10[1])); | 2782 memcpy(&array_50AC10[1], (void *)HIDWORD(v101), sizeof(array_50AC10[1])); |
2786 v50 = v103->vWorldViewPosition.x + 0.0000001; | 2786 v50 = v103->vWorldViewPosition.x + 0.0000001; |
2787 memcpy(&array_50AC10[2], v103, sizeof(array_50AC10[2])); | 2787 memcpy(&array_50AC10[2], v103, sizeof(array_50AC10[2])); |
2788 array_50AC10[2]._rhw = 1.0 / v50; | 2788 array_50AC10[2]._rhw = 1.0 / v50; |
2789 array_50AC10[2].u = 1.0; | 2789 array_50AC10[2].u = 1.0; |
2790 array_50AC10[2].v = 1.0; | 2790 array_50AC10[2].v = 1.0; |
2791 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormala, &v78, array_50AC10, 3u, 0); | 2791 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormala, &v78, array_50AC10.data(), 3u, 0); |
2792 if ( stru_F8AD28.uNumLightsApplied <= 0 ) | 2792 if ( stru_F8AD28.uNumLightsApplied <= 0 ) |
2793 { | 2793 { |
2794 v38->field_108 = 0; | 2794 v38->field_108 = 0; |
2795 } | 2795 } |
2796 else | 2796 else |
2797 { | 2797 { |
2798 v51 = pGame; | 2798 v51 = pGame; |
2799 v38->field_108 = 1; | 2799 v38->field_108 = 1; |
2800 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, 3, pNormala); | 2800 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10.data(), 3, pNormala); |
2801 } | 2801 } |
2802 if ( v104->vWorldViewPosition.x < 8.0 | 2802 if ( v104->vWorldViewPosition.x < 8.0 |
2803 || *(float *)(HIDWORD(v101) + 12) < 8.0 | 2803 || *(float *)(HIDWORD(v101) + 12) < 8.0 |
2804 || (v52 = v103, v103->vWorldViewPosition.x < 8.0) ) | 2804 || (v52 = v103, v103->vWorldViewPosition.x < 8.0) ) |
2805 { | 2805 { |
2816 v38->uNumVertices = v54; | 2816 v38->uNumVertices = v54; |
2817 if ( v54 ) | 2817 if ( v54 ) |
2818 { | 2818 { |
2819 sr_sub_4829B9((RenderVertexSoft *)HIDWORD(v101), v52, v104, v38, 0); | 2819 sr_sub_4829B9((RenderVertexSoft *)HIDWORD(v101), v52, v104, v38, 0); |
2820 LABEL_68: | 2820 LABEL_68: |
2821 sr_sub_481DB2(array_508690, v54, v38); | 2821 sr_sub_481DB2(array_508690.data(), v54, v38); |
2822 LABEL_75: | 2822 LABEL_75: |
2823 v17 = &array_77EC08[pOutdoorCamera->numStru148s]; | 2823 v17 = &array_77EC08[pOutdoorCamera->numStru148s]; |
2824 v57 = pOutdoor->GetTileTexture(v101, v100); | 2824 v57 = pOutdoor->GetTileTexture(v101, v100); |
2825 v17->uTileBitmapID = v57; | 2825 v17->uTileBitmapID = v57; |
2826 if ( v57 == -1 ) | 2826 if ( v57 == -1 ) |
2866 LABEL_104: | 2866 LABEL_104: |
2867 --pOutdoorCamera->numStru148s; | 2867 --pOutdoorCamera->numStru148s; |
2868 goto LABEL_105; | 2868 goto LABEL_105; |
2869 } | 2869 } |
2870 v62 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); | 2870 v62 = 1.0 / (v104->vWorldViewPosition.x + 0.0000001); |
2871 memcpy(array_50AC10, v104, 0x30u); | 2871 memcpy(array_50AC10.data(), v104, 0x30u); |
2872 array_50AC10[0]._rhw = v62; | 2872 array_50AC10[0]._rhw = v62; |
2873 array_50AC10[0].u = 0.0; | 2873 array_50AC10[0].u = 0.0; |
2874 array_50AC10[0].v = 0.0; | 2874 array_50AC10[0].v = 0.0; |
2875 v63 = v103->vWorldViewPosition.x + 0.0000001; | 2875 v63 = v103->vWorldViewPosition.x + 0.0000001; |
2876 memcpy(&array_50AC10[1], v103, sizeof(array_50AC10[1])); | 2876 memcpy(&array_50AC10[1], v103, sizeof(array_50AC10[1])); |
2880 v64 = v102->vWorldViewPosition.x + 0.0000001; | 2880 v64 = v102->vWorldViewPosition.x + 0.0000001; |
2881 memcpy(&array_50AC10[2], v102, sizeof(array_50AC10[2])); | 2881 memcpy(&array_50AC10[2], v102, sizeof(array_50AC10[2])); |
2882 array_50AC10[2]._rhw = 1.0 / v64; | 2882 array_50AC10[2]._rhw = 1.0 / v64; |
2883 array_50AC10[2].u = 1.0; | 2883 array_50AC10[2].u = 1.0; |
2884 array_50AC10[2].v = 0.0; | 2884 array_50AC10[2].v = 0.0; |
2885 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormalb, &v70, array_50AC10, 3u, 1); | 2885 pGame->pLightmapBuilder->StackLights_TerrainFace(pNormalb, &v70, array_50AC10.data(), 3u, 1); |
2886 if ( stru_F8AD28.uNumLightsApplied <= 0 ) | 2886 if ( stru_F8AD28.uNumLightsApplied <= 0 ) |
2887 { | 2887 { |
2888 v17->field_108 = 0; | 2888 v17->field_108 = 0; |
2889 } | 2889 } |
2890 else | 2890 else |
2891 { | 2891 { |
2892 v65 = pGame; | 2892 v65 = pGame; |
2893 v17->field_108 = 1; | 2893 v17->field_108 = 1; |
2894 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, 3, pNormalb); | 2894 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10.data(), 3, pNormalb); |
2895 } | 2895 } |
2896 if ( v104->vWorldViewPosition.x < 8.0 || v103->vWorldViewPosition.x < 8.0 || v102->vWorldViewPosition.x < 8.0 ) | 2896 if ( v104->vWorldViewPosition.x < 8.0 || v103->vWorldViewPosition.x < 8.0 || v102->vWorldViewPosition.x < 8.0 ) |
2897 { | 2897 { |
2898 v37 = sr_4250FE(3u); | 2898 v37 = sr_4250FE(3u); |
2899 OutdoorCamera::Project(v37); | 2899 OutdoorCamera::Project(v37); |
2919 v68 = v17; | 2919 v68 = v17; |
2920 v67 = v103; | 2920 v67 = v103; |
2921 LABEL_37: | 2921 LABEL_37: |
2922 sr_sub_4829B9(v35, v34, v67, v68, v69); | 2922 sr_sub_4829B9(v35, v34, v67, v68, v69); |
2923 LABEL_38: | 2923 LABEL_38: |
2924 sr_sub_481DB2(array_508690, v33, v17); | 2924 sr_sub_481DB2(array_508690.data(), v33, v17); |
2925 goto LABEL_105; | 2925 goto LABEL_105; |
2926 } | 2926 } |
2927 goto LABEL_74; | 2927 goto LABEL_74; |
2928 } | 2928 } |
2929 v55 = sr_4252E8(3u); | 2929 v55 = sr_4252E8(3u); |
2979 billboard.uViewportW = pViewport->uViewportBR_Y; | 2979 billboard.uViewportW = pViewport->uViewportBR_Y; |
2980 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; | 2980 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; |
2981 | 2981 |
2982 for (int i = 0; i < ::uNumBillboardsToDraw; ++i) | 2982 for (int i = 0; i < ::uNumBillboardsToDraw; ++i) |
2983 { | 2983 { |
2984 auto pBillboard = pBillboardRenderList + i; | 2984 auto pBillboard = &pBillboardRenderList[i]; |
2985 | 2985 |
2986 billboard.uScreenSpaceX = pBillboard->uScreenSpaceX; | 2986 billboard.uScreenSpaceX = pBillboard->uScreenSpaceX; |
2987 billboard.uScreenSpaceY = pBillboard->uScreenSpaceY; | 2987 billboard.uScreenSpaceY = pBillboard->uScreenSpaceY; |
2988 billboard.uParentBillboardID = i; | 2988 billboard.uParentBillboardID = i; |
2989 billboard._screenspace_x_scaler_packedfloat = pBillboard->_screenspace_x_scaler_packedfloat; | 2989 billboard._screenspace_x_scaler_packedfloat = pBillboard->_screenspace_x_scaler_packedfloat; |
4506 } | 4506 } |
4507 | 4507 |
4508 pRenderD3D->pDevice->SetTexture(0, pTexture); | 4508 pRenderD3D->pDevice->SetTexture(0, pTexture); |
4509 pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 4509 pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
4510 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 4510 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
4511 d3d_vertex_buffer, | 4511 d3d_vertex_buffer.data(), |
4512 uNumVertices, | 4512 uNumVertices, |
4513 D3DDP_DONOTLIGHT); | 4513 D3DDP_DONOTLIGHT); |
4514 } | 4514 } |
4515 else | 4515 else |
4516 { | 4516 { |
4541 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE)); | 4541 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE)); |
4542 | 4542 |
4543 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); | 4543 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); |
4544 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 4544 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
4545 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, | 4545 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, |
4546 d3d_vertex_buffer, | 4546 d3d_vertex_buffer.data(), |
4547 uNumVertices, | 4547 uNumVertices, |
4548 D3DDP_DONOTLIGHT)); | 4548 D3DDP_DONOTLIGHT)); |
4549 //v50 = (const char *)v5->pRenderD3D->pDevice; | 4549 //v50 = (const char *)v5->pRenderD3D->pDevice; |
4550 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); | 4550 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); |
4551 //(*(void (**)(void))(*(int *)v50 + 88))(); | 4551 //(*(void (**)(void))(*(int *)v50 + 88))(); |
4562 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); | 4562 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); |
4563 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); | 4563 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); |
4564 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); | 4564 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); |
4565 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 4565 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
4566 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, | 4566 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, |
4567 d3d_vertex_buffer, | 4567 d3d_vertex_buffer.data(), |
4568 uNumVertices, | 4568 uNumVertices, |
4569 D3DDP_DONOTLIGHT)); | 4569 D3DDP_DONOTLIGHT)); |
4570 if (bUsingSpecular) | 4570 if (bUsingSpecular) |
4571 { | 4571 { |
4572 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE)); | 4572 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE)); |
4580 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); | 4580 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); |
4581 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_INVSRCALPHA)); | 4581 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_INVSRCALPHA)); |
4582 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCALPHA)); | 4582 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCALPHA)); |
4583 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 4583 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
4584 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, | 4584 D3DFVF_XYZRHW | D3DFVF_TEX1 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR, |
4585 d3d_vertex_buffer, | 4585 d3d_vertex_buffer.data(), |
4586 uNumVertices, | 4586 uNumVertices, |
4587 D3DDP_DONOTLIGHT)); | 4587 D3DDP_DONOTLIGHT)); |
4588 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, TRUE)); | 4588 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, TRUE)); |
4589 //v40 = pRenderer->pRenderD3D->pDevice->lpVtbl; | 4589 //v40 = pRenderer->pRenderD3D->pDevice->lpVtbl; |
4590 v41 = GetLevelFogColor(); | 4590 v41 = GetLevelFogColor(); |
7413 d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u; | 7413 d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u; |
7414 d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v; | 7414 d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v; |
7415 } | 7415 } |
7416 | 7416 |
7417 this->pRenderD3D->pDevice->SetTexture(0, a5); | 7417 this->pRenderD3D->pDevice->SetTexture(0, a5); |
7418 this->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, d3d_vertex_buffer, uNumVertices, 16); | 7418 this->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, d3d_vertex_buffer.data(), uNumVertices, 16); |
7419 if (transparent) | 7419 if (transparent) |
7420 { | 7420 { |
7421 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE)); | 7421 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE)); |
7422 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); | 7422 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
7423 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO)); | 7423 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO)); |
7451 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE)); | 7451 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE)); |
7452 | 7452 |
7453 ErrD3D(pRenderD3D->pDevice->SetTexture(0, 0)); | 7453 ErrD3D(pRenderD3D->pDevice->SetTexture(0, 0)); |
7454 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7454 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7455 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7455 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7456 d3d_vertex_buffer, | 7456 d3d_vertex_buffer.data(), |
7457 uNumVertices, | 7457 uNumVertices, |
7458 16)); | 7458 16)); |
7459 //v63 = (const char *)v7->pRenderD3D->pDevice; | 7459 //v63 = (const char *)v7->pRenderD3D->pDevice; |
7460 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); | 7460 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); |
7461 //(*(void (**)(void))(*(int *)v63 + 88))(); | 7461 //(*(void (**)(void))(*(int *)v63 + 88))(); |
7473 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); | 7473 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); |
7474 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); | 7474 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); |
7475 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); | 7475 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); |
7476 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7476 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7477 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7477 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7478 d3d_vertex_buffer, | 7478 d3d_vertex_buffer.data(), |
7479 uNumVertices, | 7479 uNumVertices, |
7480 16)); | 7480 16)); |
7481 if ( pRenderer->bUsingSpecular ) | 7481 if ( pRenderer->bUsingSpecular ) |
7482 { | 7482 { |
7483 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE)); | 7483 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE)); |
7491 ErrD3D(pRenderD3D->pDevice->SetTexture(0, 0));//problem | 7491 ErrD3D(pRenderD3D->pDevice->SetTexture(0, 0));//problem |
7492 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_INVSRCALPHA)); | 7492 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_INVSRCALPHA)); |
7493 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCALPHA)); | 7493 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCALPHA)); |
7494 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7494 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7495 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7495 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7496 d3d_vertex_buffer, | 7496 d3d_vertex_buffer.data(), |
7497 uNumVertices, | 7497 uNumVertices, |
7498 16)); | 7498 16)); |
7499 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, TRUE)); | 7499 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, TRUE)); |
7500 //v44 = pRenderer->pRenderD3D->pDevice; | 7500 //v44 = pRenderer->pRenderD3D->pDevice; |
7501 v45 = GetLevelFogColor(); | 7501 v45 = GetLevelFogColor(); |
7508 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, v8)); | 7508 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, v8)); |
7509 } | 7509 } |
7510 } | 7510 } |
7511 | 7511 |
7512 if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES) | 7512 if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES) |
7513 pGame->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0); | 7513 pGame->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer.data(), uNumVertices, 0x00FFFFFF, 0.0); |
7514 } | 7514 } |
7515 // 4A26BC: could not find valid save-restore pair for esi | 7515 // 4A26BC: could not find valid save-restore pair for esi |
7516 // 4D864C: using guessed type char byte_4D864C; | 7516 // 4D864C: using guessed type char byte_4D864C; |
7517 | 7517 |
7518 //----- (004A2DA3) -------------------------------------------------------- | 7518 //----- (004A2DA3) -------------------------------------------------------- |
7592 } | 7592 } |
7593 | 7593 |
7594 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex)); | 7594 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex)); |
7595 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7595 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7596 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7596 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7597 d3d_vertex_buffer, | 7597 d3d_vertex_buffer.data(), |
7598 a2, | 7598 a2, |
7599 28)); | 7599 28)); |
7600 } | 7600 } |
7601 } | 7601 } |
7602 } | 7602 } |
7680 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); | 7680 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); |
7681 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); | 7681 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); |
7682 ErrD3D(pRenderD3D->pDevice->DrawPrimitive( | 7682 ErrD3D(pRenderD3D->pDevice->DrawPrimitive( |
7683 D3DPT_TRIANGLEFAN, | 7683 D3DPT_TRIANGLEFAN, |
7684 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7684 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7685 d3d_vertex_buffer, | 7685 d3d_vertex_buffer.data(), |
7686 uNumVertices, | 7686 uNumVertices, |
7687 28)); | 7687 28)); |
7688 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0); | 7688 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0); |
7689 } | 7689 } |
7690 else | 7690 else |
7706 | 7706 |
7707 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); | 7707 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); |
7708 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex)); | 7708 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex)); |
7709 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7709 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7710 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7710 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7711 d3d_vertex_buffer, | 7711 d3d_vertex_buffer.data(), |
7712 uNumVertices, | 7712 uNumVertices, |
7713 28)); | 7713 28)); |
7714 } | 7714 } |
7715 else | 7715 else |
7716 { | 7716 { |
7758 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, false)); | 7758 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, false)); |
7759 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); | 7759 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); |
7760 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); | 7760 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); |
7761 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7761 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7762 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7762 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7763 d3d_vertex_buffer, | 7763 d3d_vertex_buffer.data(), |
7764 uNumVertices, | 7764 uNumVertices, |
7765 28)); | 7765 28)); |
7766 | 7766 |
7767 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); | 7767 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); |
7768 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0); | 7768 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0); |
7787 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); | 7787 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); |
7788 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); | 7788 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); |
7789 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); | 7789 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_SRCCOLOR)); |
7790 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, | 7790 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
7791 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | 7791 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, |
7792 d3d_vertex_buffer, | 7792 d3d_vertex_buffer.data(), |
7793 uNumVertices, | 7793 uNumVertices, |
7794 28)); | 7794 28)); |
7795 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); | 7795 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
7796 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO)); | 7796 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO)); |
7797 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE)); | 7797 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE)); |