diff Sprites.cpp @ 1295:86a83e12d795

moving files
author Ritor1
date Mon, 17 Jun 2013 17:34:01 +0600
parents 29a8defbad9e
children 7ef4b64f6329
line wrap: on
line diff
--- a/Sprites.cpp	Mon Jun 17 09:09:30 2013 +0600
+++ b/Sprites.cpp	Mon Jun 17 17:34:01 2013 +0600
@@ -12,6 +12,10 @@
 #include "FrameTableInc.h"
 
 #include "mm7_data.h"
+#include "Outdoor.h"
+#include "DecorationList.h"
+#include "MM7.h"
+#include "Actor.h"
 
 
 
@@ -659,4 +663,120 @@
     result = 0;
   }
   return result;
-}
\ No newline at end of file
+}
+//----- (0046E26D) --------------------------------------------------------
+void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2)
+{
+  int v2; // edx@5
+  unsigned __int16 *v3; // eax@5
+  unsigned __int16 v4; // ax@6
+  LevelDecoration *v5; // edi@7
+  DecorationDesc *v6; // esi@8
+  int v7; // edx@9
+  int v8; // eax@9
+  int v9; // ecx@11
+  int v10; // ebx@13
+  int v11; // esi@13
+  int v12; // ebp@15
+  int v13; // ebx@15
+  int v14; // esi@16
+  int v15; // edi@17
+  int v16; // eax@17
+  int v17; // esi@19
+  char v18; // zf@23
+  int v19; // [sp+0h] [bp-10h]@15
+  unsigned __int16 *v20; // [sp+4h] [bp-Ch]@5
+  int v21; // [sp+8h] [bp-8h]@15
+  int v22; // [sp+Ch] [bp-4h]@13
+
+  if ( a1 >= 0 )
+  {
+    if ( a1 <= 127 )
+    {
+      if ( a2 >= 0 )
+      {
+        if ( a2 <= 127 )
+        {
+          v2 = a1 + (a2 << 7);
+          v3 = &pOutdoor->pFaceIDLIST[pOutdoor->pOMAP[v2]];
+          v20 = &pOutdoor->pFaceIDLIST[pOutdoor->pOMAP[v2]];
+          if ( v3 )
+          {
+            do
+            {
+              v4 = *v3;
+              if ( PID_TYPE(v4) == OBJECT_Decoration)
+              {
+                v5 = &pLevelDecorations[(signed __int16)v4 >> 3];
+                if ( !(v5->field_2 & 0x20) )
+                {
+                  v6 = &pDecorationList->pDecorations[v5->uDecorationDescID];
+                  if (!v6->CanMoveThrough())
+                  {
+                    v7 = v6->uRadius;
+                    v8 = v5->vPosition.x;
+                    if ( stru_721530.sMaxX <= v8 + v7 )
+                    {
+                      if ( stru_721530.sMinX >= v8 - v7 )
+                      {
+                        v9 = v5->vPosition.y;
+                        if ( stru_721530.sMaxY <= v9 + v7 )
+                        {
+                          if ( stru_721530.sMinY >= v9 - v7 )
+                          {
+                            v10 = v6->uDecorationHeight;
+                            v11 = v5->vPosition.z;
+                            v22 = v10;
+                            if ( stru_721530.sMaxZ <= v11 + v10 )
+                            {
+                              if ( stru_721530.sMinZ >= v11 )
+                              {
+                                v12 = v8 - stru_721530.normal.x;
+                                v19 = v9 - stru_721530.normal.y;
+                                v13 = stru_721530.prolly_normal_d + v7;
+                                v21 = ((v8 - stru_721530.normal.x) * stru_721530.field_58.y
+                                     - (v9 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
+                                if ( abs(v21) <= stru_721530.prolly_normal_d + v7 )
+                                {
+                                  v14 = (v12 * stru_721530.field_58.x + v19 * stru_721530.field_58.y) >> 16;
+                                  if ( v14 > 0 )
+                                  {
+                                    v15 = v5->vPosition.z;
+                                    v16 = stru_721530.normal.z
+                                        + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v14) >> 16);
+                                    if ( v16 >= v15 )
+                                    {
+                                      if ( v16 <= v22 + v15 )
+                                      {
+                                        v17 = v14 - integer_sqrt(v13 * v13 - v21 * v21);
+                                        if ( v17 < 0 )
+                                          v17 = 0;
+                                        if ( v17 < stru_721530.field_7C )
+                                        {
+                                          stru_721530.field_7C = v17;
+                                          stru_721530.uFaceID = (signed __int16)*v20;
+                                        }
+                                      }
+                                    }
+                                  }
+                                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+              v3 = v20 + 1;
+              v18 = *v20 == 0;
+              ++v20;
+            }
+            while ( !v18 );
+          }
+        }
+      }
+    }
+  }
+}