diff mm7_2.cpp @ 515:cb0ad52d6a26

LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people) Some object-related subs moved to SpriteObject.cpp
author Nomad
date Fri, 01 Mar 2013 21:13:12 +0200
parents 0e20e886365d
children 8f70e52646eb
line wrap: on
line diff
--- a/mm7_2.cpp	Fri Mar 01 18:23:49 2013 +0200
+++ b/mm7_2.cpp	Fri Mar 01 21:13:12 2013 +0200
@@ -21,7 +21,7 @@
 #include "Viewport.h"
 #include "FrameTableInc.h"
 #include "Math.h"
-#include "LayingItem.h"
+#include "SpriteObject.h"
 #include "ObjectList.h"
 #include "Chest.h"
 #include "PaletteManager.h"
@@ -7872,7 +7872,7 @@
   //int v28; // eax@35
   //int v29; // esi@35
   //__int16 v30; // ax@35
-  LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
+  SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1
   //int v32; // [sp+7Ch] [bp-Ch]@1
   //int v33; // [sp+80h] [bp-8h]@1
   int v34; // [sp+84h] [bp-4h]@1
@@ -7932,7 +7932,7 @@
 LABEL_20:
                 v15 = 0;
                 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
-                a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
+                a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
                 if ( (signed int)pObjectList->uNumObjects <= 0 )
                 {
 LABEL_24:
@@ -7977,7 +7977,7 @@
     return result;
   v23 = 0;
   v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
-  a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
+  a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
   {
 LABEL_33:
@@ -8025,14 +8025,14 @@
   unsigned __int16 v9; // cx@1
   char *v10; // edx@2
   unsigned __int16 v11; // ax@5
-  LayingItem a1; // [sp+8h] [bp-70h]@1
+  SpriteObject a1; // [sp+8h] [bp-70h]@1
 
   v6 = ecx0;
   v7 = a2;
   pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
   v8 = 0;
   v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
-  a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
+  a1.uType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
   {
 LABEL_5:
@@ -12215,7 +12215,7 @@
   _strrev(Str1);
 
   for (uint i = 0; i < 1000; ++i)
-    pLayingItems[i].uObjectDescID = 0;
+    pSpriteObjects[i].uObjectDescID = 0;
 
   v5 = pMapStats->GetMapInfo(pCurrentMapName);
   bUnderwater = 0;
@@ -14939,12 +14939,12 @@
       v17 = a1 >> 3;
       v26 = a1 >> 3;
       v18 = a1 >> 3;
-      if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10
+      if ( pObjectList->pObjects[pSpriteObjects[v18].uObjectDescID].uFlags & 0x10
         || v17 >= 1000
-        || !pLayingItems[v18].uObjectDescID )
+        || !pSpriteObjects[v18].uObjectDescID )
         return 1;
-      v19 = &pLayingItems[v18].stru_24;
-      v20 = pLayingItems[v18].stru_24.uItemID;
+      v19 = &pSpriteObjects[v18].stru_24;
+      v20 = pSpriteObjects[v18].stru_24.uItemID;
       if ( pItemsTable->pItems[v20].uEquipType == EQUIP_GOLD)
       {
         party_finds_gold(v19->uSpecEnchantmentType, 0);
@@ -14966,7 +14966,7 @@
           pParty->SetHoldingItem(v19);
         v21 = v26;
       }
-      LayingItem::OnItemPickup(v21);
+      SpriteObject::OnInteraction(v21);
       break;
 
     case OBJECT_Actor:
@@ -15442,9 +15442,9 @@
     {
       if ( v20 >= 0x3E8 )
         return 0;
-      if ( !(pLayingItems[v20].uAttributes & 0x10) )
-      {
-        v23 = pLayingItems[v20].stru_24.GetDisplayName();
+      if ( !(pSpriteObjects[v20].uAttributes & 0x10) )
+      {
+        v23 = pSpriteObjects[v20].stru_24.GetDisplayName();
 LABEL_36:
         v24 = v23;
         goto LABEL_51;
@@ -15591,9 +15591,9 @@
 
 
 //----- (0046BEF1) --------------------------------------------------------
-void LayingItem::_46BEF1_apply_spells()
-{
-  LayingItem *v1; // edi@1
+void SpriteObject::_46BEF1_apply_spells()
+{
+  SpriteObject *v1; // edi@1
   Actor *v2; // esi@2
   __int16 v3; // fps@4
   unsigned __int8 v4; // c0@4
@@ -15635,7 +15635,7 @@
 //----- (0046BFFA) --------------------------------------------------------
 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
 {
-  LayingItem *v2; // esi@1
+  SpriteObject *v2; // esi@1
   ObjectDesc *v3; // ebx@1
   unsigned __int16 v5; // cx@9
   unsigned __int16 v6; // cx@14
@@ -15788,7 +15788,7 @@
   unsigned int v153; // [sp+28h] [bp-4h]@1
 
   v153 = uLayingItemID;
-  v2 = &pLayingItems[uLayingItemID];
+  v2 = &pSpriteObjects[uLayingItemID];
   v3 = &pObjectList->pObjects[v2->uObjectDescID];
   v145 = a2;
   v151 = a2 & 7;
@@ -15813,8 +15813,8 @@
   }
   if ( v151 == OBJECT_BModel && (v2->field_58_pid & 7) != OBJECT_Player)
     BYTE2(pActors[v2->field_58_pid >> 3].uAttributes) |= 4u;
-  v6 = v2->uItemType;
-  v7 = v2->uItemType;
+  v6 = v2->uType;
+  v7 = v2->uType;
   if ( v7 > 3060 )
   {
     if ( v7 > 6090 )
@@ -15833,7 +15833,7 @@
             v98 = v6 + 1;
             v99 = pObjectList->uNumObjects;
             v32 = 0;
-            v2->uItemType = v98;
+            v2->uType = v98;
             v146 = 0;
             if ( (signed int)v99 > 0 )
             {
@@ -15877,7 +15877,7 @@
           if ( !v138 )
           {
             v109 = pObjectList->uNumObjects;
-            ++v2->uItemType;
+            ++v2->uType;
             v110 = 0;
             if ( (signed int)v109 <= 0 )
             {
@@ -15887,7 +15887,7 @@
             else
             {
               v111 = (char *)&pObjectList->pObjects->uObjectID;
-              while ( v2->uItemType != *(short *)v111 )
+              while ( v2->uType != *(short *)v111 )
               {
                 ++v110;
                 v111 += 56;
@@ -15898,7 +15898,7 @@
             }
             v2->uObjectDescID = v112;
             if ( !v112 )
-              LayingItem::OnItemPickup(v153);
+              SpriteObject::OnInteraction(v153);
             v2->vVelocity.z = 0;
             v2->vVelocity.y = 0;
             v2->vVelocity.x = 0;
@@ -15921,7 +15921,7 @@
             goto LABEL_269;
           }
 LABEL_246:
-          LayingItem::OnItemPickup(v153);
+          SpriteObject::OnInteraction(v153);
           return 0;
         }
         v106 = v145;
@@ -15966,7 +15966,7 @@
                 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
                 {
                   v138 = 0;
-                  if ( v2->uItemType == 8030 )
+                  if ( v2->uType == 8030 )
                   {
                     pActors[v108].uAIState = Standing;
                     pActors[v108].UpdateAnimation();
@@ -16002,13 +16002,13 @@
           && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
           sub_43A97E(v153, v145);
         v93 = pObjectList->uNumObjects;
-        ++v2->uItemType;
+        ++v2->uType;
         v9 = 0;
         v52 = 0;
         if ( (signed int)v93 > 0 )
         {
           v94 = (char *)&pObjectList->pObjects->uObjectID;
-          while ( v2->uItemType != *(short *)v94 )
+          while ( v2->uType != *(short *)v94 )
           {
             ++v52;
             v94 += 56;
@@ -16048,7 +16048,7 @@
             v56 = 0;
             v44 = pObjectList->uNumObjects == 0;
             v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-            v2->uItemType = v54;
+            v2->uType = v54;
             if ( v20 | v44 )
             {
 LABEL_102:
@@ -16068,7 +16068,7 @@
             }
             v2->uObjectDescID = v58;
             if ( !v58 )
-              LayingItem::OnItemPickup(v153);
+              SpriteObject::OnInteraction(v153);
             v14 = v153;
             v2->vVelocity.z = 0;
             v2->vVelocity.y = 0;
@@ -16104,7 +16104,7 @@
           v61 = 0;
           v44 = pObjectList->uNumObjects == 0;
           v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-          v2->uItemType = v59;
+          v2->uType = v59;
           if ( v20 | v44 )
           {
 LABEL_111:
@@ -16124,7 +16124,7 @@
           }
           v2->uObjectDescID = v63;
           if ( !v63 )
-            LayingItem::OnItemPickup(v153);
+            SpriteObject::OnInteraction(v153);
           v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
           v44 = v2->field_50 == 4;
           v2->vVelocity.z = 0;
@@ -16147,7 +16147,7 @@
 LABEL_160:
           v14 = v153;
 LABEL_34:
-          LayingItem::OnItemPickup(v14);
+          SpriteObject::OnInteraction(v14);
           goto LABEL_35;
         }
         if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
@@ -16157,7 +16157,7 @@
         v69 = 0;
         v44 = pObjectList->uNumObjects == 0;
         v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-        v2->uItemType = v67;
+        v2->uType = v67;
         if ( v20 | v44 )
         {
 LABEL_128:
@@ -16177,7 +16177,7 @@
         }
         v2->uObjectDescID = v71;
         if ( !v71 )
-          LayingItem::OnItemPickup(v153);
+          SpriteObject::OnInteraction(v153);
         v134 = 0;
         v72 = v153;
         v132 = 0;
@@ -16213,7 +16213,7 @@
         v86 = 0;
         v44 = pObjectList->uNumObjects == 0;
         v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-        v2->uItemType = v84;
+        v2->uType = v84;
         if ( v20 | v44 )
         {
 LABEL_155:
@@ -16233,7 +16233,7 @@
         }
         v2->uObjectDescID = v88;
         if ( !v88 )
-          LayingItem::OnItemPickup(v153);
+          SpriteObject::OnInteraction(v153);
         v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
         v2->vVelocity.z = 0;
         v2->vVelocity.y = 0;
@@ -16260,7 +16260,7 @@
         v81 = 0;
         v44 = pObjectList->uNumObjects == 0;
         v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-        v2->uItemType = 4091;
+        v2->uType = 4091;
         if ( v20 | v44 )
         {
 LABEL_144:
@@ -16280,7 +16280,7 @@
         }
         v2->uObjectDescID = v83;
         if ( !v83 )
-          LayingItem::OnItemPickup(v153);
+          SpriteObject::OnInteraction(v153);
         v134 = 0;
         v72 = v153;
         v132 = v2->field_61;
@@ -16302,7 +16302,7 @@
     {
       sub_43A97E(v153, v145);
       v23 = pObjectList->uNumObjects;
-      ++v2->uItemType;
+      ++v2->uType;
       v18 = 0;
       v24 = 0;
       if ( (signed int)v23 <= 0 )
@@ -16313,7 +16313,7 @@
       else
       {
         v25 = (char *)&pObjectList->pObjects->uObjectID;
-        while ( v2->uItemType != *(short *)v25 )
+        while ( v2->uType != *(short *)v25 )
         {
           ++v24;
           v25 += 56;
@@ -16325,7 +16325,7 @@
 LABEL_42:
       v2->uObjectDescID = v22;
       if ( v22 == v18 )
-        LayingItem::OnItemPickup(v153);
+        SpriteObject::OnInteraction(v153);
       v2->vVelocity.z = v18;
       v2->vVelocity.y = v18;
       v2->vVelocity.x = v18;
@@ -16346,7 +16346,7 @@
         case 540:
           sub_43A97E(v153, v145);
           v8 = pObjectList->uNumObjects;
-          ++v2->uItemType;
+          ++v2->uType;
           v9 = 0;
           v10 = 0;
           if ( (signed int)v8 <= 0 )
@@ -16371,7 +16371,7 @@
           v19 = 0;
           v44 = pObjectList->uNumObjects == 0;
           v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-          v2->uItemType = 600;
+          v2->uType = 600;
           if ( v20 | v44 )
             goto LABEL_41;
           v21 = (char *)&pObjectList->pObjects->uObjectID;
@@ -16387,7 +16387,7 @@
         default:
           return 0;
       }
-      while ( v2->uItemType != *(short *)v11 )
+      while ( v2->uType != *(short *)v11 )
       {
         ++v10;
         v11 += 56;
@@ -16402,8 +16402,8 @@
 LABEL_24:
       v2->uObjectDescID = v12;
       if ( !v12 )
-        LayingItem::OnItemPickup(v153);
-      v44 = v2->uItemType == 555;
+        SpriteObject::OnInteraction(v153);
+      v44 = v2->uType == 555;
       v2->vVelocity.z = 0;
       v2->vVelocity.y = 0;
       v2->vVelocity.x = 0;
@@ -16433,13 +16433,13 @@
 LABEL_93:
     sub_43A97E(v153, v145);
     v51 = pObjectList->uNumObjects;
-    ++v2->uItemType;
+    ++v2->uType;
     v9 = 0;
     v52 = 0;
     if ( (signed int)v51 > 0 )
     {
       v53 = (char *)&pObjectList->pObjects->uObjectID;
-      while ( v2->uItemType != *(short *)v53 )
+      while ( v2->uType != *(short *)v53 )
       {
         ++v52;
         v53 += 56;
@@ -16453,7 +16453,7 @@
 LABEL_182:
     v2->uObjectDescID = v95;
     if ( v95 == (short)v9 )
-      LayingItem::OnItemPickup(v153);
+      SpriteObject::OnInteraction(v153);
     v96 = v2->uSoundID;
     v2->vVelocity.z = v9;
     v2->vVelocity.y = v9;
@@ -16478,7 +16478,7 @@
     v34 = 0;
     v44 = pObjectList->uNumObjects == 0;
     v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-    v2->uItemType = 601;
+    v2->uType = 601;
     if ( v20 | v44 )
     {
 LABEL_69:
@@ -16498,7 +16498,7 @@
     }
     v2->uObjectDescID = v36;
     if ( !v36 )
-      LayingItem::OnItemPickup(v153);
+      SpriteObject::OnInteraction(v153);
     v37 = v2->vPosition.z;
     v2->vVelocity.z = 0;
     v38 = 8 * v153;
@@ -16538,7 +16538,7 @@
       v30 = v6 + 1;
       v31 = pObjectList->uNumObjects;
       v32 = 0;
-      v2->uItemType = v30;
+      v2->uType = v30;
       v146 = 0;
       if ( (signed int)v31 > 0 )
       {
@@ -16555,7 +16555,7 @@
 LABEL_196:
         v2->uObjectDescID = v46;
         if ( v46 == (short)v32 )
-          LayingItem::OnItemPickup(v153);
+          SpriteObject::OnInteraction(v153);
         v100 = v2->field_61;
         v101 = v2->vPosition.z;
         v2->uSpriteFrameID = v32;
@@ -16600,12 +16600,12 @@
   {
     sub_43A97E(v153, v145);
     v122 = pObjectList->uNumObjects;
-    ++v2->uItemType;
+    ++v2->uType;
     v52 = 0;
     if ( (signed int)v122 > 0 )
     {
       v123 = (char *)&pObjectList->pObjects->uObjectID;
-      while ( v2->uItemType != *(short *)v123 )
+      while ( v2->uType != *(short *)v123 )
       {
         ++v52;
         v123 += 56;
@@ -16623,7 +16623,7 @@
   v119 = 0;
   v44 = pObjectList->uNumObjects == 0;
   v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
-  v2->uItemType = v117;
+  v2->uType = v117;
   if ( v20 | v44 )
   {
 LABEL_255:
@@ -16643,7 +16643,7 @@
   }
   v2->uObjectDescID = v121;
   if ( !v121 )
-    LayingItem::OnItemPickup(v153);
+    SpriteObject::OnInteraction(v153);
   v2->vVelocity.z = 0;
   v2->vVelocity.y = 0;
   v2->vVelocity.x = 0;