comparison Vis.cpp @ 1172:d5dae0b4b98a

Слияние
author Ritor1
date Fri, 24 May 2013 10:53:46 +0600
parents 28ee6610a3d2 0e0f1192aa57
children 0158f383b492
comparison
equal deleted inserted replaced
1171:28ee6610a3d2 1172:d5dae0b4b98a
320 pFaceID = pBspRenderer->faces[v5].uFaceID; 320 pFaceID = pBspRenderer->faces[v5].uFaceID;
321 if ( pFaceID >= 0 ) 321 if ( pFaceID >= 0 )
322 { 322 {
323 if ( pFaceID < (signed int)pIndoor->uNumFaces ) 323 if ( pFaceID < (signed int)pIndoor->uNumFaces )
324 { 324 {
325 if ( is_part_of_selection(&pIndoor->pFaces[pFaceID], filter) ) 325 auto face = pIndoor->pFaces + pFaceID;
326 if ( is_part_of_selection(face, filter) )
326 { 327 {
327 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) ) 328 if ( !pGame->pIndoorCameraD3D->IsCulled(face) )
328 { 329 {
329 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) ) 330 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, face, 0xFFFFFFFFu) )
330 { 331 {
331 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1); 332 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1);
332 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x); 333 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x);
333 LOWORD(v9) = 0; 334 LOWORD(v9) = 0;
334 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9); 335 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9);
343 v12->sZValue = 2; 344 v12->sZValue = 2;
344 ++*pNumPointers; 345 ++*pNumPointers;
345 } 346 }
346 } 347 }
347 } 348 }
349
350 if (face->uAttributes & FACE_PICKED)
351 face->uAttributes |= FACE_OUTLINED;
352 else
353 face->uAttributes &= ~FACE_OUTLINED;
354 face->uAttributes &= ~FACE_PICKED;
348 } 355 }
349 } 356 }
350 v5 = v17 + 1; 357 v5 = v17 + 1;
351 } 358 }
352 } 359 }
383 v13 += PID(OBJECT_BModel, j | (i << 6)); 390 v13 += PID(OBJECT_BModel, j | (i << 6));
384 391
385 list->AddObject(face, VisObjectType_Face, v13); 392 list->AddObject(face, VisObjectType_Face, v13);
386 } 393 }
387 394
388 if (blv_face.uAttributes & 0x80000000) 395 if (blv_face.uAttributes & FACE_PICKED)
389 face->uAttributes |= FACE_OUTLINED; 396 face->uAttributes |= FACE_OUTLINED;
390 else 397 else
391 face->uAttributes &= ~FACE_OUTLINED; 398 face->uAttributes &= ~FACE_OUTLINED;
399 blv_face.uAttributes &= ~FACE_PICKED;
392 } 400 }
393 } 401 }
394 } 402 }
395 } 403 }
396 404
608 if (IntersectPoint.x < pFace->pBounding.x1 || IntersectPoint.x > pFace->pBounding.x2 || 616 if (IntersectPoint.x < pFace->pBounding.x1 || IntersectPoint.x > pFace->pBounding.x2 ||
609 IntersectPoint.y < pFace->pBounding.y1 || IntersectPoint.y > pFace->pBounding.y2 || 617 IntersectPoint.y < pFace->pBounding.y1 || IntersectPoint.y > pFace->pBounding.y2 ||
610 IntersectPoint.z < pFace->pBounding.z1 || IntersectPoint.z > pFace->pBounding.z2 ) 618 IntersectPoint.z < pFace->pBounding.z1 || IntersectPoint.z > pFace->pBounding.z2 )
611 return false; 619 return false;
612 620
613 pFace->uAttributes |= 0x80000000;
614
615 if (uModelID != -1) 621 if (uModelID != -1)
616 ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b, 622 ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
617 &IntersectPoint, pFace, uModelID); 623 &IntersectPoint, pFace, uModelID);
618 else 624 else
619 BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b, 625 BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
654 v6 = intersect_face_vertex_coords_list_b[i + 1] >= b; 660 v6 = intersect_face_vertex_coords_list_b[i + 1] >= b;
655 } 661 }
656 662
657 if ( v16 != 1 ) 663 if ( v16 != 1 )
658 return false; 664 return false;
665
666 pFace->uAttributes |= FACE_PICKED;
659 return true; 667 return true;
660 /* 668 /*
661 int v5; // esi@10 669 int v5; // esi@10
662 bool v6; // edi@10 670 bool v6; // edi@10
663 signed int v10; // ebx@14 671 signed int v10; // ebx@14
1252 memcpy((void *)v16, &v11, sizeof(0x30)); 1260 memcpy((void *)v16, &v11, sizeof(0x30));
1253 SortByScreenSpaceY(v5, sLeft, v6 - 1); 1261 SortByScreenSpaceY(v5, sLeft, v6 - 1);
1254 SortByScreenSpaceY(pArray, v6 + 1, sRight); 1262 SortByScreenSpaceY(pArray, v6 + 1, sRight);
1255 return true; 1263 return true;
1256 } 1264 }
1257
1258 1265
1259 //----- (004C04AF) -------------------------------------------------------- 1266 //----- (004C04AF) --------------------------------------------------------
1260 Vis::Vis() 1267 Vis::Vis()
1261 { 1268 {
1262 RenderVertexSoft v3; // [sp+Ch] [bp-60h]@1 1269 RenderVertexSoft v3; // [sp+Ch] [bp-60h]@1