diff Vis.cpp @ 1051:05c62d166182

004C1D2B cleaned
author Nomad
date Thu, 23 May 2013 14:08:26 +0200
parents 4b329bf2d197
children 1c10b24a4159 37498d2cceed 2e5220c27511
line wrap: on
line diff
--- a/Vis.cpp	Thu May 23 16:36:08 2013 +0600
+++ b/Vis.cpp	Thu May 23 14:08:26 2013 +0200
@@ -603,6 +603,67 @@
   int v5; // esi@10
   bool v6; // edi@10
   signed int v10; // ebx@14
+  int v15; // [sp+10h] [bp-Ch]@10
+  signed int v16; // [sp+18h] [bp-4h]@10
+
+  int a = 0, b = 0;
+
+  if (IntersectPoint.x < pFace->pBounding.x1 || IntersectPoint.x > pFace->pBounding.x2 ||
+      IntersectPoint.y < pFace->pBounding.y1 || IntersectPoint.y > pFace->pBounding.y2 ||
+      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);
+  else
+    BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
+                                  &IntersectPoint, pFace);
+  v5 = 2 * pFace->uNumVertices;
+  v16 = 0;
+  intersect_face_vertex_coords_list_a[v5] = intersect_face_vertex_coords_list_a[0];
+  intersect_face_vertex_coords_list_b[v5] = intersect_face_vertex_coords_list_b[0];
+  v6 = intersect_face_vertex_coords_list_b[0] >= b;
+  if (v5 <= 0)
+    return false;
+  for ( uint i = 0; i < v5; ++i )
+  {
+    if ( v16 >= 2 )
+      break;
+    if ( v6 ^ intersect_face_vertex_coords_list_b[i + 1] >= b )
+    {
+      if ( intersect_face_vertex_coords_list_a[i + 1] >= a )
+        v10 = 0;
+      else
+        v10 = 2;
+      v10 |= intersect_face_vertex_coords_list_a[i] < a ? 1 : 0;
+      if ( v10 != 3 )
+      {
+        if ( !v10)
+          ++v16;
+        else
+        {
+          int _v1 = fixpoint_div(intersect_face_vertex_coords_list_a[i + 1] - intersect_face_vertex_coords_list_a[i],
+                                 intersect_face_vertex_coords_list_b[i + 1] - intersect_face_vertex_coords_list_b[i]);
+          int _v2 = fixpoint_mul(b - intersect_face_vertex_coords_list_b[i], _v1) + 32768;
+
+          if (intersect_face_vertex_coords_list_a[i] + (_v2 >> 16) >= a)
+            ++v16;
+        }
+      }
+    }
+    v6 = intersect_face_vertex_coords_list_b[i + 1] >= b;
+  }
+
+  if ( v16 != 1 )
+    return false;
+  return true;
+/*
+  int v5; // esi@10
+  bool v6; // edi@10
+  signed int v10; // ebx@14
   int v11; // edi@16
   signed int v12; // ST28_4@18
   signed __int64 v13; // qtt@18
@@ -661,6 +722,7 @@
   if ( v16 != 1 )
     result = false;
   return result;
+}*/
 }
 
 //----- (004C1EE5) --------------------------------------------------------