diff Texture.cpp @ 2278:0cd17b0d36c2

MMT_MainMenu
author Ritor1
date Fri, 14 Mar 2014 17:59:06 +0600
parents aff7a7b072b7
children a01d3cf9ff83
line wrap: on
line diff
--- a/Texture.cpp	Fri Mar 14 13:58:51 2014 +0600
+++ b/Texture.cpp	Fri Mar 14 17:59:06 2014 +0600
@@ -517,7 +517,7 @@
 //----- (0040F414) --------------------------------------------------------
 int RGBTexture::Load(const char *pContainer, int mode)
 {
-  FILE *v4; // eax@1
+  FILE *file; // eax@1
   void *v6; // ebx@5
   char color_map[48]; // [sp+Ch] [bp-98h]@7
   Texture DstBuf; // [sp+3Ch] [bp-68h]@1
@@ -526,18 +526,25 @@
   size_t Count; // [sp+A0h] [bp-4h]@4
   char *Str1a; // [sp+ACh] [bp+8h]@5
 
+  file = pIcons_LOD->FindContainer(pContainer, 0);
+  if ( !file )
+  {
+    //char pContainerName[64];
 
-  v4 = pIcons_LOD->FindContainer(pContainer, 0);
-  if ( !v4 )
-    Error("Unable to load %s", pContainer);
+    //sprintf(pContainerName, "data\\New_Icons/%s", pContainer);
+    //MMT_Texture.LoadPCXFile(pContainerName, 0);
+    if ( !file )
+      Error("Unable to load %s", pContainer);
+    //fclose(file);
+  }
 
-  fread(&DstBuf, 1u, 0x30u, v4);
+  fread(&DstBuf, 1, 0x30u, file);
   Count = DstBuf.uTextureSize;
   if ( DstBuf.uDecompressedSize )
   {
     Str1a = (char *)malloc(DstBuf.uDecompressedSize);
     v6 = malloc(DstBuf.uTextureSize);
-    fread(v6, 1, Count, v4);
+    fread(v6, 1, Count, file);
     zlib::MemUnzip(Str1a, &DstBuf.uDecompressedSize, v6, DstBuf.uTextureSize);
     DstBuf.uTextureSize = DstBuf.uDecompressedSize;
     free(v6);
@@ -545,7 +552,7 @@
   else
   {
     Str1a = (char *)malloc(DstBuf.uTextureSize);
-    fread(Str1a, 1, Count, v4);
+    fread(Str1a, 1, Count, file);
   }
   memcpy(&header1, Str1a, 0x10u);
   memcpy(color_map, Str1a + 16, 0x30u);