comparison Indoor.cpp @ 795:472ca68386d4

more stru10 & stru9
author Nomad
date Mon, 25 Mar 2013 14:23:40 +0200
parents 4a00901e063c
children e95389c8680a
comparison
equal deleted inserted replaced
794:4a00901e063c 795:472ca68386d4
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);
1271 //int v25; // eax@47 1260 //int v25; // eax@47
1272 //Vec3_short_ *v26; // eax@47 1261 //Vec3_short_ *v26; // eax@47
1273 //double v27; // st7@47 1262 //double v27; // st7@47
1274 //signed int v28; // ST28_4@47 1263 //signed int v28; // ST28_4@47
1275 char v29; // al@48 1264 char v29; // al@48
1276 signed int v30; // eax@51 1265 //signed int v30; // eax@51
1277 //int v31; // eax@52 1266 //int v31; // eax@52
1278 //unsigned int v32; // eax@55 1267 //unsigned int v32; // eax@55
1279 //__int16 v33; // cx@56 1268 //__int16 v33; // cx@56
1280 //signed int v34; // [sp+Ch] [bp-14h]@18 1269 //signed int v34; // [sp+Ch] [bp-14h]@18
1281 //int a0; // [sp+14h] [bp-Ch]@2 1270 //int a0; // [sp+14h] [bp-Ch]@2
1285 //BLVFace *v39; // [sp+1Ch] [bp-4h]@1 1274 //BLVFace *v39; // [sp+1Ch] [bp-4h]@1
1286 1275
1287 //v3 = uFaceID; 1276 //v3 = uFaceID;
1288 //v4 = this; 1277 //v4 = this;
1289 //v5 = &pIndoor->pFaces[uFaceID]; 1278 //v5 = &pIndoor->pFaces[uFaceID];
1290 nodes[num_nodes].std__vector_0007A8 = -1; 1279 nodes[num_nodes].viewing_portal_id = -1;
1291 //v39 = &pIndoor->pFaces[uFaceID]; 1280 //v39 = &pIndoor->pFaces[uFaceID];
1292 1281
1293 auto pFace = &pIndoor->pFaces[uFaceID]; 1282 auto pFace = &pIndoor->pFaces[uFaceID];
1294 1283
1295 if (!pFace->Portal()) 1284 if (!pFace->Portal())
1418 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ; 1407 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ;
1419 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY; 1408 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY;
1420 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW; 1409 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW;
1421 //v38 = pGame->pStru10Instance; 1410 //v38 = pGame->pStru10Instance;
1422 //a0a = pGame->pIndoorCameraD3D; 1411 //a0a = pGame->pIndoorCameraD3D;
1423 if (p->std__vector_0007A8 == -1 ) 1412 v29 = false;
1413 if (p->viewing_portal_id == -1)
1424 { 1414 {
1425 v29 = pGame->pStru10Instance->MessWithPortal(pFace, nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding); 1415 v29 = pGame->pStru10Instance->CalcPortalShape(pFace, nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding);
1426 } 1416 }
1427 else 1417 else
1428 { 1418 {
1429 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F7AA08[64]; 1419 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F7AA08[64];
1430 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F79E08[64]; 1420 static RenderVertexSoft static_subAddFaceToRenderList_d3d_stru_F79E08[64];
1431 1421
1432 //v23 = 0;
1433 unsigned int a2 = pFace->uNumVertices;
1434 for (uint k = 0; k < pFace->uNumVertices; ++k) 1422 for (uint k = 0; k < pFace->uNumVertices; ++k)
1435 { 1423 {
1436 //v24 = (char *)&static_subAddFaceToRenderList_d3d_stru_F7AA08[0].vWorldPosition.z; 1424 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pIndoor->pVertices[pFace->pVertexIDs[k]].x;
1437 //do 1425 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[k]].y;
1438 //{ 1426 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[k]].z;
1439 //v25 = pFace->pVertexIDs[k];
1440 //v26 = &pIndoor->pVertices[pFace->pVertexIDs[k]];
1441 auto pVertex = &pIndoor->pVertices[pFace->pVertexIDs[k]];
1442 //v27 = (double)v26->z;
1443 //v28 = v26->y;
1444 //v17 = v39;
1445 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.x = pVertex->x;
1446 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pVertex->y;
1447 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pVertex->z;
1448 //v24 += 48;
1449 //}
1450 //while ( v23 < a2 );
1451 } 1427 }
1452 pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum( 1428
1453 static_subAddFaceToRenderList_d3d_stru_F7AA08, 1429
1454 &a2, 1430 unsigned int a2 = pFace->uNumVertices;
1455 static_subAddFaceToRenderList_d3d_stru_F79E08, 1431 pGame->pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08,
1456 p->std__vector_0007AC, 1432 &a2,
1457 4, 1433 static_subAddFaceToRenderList_d3d_stru_F79E08,
1458 0, 1434 p->std__vector_0007AC, 4, 0, 0);
1459 0); 1435
1460 v29 = pGame->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, (int *)&a2, 1436 v29 = pGame->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, &a2,
1461 nodes[num_nodes].std__vector_0007AC, 1437 nodes[num_nodes].std__vector_0007AC,
1462 nodes[num_nodes].pPortalBounding); 1438 nodes[num_nodes].pPortalBounding);
1463 } 1439 }
1464 if ( v29 ) 1440 if ( v29 )
1465 { 1441 {
1466 nodes[num_nodes].std__vector_0007A8 = uFaceID; 1442 assert(num_nodes < 150);
1467 v30 = num_nodes; 1443
1468 if ( v30 < 150 ) 1444 nodes[num_nodes].viewing_portal_id = uFaceID;
1469 { 1445 AddBspNodeToRenderList(++num_nodes - 1);
1470 //v31 = v30 + 1;
1471 num_nodes = v30 + 1;
1472 AddBspNodeToRenderList(v30);
1473 }
1474 } 1446 }
1475 if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES) 1447 if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES)
1476 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); 1448 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF);
1477 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace); 1449 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace);
1478 } 1450 }