Mercurial > mm7
changeset 1172:d5dae0b4b98a
Слияние
author | Ritor1 |
---|---|
date | Fri, 24 May 2013 10:53:46 +0600 |
parents | 28ee6610a3d2 (diff) 938af16d5b88 (current diff) |
children | 0158f383b492 |
files | Vis.cpp |
diffstat | 1 files changed, 16 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/Vis.cpp Fri May 24 08:17:50 2013 +0400 +++ b/Vis.cpp Fri May 24 10:53:46 2013 +0600 @@ -34,8 +34,8 @@ RenderVertexSoft pRay[2]; // [sp+20h] [bp-70h]@17 int v20; // [sp+84h] [bp-Ch]@10 - static Vis_SelectionList static_DetermineFacetIntersection_stru_F8FE00; - static_DetermineFacetIntersection_stru_F8FE00.uNumPointers = 0; + static Vis_SelectionList SelectionFacetIntersectionList;//stru_F8FE00 + SelectionFacetIntersectionList.uNumPointers = 0; static bool _init_flag = false; static RenderVertexSoft static_DetermineFacetIntersection_array_F8F200[64]; @@ -74,7 +74,6 @@ pGame->pIndoorCameraD3D->ViewTransform(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices); pGame->pIndoorCameraD3D->Project(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices, 1); - //v15 = this; SortVectors_x(static_DetermineFacetIntersection_array_F8F200, 0, face->uNumVertices - 1); if (static_DetermineFacetIntersection_array_F8F200[0].vWorldViewPosition.x > pick_depth) return nullptr; @@ -88,21 +87,21 @@ CastPickRay(pRay, screenspace_center_x, screenspace_center_y, pick_depth); if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) - PickOutdoorFaces_Mouse(pick_depth, pRay, &static_DetermineFacetIntersection_stru_F8FE00, &vis_face_filter, true); + PickOutdoorFaces_Mouse(pick_depth, pRay, &SelectionFacetIntersectionList, &vis_face_filter, true); else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) - PickIndoorFaces_Mouse(pick_depth, pRay, &static_DetermineFacetIntersection_stru_F8FE00, &vis_face_filter); + PickIndoorFaces_Mouse(pick_depth, pRay, &SelectionFacetIntersectionList, &vis_face_filter); else assert(false); - static_DetermineFacetIntersection_stru_F8FE00.create_object_pointers(); - sort_object_pointers(static_DetermineFacetIntersection_stru_F8FE00.object_pointers, 0, static_DetermineFacetIntersection_stru_F8FE00.uNumPointers - 1); - if (!static_DetermineFacetIntersection_stru_F8FE00.uNumPointers) + SelectionFacetIntersectionList.create_object_pointers(); + sort_object_pointers(SelectionFacetIntersectionList.object_pointers, 0, SelectionFacetIntersectionList.uNumPointers - 1); + if (!SelectionFacetIntersectionList.uNumPointers) return nullptr; - if (!static_DetermineFacetIntersection_stru_F8FE00.sub_4C2551(2, a3)) + if (!SelectionFacetIntersectionList.sub_4C2551(2, a3)) return nullptr; - if (static_DetermineFacetIntersection_stru_F8FE00.uNumPointers) - return static_DetermineFacetIntersection_stru_F8FE00.object_pointers[0]; + if (SelectionFacetIntersectionList.uNumPointers) + return SelectionFacetIntersectionList.object_pointers[0]; else return nullptr; } // F91E08: using guessed type char static_DetermineFacetIntersection_byte_F91E08__init_flags; @@ -376,8 +375,6 @@ auto bmodel = &pOutdoor->pBModels[i]; for (uint j = 0; j < bmodel->uNumFaces; ++j) { - //if ( i == 1 && j == 30 )// - //__debugbreak();// auto face = &bmodel->pFaces[j]; if (is_part_of_selection(face, filter)) { @@ -904,18 +901,15 @@ //----- (004C2551) -------------------------------------------------------- Vis_ObjectInfo *Vis_SelectionList::sub_4C2551(int a2, int a3) { - unsigned int v3; // esi@1 + //unsigned int v3; // esi@1 signed int v4; // edx@1 char *v5; // eax@2 Vis_ObjectInfo *result; // eax@6 - v3 = this->uNumPointers; + //v3 = this->uNumPointers; v4 = 0; - if ( (signed int)v3 <= 0 ) - { -LABEL_6: - result = 0; - } + if ( this->uNumPointers <= 0 ) + return false; else { v5 = (char *)&this->object_pool[0].sZValue; @@ -923,8 +917,8 @@ { ++v4; v5 += 12; - if ( v4 >= (signed int)v3 ) - goto LABEL_6; + if ( v4 >= this->uNumPointers ) + return false; } result = &this->object_pool[v4]; }