comparison Vis.cpp @ 1435:94e4c3ef9b8e

Слияние
author Ritor1
date Fri, 05 Jul 2013 21:16:12 +0600
parents 65d301bce717
children 613c77e51e38
comparison
equal deleted inserted replaced
1434:03d6ea33a8c9 1435:94e4c3ef9b8e
131 auto billboard = pRenderer->pBillboardRenderListD3D + i; 131 auto billboard = pRenderer->pBillboardRenderListD3D + i;
132 if (IsPointInsideD3DBillboard(billboard, x, y)) 132 if (IsPointInsideD3DBillboard(billboard, x, y))
133 { 133 {
134 if (v13 == -1) 134 if (v13 == -1)
135 v13 = i; 135 v13 = i;
136 else if ((unsigned int)pBillboardRenderList[billboard->uParentBillboardID].sZValue < pBillboardRenderList[pRenderer->pBillboardRenderListD3D[v13].uParentBillboardID].sZValue) 136 else if ((unsigned int)pBillboardRenderList[billboard->uParentBillboardID].sZValue <
137 pBillboardRenderList[pRenderer->pBillboardRenderListD3D[v13].uParentBillboardID].sZValue)
137 v13 = i; 138 v13 = i;
138 } 139 }
139 } 140 }
140 141
141 if ( v13 == -1 ) 142 if ( v13 == -1 )
419 420
420 static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8; 421 static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8;
421 422
422 v8.object_type = VisObjectType_Sprite; 423 v8.object_type = VisObjectType_Sprite;
423 v8.object_id = object_id; 424 v8.object_id = object_id;
424 v8.field_8 = a6; 425 v8.at_ai_state = a6;
425 v8.field_C = a5; 426 v8.no_at_ai_state = a5;
426 v8.field_10 = a4; 427 v8.select_flags = a4;
427 Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers = 0; 428 Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers = 0;
428 PickBillboards_Keyboard(pick_depth, &Vis_static_sub_4C1944_stru_F8BDE8, &v8); 429 PickBillboards_Keyboard(pick_depth, &Vis_static_sub_4C1944_stru_F8BDE8, &v8);
429 Vis_static_sub_4C1944_stru_F8BDE8.create_object_pointers(Vis_SelectionList::Unique); 430 Vis_static_sub_4C1944_stru_F8BDE8.create_object_pointers(Vis_SelectionList::Unique);
430 sort_object_pointers( 431 sort_object_pointers(
431 Vis_static_sub_4C1944_stru_F8BDE8.object_pointers, 432 Vis_static_sub_4C1944_stru_F8BDE8.object_pointers,
729 return result; 730 return result;
730 }*/ 731 }*/
731 } 732 }
732 733
733 //----- (004C1EE5) -------------------------------------------------------- 734 //----- (004C1EE5) --------------------------------------------------------
734 void Vis::BLV_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a, __int16 *intersect_face_vertex_coords_list_b, Vec3_short_ *IntersectPoint, BLVFace *pFace) 735 void Vis::BLV_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a,
736 __int16 *intersect_face_vertex_coords_list_b,
737 Vec3_short_ *IntersectPoint, BLVFace *pFace)
735 { 738 {
736 if (pFace->uAttributes & FACE_XY_PLANE) 739 if (pFace->uAttributes & FACE_XY_PLANE)
737 { 740 {
738 *a = IntersectPoint->x; 741 *a = IntersectPoint->x;
739 *b = IntersectPoint->y; 742 *b = IntersectPoint->y;
777 } 780 }
778 else assert(false); 781 else assert(false);
779 } 782 }
780 783
781 //----- (004C2186) -------------------------------------------------------- 784 //----- (004C2186) --------------------------------------------------------
782 void Vis::ODM_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a, __int16 *intersect_face_vertex_coords_list_b, Vec3_short_ *IntersectPoint, BLVFace *pFace, unsigned int uModelID) 785 void Vis::ODM_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a,
786 __int16 *intersect_face_vertex_coords_list_b,
787 Vec3_short_ *IntersectPoint, BLVFace *pFace, unsigned int uModelID)
783 { 788 {
784 if (pFace->uAttributes & FACE_XY_PLANE) 789 if (pFace->uAttributes & FACE_XY_PLANE)
785 { 790 {
786 *a = IntersectPoint->x; 791 *a = IntersectPoint->x;
787 *b = IntersectPoint->y; 792 *b = IntersectPoint->y;
892 v11[1].flt_2C = 0.0; 897 v11[1].flt_2C = 0.0;
893 v11[1].vWorldPosition.x = (double)pIndoorCamera->pos.x; 898 v11[1].vWorldPosition.x = (double)pIndoorCamera->pos.x;
894 v11[1].vWorldPosition.y = (double)pIndoorCamera->pos.y; 899 v11[1].vWorldPosition.y = (double)pIndoorCamera->pos.y;
895 v11[1].vWorldPosition.z = (double)pIndoorCamera->pos.z; 900 v11[1].vWorldPosition.z = (double)pIndoorCamera->pos.z;
896 901
897 memcpy(pRay, &v11[1], 0x30u); 902 memcpy(pRay, &v11[1], sizeof(RenderVertexSoft));
898 memcpy(&pRay[1], v11, sizeof(pRay[1])); 903 memcpy(&pRay[1], &v11[0], sizeof(RenderVertexSoft));
899 } 904 }
900 905
901 //----- (004C2551) -------------------------------------------------------- 906 //----- (004C2551) --------------------------------------------------------
902 Vis_ObjectInfo *Vis_SelectionList::SelectionPointers(int pVisObjectType, int pid) 907 Vis_ObjectInfo *Vis_SelectionList::SelectionPointers(int pVisObjectType, int pid)
903 { 908 {
913 { 918 {
914 if ( this->object_pool[i].object_type == pVisObjectType && (this->object_pool[i].sZValue & 0xFFFF) == pid ) 919 if ( this->object_pool[i].object_type == pVisObjectType && (this->object_pool[i].sZValue & 0xFFFF) == pid )
915 return &this->object_pool[i]; 920 return &this->object_pool[i];
916 } 921 }
917 } 922 }
918 return false; 923 return nullptr;
919 /*v4 = 0; 924 /*v4 = 0;
920 if ( this->uNumPointers <= 0 ) 925 if ( this->uNumPointers <= 0 )
921 return false; 926 return false;
922 else 927 else
923 { 928 {
971 MessageBoxW(nullptr, L"Unknown pointer creation flag passed to ::create_object_pointers()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:1358", 0); 976 MessageBoxW(nullptr, L"Unknown pointer creation flag passed to ::create_object_pointers()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:1358", 0);
972 } 977 }
973 } 978 }
974 979
975 //----- (004C264A) -------------------------------------------------------- 980 //----- (004C264A) --------------------------------------------------------
976 void Vis::sort_object_pointers(Vis_ObjectInfo **pPointers, int left, int right) 981 void Vis::sort_object_pointers( Vis_ObjectInfo **pPointers, int start, int end )
977 { 982 {
978 int v4; // edx@1 983 int sort_start; // edx@1
979 int v5; // ebx@1 984 int forward_sort_index; // esi@2
980 int v6; // esi@2 985 signed int backward_sort_index; // ecx@2
981 signed int i; // ecx@2 986 unsigned int last_z_val; // eax@3
982 int v8; // eax@3 987 unsigned int more_lz_val; // ebx@4
983 int v9; // ebx@4 988 unsigned int less_lz_val; // ebx@6
984 int v10; // ebx@6 989 Vis_ObjectInfo *temp_pointer; // eax@7
985 Vis_ObjectInfo *v11; // eax@7
986 Vis_ObjectInfo *a3a; // [sp+14h] [bp+Ch]@2 990 Vis_ObjectInfo *a3a; // [sp+14h] [bp+Ch]@2
987 991
988 v4 = left; 992 sort_start = start;
989 v5 = right; 993
990 if ( right > left ) 994 if ( end > start )
991 { 995 {
992 do 996 do
993 { 997 {
994 v6 = v4 - 1; 998 forward_sort_index = sort_start - 1;
995 a3a = pPointers[v5]; 999 backward_sort_index = end;
996 for ( i = v5; ; pPointers[i] = v11 ) 1000 do
997 { 1001 {
998 v8 = a3a->sZValue; 1002 last_z_val = pPointers[end]->sZValue&0xFFFF0000;
999 LOWORD(v8) = 0;
1000 do 1003 do
1001 { 1004 {
1002 ++v6; 1005 ++forward_sort_index;
1003 v9 = pPointers[v6]->sZValue; 1006 more_lz_val = pPointers[forward_sort_index]->sZValue&0xFFFF0000;
1004 LOWORD(v9) = 0;
1005 } 1007 }
1006 while ( v9 < (unsigned int)v8 ); 1008 while ( more_lz_val < last_z_val );
1009
1007 do 1010 do
1008 { 1011 {
1009 if ( i < 1 ) 1012 if ( backward_sort_index < 1 )
1010 break; 1013 break;
1011 --i; 1014 --backward_sort_index;
1012 v10 = pPointers[i]->sZValue; 1015 less_lz_val = pPointers[backward_sort_index]->sZValue&0xFFFF0000;
1013 LOWORD(v10) = 0;
1014 } 1016 }
1015 while ( v10 > (unsigned int)v8 ); 1017 while ( less_lz_val > last_z_val );
1016 v11 = pPointers[v6]; 1018
1017 if ( v6 >= i ) 1019 temp_pointer = pPointers[forward_sort_index];
1018 break; 1020 if ( forward_sort_index >= backward_sort_index )
1019 pPointers[v6] = pPointers[i]; 1021 {
1020 } 1022 pPointers[forward_sort_index] = pPointers[end];
1021 v5 = right; 1023 pPointers[end] = temp_pointer;
1022 pPointers[v6] = pPointers[right]; 1024 }
1023 pPointers[right] = v11; 1025 else
1024 sort_object_pointers(pPointers, v4, v6 - 1); 1026 {
1025 v4 = v6 + 1; 1027 pPointers[forward_sort_index] = pPointers[backward_sort_index];
1026 } 1028 pPointers[backward_sort_index] = temp_pointer;
1027 while ( right > v6 + 1 ); 1029 }
1030
1031 } while ( forward_sort_index < backward_sort_index );
1032
1033 sort_object_pointers(pPointers, sort_start, forward_sort_index - 1);
1034 sort_start = forward_sort_index + 1;
1035 }
1036 while ( end > forward_sort_index + 1 );
1028 } 1037 }
1029 } 1038 }
1030 1039
1031 //----- (004C26D0) -------------------------------------------------------- 1040 //----- (004C26D0) --------------------------------------------------------
1032 bool Vis::SortVerticesByX(RenderVertexD3D3 *a2, unsigned int uStart, unsigned int uEnd) 1041 bool Vis::SortVerticesByX(RenderVertexD3D3 *a2, unsigned int uStart, unsigned int uEnd)
1401 case VisObjectType_Any: 1410 case VisObjectType_Any:
1402 return true; 1411 return true;
1403 1412
1404 case VisObjectType_Sprite: 1413 case VisObjectType_Sprite:
1405 { 1414 {
1406 v5 = filter->field_10; 1415 v5 = filter->select_flags;
1407 int object_idx = PID_ID(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid); 1416 int object_idx = PID_ID(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid);
1408 int object_type = PID_TYPE(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid); 1417 int object_type = PID_TYPE(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid);
1409 if ( v5 & 2 ) 1418 if ( v5 & 2 )
1410 { 1419 {
1411 if (object_type == filter->object_id) 1420 if (object_type == filter->object_id)
1434 return true; 1443 return true;
1435 } 1444 }
1436 1445
1437 v10 = &pActors[object_idx]; 1446 v10 = &pActors[object_idx];
1438 int result = 1 << LOBYTE(v10->uAIState); 1447 int result = 1 << LOBYTE(v10->uAIState);
1439 if ( result & filter->field_C 1448 if ( result & filter->no_at_ai_state
1440 || !(result & filter->field_8) 1449 || !(result & filter->at_ai_state)
1441 || v5 & 8 && (result = MonsterStats::BelongsToSupertype(v10->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) == 0 ) 1450 || v5 & 8 && (result = MonsterStats::BelongsToSupertype(v10->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) == 0 )
1442 return false; 1451 return false;
1443 if ( !(filter->field_10 & 1) ) 1452 if ( !(filter->select_flags & 1) )
1444 return true; 1453 return true;
1445 1454
1446 result = v10->GetActorsRelation(nullptr); 1455 result = v10->GetActorsRelation(nullptr);
1447 if (result == 0) 1456 if (result == 0)
1448 return false; 1457 return false;
1470 else 1479 else
1471 assert(false); 1480 assert(false);
1472 1481
1473 if (filter->object_id != OBJECT_BLVDoor) 1482 if (filter->object_id != OBJECT_BLVDoor)
1474 return true; 1483 return true;
1475 if (no_event || face_attrib & filter->field_C) 1484 if (no_event || face_attrib & filter->no_at_ai_state)
1476 return false; 1485 return false;
1477 return (face_attrib & filter->field_8) != 0; 1486 return (face_attrib & filter->at_ai_state) != 0;
1478 } 1487 }
1479 1488
1480 default: 1489 default:
1481 assert(false); 1490 assert(false);
1482 } 1491 }
1513 unsigned int v29; // eax@47 1522 unsigned int v29; // eax@47
1514 char result; // al@48 1523 char result; // al@48
1515 struct RenderVertexSoft pPickingRay[2]; 1524 struct RenderVertexSoft pPickingRay[2];
1516 //int v31; // [sp+20h] [bp-DCh]@5 1525 //int v31; // [sp+20h] [bp-DCh]@5
1517 struct RenderVertexSoft local_80[2]; 1526 struct RenderVertexSoft local_80[2];
1518 //int v32; // [sp+80h] [bp-7Ch]@22 1527
1519 float v33; // [sp+E0h] [bp-1Ch]@33 1528 float test_x;
1520 float v34; // [sp+E4h] [bp-18h]@32 1529 float test_y;
1521 int v35; // [sp+E8h] [bp-14h]@5 1530
1522 int v36; // [sp+ECh] [bp-10h]@5 1531 float t1_x;
1532 float t1_y;
1533 float t2_x;
1534 float t2_y;
1535 float swap_temp;
1523 int v37; // [sp+F0h] [bp-Ch]@5 1536 int v37; // [sp+F0h] [bp-Ch]@5
1524 float v38; // [sp+F4h] [bp-8h]@17 1537
1525 //void *v39; // [sp+F8h] [bp-4h]@1
1526 signed int v40; // [sp+108h] [bp+Ch]@17 1538 signed int v40; // [sp+108h] [bp+Ch]@17
1527 float v41; // [sp+108h] [bp+Ch]@32 1539
1528 1540
1529 static Vis_SelectionList Vis_static_stru_F91E10; 1541 static Vis_SelectionList Vis_static_stru_F91E10;
1530 Vis_static_stru_F91E10.uNumPointers = 0; 1542 Vis_static_stru_F91E10.uNumPointers = 0;
1531 v3 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].uParentBillboardID; 1543 v3 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].uParentBillboardID;
1532 if (v3 == -1) 1544 if (v3 == -1)
1533 return false; 1545 return false;
1546
1534 if (pBillboardRenderList[v3].GetFloatZ() > fDepth) 1547 if (pBillboardRenderList[v3].GetFloatZ() > fDepth)
1535 {
1536 LABEL_49:
1537 return false; 1548 return false;
1538 } 1549
1539 1550
1540 v37 = pBillboardRenderList[v3].sZValue & 0xFFFF0000; 1551 GetPolygonCenter(pRenderer->pBillboardRenderListD3D[v3].pQuards, 4, &test_x, &test_y);
1541 GetPolygonCenter(pRenderer->pBillboardRenderListD3D[v3].pQuards, 4, (float *)&v35, (float *)&v36); 1552 CastPickRay(pPickingRay, test_x, test_y, fDepth);
1542 CastPickRay(pPickingRay, *(float *)&v35, *(float *)&v36, fDepth);
1543 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) 1553 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1544 PickIndoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter); 1554 PickIndoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter);
1545 else 1555 else
1546 PickOutdoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter, false); 1556 PickOutdoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter, false);
1547 Vis_static_stru_F91E10.create_object_pointers(); 1557 Vis_static_stru_F91E10.create_object_pointers();
1548 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1); 1558 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1);
1549 if (Vis_static_stru_F91E10.uNumPointers) 1559 if (Vis_static_stru_F91E10.uNumPointers)
1550 { 1560 {
1551 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z) 1561 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z)
1552 return 1; 1562 return true;
1553 } 1563 }
1554 else if ((double)(pViewport->uScreen_TL_X) <= *(float *)&v35 && 1564 else if ((double)(pViewport->uScreen_TL_X) <= test_x &&
1555 (double)pViewport->uScreen_BR_X >= *(float *)&v35 && 1565 (double)pViewport->uScreen_BR_X >= test_x &&
1556 (double)pViewport->uScreen_TL_Y <= *(float *)&v36 && 1566 (double)pViewport->uScreen_TL_Y <= test_y &&
1557 (double)pViewport->uScreen_BR_Y >= *(float *)&v36) 1567 (double)pViewport->uScreen_BR_Y >= test_y)
1558 return 1; 1568 return true;
1559 v40 = 0; 1569
1560 v10 = (int)&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y; 1570 for (v40 = 0; v40 < 4; ++v40)
1561 LODWORD(v38) = (int)&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y;
1562 while ( 1 )
1563 {
1564 v12 = *(float *)(v10 - 4);
1565 v11 = *(float *)v10;
1566 v13 = *(float *)(v10 - 4);
1567 Vis_static_stru_F91E10.uNumPointers = 0;
1568 if ( v13 >= (double)(pViewport->uScreen_TL_X))
1569 { 1571 {
1570 if ( v12 <= (double)pViewport->uScreen_BR_X ) 1572 test_x=pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[v40].pos.x;
1571 { 1573 test_y= pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[v40].pos.y;
1572 if ( v11 >= (double)pViewport->uScreen_TL_Y ) 1574 if ((double)(pViewport->uScreen_TL_X) <= test_x &&
1575 (double)pViewport->uScreen_BR_X >= test_x &&
1576 (double)pViewport->uScreen_TL_Y <= test_y &&
1577 (double)pViewport->uScreen_BR_Y >= test_y)
1573 { 1578 {
1574 if ( v11 <= (double)pViewport->uScreen_BR_Y ) 1579 CastPickRay(local_80, test_x, test_y, fDepth);
1575 { 1580 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1576 v14 = v11; 1581 PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter);
1577 v15 = v12; 1582 else
1578 CastPickRay(local_80, SLODWORD(v15), v14, fDepth); 1583 PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false);
1579 if ( uCurrentlyLoadedLevelType == 1 ) 1584 Vis_static_stru_F91E10.create_object_pointers();
1580 PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter); 1585 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1);
1581 else 1586 if ( !Vis_static_stru_F91E10.uNumPointers )
1582 PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false); 1587 return true;
1583 Vis_static_stru_F91E10.create_object_pointers(); 1588 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z)
1584 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1); 1589 return true;
1585 if ( !Vis_static_stru_F91E10.uNumPointers )
1586 break;
1587 else
1588 {
1589 //v18 = Vis_static_stru_F91E10.uNumPointers <= 0 ? 0 : (int);
1590 //v19 = *(_DWORD *)(v18 + 4);
1591 //LOWORD(v19) = 0;
1592 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z)
1593 break;
1594 }
1595 }
1596 } 1590 }
1597 } 1591
1598 } 1592 }
1599 ++v40; 1593
1600 v10 = LODWORD(v38) + 32;
1601 LODWORD(v38) += 32;
1602 if ( v40 >= 4 ) 1594 if ( v40 >= 4 )
1603 { 1595 {
1604 if ( uCurrentlyLoadedLevelType != 2 ) 1596 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
1605 return false; 1597 return false;
1606 v21 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.x; 1598 t1_x = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.x;
1607 v20 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[3].pos.x; 1599 t2_x = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[3].pos.x;
1608 v22 = *(int *)(&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y); 1600
1609 v34 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[3].pos.x; 1601 t1_y = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y;
1610 LODWORD(v38) = v22; 1602 t2_y = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[1].pos.y;
1611 v41 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[1].pos.y; 1603 if ( t1_x > t2_x )
1612 if ( v21 > v20 )
1613 { 1604 {
1614 v33 = v21; 1605 swap_temp = t1_x;
1615 v21 = v34; 1606 t1_x = t2_x;
1616 v20 = v33; 1607 t2_x = swap_temp;
1617 } 1608 }
1618 if ( v38 > (double)v41 ) 1609 if ( t1_y > t2_y )
1619 v41 = v38; 1610 test_y = t1_y;
1611 else
1612 test_y = t2_y;
1613
1620 Vis_static_stru_F91E10.uNumPointers = 0; 1614 Vis_static_stru_F91E10.uNumPointers = 0;
1621 v23 = (v20 - v21) * 0.5; 1615
1622 if ( v23 < (double)(pViewport->uScreen_TL_X) 1616 test_x = (t2_x - t1_x) * 0.5;
1623 || v23 > (double)pViewport->uScreen_BR_X 1617 if ((double)(pViewport->uScreen_TL_X) <= test_x &&
1624 || (double)pViewport->uScreen_TL_Y > v41 1618 (double)pViewport->uScreen_BR_X >= test_x &&
1625 || (double)pViewport->uScreen_BR_Y < v41 1619 (double)pViewport->uScreen_TL_Y <= test_y &&
1626 || ((v25 = v23, CastPickRay(local_80, SLODWORD(v25), v41, fDepth), uCurrentlyLoadedLevelType != 1) ? 1620 (double)pViewport->uScreen_BR_Y >= test_y)
1627 (PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false)) : 1621 {
1628 (PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter)), 1622 CastPickRay(local_80, test_x, test_y, fDepth);
1629 (Vis_static_stru_F91E10.create_object_pointers(), 1623 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1630 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1), 1624 PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter);
1631 Vis_static_stru_F91E10.uNumPointers) 1625 else
1632 && (Vis_static_stru_F91E10.uNumPointers <= 0 ? (v28 = 0) : (v28 = (int)Vis_static_stru_F91E10.object_pointers), 1626 PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false);
1633 v29 = *(_DWORD *)(v28 + 4), 1627 Vis_static_stru_F91E10.create_object_pointers();
1634 LOWORD(v29) = 0, 1628 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1);
1635 v29 <= v37)) ) 1629 if ( !Vis_static_stru_F91E10.uNumPointers )
1636 return false; 1630 return true;
1637 break; 1631 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z)
1638 } 1632 return true;
1639 } 1633
1640 return true; 1634 }
1635
1636 }
1637 return false;
1641 } 1638 }
1642 // F93E18: using guessed type char static_byte_F93E18_init; 1639 // F93E18: using guessed type char static_byte_F93E18_init;
1643 1640
1644 //----- (004C0D32) -------------------------------------------------------- 1641 //----- (004C0D32) --------------------------------------------------------
1645 void Vis::PickIndoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter) 1642 void Vis::PickIndoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter)