diff Indoor.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 7887a9cf9e7b
children 35f28d4c0ff9
line wrap: on
line diff
--- a/Indoor.cpp	Fri Mar 01 18:23:49 2013 +0200
+++ b/Indoor.cpp	Fri Mar 01 21:13:12 2013 +0200
@@ -2,7 +2,7 @@
 
 #include "Outdoor.h"
 #include "Render.h"
-#include "LayingItem.h"
+#include "SpriteObject.h"
 #include "Events.h"
 #include "Game.h"
 #include "Viewport.h"
@@ -1892,7 +1892,7 @@
   int v72; // eax@38
   unsigned __int16 v73; // ax@42
   char *v74; // ecx@42
-  LayingItem *v75; // ecx@44
+  SpriteObject *v75; // ecx@44
   size_t v76; // eax@45
   int j; // edx@46
   unsigned __int16 v78; // ax@50
@@ -2362,13 +2362,13 @@
         while ( Argsi < (signed int)uNumLevelDecorations );
       }
       fseek(v7, v219, 0);
-      fread(&uNumLayingItems, 4u, 1u, v7);
+      fread(&uNumSpriteObjects, 4u, 1u, v7);
       fseek(v7, v220, 0);
-      fread(pLayingItems, 0x70u, uNumLayingItems, v7);
-      if ( (signed int)uNumLayingItems > 0 )
+      fread(pSpriteObjects, 0x70u, uNumSpriteObjects, v7);
+      if ( (signed int)uNumSpriteObjects > 0 )
       {
-        v75 = pLayingItems;
-        pDest = (char *)uNumLayingItems;
+        v75 = pSpriteObjects;
+        pDest = (char *)uNumSpriteObjects;
         do
         {
           Argsj = 0;
@@ -2517,7 +2517,7 @@
   assert(sizeof(SpawnPointMM7) == 24);
   assert(sizeof(DDM_DLV_Header) == 40);
   assert(sizeof(Actor) == 836);
-  assert(sizeof(LayingItem) == 112);
+  assert(sizeof(SpriteObject) == 112);
   assert(sizeof(Chest) == 5324);
   assert(sizeof(stru123) == 0xC8);
   assert(sizeof(BLVMapOutline) == 12);
@@ -2972,23 +2972,23 @@
   pGameLoadingUI_ProgressBar->Progress();
   pGameLoadingUI_ProgressBar->Progress();
 
-  memcpy(&uNumLayingItems, pData, 4);
-  memcpy(pLayingItems, pData + 4, uNumLayingItems * sizeof(LayingItem));
-  pData += 4 + uNumLayingItems * sizeof(LayingItem);
+  memcpy(&uNumSpriteObjects, pData, 4);
+  memcpy(pSpriteObjects, pData + 4, uNumSpriteObjects * sizeof(SpriteObject));
+  pData += 4 + uNumSpriteObjects * sizeof(SpriteObject);
 
   pGameLoadingUI_ProgressBar->Progress();
 
-  for (uint i = 0; i < uNumLayingItems; ++i)
+  for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto pItem = pLayingItems + i;
+    auto pItem = pSpriteObjects + i;
  
     if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100))
     {
-      pItem->uItemType = pItemsTable->pItems[pItem->stru_24.uItemID - 1].uSpriteID;
+      pItem->uType = pItemsTable->pItems[pItem->stru_24.uItemID - 1].uSpriteID;
 
       uint uObjectID = 0;
       for (uint j = 0; j < pObjectList->uNumObjects; ++j)
-        if (pItem->uItemType == pObjectList->pObjects[j].uObjectID)
+        if (pItem->uType == pObjectList->pObjects[j].uObjectID)
         {
           pItem->uObjectDescID = j;
           break;
@@ -4138,7 +4138,7 @@
           _46E44E_collide_against_faces_and_portals(1u);
           _46E0B2_collide_against_decorations();
           _46EF01_collision_chech_player(0);
-          _46ED8A_collide_against_layingItems(_this);
+          _46ED8A_collide_against_sprite_objects(_this);
           v25 = 0;
           v56 = 0;
           if ( ai_arrays_size > v22 )
@@ -4487,7 +4487,7 @@
   if ( !(dword_6BE364_game_settings_1 & 0x2000) )
   {
     InitializeActors();
-    InitializeLayingItems();
+    InitializeSpriteObjects();
   }
   BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
   if ( !v39 )
@@ -4658,9 +4658,9 @@
 
   pGameLoadingUI_ProgressBar->Progress();
 
-  for (uint i = 0; i < uNumLayingItems; ++i)
+  for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto p = pLayingItems + i;
+    auto p = pSpriteObjects + i;
     if (p->uObjectDescID)
     {
       auto uItemID = p->stru_24.uItemID;