diff Overlays.cpp @ 2274:90f56da08d76

small cleaning
author Ritor1
date Fri, 14 Mar 2014 09:32:25 +0600
parents aff7a7b072b7
children d6887ee81068
line wrap: on
line diff
--- a/Overlays.cpp	Thu Feb 27 00:36:31 2014 +0100
+++ b/Overlays.cpp	Fri Mar 14 09:32:25 2014 +0600
@@ -43,54 +43,37 @@
 //----- (004418B6) --------------------------------------------------------
 int OtherOverlayList::_4418B6(int uOverlayID, __int16 a3, int a4, int a5, __int16 a6)
 {
-  signed int v6; // edx@1
-  OtherOverlayList *v7; // eax@1
-  //signed int result; // eax@4
   signed int v9; // esi@6
-  __int16 v10; // dx@9
   __int16 v11; // dx@11
 
-  v6 = 0;
-  v7 = this;
-  while ( v7->pOverlays[0].field_6 > 0 )
-  {
-    ++v6;
-    v7 = (OtherOverlayList *)((char *)v7 + 20);
-    if ( v6 >= 50 )
-      return 0;
-  }
-  v7->pOverlays[0].field_0 = 0;
-  v7->pOverlays[0].field_A = 0;
-  v7->pOverlays[0].field_8 = 0;
-  v7->pOverlays[0].field_C = a3;
-  v9 = 0;
-  if ( (signed int)pOverlayList->uNumOverlays <= 0 )
-  {
-LABEL_9:
-    v10 = 0;
-  }
-  else
+  for ( uint i = 0; i < 50; ++i )
   {
-    while ( uOverlayID != pOverlayList->pOverlays[v9].uOverlayID )
+    if ( this->pOverlays[i].field_6 <= 0 )
     {
-      ++v9;
-      if ( v9 >= (signed int)pOverlayList->uNumOverlays )
-        goto LABEL_9;
+      this->pOverlays[i].field_0 = 0;
+      this->pOverlays[i].field_A = 0;
+      this->pOverlays[i].field_8 = 0;
+      this->pOverlays[i].field_C = a3;
+      v9 = 0;
+      for ( v9; v9 < (signed int)pOverlayList->uNumOverlays; ++v9 )
+      {
+        if ( uOverlayID == pOverlayList->pOverlays[v9].uOverlayID )
+          break;
+      }
+      this->pOverlays[i].field_2 = v9;
+      this->pOverlays[i].field_4 = 0;
+      if ( a4 )
+        v11 = a4;
+      else
+        v11 = 8 * pSpriteFrameTable->pSpriteSFrames[pOverlayList->pOverlays[v9].uSpriteFramesetID].uAnimLength;
+      this->pOverlays[i].field_6 = v11;
+      this->pOverlays[i].field_10 = a5;
+      this->pOverlays[i].field_E = a6;
+      bRedraw = true;
+      return true;
     }
-    v10 = v9;
   }
-  v7->pOverlays[0].field_2 = v10;
-  v7->pOverlays[0].field_4 = 0;
-  if ( a4 )
-    v11 = a4;
-  else
-    v11 = 8 * pSpriteFrameTable->pSpriteSFrames[pOverlayList->pOverlays[v10].uSpriteFramesetID].uAnimLength;
-  v7->pOverlays[0].field_6 = v11;
-  v7->pOverlays[0].field_10 = a5;
-  v7->pOverlays[0].field_E = a6;
-
-  bRedraw = true;
-  return true;
+  return 0;
 }
 
 //----- (00441964) --------------------------------------------------------
@@ -176,7 +159,7 @@
   FILE *v4; // eax@1
   unsigned int v5; // esi@3
   void *v7; // eax@9
-  FILE *v8; // ST0C_4@11
+  //FILE *v8; // ST0C_4@11
   char *i; // eax@11
   char Buf; // [sp+10h] [bp-2F0h]@3
   FrameTableTxtLine v18; // [sp+204h] [bp-FCh]@4
@@ -215,9 +198,9 @@
     Error("OverlayDescriptionList::load - Out of Memory!");
 
   memset(v7, v3, 8 * this->uNumOverlays);
-  v8 = File;
+  //v8 = File;
   this->uNumOverlays = v3;
-  fseek(v8, v3, v3);
+  fseek(File, v3, v3);
   for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
   {
     *strchr(&Buf, 10) = 0;
@@ -234,8 +217,7 @@
       }
       else
         this->pOverlays[this->uNumOverlays].uOverlayType = 0;
-      this->pOverlays[this->uNumOverlays++].uSpriteFramesetID = pSpriteFrameTable->FastFindSprite(
-                                                              (char *)v19.pProperties[2]);
+      this->pOverlays[this->uNumOverlays++].uSpriteFramesetID = pSpriteFrameTable->FastFindSprite((char *)v19.pProperties[2]);
     }
   }
   fclose(File);