diff LOD.cpp @ 117:a64b244da76c

some things lod
author Nomad
date Tue, 13 Nov 2012 17:29:38 +0200
parents 75faebd0a975
children 2546de5c70dd 6d1f537a1346
line wrap: on
line diff
--- a/LOD.cpp	Thu Nov 08 04:57:39 2012 +0200
+++ b/LOD.cpp	Tue Nov 13 17:29:38 2012 +0200
@@ -995,34 +995,32 @@
     _6A0CA8_lod_unused = 0;
   }
 }
-// 6A0CA8: using guessed type int 6A0CA8_lod_unused;
+
+
 
 //----- (00461492) --------------------------------------------------------
 int LODWriteableFile::_461492(LOD::FileHeader *pHeader, LOD::Directory *pDir, const char *Source)
 {
-  LODWriteableFile *v4; // esi@1
-  FILE *v6; // eax@5
-
-  v4 = this;
-  if ( this->isFileOpened )
+  if (isFileOpened)
     return 1;
   if ( !pDir->pFilename[0] )
     return 2;
-  strcpy((char *)pHeader, "LOD");
+  strcpy(pHeader->pSignature, "LOD");
   pHeader->dword_0000A4 = 100;
   pHeader->uNumIndices = 1;
   pDir->pFilename[15] = 0;
   pDir->uDataSize = 0;
   pDir->uOfsetFromSubindicesStart = 288;
-  strcpy((char *)v4->pLODName, Source);
-  v6 = fopen((const char *)v4->pLODName, "wb+");
-  v4->pFile = v6;
-  if ( !v6 )
+  strcpy(pLODName, Source);
+
+  pFile = fopen(pLODName, "wb+");
+  if (!pFile)
     return 3;
-  fwrite(pHeader, 0x100, 1, v6);
-  fwrite(pDir, 0x20, 1, v4->pFile);
-  fclose(v4->pFile);
-  v4->pFile = 0;
+
+  fwrite(pHeader, 0x100, 1, pFile);
+  fwrite(pDir, 0x20, 1, pFile);
+  fclose(pFile);
+  pFile = 0;
   return 0;
 }
 
@@ -1645,6 +1643,7 @@
 // 6A0CA8: using guessed type int 6A0CA8_lod_unused;
 
 
+//----- (00461B48) --------------------------------------------------------
 unsigned int LODWriteableFile::Write(const LOD::Directory *pDir, const void *pDirData, int a4)
 {
   //LODWriteableFile *v4; // ebx@1