diff Render.cpp @ 1162:79fd2fb7a3ab

RenderHWLContainer::Release cleanup
author Grumpy7
date Tue, 04 Jun 2013 01:40:53 +0200
parents da80e03c677c
children 6b911d7e09a5
line wrap: on
line diff
--- a/Render.cpp	Mon Jun 03 23:26:05 2013 +0200
+++ b/Render.cpp	Tue Jun 04 01:40:53 2013 +0200
@@ -10867,59 +10867,34 @@
 //----- (0045271F) --------------------------------------------------------
 bool RenderHWLContainer::Release()
 {
-  RenderHWLContainer *v1; // esi@1
-  int v2; // ebx@1
-  void **v3; // edi@3
   __int32 v4; // eax@6
   FILE *v5; // ST24_4@6
-  size_t *v6; // edi@6
-  int v7; // ebx@7
-  signed int v9; // [sp+0h] [bp-8h]@6
   FILE *File; // [sp+4h] [bp-4h]@6
 
-  v1 = this;
-  v2 = 0;
-  if ( this->bDumpDebug )
+  if ( this->bDumpDebug)
   {
     File = fopen("logd3d.txt", "w");
-    v4 = ftell(v1->pFile);
-    v5 = v1->pFile;
-    v6 = &v1->uNumItems;
-    v1->uDataOffset = v4;
-    fwrite(&v1->uNumItems, 4u, 1u, v5);
-    v9 = 0;
-    if ( (signed int)v1->uNumItems > 0 )
-    {
-      v7 = (int)v1->pSpriteNames;
-      do
-      {
-        fwrite(*(const void **)v7, 1u, 0x14u, v1->pFile);
-        fprintf(File, "D3D texture name:  %s\t\toffset: %x\n", *(unsigned int *)v7, *(unsigned int *)(v7 + 200000));
-        ++v9;
-        v7 += 4;
-      }
-      while ( v9 < (signed int)*v6 );
-      v2 = 0;
-    }
-    fwrite(v1->pSpriteOffsets, 4u, *v6, v1->pFile);
-    fseek(v1->pFile, 4, v2);
-    fwrite(&v1->uDataOffset, 4u, 1u, v1->pFile);
-    fclose(v1->pFile);
+    v4 = ftell(this->pFile);
+    v5 = this->pFile;
+    this->uDataOffset = v4;
+    fwrite(&this->uNumItems, 4u, 1u, v5);
+    for (int i = 0; i < this->uNumItems; i++)
+    {
+      fwrite(this->pSpriteNames[i], 1u, 0x14u, this->pFile);
+      fprintf(File, "D3D texture name:  %s\t\toffset: %x\n", this->pSpriteNames[i], *(unsigned int *)(&(this->pSpriteNames[i]) + 200000/sizeof(char*)));
+    }
+    fwrite(this->pSpriteOffsets, 4u, this->uNumItems, this->pFile);
+    fseek(this->pFile, 4, 0);
+    fwrite(&this->uDataOffset, 4u, 1u, this->pFile);
+    fclose(this->pFile);
     fclose(File);
   }
   else
   {
     fclose(this->pFile);
-    if ( (signed int)v1->uNumItems > 0 )
-    {
-      v3 = (void **)v1->pSpriteNames;
-      do
-      {
-        free(*v3);
-        ++v2;
-        ++v3;
-      }
-      while ( v2 < (signed int)v1->uNumItems );
+    for (int i = 0; i < this->uNumItems; i++)
+    {
+      free(this->pSpriteNames[i]);
     }
   }
   return true;