comparison Vis.cpp @ 1053:1c10b24a4159

BLV picky-blicky
author Nomad
date Thu, 23 May 2013 19:03:36 +0200
parents 05c62d166182
children 0e0f1192aa57
comparison
equal deleted inserted replaced
1052:d48c762de563 1053:1c10b24a4159
321 pFaceID = pBspRenderer->faces[v5].uFaceID; 321 pFaceID = pBspRenderer->faces[v5].uFaceID;
322 if ( pFaceID >= 0 ) 322 if ( pFaceID >= 0 )
323 { 323 {
324 if ( pFaceID < (signed int)pIndoor->uNumFaces ) 324 if ( pFaceID < (signed int)pIndoor->uNumFaces )
325 { 325 {
326 if ( is_part_of_selection(&pIndoor->pFaces[pFaceID], filter) ) 326 auto face = pIndoor->pFaces + pFaceID;
327 if ( is_part_of_selection(face, filter) )
327 { 328 {
328 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) ) 329 if ( !pGame->pIndoorCameraD3D->IsCulled(face) )
329 { 330 {
330 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) ) 331 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, face, 0xFFFFFFFFu) )
331 { 332 {
332 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1); 333 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1);
333 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x); 334 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x);
334 LOWORD(v9) = 0; 335 LOWORD(v9) = 0;
335 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9); 336 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9);
344 v12->sZValue = 2; 345 v12->sZValue = 2;
345 ++*pNumPointers; 346 ++*pNumPointers;
346 } 347 }
347 } 348 }
348 } 349 }
350
351 if (face->uAttributes & FACE_PICKED)
352 face->uAttributes |= FACE_OUTLINED;
353 else
354 face->uAttributes &= ~FACE_OUTLINED;
355 face->uAttributes &= ~FACE_PICKED;
349 } 356 }
350 } 357 }
351 v5 = v17 + 1; 358 v5 = v17 + 1;
352 } 359 }
353 } 360 }
386 v13 += PID(OBJECT_BModel, j | (i << 6)); 393 v13 += PID(OBJECT_BModel, j | (i << 6));
387 394
388 list->AddObject(face, VisObjectType_Face, v13); 395 list->AddObject(face, VisObjectType_Face, v13);
389 } 396 }
390 397
391 if (blv_face.uAttributes & 0x80000000) 398 if (blv_face.uAttributes & FACE_PICKED)
392 face->uAttributes |= FACE_OUTLINED; 399 face->uAttributes |= FACE_OUTLINED;
393 else 400 else
394 face->uAttributes &= ~FACE_OUTLINED; 401 face->uAttributes &= ~FACE_OUTLINED;
402 blv_face.uAttributes &= ~FACE_PICKED;
395 } 403 }
396 } 404 }
397 } 405 }
398 } 406 }
399 407
611 if (IntersectPoint.x < pFace->pBounding.x1 || IntersectPoint.x > pFace->pBounding.x2 || 619 if (IntersectPoint.x < pFace->pBounding.x1 || IntersectPoint.x > pFace->pBounding.x2 ||
612 IntersectPoint.y < pFace->pBounding.y1 || IntersectPoint.y > pFace->pBounding.y2 || 620 IntersectPoint.y < pFace->pBounding.y1 || IntersectPoint.y > pFace->pBounding.y2 ||
613 IntersectPoint.z < pFace->pBounding.z1 || IntersectPoint.z > pFace->pBounding.z2 ) 621 IntersectPoint.z < pFace->pBounding.z1 || IntersectPoint.z > pFace->pBounding.z2 )
614 return false; 622 return false;
615 623
616 pFace->uAttributes |= 0x80000000;
617
618 if (uModelID != -1) 624 if (uModelID != -1)
619 ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b, 625 ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
620 &IntersectPoint, pFace, uModelID); 626 &IntersectPoint, pFace, uModelID);
621 else 627 else
622 BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b, 628 BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
657 v6 = intersect_face_vertex_coords_list_b[i + 1] >= b; 663 v6 = intersect_face_vertex_coords_list_b[i + 1] >= b;
658 } 664 }
659 665
660 if ( v16 != 1 ) 666 if ( v16 != 1 )
661 return false; 667 return false;
668
669 pFace->uAttributes |= FACE_PICKED;
662 return true; 670 return true;
663 /* 671 /*
664 int v5; // esi@10 672 int v5; // esi@10
665 bool v6; // edi@10 673 bool v6; // edi@10
666 signed int v10; // ebx@14 674 signed int v10; // ebx@14