changeset 130:7b12505a23c0

7.11.12
author Ritor1
date Wed, 07 Nov 2012 22:09:43 +0600
parents fe45d65251a5
children d2ca891da89f
files Indoor.cpp LOD.cpp LOD.h Outdoor.cpp PaletteManager.h mm7_2.cpp
diffstat 6 files changed, 46 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Sun Nov 04 17:04:05 2012 +0600
+++ b/Indoor.cpp	Wed Nov 07 22:09:43 2012 +0600
@@ -4445,9 +4445,9 @@
   }
   if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d23.blv") )
     bNoNPCHiring = 1;
-  pPaletteManager->field_267AD3 = 0;
-  pPaletteManager->field_267AD4 = 0;
-  pPaletteManager->field_267AD5 = 0;
+  pPaletteManager->pPalette_tintColor[0] = 0;
+  pPaletteManager->pPalette_tintColor[1] = 0;
+  pPaletteManager->pPalette_tintColor[2] = 0;
   pPaletteManager->RecalculateAll();
   if ( qword_A750D8 )
     qword_A750D8 = 0i64;
--- a/LOD.cpp	Sun Nov 04 17:04:05 2012 +0600
+++ b/LOD.cpp	Wed Nov 07 22:09:43 2012 +0600
@@ -2043,8 +2043,8 @@
 void LOD::FileHeader::Reset()
 {
   this->pSignature[0] = 0;
-  this->array_000004[0] = 0;
-  this->array_000054[0] = 0;
+  this->LodVersion[0] = 0;
+  this->LodDescription[0] = 0;
   this->dword_0000A4 = 0;
   this->dword_0000A8 = 0;
   this->uNumIndices = 0;
--- a/LOD.h	Sun Nov 04 17:04:05 2012 +0600
+++ b/LOD.h	Wed Nov 07 22:09:43 2012 +0600
@@ -23,8 +23,8 @@
     void Reset();
 
     unsigned __int8 pSignature[4];
-    char array_000004[80];
-    char array_000054[80];
+    char LodVersion[80];
+    char LodDescription[80];
     int dword_0000A4;
     int dword_0000A8;
     unsigned int uNumIndices;
--- a/Outdoor.cpp	Sun Nov 04 17:04:05 2012 +0600
+++ b/Outdoor.cpp	Wed Nov 07 22:09:43 2012 +0600
@@ -1329,25 +1329,25 @@
 
   if (bUnderwater)
   {
-    pPaletteManager->field_267AD3 = 0x10;
-    pPaletteManager->field_267AD4 = 0xC2;
-    pPaletteManager->field_267AD5 = 0x99;
-    pPaletteManager->field_267AD0 = 0x25;
-    pPaletteManager->field_267AD1 = 0x8F;
-    pPaletteManager->field_267AD2 = 0x5C;
+    pPaletteManager->pPalette_tintColor[0] = 0x10;
+    pPaletteManager->pPalette_tintColor[1] = 0xC2;
+    pPaletteManager->pPalette_tintColor[2] = 0x99;
+    pPaletteManager->pPalette_mistColor[0] = 0x25;
+    pPaletteManager->pPalette_mistColor[1] = 0x8F;
+    pPaletteManager->pPalette_mistColor[2] = 0x5C;
   }
   else
   {
-    pPaletteManager->field_267AD3 = 0;
-    pPaletteManager->field_267AD4 = 0;
-    pPaletteManager->field_267AD5 = 0;
-    if (pPaletteManager->field_267AD0 != 0x80 ||
-        pPaletteManager->field_267AD1 != 0x80 ||
-        pPaletteManager->field_267AD2 != 0x80)
+    pPaletteManager->pPalette_tintColor[0] = 0;
+    pPaletteManager->pPalette_tintColor[1] = 0;
+    pPaletteManager->pPalette_tintColor[2] = 0;
+    if (pPaletteManager->pPalette_mistColor[0] != 0x80 ||
+        pPaletteManager->pPalette_mistColor[1] != 0x80 ||
+        pPaletteManager->pPalette_mistColor[2] != 0x80)
     {
-      pPaletteManager->field_267AD0 = 0x80;
-      pPaletteManager->field_267AD1 = 0x80;
-      pPaletteManager->field_267AD2 = 0x80;
+      pPaletteManager->pPalette_mistColor[0] = 0x80;
+      pPaletteManager->pPalette_mistColor[1] = 0x80;
+      pPaletteManager->pPalette_mistColor[2] = 0x80;
       pPaletteManager->RecalculateAll();
     }
   }
--- a/PaletteManager.h	Sun Nov 04 17:04:05 2012 +0600
+++ b/PaletteManager.h	Wed Nov 07 22:09:43 2012 +0600
@@ -31,12 +31,8 @@
   int pPaletteIDs[50];
   int _num_locked;
   int _pal_lock_test;
-  unsigned __int8 field_267AD0;
-  unsigned __int8 field_267AD1;
-  unsigned __int8 field_267AD2;
-  unsigned char field_267AD3;
-  unsigned char field_267AD4;
-  unsigned char field_267AD5;
+  unsigned __int8 pPalette_mistColor[3];
+  unsigned char pPalette_tintColor[3];
   char field_267AD6;
   char field_267AD7;
   unsigned int uNumTargetRBits;
--- a/mm7_2.cpp	Sun Nov 04 17:04:05 2012 +0600
+++ b/mm7_2.cpp	Wed Nov 07 22:09:43 2012 +0600
@@ -11717,9 +11717,9 @@
 //----- (0046086A) --------------------------------------------------------
 bool Autosave()
 {
-  int v0; // esi@3
-  int v1; // eax@4
-  int v2; // edx@5
+  int flag; // esi@3
+  int i; // eax@4
+  //int v2; // edx@5
   FILE *v3; // eax@7
   LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
   LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
@@ -11731,13 +11731,13 @@
 
   if ( pVideoPlayer->AnyMovieLoaded() )
     pVideoPlayer->Unload();
-  v0 = 0;
+  flag = 0;
   pSave = pAllocator->AllocNamedChunk(0, 0xF4240, 0);
   pNew_LOD->CloseWriteFile();
   remove("data\\new.lod");
   this_.Reset();
-  strcpy(this_.array_000004, "MMVII");
-  strcpy(this_.array_000054, "newmaps for MMVII");
+  strcpy(this_.LodVersion, "MMVII");
+  strcpy(this_.LodDescription, "newmaps for MMVII");
   this_.dword_0000A4 = 100;
   this_.dword_0000A8 = 0;
   a3.dword_000018 = 0;
@@ -11749,25 +11749,12 @@
     pNew_LOD->CreateTempFile();
     pNew_LOD->uNumSubIndices = 0;
     pDir.Reset();
-    v1 = (signed int)pGames_LOD->uNumSubIndices / 2;
-    if ( (signed int)pGames_LOD->uNumSubIndices / 2 < (signed int)pGames_LOD->uNumSubIndices )
-    {
-      v2 = 32 * v1;
-      v11 = 32 * v1;
-      v9 = pGames_LOD->uNumSubIndices - v1;
-      while ( 1 )
-      {
-        memcpy(&pDir, (char *)pGames_LOD->pSubIndices + v2, sizeof(pDir));
-        v3 = pGames_LOD->FindContainer((const char *)pGames_LOD->pSubIndices + v2, 1);
-        fread(pSave, pGames_LOD->pSubIndices[v11 / 0x20].uDataSize, 1u, v3);
-        pNew_LOD->AppendDirectory(&pDir, pSave);
-        v11 += 32;
-        --v9;
-        if ( !v9 )
-          break;
-        v2 = v11;
-      }
-      v0 = 0;
+	for (int i =  pGames_LOD->uNumSubIndices / 2; i < pGames_LOD->uNumSubIndices; ++i)
+    {
+     memcpy(&pDir, (char *)&pGames_LOD->pSubIndices[i], sizeof(pDir));
+     v3 = pGames_LOD->FindContainer((const char *)&pGames_LOD->pSubIndices[i], 1);
+     fread(pSave, pGames_LOD->pSubIndices[i].uDataSize, 1, v3);
+     pNew_LOD->AppendDirectory(&pDir, pSave);
     }
     v7.Reset();
     strcpy(pSavegameHeader->pLocationName, "out01.odm");
@@ -11775,22 +11762,22 @@
     v7.uDataSize = 100;
     pNew_LOD->AppendDirectory(&v7, &pSavegameHeader);
     pNew_LOD->Save();
-    pParty->vPrevPosition.y = v0;
+    pParty->vPrevPosition.y = flag;
     pParty->vPrevPosition.x = 12552;
     pParty->vPosition.x = 12552;
-    pParty->vPosition.z = v0;
-    pParty->uFallStartY = v0;
-    pParty->sPrevRotationX = v0;
-    pParty->sRotationX = v0;
+    pParty->vPosition.z = flag;
+    pParty->uFallStartY = flag;
+    pParty->sPrevRotationX = flag;
+    pParty->sRotationX = flag;
     pParty->vPrevPosition.z = 1816;
     pParty->vPosition.y = 1816;
-    v0 = 1;
+    flag = 1;
     pParty->sPrevRotationY = 512;
     pParty->sRotationY = 512;
     SaveGame(1, (__int16 *)1);
   }
   pAllocator->FreeChunk(pSave);
-  return v0;
+  return flag;
 }
 
 
@@ -13929,9 +13916,9 @@
   pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
-  pPaletteManager->field_267AD0 = 128;
-  pPaletteManager->field_267AD1 = 128;
-  pPaletteManager->field_267AD2 = 128;
+  pPaletteManager->pPalette_tintColor[0] = 128;
+  pPaletteManager->pPalette_tintColor[1] = 128;
+  pPaletteManager->pPalette_tintColor[2] = 128;
   pPaletteManager->RecalculateAll();
   pSprites_LOD->field_ECAC = 1;
   pObjectList->InitializeSprites();