Mercurial > mm7
comparison Indoor.cpp @ 806:e95389c8680a
Слияние
author | Ritor1 |
---|---|
date | Mon, 25 Mar 2013 17:29:59 +0600 |
parents | 305ba6e71c71 472ca68386d4 |
children | 08d90b633131 |
comparison
equal
deleted
inserted
replaced
805:305ba6e71c71 | 806:e95389c8680a |
---|---|
269 | 269 |
270 //----- (00440B44) -------------------------------------------------------- | 270 //----- (00440B44) -------------------------------------------------------- |
271 void IndoorLocation::ExecDraw(bool bD3D) | 271 void IndoorLocation::ExecDraw(bool bD3D) |
272 { | 272 { |
273 int v2; // eax@3 | 273 int v2; // eax@3 |
274 IndoorCameraD3D_Vec4 *v3; // edx@4 | 274 //IndoorCameraD3D_Vec4 *v3; // edx@4 |
275 unsigned int v5; // ecx@9 | 275 //unsigned int v5; // ecx@9 |
276 RenderVertexSoft *v6; // [sp-4h] [bp-8h]@4 | 276 //RenderVertexSoft *v6; // [sp-4h] [bp-8h]@4 |
277 | 277 |
278 if (bD3D) | 278 if (bD3D) |
279 { | 279 { |
280 pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | 280 pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
281 for (uint i = 0; i < pBspRenderer->num_faces; ++i) | 281 for (uint i = 0; i < pBspRenderer->num_faces; ++i) |
282 { | 282 { |
283 v2 = pBspRenderer->faces[i].uNodeID; | 283 v2 = pBspRenderer->faces[i].uNodeID; |
284 if ( pBspRenderer->nodes[v2].std__vector_0007A8 == -1 ) | 284 if (pBspRenderer->nodes[v2].viewing_portal_id == -1) |
285 { | 285 IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, nullptr, 4, nullptr); |
286 v6 = 0; | |
287 v3 = 0; | |
288 } | |
289 else | 286 else |
290 { | 287 IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, pBspRenderer->nodes[v2].std__vector_0007AC, 4, pBspRenderer->nodes[v2].pPortalBounding); |
291 v3 = pBspRenderer->nodes[v2].std__vector_0007AC; | |
292 v6 = pBspRenderer->nodes[v2].pPortalBounding; | |
293 } | |
294 IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, v3, 4, v6); | |
295 } | 288 } |
296 } | 289 } |
297 else | 290 else for (uint j = 0; j < pBspRenderer->num_faces; ++j ) |
298 { | 291 { |
299 for (uint j = 0; j < pBspRenderer->num_faces; ++j ) | 292 pBLVRenderParams->field_7C = &pBspRenderer->nodes[pBspRenderer->faces[j].uNodeID].field_C; |
300 { | 293 IndoorLocation::ExecDraw_sw(pBspRenderer->faces[j].uFaceID); |
301 v5 = pBspRenderer->faces[j].uFaceID; | |
302 pBLVRenderParams->field_7C = &pBspRenderer->nodes[pBspRenderer->faces[j].uNodeID].field_C; | |
303 IndoorLocation::ExecDraw_sw(v5); | |
304 } | |
305 } | 294 } |
306 } | 295 } |
307 | 296 |
308 //----- (00440BED) -------------------------------------------------------- | 297 //----- (00440BED) -------------------------------------------------------- |
309 void __fastcall sub_440BED(IndoorLocation_drawstru *_this) | 298 void __fastcall sub_440BED(IndoorLocation_drawstru *_this) |
515 } | 504 } |
516 | 505 |
517 if (!pVertices || | 506 if (!pVertices || |
518 (pGame->pStru9Instance->_498377(pPortalBounding, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) ) | 507 (pGame->pStru9Instance->_498377(pPortalBounding, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) ) |
519 { | 508 { |
520 if (pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum(static_vertices_F7C228, &uNumVerticesa, | 509 if (pGame->pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa, |
521 static_vertices_F7B628, pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa ) | 510 static_vertices_F7B628, pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa ) |
522 { | 511 { |
523 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel); | 512 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel); |
524 v17 = (248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | (((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | ((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) << 8)) << 8); | 513 v17 = (248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | (((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | ((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) << 8)) << 8); |
525 sub_4B0E07(uFaceID); | 514 sub_4B0E07(uFaceID); |
1282 //int v25; // eax@47 | 1271 //int v25; // eax@47 |
1283 //Vec3_short_ *v26; // eax@47 | 1272 //Vec3_short_ *v26; // eax@47 |
1284 //double v27; // st7@47 | 1273 //double v27; // st7@47 |
1285 //signed int v28; // ST28_4@47 | 1274 //signed int v28; // ST28_4@47 |
1286 char v29; // al@48 | 1275 char v29; // al@48 |
1287 signed int v30; // eax@51 | 1276 //signed int v30; // eax@51 |
1288 //int v31; // eax@52 | 1277 //int v31; // eax@52 |
1289 //unsigned int v32; // eax@55 | 1278 //unsigned int v32; // eax@55 |
1290 //__int16 v33; // cx@56 | 1279 //__int16 v33; // cx@56 |
1291 //signed int v34; // [sp+Ch] [bp-14h]@18 | 1280 //signed int v34; // [sp+Ch] [bp-14h]@18 |
1292 //int a0; // [sp+14h] [bp-Ch]@2 | 1281 //int a0; // [sp+14h] [bp-Ch]@2 |
1296 //BLVFace *v39; // [sp+1Ch] [bp-4h]@1 | 1285 //BLVFace *v39; // [sp+1Ch] [bp-4h]@1 |
1297 | 1286 |
1298 //v3 = uFaceID; | 1287 //v3 = uFaceID; |
1299 //v4 = this; | 1288 //v4 = this; |
1300 //v5 = &pIndoor->pFaces[uFaceID]; | 1289 //v5 = &pIndoor->pFaces[uFaceID]; |
1301 nodes[num_nodes].std__vector_0007A8 = -1; | 1290 nodes[num_nodes].viewing_portal_id = -1; |
1302 //v39 = &pIndoor->pFaces[uFaceID]; | 1291 //v39 = &pIndoor->pFaces[uFaceID]; |
1303 | 1292 |
1304 auto pFace = &pIndoor->pFaces[uFaceID]; | 1293 auto pFace = &pIndoor->pFaces[uFaceID]; |
1305 | 1294 |
1306 if (!pFace->Portal()) | 1295 if (!pFace->Portal()) |
1429 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ; | 1418 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ; |
1430 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY; | 1419 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY; |
1431 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW; | 1420 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW; |
1432 //v38 = pGame->pStru10Instance; | 1421 //v38 = pGame->pStru10Instance; |
1433 //a0a = pGame->pIndoorCameraD3D; | 1422 //a0a = pGame->pIndoorCameraD3D; |
1434 if (p->std__vector_0007A8 == -1 ) | 1423 v29 = false; |
1424 if (p->viewing_portal_id == -1) | |
1435 { | 1425 { |
1436 v29 = pGame->pStru10Instance->MessWithPortal(pFace, nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding); | 1426 v29 = pGame->pStru10Instance->CalcPortalShape(pFace, nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding); |
1437 } | 1427 } |
1438 else | 1428 else |
1439 { | 1429 { |
1440 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F7AA08[64]; | 1430 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F7AA08[64]; |
1441 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F79E08[64]; | 1431 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F79E08[64]; |
1442 | 1432 |
1443 //v23 = 0; | |
1444 unsigned int a2 = pFace->uNumVertices; | |
1445 for (uint k = 0; k < pFace->uNumVertices; ++k) | 1433 for (uint k = 0; k < pFace->uNumVertices; ++k) |
1446 { | 1434 { |
1447 //v24 = (char *)&static_subAddFaceToRenderList_d3d_stru_F7AA08[0].vWorldPosition.z; | 1435 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pIndoor->pVertices[pFace->pVertexIDs[k]].x; |
1448 //do | 1436 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[k]].y; |
1449 //{ | 1437 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[k]].z; |
1450 //v25 = pFace->pVertexIDs[k]; | |
1451 //v26 = &pIndoor->pVertices[pFace->pVertexIDs[k]]; | |
1452 auto pVertex = &pIndoor->pVertices[pFace->pVertexIDs[k]]; | |
1453 //v27 = (double)v26->z; | |
1454 //v28 = v26->y; | |
1455 //v17 = v39; | |
1456 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pVertex->x; | |
1457 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pVertex->y; | |
1458 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pVertex->z; | |
1459 //v24 += 48; | |
1460 //} | |
1461 //while ( v23 < a2 ); | |
1462 } | 1438 } |
1463 pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum( | 1439 |
1464 static_subAddFaceToRenderList_d3d_stru_F7AA08, | 1440 |
1465 &a2, | 1441 unsigned int a2 = pFace->uNumVertices; |
1466 static_subAddFaceToRenderList_d3d_stru_F79E08, | 1442 pGame->pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08, |
1467 p->std__vector_0007AC, | 1443 &a2, |
1468 4, | 1444 static_subAddFaceToRenderList_d3d_stru_F79E08, |
1469 0, | 1445 p->std__vector_0007AC, 4, 0, 0); |
1470 0); | 1446 |
1471 v29 = pGame->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, (int *)&a2, | 1447 v29 = pGame->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, &a2, |
1472 nodes[num_nodes].std__vector_0007AC, | 1448 nodes[num_nodes].std__vector_0007AC, |
1473 nodes[num_nodes].pPortalBounding); | 1449 nodes[num_nodes].pPortalBounding); |
1474 } | 1450 } |
1475 if ( v29 ) | 1451 if ( v29 ) |
1476 { | 1452 { |
1477 nodes[num_nodes].std__vector_0007A8 = uFaceID; | 1453 assert(num_nodes < 150); |
1478 v30 = num_nodes; | 1454 |
1479 if ( v30 < 150 ) | 1455 nodes[num_nodes].viewing_portal_id = uFaceID; |
1480 { | 1456 AddBspNodeToRenderList(++num_nodes - 1); |
1481 //v31 = v30 + 1; | |
1482 num_nodes = v30 + 1; | |
1483 AddBspNodeToRenderList(v30); | |
1484 } | |
1485 } | 1457 } |
1486 if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES) | 1458 if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES) |
1487 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); | 1459 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); |
1488 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace); | 1460 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace); |
1489 } | 1461 } |