Mercurial > mm7
changeset 1137:62c759bc49f7
m
author | Ritor1 |
---|---|
date | Sat, 01 Jun 2013 10:32:08 +0600 |
parents | 3dc32954f1c7 |
children | f947bedb2859 |
files | Vis.cpp Vis.h mm7_2.cpp |
diffstat | 3 files changed, 33 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/Vis.cpp Sat May 25 02:23:47 2013 +0600 +++ b/Vis.cpp Sat Jun 01 10:32:08 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 SelectedPointersList; + SelectedPointersList.uNumPointers = 0; static bool _init_flag = false; static RenderVertexSoft static_DetermineFacetIntersection_array_F8F200[64]; @@ -88,21 +88,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, &SelectedPointersList, &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, &SelectedPointersList, &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) + SelectedPointersList.create_object_pointers(); + sort_object_pointers(SelectedPointersList.object_pointers, 0, SelectedPointersList.uNumPointers - 1); + if (!SelectedPointersList.uNumPointers) return nullptr; - if (!static_DetermineFacetIntersection_stru_F8FE00.sub_4C2551(2, pid)) + if (!SelectedPointersList.SelectionPointers(VisObjectType_Face, pid)) return nullptr; - if (static_DetermineFacetIntersection_stru_F8FE00.uNumPointers) - return static_DetermineFacetIntersection_stru_F8FE00.object_pointers[0]; + if (SelectedPointersList.uNumPointers) + return SelectedPointersList.object_pointers[0]; else return nullptr; } // F91E08: using guessed type char static_DetermineFacetIntersection_byte_F91E08__init_flags; @@ -376,8 +376,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)) { @@ -902,29 +900,17 @@ } //----- (004C2551) -------------------------------------------------------- -Vis_ObjectInfo *Vis_SelectionList::sub_4C2551(int pVisObjectType, int pid) +Vis_ObjectInfo *Vis_SelectionList::SelectionPointers(int pVisObjectType, int pid) { - //unsigned int v3; // esi@1 - signed int v4; // edx@1 - //char *v5; // eax@2 - //Vis_ObjectInfo *result; // eax@6 - - //v3 = this->uNumPointers; - v4 = 0; - if ( this->uNumPointers <= 0 ) - return false; - else + if ( this->uNumPointers > 0 ) { - //v5 = (char *)&this->object_pool[0].sZValue; - while ( this->object_pool[v4].object_type != pVisObjectType || (this->object_pool[v4].sZValue & 0xFFFF) != pid ) + for ( uint i = 0; i < this->uNumPointers; ++i ) { - ++v4; - //v5 += 12; - if ( v4 >= this->uNumPointers ) - return false; + if ( this->object_pool[i].object_type == pVisObjectType && (this->object_pool[i].sZValue & 0xFFFF) == pid ) + return &this->object_pool[i]; } - return &this->object_pool[v4]; } + return false; } //----- (004C2591) -------------------------------------------------------- @@ -972,12 +958,12 @@ //int v5; // ebx@1 int v6; // esi@2 signed int i; // ecx@2 - int v8; // eax@3 - int v9; // ebx@4 - int v10; // ebx@6 + //int v8; // eax@3 + //int v9; // ebx@4 + //int v10; // ebx@6 Vis_ObjectInfo *v11; // eax@7 //Vis *thisa; // [sp+4h] [bp-4h]@1 - Vis_ObjectInfo *a3a; // [sp+14h] [bp+Ch]@2 + //Vis_ObjectInfo *a3a; // [sp+14h] [bp+Ch]@2 //v4 = left; //v5 = right; @@ -987,27 +973,27 @@ do { v6 = left - 1; - a3a = pPointers[right]; + //a3a = pPointers[right]; for ( i = right; ; pPointers[i] = v11 ) { - v8 = a3a->sZValue; - LOWORD(v8) = 0; + //v8 = a3a->sZValue; + //LOWORD(v8) = 0; do { ++v6; - v9 = pPointers[v6]->sZValue; - LOWORD(v9) = 0; + //v9 = pPointers[v6]->sZValue; + //LOWORD(v9) = 0; } - while ( v9 < (unsigned int)v8 ); + while ( pPointers[v6]->sZValue < pPointers[right]->sZValue ); do { if ( i < 1 ) break; --i; - v10 = pPointers[i]->sZValue; - LOWORD(v10) = 0; + //v10 = pPointers[i]->sZValue; + //LOWORD(v10) = 0; } - while ( v10 > (unsigned int)v8 ); + while ( pPointers[i]->sZValue > pPointers[right]->sZValue ); v11 = pPointers[v6]; if ( v6 >= i ) break;
--- a/Vis.h Sat May 25 02:23:47 2013 +0600 +++ b/Vis.h Sat Jun 01 10:32:08 2013 +0600 @@ -60,7 +60,7 @@ Vis_SelectionList(); //----- (004C0585) -------------------------------------------------------- ~Vis_SelectionList() {} - Vis_ObjectInfo *sub_4C2551(int a2, int a3); + Vis_ObjectInfo *SelectionPointers(int a2, int a3); void create_object_pointers(PointerCreationType type = All); inline void AddObject(void *object, VisObjectType type, int packed_zval)
--- a/mm7_2.cpp Sat May 25 02:23:47 2013 +0600 +++ b/mm7_2.cpp Sat Jun 01 10:32:08 2013 +0600 @@ -10525,13 +10525,13 @@ if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) { int bmodel_id = a1 >> 9, - face_id = PID_ID(a1) &0x3F; + face_id = PID_ID(a1) & 0x3F; if (bmodel_id >= pOutdoor->uNumBModels) return 1; auto face = &pOutdoor->pBModels[bmodel_id].pFaces[face_id]; - if (face->uAttributes & 0x100000 || (v6 = face->sCogTriggeredID) == 0 ) + if (face->uAttributes & 0x100000 || face->sCogTriggeredID == 0 ) return 1; - EventProcessor((signed __int16)v6, v2, 1); + EventProcessor((signed __int16)face->sCogTriggeredID, v2, 1); } else {