Mercurial > might-and-magic-trilogy
comparison mm7_3.cpp @ 116:918dca162239
stru170 -> BspRenderer
author | Nomad |
---|---|
date | Thu, 08 Nov 2012 04:57:39 +0200 |
parents | 8e802a11b20d |
children | a2715ce5cf17 6c67511e2f71 |
comparison
equal
deleted
inserted
replaced
115:75faebd0a975 | 116:918dca162239 |
---|---|
12878 } | 12878 } |
12879 | 12879 |
12880 | 12880 |
12881 | 12881 |
12882 //----- (0043F953) -------------------------------------------------------- | 12882 //----- (0043F953) -------------------------------------------------------- |
12883 void PrepareWallsRenderList_BLV() | 12883 void PrepareBspRenderList_BLV() |
12884 { | 12884 { |
12885 pStru170->uNumFaceIDs = 0; | 12885 pBspRenderer->uNumFaceIDs = 0; |
12886 if ( pBLVRenderParams->uPartySectorID ) | 12886 |
12887 { | 12887 if (pBLVRenderParams->uPartySectorID) |
12888 pStru170->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID; | 12888 { |
12889 pStru170->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW; | 12889 pBspRenderer->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID; |
12890 pStru170->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ; | 12890 pBspRenderer->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW; |
12891 pStru170->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY; | 12891 pBspRenderer->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ; |
12892 pStru170->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX; | 12892 pBspRenderer->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY; |
12893 pStru170->field_FA8[0].field_C._43F9E1( | 12893 pBspRenderer->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX; |
12894 pBspRenderer->field_FA8[0].field_C._43F9E1( | |
12894 pBLVRenderParams->uViewportX, | 12895 pBLVRenderParams->uViewportX, |
12895 pBLVRenderParams->uViewportY, | 12896 pBLVRenderParams->uViewportY, |
12896 pBLVRenderParams->uViewportZ, | 12897 pBLVRenderParams->uViewportZ, |
12897 pBLVRenderParams->uViewportW); | 12898 pBLVRenderParams->uViewportW); |
12898 pStru170->field_FA8[0].uFaceID = -1; | 12899 pBspRenderer->field_FA8[0].uFaceID = -1; |
12899 pStru170->field_FA8[0].std__vector_0007A8 = -1; | 12900 pBspRenderer->field_FA8[0].std__vector_0007A8 = -1; |
12900 pStru170->std__vector_000FA8 = 1; | 12901 pBspRenderer->std__vector_000FA8 = 1; |
12901 sub_440639(0); | 12902 sub_440639(0); |
12902 } | 12903 } |
12903 pStru170->MakeVisibleSectorList(); | 12904 |
12905 pBspRenderer->MakeVisibleSectorList(); | |
12904 } | 12906 } |
12905 | 12907 |
12906 //----- (0043F9E1) -------------------------------------------------------- | 12908 //----- (0043F9E1) -------------------------------------------------------- |
12907 void stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w) | 12909 void BspRenderer_stru2::_43F9E1(__int16 x, int y, __int16 z, int w) |
12908 { | 12910 { |
12909 _viewport_space_y = y; | 12911 _viewport_space_y = y; |
12910 _viewport_space_w = w; | 12912 _viewport_space_w = w; |
12911 | 12913 |
12912 for (uint i = 0; i < 480; ++i) | 12914 for (uint i = 0; i < 480; ++i) |
13255 signed int v2; // edi@1 | 13257 signed int v2; // edi@1 |
13256 BLVSector *v3; // esi@1 | 13258 BLVSector *v3; // esi@1 |
13257 | 13259 |
13258 v1 = a1; | 13260 v1 = a1; |
13259 v2 = 0; | 13261 v2 = 0; |
13260 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID]; | 13262 v3 = &pIndoor->pSectors[pBspRenderer->field_FA8[a1].uSectorID]; |
13261 if ( pRenderer->pRenderD3D ) | 13263 if ( pRenderer->pRenderD3D ) |
13262 { | 13264 { |
13263 if ( v3->uNumNonBSPFaces > 0 ) | 13265 if ( v3->uNumNonBSPFaces > 0 ) |
13264 { | 13266 { |
13265 do | 13267 do |
13266 { | 13268 { |
13267 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); | 13269 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); |
13268 pStru170->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]); | 13270 pBspRenderer->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]); |
13269 } | 13271 } |
13270 while ( v2 < v3->uNumNonBSPFaces ); | 13272 while ( v2 < v3->uNumNonBSPFaces ); |
13271 } | 13273 } |
13272 } | 13274 } |
13273 else | 13275 else |
13274 { | 13276 { |
13275 if ( v3->uNumNonBSPFaces > 0 ) | 13277 if ( v3->uNumNonBSPFaces > 0 ) |
13276 { | 13278 { |
13277 do | 13279 do |
13278 pStru170->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]); | 13280 pBspRenderer->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]); |
13279 while ( v2 < v3->uNumNonBSPFaces ); | 13281 while ( v2 < v3->uNumNonBSPFaces ); |
13280 } | 13282 } |
13281 } | 13283 } |
13282 if ( v3->field_0 & 0x10 ) | 13284 if ( v3->field_0 & 0x10 ) |
13283 sub_4406BC(v1, v3->uFirstBSPNode); | 13285 sub_4406BC(v1, v3->uFirstBSPNode); |
13294 int v7; // ebp@10 | 13296 int v7; // ebp@10 |
13295 int v8; // ebx@10 | 13297 int v8; // ebx@10 |
13296 __int16 v9; // di@18 | 13298 __int16 v9; // di@18 |
13297 int v10; // [sp+10h] [bp-Ch]@1 | 13299 int v10; // [sp+10h] [bp-Ch]@1 |
13298 bool v11; // [sp+14h] [bp-8h]@5 | 13300 bool v11; // [sp+14h] [bp-8h]@5 |
13299 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1 | 13301 BspRenderer_stru0 *v12; // [sp+18h] [bp-4h]@1 |
13300 | 13302 |
13301 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode); | 13303 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode); |
13302 | 13304 |
13303 v10 = a1; | 13305 v10 = a1; |
13304 v12 = &pStru170->field_FA8[a1]; | 13306 v12 = &pBspRenderer->field_FA8[a1]; |
13305 while ( 1 ) | 13307 while ( 1 ) |
13306 { | 13308 { |
13307 v2 = &pIndoor->pSectors[v12->uSectorID]; | 13309 v2 = &pIndoor->pSectors[v12->uSectorID]; |
13308 v3 = &pIndoor->pNodes[uFirstNode]; | 13310 v3 = &pIndoor->pNodes[uFirstNode]; |
13309 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]]; | 13311 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]]; |
13326 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]); | 13328 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]); |
13327 | 13329 |
13328 if ( pRenderer->pRenderD3D ) | 13330 if ( pRenderer->pRenderD3D ) |
13329 { | 13331 { |
13330 while ( v7 < v8 ) | 13332 while ( v7 < v8 ) |
13331 pStru170->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]); | 13333 pBspRenderer->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]); |
13332 } | 13334 } |
13333 else | 13335 else |
13334 { | 13336 { |
13335 while ( v7 < v8 ) | 13337 while ( v7 < v8 ) |
13336 pStru170->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]); | 13338 pBspRenderer->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]); |
13337 } | 13339 } |
13338 v9 = v11 ? v3->uFront : v3->uBack; | 13340 v9 = v11 ? v3->uFront : v3->uBack; |
13339 if ( v9 == -1 ) | 13341 if ( v9 == -1 ) |
13340 break; | 13342 break; |
13341 uFirstNode = v9; | 13343 uFirstNode = v9; |