diff Vis.cpp @ 1172:d5dae0b4b98a

Слияние
author Ritor1
date Fri, 24 May 2013 10:53:46 +0600
parents 28ee6610a3d2 0e0f1192aa57
children 0158f383b492
line wrap: on
line diff
--- a/Vis.cpp	Fri May 24 10:53:33 2013 +0600
+++ b/Vis.cpp	Fri May 24 10:53:46 2013 +0600
@@ -322,11 +322,12 @@
     {
       if ( pFaceID < (signed int)pIndoor->uNumFaces )
       {
-        if ( is_part_of_selection(&pIndoor->pFaces[pFaceID], filter) )
+        auto face = pIndoor->pFaces + pFaceID;
+        if ( is_part_of_selection(face, filter) )
         {
-          if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) )
+          if ( !pGame->pIndoorCameraD3D->IsCulled(face) )
           {
-            if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) )
+            if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, face, 0xFFFFFFFFu) )
             {
               pGame->pIndoorCameraD3D->ViewTransform(&a1, 1);
               v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x);
@@ -345,6 +346,12 @@
             }
           }
         }
+        
+        if (face->uAttributes & FACE_PICKED)
+          face->uAttributes |= FACE_OUTLINED;
+        else
+          face->uAttributes &= ~FACE_OUTLINED;
+        face->uAttributes &= ~FACE_PICKED;
       }
     }
     v5 = v17 + 1;
@@ -385,10 +392,11 @@
           list->AddObject(face, VisObjectType_Face, v13);
         }
 
-        if (blv_face.uAttributes & 0x80000000)
+        if (blv_face.uAttributes & FACE_PICKED)
           face->uAttributes |= FACE_OUTLINED;
         else
           face->uAttributes &= ~FACE_OUTLINED;
+        blv_face.uAttributes &= ~FACE_PICKED;
       }
     }
   }
@@ -610,8 +618,6 @@
       IntersectPoint.z < pFace->pBounding.z1 || IntersectPoint.z > pFace->pBounding.z2 )
     return false;
 
-  pFace->uAttributes |= 0x80000000;
-
   if (uModelID != -1)
     ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
                                 &IntersectPoint, pFace, uModelID);
@@ -656,6 +662,8 @@
 
   if ( v16 != 1 )
     return false;
+
+  pFace->uAttributes |= FACE_PICKED;
   return true;
 /*
   int v5; // esi@10
@@ -1255,7 +1263,6 @@
   return true;
 }
 
-
 //----- (004C04AF) --------------------------------------------------------
 Vis::Vis()
 {