diff SaveLoad.cpp @ 110:430786d916d6

6.11.12 SaveLoad
author Ritor1
date Tue, 06 Nov 2012 17:30:24 +0600
parents ccc0cf95706a
children e5d6903a077a
line wrap: on
line diff
--- a/SaveLoad.cpp	Tue Nov 06 10:07:35 2012 +0600
+++ b/SaveLoad.cpp	Tue Nov 06 17:30:24 2012 +0600
@@ -298,14 +298,12 @@
   int v70; // [sp+264h] [bp-Ch]@22
   std::string *v71; // [sp+268h] [bp-8h]@8
   int a3; // [sp+26Fh] [bp-1h]@8
-
+  
   v66 = a2;
   //v64 = (std::string *)a1;
-
   strcpy(byte_6BE3B0, pCurrentMapName);
   if (!_strcmpi(pCurrentMapName, "d05.blv"))
     return false;
-
   DstBuf = malloc(0xF4240u);
   pDir.Reset();
     v52 = pParty->vPosition.x;
@@ -319,48 +317,32 @@
   pParty->uFallStartY = pParty->vPrevPosition.y;
   pParty->sRotationY = pParty->sPrevRotationY;
   pParty->sRotationX = pParty->sPrevRotationX;
-
   if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
     pIndoor->stru1.uLastVisitDay = pParty->uTimePlayed;
   else
     pOutdoor->uLastVisitDay = pParty->uTimePlayed;
-
   v3 = MakeScreenshot(150, 112);
-  {
-    strcpy(pDir.pFilename, "image.pcx");
-
-    pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize);
-  }
+  strcpy(pDir.pFilename, "image.pcx");
+  pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize);
   free(v3);
-
-    if ( pCurrentScreen == 11 )
+  if ( pCurrentScreen == 11 )//Save
     {
-      pRenderer->DrawTextureIndexed(
-        8u,
-        8u,
-        (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
-      pRenderer->DrawTextureIndexed(
-        0x12u,
-        0x8Du,
-        (Texture *)(uTextureID_save_up != -1 ? &pIcons_LOD->pTextures[uTextureID_save_up] : 0));
-      v36 = pGlobalTXT_LocalizationStrings[190];
+      pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
+      pRenderer->DrawTextureIndexed(0x12u, 0x8Du, (Texture *)(uTextureID_save_up != -1 ? &pIcons_LOD->pTextures[uTextureID_save_up] : 0));
       v4 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[190]);
-      pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, v36, 0, 0, 0);
-      v37 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
-      v5 = pFontSmallnum->AlignText_Center(0xBAu,
-             (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
-      pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, v37, 185, 0);
-      v36 = pGlobalTXT_LocalizationStrings[165];
+      pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение
+      v5 = pFontSmallnum->AlignText_Center(0xBAu, (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
+      pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot), 185, 0);
       v6 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
-      pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, v36, 0, 0, 0);
+      pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0); //Пожалуйста, подождите
       pRenderer->Present();
     }
     if ( pNew_LOD->Write(&pDir, DstBuf, 0) )
     {
-      sprintf(Str, pGlobalTXT_LocalizationStrings[612], 200);
-    MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0);
+      sprintf(Str, pGlobalTXT_LocalizationStrings[612], 200); //Сохраненная игра повреждена! Code=%d
+      MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0);
     }
-    else
+  else
     {
       v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp";
     }
@@ -382,7 +364,7 @@
       sprintf(Str, pGlobalTXT_LocalizationStrings[612], 202);
     MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:793", 0);
     }
-    strcpy((char *)&pDir, "Timer.bin");
+    strcpy((char *)&pDir, "clock.bin");
     pDir.uDataSize = 40;
     if ( pNew_LOD->Write(&pDir, &pEventTimer, 0) )
     {
@@ -650,7 +632,6 @@
     pParty->sRotationY = v53;
     result = v54;
     pParty->sRotationX = v54;
-
   return result;
 }